refactor: 将 Cloudflare Access 配置移至 wrangler.jsonc 管理
This commit is contained in:
1 parent
a261803204
commit
15620f8632
4 files changed
+19
-8
No files matched your search
+3
-3
@@ -1,3 +1,3 @@
|
|||||||
# Required when exercising production-mode admin routes locally.
|
# Optional local overrides. The deployed values live in wrangler.jsonc.
|
||||||
CF_ACCESS_TEAM_DOMAIN=https://your-team.cloudflareaccess.com
|
CF_ACCESS_TEAM_DOMAIN=https://hisland.cloudflareaccess.com
|
||||||
CF_ACCESS_AUD=your-access-application-audience
|
CF_ACCESS_AUD=35b84a1c6ea81e1c036272ee68ecc4197041aadc1bed0815accac283a30e01ff
|
||||||
Vendored
+1
-4
@@ -3,10 +3,7 @@
|
|||||||
declare global {
|
declare global {
|
||||||
namespace App {
|
namespace App {
|
||||||
interface Platform {
|
interface Platform {
|
||||||
env: Env & {
|
env: Env;
|
||||||
CF_ACCESS_TEAM_DOMAIN?: string;
|
|
||||||
CF_ACCESS_AUD?: string;
|
|
||||||
};
|
|
||||||
context: ExecutionContext;
|
context: ExecutionContext;
|
||||||
caches: CacheStorage & { default: Cache };
|
caches: CacheStorage & { default: Cache };
|
||||||
cf?: IncomingRequestCfProperties;
|
cf?: IncomingRequestCfProperties;
|
||||||
|
|||||||
Vendored
+11
-1
@@ -1,14 +1,24 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// Generated by Wrangler by running `wrangler types` (hash: 595eaffe197c5cd34fd594e9940c7cf0)
|
// Generated by Wrangler by running `wrangler types` (hash: 8e316e5cc1c036c1cc1ec926e6667c6d)
|
||||||
// Runtime types generated with workerd@1.20260801.1 2026-08-07 nodejs_compat
|
// Runtime types generated with workerd@1.20260801.1 2026-08-07 nodejs_compat
|
||||||
interface __BaseEnv_Env {
|
interface __BaseEnv_Env {
|
||||||
R2: R2Bucket;
|
R2: R2Bucket;
|
||||||
DB: D1Database;
|
DB: D1Database;
|
||||||
|
CF_ACCESS_TEAM_DOMAIN: 'https://hisland.cloudflareaccess.com';
|
||||||
|
CF_ACCESS_AUD: '35b84a1c6ea81e1c036272ee68ecc4197041aadc1bed0815accac283a30e01ff';
|
||||||
}
|
}
|
||||||
declare namespace Cloudflare {
|
declare namespace Cloudflare {
|
||||||
interface Env extends __BaseEnv_Env {}
|
interface Env extends __BaseEnv_Env {}
|
||||||
}
|
}
|
||||||
interface Env extends __BaseEnv_Env {}
|
interface Env extends __BaseEnv_Env {}
|
||||||
|
type StringifyValues<EnvType extends Record<string, unknown>> = {
|
||||||
|
[Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;
|
||||||
|
};
|
||||||
|
declare namespace NodeJS {
|
||||||
|
interface ProcessEnv extends StringifyValues<
|
||||||
|
Pick<Cloudflare.Env, 'CF_ACCESS_TEAM_DOMAIN' | 'CF_ACCESS_AUD'>
|
||||||
|
> {}
|
||||||
|
}
|
||||||
|
|
||||||
// Begin runtime types
|
// Begin runtime types
|
||||||
/*! *****************************************************************************
|
/*! *****************************************************************************
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
"compatibility_date": "2026-08-07",
|
"compatibility_date": "2026-08-07",
|
||||||
"compatibility_flags": ["nodejs_compat"],
|
"compatibility_flags": ["nodejs_compat"],
|
||||||
"pages_build_output_dir": ".svelte-kit/cloudflare",
|
"pages_build_output_dir": ".svelte-kit/cloudflare",
|
||||||
|
"vars": {
|
||||||
|
"CF_ACCESS_TEAM_DOMAIN": "https://hisland.cloudflareaccess.com",
|
||||||
|
"CF_ACCESS_AUD": "35b84a1c6ea81e1c036272ee68ecc4197041aadc1bed0815accac283a30e01ff"
|
||||||
|
},
|
||||||
"d1_databases": [
|
"d1_databases": [
|
||||||
{
|
{
|
||||||
"binding": "DB",
|
"binding": "DB",
|
||||||
|
|||||||
Reference in new issue
Block a user