From f79d92e950046bc43a862eabc8e7f894c5324be8 Mon Sep 17 00:00:00 2001 From: wanghe Date: Wed, 31 Jul 2024 13:53:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=202FAuth=20(#1831)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/2fauth/5.2.0/data.yml | 30 +++++++++++++++++++++++++++ apps/2fauth/5.2.0/data/.gitkeep | 0 apps/2fauth/5.2.0/docker-compose.yml | 27 ++++++++++++++++++++++++ apps/2fauth/5.2.0/scripts/init.sh | 3 +++ apps/2fauth/README.md | 12 +++++++++++ apps/2fauth/data.yml | 19 +++++++++++++++++ apps/2fauth/logo.png | Bin 0 -> 2989 bytes 7 files changed, 91 insertions(+) create mode 100755 apps/2fauth/5.2.0/data.yml create mode 100644 apps/2fauth/5.2.0/data/.gitkeep create mode 100644 apps/2fauth/5.2.0/docker-compose.yml create mode 100644 apps/2fauth/5.2.0/scripts/init.sh create mode 100644 apps/2fauth/README.md create mode 100644 apps/2fauth/data.yml create mode 100644 apps/2fauth/logo.png diff --git a/apps/2fauth/5.2.0/data.yml b/apps/2fauth/5.2.0/data.yml new file mode 100755 index 00000000..53144b4c --- /dev/null +++ b/apps/2fauth/5.2.0/data.yml @@ -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 diff --git a/apps/2fauth/5.2.0/data/.gitkeep b/apps/2fauth/5.2.0/data/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/apps/2fauth/5.2.0/docker-compose.yml b/apps/2fauth/5.2.0/docker-compose.yml new file mode 100644 index 00000000..fc992595 --- /dev/null +++ b/apps/2fauth/5.2.0/docker-compose.yml @@ -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 \ No newline at end of file diff --git a/apps/2fauth/5.2.0/scripts/init.sh b/apps/2fauth/5.2.0/scripts/init.sh new file mode 100644 index 00000000..4e811c86 --- /dev/null +++ b/apps/2fauth/5.2.0/scripts/init.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +chown -R 1000:1000 data \ No newline at end of file diff --git a/apps/2fauth/README.md b/apps/2fauth/README.md new file mode 100644 index 00000000..e0be945e --- /dev/null +++ b/apps/2fauth/README.md @@ -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`,无需进行反向代理设置。 diff --git a/apps/2fauth/data.yml b/apps/2fauth/data.yml new file mode 100644 index 00000000..a14adc27 --- /dev/null +++ b/apps/2fauth/data.yml @@ -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/ diff --git a/apps/2fauth/logo.png b/apps/2fauth/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9fa1fd2310a3fea89ee8c33d59715cde725b189b GIT binary patch literal 2989 zcmV;e3sUrnP)M@d9MRCwC#*GqDnKoADt z8J(a9D|-RT0Z^3et!LJj6dk~TbOB!3Cs?_FU@l7o4RAxYw3J^SMDr#Q8?kaH%4yGagG;<*~J%)_8*9<6t(>pB3YlyGSIytccemyL}y)HvDFhmJ(l4*Qdg4eM8Srk2C&}N_h;`1I?<8KP z2qw_sF2UQZGQ3zFd0lQ_{8Uvc@p4r>>FkaJ&9v|FDpfRs?oOiqUgCAi$m`~W1jdJ3 ziPtLpuIjRu60cX?i%zbEy~P1lr3VP$8sOI+s=+o+_64lg^N8ZJotwdFi{s0&$ zv5=_lcn7p~ea?_Vd`sLyBvJVT#(?ZUeR)6{#}y+3!wjiJ9s||9pnbUY9m&-9z(|@1 z%^izQeyhHB0W|ZzM?$r46CBw9{F_8d$CdJEHTrv`71;#$o8D3)t!kwl7H7i@iPgVs z#gz!qghlP~4!B}opR&KanZa_}Fc3g@O+H}Tp?7B*(klr~+aojwIJUVYIhI^PuI12j zZD_#fhA{pBkoPM)_6*1g5|$K8?_`Ue;mvxzk}T%>(-nKIEcbN5D?pj7`d`M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