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_ADDRESS=:8000
SERVER_EXTERNAL_URL=http://test.sne.moe
SERVER_EXTERNAL_URL=http://test.sne.moe:8080
SERVER_DEBUG_MODE=true
SERVER_FILE_LOGGER=false
DATABASE_TYPE=postgres
DATABASE_HOST=127.0.0.1
DATABASE_HOST=localhost:5432
DATABASE_NAME=postgres
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=postgres
CACHE_HOSTS=["127.0.0.1:6379"]
CACHE_HOSTS=localhost:6379
CACHE_MASTER=
CACHE_USERNAME=
CACHE_PASSWORD=
CACHE_DB=0
SEARCH_HOST=127.0.0.1
SEARCH_HOST=localhost
SEARCH_API_KEY=
EMAIL_RESEND_API_KEY=
EMAIL_FROM=
EMAIL_RESEND_API_KEY=re_BMJaPVVB_kgdf1Go7n3dWVywp6hp4WmSA
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_JWT_TTL=15s

View File

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

View File

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