Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 新增 2FAuth #1831

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions apps/2fauth/5.2.0/data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
additionalProperties:
formFields:
- default: 2FAuth
envKey: APP_NAME
labelEn: APP NAME
labelZh: 应用名称
required: true
type: text
- default: 8000
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
required: true
rule: paramPort
type: number
- default: http://localhost:8000
edit: true
envKey: APP_URL
labelEn: APP URL
labelZh: 外部地址(可以添加为反向代理网站,并启用 HTTPS)
required: true
rule: paramExtUrl
type: text
- default: SomeRandomStringOf32CharsExactly
envKey: APP_KEY
labelEn: APP KEY
labelZh: 加密键
required: true
type: text
Empty file added apps/2fauth/5.2.0/data/.gitkeep
Empty file.
27 changes: 27 additions & 0 deletions apps/2fauth/5.2.0/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
services:
2fauth:
image: 2fauth/2fauth:5.2.0
container_name: ${CONTAINER_NAME}
restart: always
ports:
- ${PANEL_APP_PORT_HTTP}:8000/tcp
networks:
- 1panel-network
volumes:
- ./data:/2fauth
environment:
- APP_NAME=${APP_NAME}
- APP_KEY=${APP_KEY}
- APP_URL=${APP_URL}
- IS_DEMO_APP=false
- LOG_CHANNEL=daily
- LOG_LEVEL=notice
- DB_DATABASE="/srv/database/database.sqlite"
- CACHE_DRIVER=file
- SESSION_DRIVER=file
- AUTHENTICATION_GUARD=web-guard
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true
3 changes: 3 additions & 0 deletions apps/2fauth/5.2.0/scripts/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

chown -R 1000:1000 data
12 changes: 12 additions & 0 deletions apps/2fauth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 设置

## **启用 HTTPS**

- **创建应用**:外部地址填写 `https://2fauth.example.com`(请根据实际情况替换域名)。
- **创建反向代理网站**:代理地址填写 `http://127.0.0.1:8000`(请根据实际情况替换 IP 和端口)。
- **申请证书**:为 `2fauth.example.com` 创建证书,验证方式选择 HTTP 类型。
- **启用 HTTPS**:进入网站设置页面,点击 HTTPS,选择刚刚添加的证书并保存。

## **不启用 HTTPS**

- 如果不启用 HTTPS,会导致无法扫描二维码等问题。在这种情况下,外部地址可以直接填写 `http://192.168.10.100:8000`,无需进行反向代理设置。
19 changes: 19 additions & 0 deletions apps/2fauth/data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 2FAuth
tags:
- 安全
title: 管理双因素身份验证(2FA)帐户并生成安全代码的 Web 应用程序
description: 管理双因素身份验证(2FA)帐户并生成安全代码的 Web 应用程序
additionalProperties:
key: 2fauth
name: 2FAuth
tags:
- Security
shortDescZh: 管理双因素身份验证(2FA)帐户并生成安全代码的 Web 应用程序
shortDescEn: A Web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes
type: tool
crossVersionUpdate: true
limit: 0
recommend: 0
website: https://docs.2fauth.app/
github: https://github.com/Bubka/2FAuth
document: https://docs.2fauth.app/
Binary file added apps/2fauth/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.