根据已更新的原型调整系统

This commit is contained in:
Weiming committed 2026-12-03 16:45:37 +08:00
1 parent c3cdb9e2d6
commit 65de682b7a
69 files changed
+1357 -345

No files matched your search

+24 -9
View File
@@ -1,26 +1,41 @@
# Backend deployment notes
## Configuration file-only deployment
Runtime configuration is read from `./config/application.yml`. Spring Boot loads
that file automatically when IDEA or the packaged JAR starts with the backend
directory as its working directory; no environment variables or additional JVM
arguments are required. Copy `config/application.example.yml` when preparing a
new server and replace every `CHANGE_ME` value before startup.
`config/application.yml` contains database credentials and cryptographic keys and
is intentionally ignored by Git. Include it in the private deployment package,
restrict its filesystem permissions to the service account, and never publish it
to a source repository. The classpath `src/main/resources/application.yml` keeps
fail-fast placeholders so a missing private configuration cannot silently start
with shared credentials.
Before saving any `secret=true` value in `sys_integration_config`, configure
`APP_INTEGRATION_ENCRYPTION_KEY` (preferably a randomly generated 32-byte or
longer secret) in the backend runtime environment. Do not commit the key or
place a real value in `src/main/resources/application.yml`.
`app.integration-encryption-key` in the private configuration file with a random
32-byte-or-longer secret.
## Payee bank-account protection
Before creating or changing a payee bank account, provide these runtime secrets:
Before creating or changing a payee bank account, provide these values in the
private configuration file:
- `APP_BANK_ACCOUNT_ENCRYPTION_KEYS`: comma-separated `version=Base64Key`
- `app.bank-account.encryption-keys`: comma-separated `version=Base64Key`
entries; every decoded AES key must be exactly 32 bytes. Keep old versions
present while old ciphertext still exists.
- `APP_BANK_ACCOUNT_ACTIVE_KEY_VERSION`: the version used for new ciphertext.
- `APP_BANK_ACCOUNT_FINGERPRINT_KEY`: a separate Base64-encoded 32-byte HMAC key.
- `app.bank-account.active-key-version`: the version used for new ciphertext.
- `app.bank-account.fingerprint-key`: a separate Base64-encoded 32-byte HMAC key.
Never reuse the integration key, JWT secret, database password, or an encryption
key as the fingerprint key. Keep all real values outside the repository.
For an existing database, apply
`V20261201_02__protect_payee_bank_accounts.sql` first. After a verified backup,
set `APP_BANK_ACCOUNT_LEGACY_BACKFILL_ENABLED=true` for one observed maintenance
set `app.bank-account.legacy-backfill-enabled=true` for one observed maintenance
run, then return it to `false`. The backfill is deliberately non-destructive: it
adds ciphertext, mask, fingerprint, and key version but does not clear the legacy
plaintext column. Final plaintext clearing requires a separate reviewed change,
@@ -42,7 +57,7 @@ or have a DBA pre-create those tables and keep the runtime account DML-only.
Existing installations use the closed manifest and chain runner documented in
[`../financial_system_docs/mysql-migration-runner.md`](../financial_system_docs/mysql-migration-runner.md), with
DBA review and staging rehearsal; never run the clean-install snapshot against them.
Deployment JDBC `serverTimezone` and `DB_TIME_ZONE` are both `UTC`. MySQL 8.4 LTS
Deployment JDBC `serverTimezone` and `database.time-zone` are both `UTC`. MySQL 8.4 LTS
is the runtime target; repository tests are not evidence of execution on a real
production-equivalent instance, so the exact manifest requires production-like rehearsal.
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.