Compare commits

..

11 Commits

@ -79,9 +79,7 @@ declare module 'vue' {
NodeSelectorNodeSelector: typeof import('./src/components/NodeSelector/NodeSelector.vue')['default']
NotificationNotification: typeof import('./src/components/Notification/Notification.vue')['default']
OTPInputOTPInput: typeof import('./src/components/OTPInput/OTPInput.vue')['default']
OTPOTPAuthorization: typeof import('./src/components/OTP/OTPAuthorization.vue')['default']
PageHeaderPageHeader: typeof import('./src/components/PageHeader/PageHeader.vue')['default']
PasskeyPasskeyRegistration: typeof import('./src/components/Passkey/PasskeyRegistration.vue')['default']
ReactiveFromNowReactiveFromNow: typeof import('./src/components/ReactiveFromNow/ReactiveFromNow.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
@ -100,6 +98,7 @@ declare module 'vue' {
SwitchAppearanceIconsVPIconMoon: typeof import('./src/components/SwitchAppearance/icons/VPIconMoon.vue')['default']
SwitchAppearanceIconsVPIconSun: typeof import('./src/components/SwitchAppearance/icons/VPIconSun.vue')['default']
SwitchAppearanceSwitchAppearance: typeof import('./src/components/SwitchAppearance/SwitchAppearance.vue')['default']
TwoFAAuthorization: typeof import('./src/components/TwoFA/Authorization.vue')['default']
VPSwitchVPSwitch: typeof import('./src/components/VPSwitch/VPSwitch.vue')['default']
}
}

@ -1,6 +1,6 @@
{
"name": "nginx-ui-app-next",
"version": "2.0.0-beta.33",
"version": "2.0.0-beta.35",
"type": "module",
"scripts": {
"dev": "vite --host",
@ -15,11 +15,11 @@
"@ant-design/icons-vue": "^7.0.1",
"@formkit/auto-animate": "^0.8.2",
"@simplewebauthn/browser": "^10.0.0",
"@vue/reactivity": "^3.5.5",
"@vue/shared": "^3.5.5",
"@vueuse/components": "^11.0.3",
"@vueuse/core": "^11.0.3",
"@vueuse/integrations": "^11.0.3",
"@vue/reactivity": "^3.5.6",
"@vue/shared": "^3.5.6",
"@vueuse/components": "^11.1.0",
"@vueuse/core": "^11.1.0",
"@vueuse/integrations": "^11.1.0",
"@xterm/addon-attach": "^0.11.0",
"@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0",
@ -36,8 +36,8 @@
"reconnecting-websocket": "^4.4.0",
"sortablejs": "^1.15.3",
"universal-cookie": "^7.2.0",
"vite-plugin-build-id": "^0.3.6",
"vue": "^3.5.5",
"vite-plugin-build-id": "0.3.6",
"vue": "^3.5.6",
"vue-router": "^4.4.5",
"vue3-ace-editor": "2.2.4",
"vue3-apexcharts": "1.5.3",
@ -55,11 +55,11 @@
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-vue": "^5.1.3",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vue/compiler-sfc": "^3.5.5",
"@vue/compiler-sfc": "^3.5.6",
"@vue/tsconfig": "^0.5.1",
"ace-builds": "^1.36.2",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.30.0",
@ -73,9 +73,9 @@
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-components": "^0.27.4",
"unplugin-vue-define-options": "^1.5.1",
"vite": "^5.4.5",
"vite": "^5.4.6",
"vite-svg-loader": "^5.1.0",
"vue-tsc": "^2.1.6"
},
"packageManager": "pnpm@9.6.0"
"packageManager": "pnpm@9.10.0"
}

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
import { createVNode, render } from 'vue'
import { Modal, message } from 'ant-design-vue'
import { useCookies } from '@vueuse/integrations/useCookies'
import Authorization from '@/components/2FA/Authorization.vue'
import Authorization from '@/components/TwoFA/Authorization.vue'
import twoFA from '@/api/2fa'
import { useUserStore } from '@/pinia'

@ -7,7 +7,7 @@ import { useSettingsStore, useUserStore } from '@/pinia'
import 'nprogress/nprogress.css'
import router from '@/routes'
import use2FAModal from '@/components/2FA/use2FAModal'
import use2FAModal from '@/components/TwoFA/use2FAModal'
const user = useUserStore()
const settings = useSettingsStore()

@ -1 +1 @@
{"version":"2.0.0-beta.33","build_id":158,"total_build":362}
{"version":"2.0.0-beta.35","build_id":160,"total_build":364}

@ -133,6 +133,8 @@ const isManaged = computed(() => {
name: data.name,
domains: data.domains,
key_type: data.key_type,
challenge_method: data.challenge_method,
dns_credential_id: data.dns_credential_id,
}"
@renewed="init"
/>

@ -2,7 +2,7 @@
import { message } from 'ant-design-vue'
import config from '@/api/config'
import use2FAModal from '@/components/2FA/use2FAModal'
import use2FAModal from '@/components/TwoFA/use2FAModal'
const emit = defineEmits(['created'])
const visible = ref(false)

@ -1,7 +1,7 @@
<script setup lang="ts">
import { message } from 'ant-design-vue'
import config from '@/api/config'
import use2FAModal from '@/components/2FA/use2FAModal'
import use2FAModal from '@/components/TwoFA/use2FAModal'
import NodeSelector from '@/components/NodeSelector/NodeSelector.vue'
const emit = defineEmits(['renamed'])

@ -242,7 +242,7 @@ async function performUpgrade() {
<style lang="less">
.dark {
.core-upgrade-log-container {
background-color: rgba(0, 0, 0, 0.84);
background-color: rgba(0, 0, 0, 0.84) !important;
}
}
</style>

@ -42,13 +42,19 @@ function batchUpgrade() {
<BatchUpgrader ref="refUpgrader" />
<FooterToolBar v-if="selectedNodes?.length > 0">
<AButton
type="primary"
@click="batchUpgrade"
<FooterToolBar>
<ATooltip
:title="$gettext('Please select at least one node to upgrade')"
placement="topLeft"
>
{{ $gettext('Upgrade') }}
</AButton>
<AButton
:disabled="selectedNodeIds.length === 0"
type="primary"
@click="batchUpgrade"
>
{{ $gettext('Upgrade') }}
</AButton>
</ATooltip>
</FooterToolBar>
</div>
</template>

@ -8,7 +8,7 @@ import auth from '@/api/auth'
import install from '@/api/install'
import SetLanguage from '@/components/SetLanguage/SetLanguage.vue'
import SwitchAppearance from '@/components/SwitchAppearance/SwitchAppearance.vue'
import Authorization from '@/components/2FA/Authorization.vue'
import Authorization from '@/components/TwoFA/Authorization.vue'
import gettext from '@/gettext'
import passkey from '@/api/passkey'
@ -229,7 +229,7 @@ async function handlePasskeyLogin() {
:two-f-a-status="{
enabled: true,
otp_status: true,
passkey_status: true,
passkey_status: false,
}"
@submit-o-t-p="handleOTPSubmit"
/>

@ -11,7 +11,7 @@ import type { Settings } from '@/views/preference/typedef'
import LogrotateSettings from '@/views/preference/LogrotateSettings.vue'
import { useSettingsStore } from '@/pinia'
import AuthSettings from '@/views/preference/AuthSettings.vue'
import use2FAModal from '@/components/2FA/use2FAModal'
import use2FAModal from '@/components/TwoFA/use2FAModal'
const data = ref<Settings>({
server: {

@ -4,7 +4,7 @@ import { Terminal } from '@xterm/xterm'
import { FitAddon } from '@xterm/addon-fit'
import _ from 'lodash'
import ws from '@/lib/websocket'
import use2FAModal from '@/components/2FA/use2FAModal'
import use2FAModal from '@/components/TwoFA/use2FAModal'
import twoFA from '@/api/2fa'
let term: Terminal | null

@ -41,7 +41,8 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
{text: 'Logrotate', link: '/guide/config-logrotate'},
{text: 'Cluster', link: '/guide/config-cluster'},
{text: 'Auth', link: '/guide/config-auth'},
{text: 'Crypto', link: '/guide/config-crypto'}
{text: 'Crypto', link: '/guide/config-crypto'},
{text: 'Webauthn', link: '/guide/config-webauthn'}
]
},
{

@ -46,7 +46,8 @@ export const zhCNConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
{text: 'Logrotate', link: '/zh_CN/guide/config-logrotate'},
{text: '集群', link: '/zh_CN/guide/config-cluster'},
{text: '认证', link: '/zh_CN/guide/config-auth'},
{text: '加密', link: '/zh_CN/guide/config-crypto'}
{text: '加密', link: '/zh_CN/guide/config-crypto'},
{text: 'Webauthn', link: '/zh_CN/guide/config-webauthn'},
]
},
{

@ -45,7 +45,8 @@ export const zhTWConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
{text: 'Logrotate', link: '/zh_TW/guide/config-logrotate'},
{text: '集群', link: '/zh_TW/guide/config-cluster'},
{text: '認證', link: '/zh_TW/guide/config-auth'},
{text: '加密', link: '/zh_TW/guide/config-crypto'}
{text: '加密', link: '/zh_TW/guide/config-crypto'},
{text: 'Webauthn', link: '/zh_TW/guide/config-webauthn'},
]
},
{

@ -0,0 +1,41 @@
# Webauthn
Webauthn is a web standard for secure authentication. It allows users to log in to websites using biometrics, mobile devices, and FIDO security keys.
Webauthn is a passwordless authentication method that provides a secure and easy-to-use alternative to passwords.
Since `v2.0.0-beta.34`, Nginx UI has supported Webauthn passkey as a login and 2FA method.
## Passkey
Passkeys are webauthn credentials that validate your identity using touch, facial recognition, a device password, or a PIN. They can be used as a password replacement or as a 2FA method.
## Configurations
To ensure security, Webauthn configuration cannot be added through the UI.
Please manually configure the following in the app.ini configuration file and restart Nginx UI.
### RPDisplayName
- Type: `string`
This option is used to set the display name of the relying party (RP) when registering a new credential.
### RPID
- Type: `string`
This option is used to set the ID of the relying party (RP) when registering a new credential.
### RPOrigins
- Type: `[]string`
This option is used to set the origins of the relying party (RP) when registering a new credential.
Afterward, refresh this page and click add passkey again.
Due to the security policies of some browsers, you cannot use passkeys on non-HTTPS websites, except when running on `localhost`.
## Detail
1. **Automatic 2FA with Passkey:**
When you log in using a passkey, all subsequent actions requiring 2FA will automatically use the passkey. This means you won’t need to manually click “Authenticate with a passkey” in the 2FA dialog box.
2. **Passkey Deletion:**
If you log in using a passkey and then navigate to Settings > Authentication and delete the current passkey, the passkey will no longer be used for subsequent 2FA challenges during the current session. If Time-based One-Time Password (TOTP) is configured, it will be used instead; if not, 2FA will not be triggered.
3. **Adding a New Passkey:**
If you log in without using a passkey and then add a new passkey via Settings > Authentication, the newly added passkey will be prioritized for all subsequent 2FA actions during the current session.

@ -1,4 +1,5 @@
# Environment Variables
Applicable for version v2.0.0-beta.23 and above.
## Server
@ -25,50 +26,58 @@ Applicable for version v2.0.0-beta.23 and above.
## Nginx
| Configuration Setting | Environment Variable |
| ----------------------------- | ------------------------------------- |
| AccessLogPath | NGINX_UI_NGINX_ACCESS_LOG_PATH |
| ErrorLogPath | NGINX_UI_NGINX_ERROR_LOG_PATH |
| ConfigDir | NGINX_UI_NGINX_CONFIG_DIR |
| PIDPath | NGINX_UI_NGINX_PID_PATH |
| TestConfigCmd | NGINX_UI_NGINX_TEST_CONFIG_CMD |
| ReloadCmd | NGINX_UI_NGINX_RELOAD_CMD |
| RestartCmd | NGINX_UI_NGINX_RESTART_CMD |
| Configuration Setting | Environment Variable |
|-----------------------|--------------------------------|
| AccessLogPath | NGINX_UI_NGINX_ACCESS_LOG_PATH |
| ErrorLogPath | NGINX_UI_NGINX_ERROR_LOG_PATH |
| ConfigDir | NGINX_UI_NGINX_CONFIG_DIR |
| PIDPath | NGINX_UI_NGINX_PID_PATH |
| TestConfigCmd | NGINX_UI_NGINX_TEST_CONFIG_CMD |
| ReloadCmd | NGINX_UI_NGINX_RELOAD_CMD |
| RestartCmd | NGINX_UI_NGINX_RESTART_CMD |
## OpenAI
| Configuration Setting | Environment Variable |
| ----------------------------- | ------------------------------------- |
| Model | NGINX_UI_OPENAI_MODEL |
| BaseUrl | NGINX_UI_OPENAI_BASE_URL |
| Proxy | NGINX_UI_OPENAI_PROXY |
| Token | NGINX_UI_OPENAI_TOKEN |
| Configuration Setting | Environment Variable |
|-----------------------|--------------------------|
| Model | NGINX_UI_OPENAI_MODEL |
| BaseUrl | NGINX_UI_OPENAI_BASE_URL |
| Proxy | NGINX_UI_OPENAI_PROXY |
| Token | NGINX_UI_OPENAI_TOKEN |
## Casdoor
| Configuration Setting | Environment Variable |
| ----------------------------- | ------------------------------------- |
| Endpoint | NGINX_UI_CASDOOR_ENDPOINT |
| ClientId | NGINX_UI_CASDOOR_CLIENT_ID |
| ClientSecret | NGINX_UI_CASDOOR_CLIENT_SECRET |
| Certificate | NGINX_UI_CASDOOR_CERTIFICATE |
| Organization | NGINX_UI_CASDOOR_ORGANIZATION |
| Application | NGINX_UI_CASDOOR_APPLICATION |
| RedirectUri | NGINX_UI_CASDOOR_REDIRECT_URI |
| Configuration Setting | Environment Variable |
|-----------------------|--------------------------------|
| Endpoint | NGINX_UI_CASDOOR_ENDPOINT |
| ClientId | NGINX_UI_CASDOOR_CLIENT_ID |
| ClientSecret | NGINX_UI_CASDOOR_CLIENT_SECRET |
| Certificate | NGINX_UI_CASDOOR_CERTIFICATE |
| Organization | NGINX_UI_CASDOOR_ORGANIZATION |
| Application | NGINX_UI_CASDOOR_APPLICATION |
| RedirectUri | NGINX_UI_CASDOOR_REDIRECT_URI |
## Logrotate
| Configuration Setting | Environment Variable |
| ----------------------------- | ------------------------------------- |
| Enabled | NGINX_UI_LOGROTATE_ENABLED |
| CMD | NGINX_UI_LOGROTATE_CMD |
| Interval | NGINX_UI_LOGROTATE_INTERVAL |
| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------|
| Enabled | NGINX_UI_LOGROTATE_ENABLED |
| CMD | NGINX_UI_LOGROTATE_CMD |
| Interval | NGINX_UI_LOGROTATE_INTERVAL |
## Auth
| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------|
| IPWhiteList | NGINX_UI_AUTH_IPWhiteList |
| Configuration Setting | Environment Variable |
|-----------------------|---------------------------|
| IPWhiteList | NGINX_UI_AUTH_IPWhiteList |
## Webauthn
| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------------|
| RPDisplayName | NGINX_UI_WEBAUTHN_RP_DISPLAY_NAME |
| RPID | NGINX_UI_WEBAUTHN_RPID |
| RPOrigins | NGINX_UI_WEBAUTHN_RP_ORIGINS |
## Predefined User

@ -7,11 +7,11 @@
"docs:preview": "vitepress preview"
},
"dependencies": {
"vitepress": "^1.3.1",
"vue": "^3.4.33"
"vitepress": "^1.3.4",
"vue": "^3.5.6"
},
"devDependencies": {
"@types/node": "^20.14.11",
"@types/node": "^20.16.5",
"less": "^4.2.0"
},
"license": "AGPL-3.0",

File diff suppressed because it is too large Load Diff

@ -0,0 +1,53 @@
# Webauthn
Webauthn 是一种用于安全身份验证的网络标准。它允许用户使用生物识别、移动设备和 FIDO 安全密钥登录网站。
Webauthn 是一种无密码的身份验证方法,提供了比传统密码更安全、易用的替代方案。
从 `v2.0.0-beta.34` 版本开始,Nginx UI 支持将 Webauthn Passkey 作为登录和双因素认证(2FA)方法。
## Passkey
Passkey 是使用触摸、面部识别、设备密码或 PIN 验证您身份的 Webauthn 凭证。它们可用作密码替代品或作为 2FA 方法。
## 配置
为确保安全性,不能通过 UI 添加 Webauthn 配置。
请在 app.ini 配置文件中手动添加以下内容,并重新启动 Nginx UI。
### RPDisplayName
- 类型:`string`
用于在注册新凭证时设置依赖方(RP)的显示名称。
### RPID
- 类型:`string`
用于在注册新凭证时设置依赖方(RP)的 ID。
### RPOrigins
- 类型:`[]string`
用于在注册新凭证时设置依赖方(RP)的来源(origins)。
完成后,刷新此页面并再次点击添加 Passkey。
由于某些浏览器的安全策略,除非在 `localhost` 上运行,否则无法在非 HTTPS 网站上使用 Passkey。
## 详细说明
1. **使用 Passkey 的自动 2FA:**
当您使用 Passkey 登录时,所有后续需要 2FA 的操作将自动使用 Passkey。这意味着您无需在 2FA 对话框中手动点击 “通过 Passkey 进行认证”。
2. **删除 Passkey:**
如果您使用 Passkey 登录后,前往“设置 > 认证”并删除当前的 Passkey,那么在当前会话中,Passkey 将不再用于后续的 2FA 验证。如果已配置基于时间的一次性密码(TOTP),则将改为使用它;如果未配置,则将关闭 2FA。
3. **添加新 Passkey:**
如果您在未使用 Passkey 的情况下登录,然后通过 “设置 > 认证” 添加新的 Passkey,那么在当前会话中,新增的 Passkey 将优先用于后续所有的 2FA 验证。

@ -70,6 +70,15 @@
|-----------------------|-----------------------------|
| IPWhiteList | NGINX_UI_AUTH_IPWhiteList |
## Webauthn
| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------------|
| RPDisplayName | NGINX_UI_WEBAUTHN_RP_DISPLAY_NAME |
| RPID | NGINX_UI_WEBAUTHN_RPID |
| RPOrigins | NGINX_UI_WEBAUTHN_RP_ORIGINS |
## 预定义用户
在跳过安装模式下,您可以设置以下环境变量以创建预定义用户:

@ -0,0 +1,53 @@
# Webauthn
Webauthn 是一種用於安全身份驗證的網路標準。它允許使用者使用生物識別、行動裝置和 FIDO 安全金鑰登入網站。
Webauthn 是一種無密碼的身份驗證方法,提供了比傳統密碼更安全、易用的替代方案。
從 `v2.0.0-beta.34` 版本開始,Nginx UI 支援將 Webauthn Passkey 作為登入和雙因素認證(2FA)方法。
## Passkey
Passkey 是使用觸控、面部識別、裝置密碼或 PIN 驗證您身份的 Webauthn 憑證。它們可用作密碼替代品或作為 2FA 方法。
## 配置
為確保安全性,不能透過 UI 添加 Webauthn 配置。
請在 app.ini 配置檔中手動添加以下內容,並重新啟動 Nginx UI。
### RPDisplayName
- 類型:`string`
用於在註冊新憑證時設定依賴方(RP)的顯示名稱。
### RPID
- 類型:`string`
用於在註冊新憑證時設定依賴方(RP)的 ID。
### RPOrigins
- 類型:`[]string`
用於在註冊新憑證時設定依賴方(RP)的來源(origins)。
完成後,刷新此頁面並再次點擊添加 Passkey。
由於某些瀏覽器的安全策略,除非在 `localhost` 上運行,否則無法在非 HTTPS 網站上使用 Passkey。
## 詳細說明
1. **使用 Passkey 的自動 2FA:**
當您使用 Passkey 登入時,所有後續需要 2FA 的操作將自動使用 Passkey。這意味著您無需在 2FA 對話框中手動點擊「通過 Passkey 進行認證」。
2. **刪除 Passkey:**
如果您使用 Passkey 登入後,前往「設定 > 認證」並刪除當前的 Passkey,那麼在當前會話中,Passkey 將不再用於後續的 2FA 驗證。如果已配置基於時間的一次性密碼(TOTP),則將改為使用它;如果未配置,則將關閉 2FA。
3. **添加新 Passkey:**
如果您在未使用 Passkey 的情況下登入,然後透過「設定 > 認證」添加新的 Passkey,那麼在當前會話中,新增的 Passkey 將優先用於後續所有的 2FA 驗證。

@ -70,6 +70,15 @@
|-----------------------|-----------------------------|
| IPWhiteList | NGINX_UI_AUTH_IPWhiteList |
## Webauthn
| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------------|
| RPDisplayName | NGINX_UI_WEBAUTHN_RP_DISPLAY_NAME |
| RPID | NGINX_UI_WEBAUTHN_RPID |
| RPOrigins | NGINX_UI_WEBAUTHN_RP_ORIGINS |
## 預定義使用者
在跳過安裝模式下,您可以設置以下環境變量以創建預定義使用者:

@ -81,7 +81,7 @@ require (
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/aws/aws-sdk-go-v2 v1.30.5 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.33 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.34 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.32 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect
@ -235,8 +235,8 @@ require (
github.com/stretchr/objx v0.5.2 // indirect
github.com/tdewolff/minify/v2 v2.20.37 // indirect
github.com/tdewolff/parse/v2 v2.7.15 // indirect
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1002 // indirect
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1002 // indirect
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1003 // indirect
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1003 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.8.0 // indirect
github.com/transip/gotransip/v6 v6.26.0 // indirect
@ -250,7 +250,7 @@ require (
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/vultr/govultr/v3 v3.9.1 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/yandex-cloud/go-genproto v0.0.0-20240911120709-1fa0cb6f47c2 // indirect
github.com/yandex-cloud/go-genproto v0.0.0-20240916135905-fb3873d459a7 // indirect
github.com/yandex-cloud/go-sdk v0.0.0-20240911121212-e4e74d0d02f5 // indirect
github.com/yosssi/ace v0.0.5 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect

@ -39,6 +39,7 @@ cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRY
cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM=
cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I=
cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY=
cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ=
cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4=
cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw=
cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E=
@ -713,6 +714,8 @@ github.com/aws/aws-sdk-go-v2 v1.30.5 h1:mWSRTwQAb0aLE17dSzztCVJWI9+cRMgqebndjwDy
github.com/aws/aws-sdk-go-v2 v1.30.5/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0=
github.com/aws/aws-sdk-go-v2/config v1.27.33 h1:Nof9o/MsmH4oa0s2q9a0k7tMz5x/Yj5k06lDODWz3BU=
github.com/aws/aws-sdk-go-v2/config v1.27.33/go.mod h1:kEqdYzRb8dd8Sy2pOdEbExTTF5v7ozEXX0McgPE7xks=
github.com/aws/aws-sdk-go-v2/config v1.27.34 h1:5sLceuETg/215nLtY/QIVB2O6cosS0iC/Tx5oyqUhbw=
github.com/aws/aws-sdk-go-v2/config v1.27.34/go.mod h1:kEqdYzRb8dd8Sy2pOdEbExTTF5v7ozEXX0McgPE7xks=
github.com/aws/aws-sdk-go-v2/credentials v1.17.32 h1:7Cxhp/BnT2RcGy4VisJ9miUPecY+lyE9I8JvcZofn9I=
github.com/aws/aws-sdk-go-v2/credentials v1.17.32/go.mod h1:P5/QMF3/DCHbXGEGkdbilXHsyTBX5D3HSwcrSc9p20I=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 h1:pfQ2sqNpMVK6xz2RbqLEL0GH87JOwSxPV2rzm8Zsb74=
@ -772,6 +775,7 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@ -972,6 +976,7 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
@ -1447,6 +1452,7 @@ github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaR
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
@ -1633,8 +1639,12 @@ github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 h1:IkjBCtQOOjIn03
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1002 h1:RE84sHFFx6t24DJvSnF9fS1DzBNv9OpctzHK3t7AY+I=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1002/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1003 h1:cl6DSa2pWPGS3GFG+UUmMewolR1x7Q7GR04xcjtGl9s=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1003/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1002 h1:QwE0dRkAAbdf+eACnkNULgDn9ZKUJpPWRyXdqJolP5E=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1002/go.mod h1:WdC0FYbqYhJwQ3kbqri6hVP5HAEp+rzX9FToItTAzUg=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1003 h1:0V2mVcFk5t9fDtHU6FAmAgaB3QY44pcgA0JDo0vElE0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1003/go.mod h1:DQJIItbcvoOX27p4pHtRfVt5yrKSJReFVCMLSFdO2ks=
github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU=
github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY=
github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY=
@ -1678,6 +1688,8 @@ github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJx
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
github.com/yandex-cloud/go-genproto v0.0.0-20240911120709-1fa0cb6f47c2 h1:WgeEP+8WizCQyccJNHOMLONq23qVAzYHtyg5qTdUWmg=
github.com/yandex-cloud/go-genproto v0.0.0-20240911120709-1fa0cb6f47c2/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE=
github.com/yandex-cloud/go-genproto v0.0.0-20240916135905-fb3873d459a7 h1:Ij9Led7+hSzANWYBduHXmVsGm5E9kmmJeDqFZ2Y/gc0=
github.com/yandex-cloud/go-genproto v0.0.0-20240916135905-fb3873d459a7/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE=
github.com/yandex-cloud/go-sdk v0.0.0-20240911121212-e4e74d0d02f5 h1:Q4LvUMF4kzaGtopoIdXReL9/qGtmzOewBhF3dQvuHMU=
github.com/yandex-cloud/go-sdk v0.0.0-20240911121212-e4e74d0d02f5/go.mod h1:9dt2V80cfJGRZA+5SKP3Ky+R/DxH02XfKObi2Uy2uPc=
github.com/yosssi/ace v0.0.5 h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA=

@ -15,7 +15,7 @@ lego --email you@example.com --dns dnshomede --domains my.example.org --domains
[Configuration]
[Configuration.Credentials]
DNSHOMEDE_CREDENTIALS = "Comma-separated list of domain:password credential pairs"
[Configuration.Addtional]
[Configuration.Additional]
DNSHOMEDE_POLLING_INTERVAL = "Time between DNS propagation checks"
DNSHOMEDE_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation; defaults to 300s (5 minutes)"
DNSHOMEDE_SEQUENCE_INTERVAL = "Time between sequential requests"

@ -16,7 +16,6 @@ lego --email you@example.com --dns exoscale --domains my.example.org run
EXOSCALE_API_SECRET = "API secret"
[Configuration.Additional]
EXOSCALE_ENDPOINT = "API endpoint URL"
EXOSCALE_API_ZONE = "API zone"
EXOSCALE_POLLING_INTERVAL = "Time between DNS propagation check"
EXOSCALE_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"
EXOSCALE_TTL = "The TTL of the TXT record used for the DNS challenge"

@ -0,0 +1,29 @@
Name = "Huawei Cloud"
Description = ''''''
URL = "https://huaweicloud.com"
Code = "huaweicloud"
Since = "v4.19"
Example = '''
HUAWEICLOUD_ACCESS_KEY_ID=your-access-key-id \
HUAWEICLOUD_SECRET_ACCESS_KEY=your-secret-access-key \
HUAWEICLOUD_REGION=cn-south-1 \
lego --email you@example.com --dns huaweicloud --domains my.example.org run
'''
[Configuration]
[Configuration.Credentials]
HUAWEICLOUD_ACCESS_KEY_ID = "Access key ID"
HUAWEICLOUD_SECRET_ACCESS_KEY = "Access Key secret"
HUAWEICLOUD_REGION = "Region"
[Configuration.Additional]
HUAWEICLOUD_POLLING_INTERVAL = "Time between DNS propagation check"
HUAWEICLOUD_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"
HUAWEICLOUD_TTL = "The TTL of the TXT record used for the DNS challenge"
HUAWEICLOUD_HTTP_TIMEOUT = "API request timeout"
[Links]
API = "https://console-intl.huaweicloud.com/apiexplorer/#/openapi/DNS/doc?locale=en-us"
CN_API = "https://support.huaweicloud.com/api-dns/zh-cn_topic_0132421999.html"
GoClient = "https://github.com/huaweicloud/huaweicloud-sdk-go-v3"

@ -38,7 +38,7 @@ HURRICANE_TOKENS=example.org:token
[Configuration]
[Configuration.Credentials]
HURRICANE_TOKENS = "TXT record names and tokens"
[Configuration.Addtional]
[Configuration.Additional]
HURRICANE_POLLING_INTERVAL = "Time between DNS propagation checks"
HURRICANE_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation; defaults to 300s (5 minutes)"
HURRICANE_SEQUENCE_INTERVAL = "Time between sequential requests"

@ -13,6 +13,12 @@ OVH_CONSUMER_KEY=256vfsd347245sdfg \
OVH_ENDPOINT=ovh-eu \
lego --email you@example.com --dns ovh --domains my.example.org run
# Or Access Token:
OVH_ACCESS_TOKEN=xxx \
OVH_ENDPOINT=ovh-eu \
lego --email you@example.com --dns ovh --domains my.example.org run
# Or OAuth2:
OVH_CLIENT_ID=yyy \
@ -68,6 +74,7 @@ Both authentication methods cannot be used at the same time.
OVH_CONSUMER_KEY = "Consumer key (Application Key authentication)"
OVH_CLIENT_ID = "Client ID (OAuth2)"
OVH_CLIENT_SECRET = "Client secret (OAuth2)"
OVH_ACCESS_TOKEN = "Access token"
[Configuration.Additional]
OVH_POLLING_INTERVAL = "Time between DNS propagation check"
OVH_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"

@ -60,6 +60,13 @@ func (c *ConfigPayload) mkCertificateDir() (err error) {
}
}
if _, err = os.Stat(c.CertificateDir); os.IsNotExist(err) {
err = os.MkdirAll(c.CertificateDir, 0755)
if err == nil {
return nil
}
}
// For windows, replace * with # (issue #403)
c.CertificateDir = strings.ReplaceAll(c.CertificateDir, "*", "#")
if _, err = os.Stat(c.CertificateDir); os.IsNotExist(err) {

@ -3,15 +3,17 @@ package model
import (
"github.com/go-webauthn/webauthn/webauthn"
"github.com/spf13/cast"
"gorm.io/gorm"
)
type User struct {
Model
Name string `json:"name"`
Password string `json:"-"`
Status bool `json:"status" gorm:"default:1"`
OTPSecret []byte `json:"-" gorm:"type:blob"`
Name string `json:"name"`
Password string `json:"-"`
Status bool `json:"status" gorm:"default:1"`
OTPSecret []byte `json:"-" gorm:"type:blob"`
EnabledTwoFA bool `json:"enabled_2fa" gorm:"-"`
}
type AuthToken struct {
@ -24,6 +26,11 @@ func (u *User) TableName() string {
return "auths"
}
func (u *User) AfterFind(_ *gorm.DB) error {
u.EnabledTwoFA = u.Enabled2FA()
return nil
}
func (u *User) EnabledOTP() bool {
return len(u.OTPSecret) != 0
}

Loading…
Cancel
Save