feat: 建立 ApiState Temporal native 开发链

This commit is contained in:
root
2026-07-17 03:15:50 +02:00
parent ac695021e9
commit d203b22183
19 changed files with 1099 additions and 172 deletions
+94 -3
View File
@@ -74,27 +74,118 @@ ranking:
records:
publicLimit: 20
temporal:
addressEnv: APISTATE_TEMPORAL_ADDRESS
namespace: unidesk
taskQueue: apistate
scoreScheduleWorkflowId: apistate-score-refresh-schedule
workflowExecutionTimeout: 5m
activityStartToCloseTimeout: 4m
retry:
maximumAttempts: 1
runtime:
secretsRoot: /root/.unidesk/.state/secrets
secretSourcePaths:
platform-infra/sub2api.env: /root/.unidesk/.state/secrets/platform-infra/sub2api.env
platform-infra/apistate.env: /root/.unidesk/.state/secrets/platform-infra/apistate.env
defaultCliTarget: local
overApiTarget: native-api
cliTargets:
local:
mode: embedded
databasePath: .state/sub2rank.sqlite
scoreCachePath: .state/account-scores.json
production:
mode: http
baseUrl: https://apistate.hwpod.com
adminToken:
sourceRef: platform-infra/apistate.env
sourceKey: APISTATE_API_KEY
native-api:
mode: http
baseUrl: http://127.0.0.1:8080
adminToken:
sourceRef: platform-infra/apistate.env
sourceKey: APISTATE_API_KEY
native:
stateDir: .state/native
env:
APISTATE_WEB_PASSWORD:
sourceRef: platform-infra/apistate.env
sourceKey: APISTATE_WEB_PASSWORD
APISTATE_API_KEY:
sourceRef: platform-infra/apistate.env
sourceKey: APISTATE_API_KEY
APISTATE_SESSION_SECRET:
sourceRef: platform-infra/apistate.env
sourceKey: APISTATE_SESSION_SECRET
SUB2API_ADMIN_EMAIL:
sourceRef: platform-infra/sub2api.env
sourceKey: ADMIN_EMAIL
SUB2API_ADMIN_PASSWORD:
sourceRef: platform-infra/sub2api.env
sourceKey: ADMIN_PASSWORD
services:
api:
command:
- bun
- --hot
- src/api.ts
- --config
- config/sub2rank.yaml
- --runtime
- native
pidFile: api.pid
logFile: api.log
worker:
command:
- bun
- src/worker.ts
- --config
- config/sub2rank.yaml
- --runtime
- native
pidFile: worker.pid
logFile: worker.log
web:
command:
- bun
- --hot
- src/dev-web.ts
- --config
- config/sub2rank.yaml
- --runtime
- native
pidFile: web.pid
logFile: web.log
serverTargets:
k8s:
listenHost: 0.0.0.0
native:
listenHost: 127.0.0.1
listenPort: 8080
databasePath: /var/lib/sub2rank/sub2rank.sqlite
workerHealthHost: 127.0.0.1
workerHealthPort: 8081
webListenHost: 127.0.0.1
webListenPort: 5173
webApiBaseUrl: http://127.0.0.1:8080
databasePath: .state/sub2rank.sqlite
scoreCachePath: .state/account-scores.json
adminTokenEnv: APISTATE_API_KEY
sub2apiAdminEmailEnv: SUB2API_ADMIN_EMAIL
sub2apiAdminPasswordEnv: SUB2API_ADMIN_PASSWORD
webPasswordEnv: APISTATE_WEB_PASSWORD
apiKeyEnv: APISTATE_API_KEY
sessionSecretEnv: APISTATE_SESSION_SECRET
k8s:
listenHost: 0.0.0.0
listenPort: 8080
workerHealthHost: 0.0.0.0
workerHealthPort: 8081
webListenHost: 127.0.0.1
webListenPort: 5173
webApiBaseUrl: http://127.0.0.1:8080
databasePath: /var/lib/sub2rank/sub2rank.sqlite
scoreCachePath: /var/lib/sub2rank/account-scores.json
adminTokenEnv: APISTATE_API_KEY
sub2apiAdminEmailEnv: SUB2API_ADMIN_EMAIL
sub2apiAdminPasswordEnv: SUB2API_ADMIN_PASSWORD