Modify condig file

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2025-12-27 04:24:19 +08:00
parent afc62f311b
commit e87bda4f33
4 changed files with 28 additions and 30 deletions

View File

@@ -1,29 +1,31 @@
SERVER_APPLICATION=nixcn-cms SERVER_APPLICATION=nixcn-cms
SERVER_ADDRESS=:8000 SERVER_ADDRESS=:8000
SERVER_EXTERNAL_URL=http://test.sne.moe SERVER_EXTERNAL_URL=http://test.sne.moe:8080
SERVER_DEBUG_MODE=true SERVER_DEBUG_MODE=true
SERVER_FILE_LOGGER=false SERVER_FILE_LOGGER=false
DATABASE_TYPE=postgres DATABASE_TYPE=postgres
DATABASE_HOST=127.0.0.1 DATABASE_HOST=localhost:5432
DATABASE_NAME=postgres DATABASE_NAME=postgres
DATABASE_USERNAME=postgres DATABASE_USERNAME=postgres
DATABASE_PASSWORD=postgres DATABASE_PASSWORD=postgres
CACHE_HOSTS=["127.0.0.1:6379"] CACHE_HOSTS=localhost:6379
CACHE_MASTER= CACHE_MASTER=
CACHE_USERNAME= CACHE_USERNAME=
CACHE_PASSWORD= CACHE_PASSWORD=
CACHE_DB=0 CACHE_DB=0
SEARCH_HOST=127.0.0.1 SEARCH_HOST=localhost
SEARCH_API_KEY= SEARCH_API_KEY=
EMAIL_RESEND_API_KEY= EMAIL_RESEND_API_KEY=re_BMJaPVVB_kgdf1Go7n3dWVywp6hp4WmSA
EMAIL_FROM= EMAIL_FROM=NixCN CMS Email Verify <nixcn@violet.sne.moe>
SECRETS_JWT_SECRET=6Wd5xkDkF4XX5q2Ckq6TY6WX
SECRETS_TURNSTILE_SECRET=0x4AAAAAACI5pgVONOZ0rzyAYsdUcoOBF8w
SECRETS_JWT_SECRET=something
SECRETS_TURNSTILE_SECRET=something
TTL_MAGIC_LINK_TTL=10m TTL_MAGIC_LINK_TTL=10m
TTL_JWT_TTL=15s TTL_JWT_TTL=15s

View File

@@ -1,5 +1,5 @@
server: server:
application: nixcn-cms application: example
address: :8000 address: :8000
external_url: https://example.com external_url: https://example.com
debug_mode: false debug_mode: false
@@ -23,8 +23,8 @@ email:
resend_api_key: abc resend_api_key: abc
from: from:
secrets: secrets:
jwt_secret: something jwt_secret: example
turnstile_secret: something turnstile_secret: example
ttl: ttl:
magic_link_ttl: 10m magic_link_ttl: 10m
jwt_ttl: 15s jwt_ttl: 15s

View File

@@ -26,23 +26,18 @@
enable = true; enable = true;
dataDir = "${config.env.DEVENV_STATE}/caddy"; dataDir = "${config.env.DEVENV_STATE}/caddy";
config = '' config = ''
test.sne.moe { :8080 {
tls internal handle /api/* {
handle /api/* { reverse_proxy 127.0.0.1:8000
reverse_proxy 127.0.0.1:8000 }
} handle {
root * ${config.env.DEVENV_ROOT}/.outputs/static
handle { encode zstd gzip
root * ${config.env.DEVENV_ROOT}/.outputs/static @assets path /assets/*
header @assets Cache-Control "public, max-age=31536000, immutable"
encode zstd gzip try_files {path} /index.html
file_server
@assets path /assets/* }
header @assets Cache-Control "public, max-age=31536000, immutable"
try_files {path} /index.html
file_server
}
} }
''; '';
}; };

View File

@@ -13,10 +13,11 @@ install:
cd {{ client_dir }} && {{ bun_cmd }} install cd {{ client_dir }} && {{ bun_cmd }} install
clean: clean:
find .outputs -mindepth 1 ! -name config.yaml -exec rm -rf {} + rm -rf {{ output_dir }}
mkdir -p {{ output_dir }}
cp {{ join(project_dir, "config.default.yaml") }} {{ join(output_dir, "config.yaml") }}
build: build:
mkdir -p {{ output_dir }}
{{ go_cmd }} build -o {{ exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_enrty }} {{ go_cmd }} build -o {{ exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_enrty }}
cd {{ client_dir }} && {{ bun_cmd }} run build --outDir {{ join(output_dir, "static") }} cd {{ client_dir }} && {{ bun_cmd }} run build --outDir {{ join(output_dir, "static") }}