7 Commits
Author SHA1 Message Date
Zakk d537477a1c fix(service): the findings of a cold read of the upgrade and crash-recovery changes
A SQLite file that an earlier release's migration left empty next to an
intact bolt.db was taken as authoritative; a file without the system
settings a completed migration writes is discarded and the migration
runs again. A database migrated by that earlier release holds its
groups and outbound settings in the two tables the runtime never read;
opening it copies them into the keys it reads, for outbounds that have
none yet.

A start whose host-state recovery failed refused to run, and a start
that rolled back after its own stop tore the host state down a second
time; recovery is logged and retried at the next start, and a rollback
that stopped its process only clears the marker. A system-proxy
snapshot pending from an earlier run blocked every later system-proxy
start; it is reused as the original instead (Linux and macOS here; the
Windows side follows with its per-profile snapshot).

An empty /etc/resolv.conf was backed up as an empty file, which the
restore rejects as truncated; it is written as a marker and restored as
empty. db.Close resets the once so a reopen works.
2026-09-20 09:17:58 +10:00
Zakk ba9d464c90 fix(db): apply pragmas per connection, escape LIKE, compute sort in the insert
PRAGMA busy_timeout and foreign_keys ran once through the database/sql
pool, so only one pooled connection had them and concurrent writers failed
with SQLITE_BUSY; pass them in the DSN for both the modernc and the CGO
driver. BucketClear built its LIKE prefix from the outbound name without
escaping % and _, so clearing one outbound could wipe another's rows.
ListAppend read MAX(sort) in a separate statement, so two concurrent
appends got the same sort value; compute it inside the INSERT.
2026-09-18 02:53:32 +10:00
fnRice e42174caec fix(db): fix missing remarks and auto_select fields in subscription schema and update relevant queries. 2026-07-01 11:02:34 +08:00
Markson Hon 8d783e219d build: fix loong64 sqlite build path in CI
- route loong64 to sqlite3(cgo) driver branch

- install loongarch cross compiler and enable cgo for loong64 in binaries workflow

- bump bbolt to v1.4.3 for loong64 compatibility

- keep no-cgo cross builds compile-clean for loong64/mips64
2026-05-04 19:45:26 +08:00
Markson Hon c6e21dc591 build: fix mips-family sqlite driver selection and CI cgo setup
- extend mips driver build tags to cover mips/mips64 variants

- update sqlite validation message to mips-family scope

- enable CGO only for Linux mips-family targets in binaries workflow

- install required mips cross compilers in CI
2026-05-04 19:37:22 +08:00
Markson Hon afd73bbbc8 service/db: switch sqlite driver by target architecture
Use build-tag specific driver selection for sqlite:

- keep modernc sqlite on non-mipsle targets

- use go-sqlite3 for mipsle builds with cgo

- return explicit error when sqlite driver is unavailable

Also apply the same driver selection in migration db initialization.
2026-05-04 19:27:15 +08:00
Markson Hon b013ec71eb feat(db): migrate storage from BoltDB to SQLite 2026-05-04 19:07:17 +08:00