tss site blah

This commit is contained in:
FURRO404
2026-06-20 21:58:27 -07:00
parent 1eb0f1ffc8
commit 45142f280a
5 changed files with 83 additions and 16 deletions
+4
View File
@@ -6,6 +6,10 @@ It reads two SQLite databases:
- `TSS_BATTLES_DB` for `tss_battles.db` (matches, players, and the `match_logs` table)
- `TSS_TEAMS_DB` for `tss_teams.db`
- `TSS_TOURNAMENTS_DB` for `tss_tournaments.db`
If any of these are unset, the backend first looks under `STORAGE_VOL_PATH`
before falling back to the current working directory.
- `BACKEND_HOST` bind host, default `127.0.0.1`
- `BACKEND_ALLOWED_ORIGINS` comma-separated browser origins allowed by CORS
+7 -3
View File
@@ -2299,9 +2299,13 @@ fn lookup_vehicle_icon(icons: &HashMap<String, String>, cdk: &str) -> String {
}
fn resolve_db_path(env_key: &str, default_file: &str) -> PathBuf {
let raw = env::var(env_key).unwrap_or_else(|_| default_file.to_string());
let expanded = expand_home(&raw);
let path = PathBuf::from(expanded);
let path = if let Ok(raw) = env::var(env_key) {
PathBuf::from(expand_home(&raw))
} else if let Ok(storage) = env::var("STORAGE_VOL_PATH") {
PathBuf::from(expand_home(&storage)).join(default_file)
} else {
PathBuf::from(default_file)
};
if path.is_absolute() {
path
} else {