fix: DISABLE_ADMIN_PASSWORD_CHECK still show admin password modal (#406)

This commit is contained in:
Dream Hunter
2024-08-14 22:52:45 +08:00
committed by GitHub
parent d90f54345d
commit c969c4b082
9 changed files with 1672 additions and 1635 deletions
+13 -13
View File
@@ -18,32 +18,32 @@
}, },
"dependencies": { "dependencies": {
"@simplewebauthn/browser": "^10.0.0", "@simplewebauthn/browser": "^10.0.0",
"@unhead/vue": "^1.9.15", "@unhead/vue": "^1.9.16",
"@vicons/material": "^0.12.0", "@vicons/material": "^0.12.0",
"@vueuse/core": "^10.11.0", "@vueuse/core": "^10.11.1",
"@wangeditor/editor": "^5.1.23", "@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12", "@wangeditor/editor-for-vue": "^5.1.12",
"axios": "^1.7.2", "axios": "^1.7.3",
"jszip": "^3.10.1", "jszip": "^3.10.1",
"mail-parser-wasm": "^0.1.8", "mail-parser-wasm": "^0.1.8",
"naive-ui": "^2.38.2", "naive-ui": "^2.39.0",
"postal-mime": "^2.2.5", "postal-mime": "^2.2.7",
"vooks": "^0.2.12", "vooks": "^0.2.12",
"vue": "^3.4.31", "vue": "^3.4.37",
"vue-clipboard3": "^2.0.0", "vue-clipboard3": "^2.0.0",
"vue-i18n": "^9.13.1", "vue-i18n": "^9.13.1",
"vue-router": "^4.4.0" "vue-router": "^4.4.3"
}, },
"devDependencies": { "devDependencies": {
"@vicons/fa": "^0.12.0", "@vicons/fa": "^0.12.0",
"@vitejs/plugin-vue": "^5.0.5", "@vitejs/plugin-vue": "^5.1.2",
"unplugin-auto-import": "^0.17.6", "unplugin-auto-import": "^0.18.2",
"unplugin-vue-components": "^0.27.2", "unplugin-vue-components": "^0.27.4",
"vite": "^5.3.3", "vite": "^5.4.0",
"vite-plugin-pwa": "^0.19.8", "vite-plugin-pwa": "^0.19.8",
"vite-plugin-top-level-await": "^1.4.1", "vite-plugin-top-level-await": "^1.4.4",
"vite-plugin-wasm": "^3.3.0", "vite-plugin-wasm": "^3.3.0",
"workbox-window": "^7.1.0", "workbox-window": "^7.1.0",
"wrangler": "^3.63.1" "wrangler": "^3.70.0"
} }
} }
+1051 -1054
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -56,6 +56,9 @@ const getOpenSettings = async (message) => {
try { try {
const res = await api.fetch("/open_api/settings"); const res = await api.fetch("/open_api/settings");
const domainLabels = res["domainLabels"] || []; const domainLabels = res["domainLabels"] || [];
if (res["domains"]?.length < 1) {
message.error("No domains found, please check your worker settings");
}
Object.assign(openSettings.value, { Object.assign(openSettings.value, {
...res, ...res,
title: res["title"] || "", title: res["title"] || "",
+6 -1
View File
@@ -27,6 +27,7 @@ export const useGlobalState = createGlobalState(
enableWebhook: false, enableWebhook: false,
isS3Enabled: false, isS3Enabled: false,
showGithub: true, showGithub: true,
disableAdminPasswordCheck: false,
}) })
const settings = ref({ const settings = ref({
fetched: false, fetched: false,
@@ -83,7 +84,11 @@ export const useGlobalState = createGlobalState(
/** @type {null | {domains: string[] | undefined | null, role: string, prefix: string | undefined | null}} */ /** @type {null | {domains: string[] | undefined | null, role: string, prefix: string | undefined | null}} */
user_role: null, user_role: null,
}); });
const showAdminPage = computed(() => !!adminAuth.value || userSettings.value.is_admin); const showAdminPage = computed(() =>
!!adminAuth.value
|| userSettings.value.is_admin
|| openSettings.value.disableAdminPasswordCheck
);
const telegramApp = ref(window.Telegram?.WebApp || {}); const telegramApp = ref(window.Telegram?.WebApp || {});
const isTelegram = ref(!!window.Telegram?.WebApp?.initData); const isTelegram = ref(!!window.Telegram?.WebApp?.initData);
return { return {
@@ -6,3 +6,26 @@
打开 [cloudflare控制台](https://dash.cloudflare.com/) 打开 [cloudflare控制台](https://dash.cloudflare.com/)
请查看通过 [命令行部署](/zh/guide/cli/pre-requisite) 或者 [用户界面部署](/zh/guide/ui/d1) 请查看通过 [命令行部署](/zh/guide/cli/pre-requisite) 或者 [用户界面部署](/zh/guide/ui/d1)
## 升级流程
首先确认当前的版本,然后访问 [Release 页面](https://github.com/dreamhunter2333/cloudflare_temp_email/releases/) 和 [CHANGELOG 页面](https://github.com/dreamhunter2333/cloudflare_temp_email/blob/main/CHANGELOG.md) 中找到当前的版本
> [!WARNING] 注意
> 需要注意 `Breaking Changes` 是必须进行 `数据库 sql 执行` 或者 `变量配置` 的
然后查看从当前版本往后的所有更改,需要注意 `Breaking Changes` 是必须进行 `数据库 sql 执行` 或者 `变量配置` 的, 其他的功能更新按需配置即可
然后参考下面的文档使用 `CLI` 或者 `UI` 覆盖部署之前的 `worker``pages` 即可
CLI 部署
- [命令行更新 d1](/zh/guide/cli/d1)
- [命令行部署 worker](/zh/guide/cli/worker)
- [命令行部署 pages](/zh/guide/cli/worker)
UI 部署
- [用户界面更新 d1](/zh/guide/ui/d1)
- [用户界面部署 worker](/zh/guide/ui/worker)
- [用户界面部署 pages](/zh/guide/ui/pages)
+4 -1
View File
@@ -31,7 +31,10 @@
![worker3](/ui_install/worker-3.png) ![worker3](/ui_install/worker-3.png)
6. 点击 `Settings` -> `Variables`, 如图所示添加变量,参考 [修改 wrangler.toml 配置文件](/zh/guide/cli/worker.html#修改-wrangler-toml-配置文件) 中的 `vars` 部分 6. 点击 `Settings` -> `Variables`, 如图所示添加变量,参考 [修改 wrangler.toml 配置文件](/zh/guide/cli/worker.html#修改-wrangler-toml-配置文件) 中的 `[vars]` 部分
> [!NOTE]
> 注意字符串格式的变量的最外层的引号是不需要的
![worker-var](/ui_install/worker-var.png) ![worker-var](/ui_install/worker-var.png)
+9 -9
View File
@@ -11,22 +11,22 @@
"build": "wrangler deploy --dry-run --outdir dist --minify" "build": "wrangler deploy --dry-run --outdir dist --minify"
}, },
"devDependencies": { "devDependencies": {
"@cloudflare/workers-types": "^4.20240620.0", "@cloudflare/workers-types": "^4.20240806.0",
"@eslint/js": "8.56.0", "@eslint/js": "8.56.0",
"@simplewebauthn/types": "^10.0.0", "@simplewebauthn/types": "^10.0.0",
"eslint": "8.56.0", "eslint": "8.56.0",
"globals": "^15.8.0", "globals": "^15.9.0",
"typescript-eslint": "^7.15.0", "typescript-eslint": "^7.18.0",
"wrangler": "^3.63.1" "wrangler": "^3.70.0"
}, },
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.609.0", "@aws-sdk/client-s3": "^3.629.0",
"@aws-sdk/s3-request-presigner": "^3.609.0", "@aws-sdk/s3-request-presigner": "^3.629.0",
"@simplewebauthn/server": "^10.0.1", "@simplewebauthn/server": "^10.0.1",
"hono": "^4.4.12", "hono": "^4.5.5",
"mimetext": "^3.0.24", "mimetext": "^3.0.24",
"postal-mime": "^2.2.5", "postal-mime": "^2.2.7",
"resend": "^3.4.0", "resend": "^3.5.0",
"telegraf": "4.16.3" "telegraf": "4.16.3"
}, },
"pnpm": { "pnpm": {
+562 -557
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -37,6 +37,7 @@ api.get('/open_api/settings', async (c) => {
"isS3Enabled": isS3Enabled(c), "isS3Enabled": isS3Enabled(c),
"version": CONSTANTS.VERSION, "version": CONSTANTS.VERSION,
"showGithub": !getBooleanValue(c.env.DISABLE_SHOW_GITHUB), "showGithub": !getBooleanValue(c.env.DISABLE_SHOW_GITHUB),
"disableAdminPasswordCheck": getBooleanValue(c.env.DISABLE_ADMIN_PASSWORD_CHECK)
}); });
}) })