mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-11-04 03:42:14 +00:00
* feat(free_games_claimer): store application data in /config/data
The add-on kept everything the application writes in its private /data
volume, so the claim database, the screenshots and the browser profiles
could only be reached with a "docker exec" (#3081).
/fgc/data now points at /config/data, which Home Assistant exposes as
/addon_configs/xxx-free_games_claimer/data. This is the pattern the
aurral, maintainerr and nextcloud add-ons already use for the same
problem.
An existing /data payload is copied over once on first start. The copy
is staged in /config/.data-migration and renamed into place, so an
interrupted migration is retried on the next start instead of leaving a
half-copied database or browser profile behind. Nothing is removed from
/data, so a downgrade to 2.1.0 still finds its data.
Two clean-ups in the same script, both consequences of the move: the
"cp -rnf /fgc/* /data/" line copied the whole upstream source tree into
the persistent volume on every start and nothing ever read those copies,
and the recursive "chmod 777" on the configuration directory would now
have made the migrated browser profile and the credentials in config.env
world-writable.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(free_games_claimer): address review findings on the data migration
Three defects found by the Codex and CodeRabbit PR reviewers, all
reproduced before being accepted:
- A CONFIG_LOCATION under /config/data (for example
/config/data/custom.env) made "mkdir -p $HOME" create the migration's
own guard directory before the guard was tested, so the migration
silently skipped itself and the add-on started with no claim history
and no authenticated sessions. The migration now runs before the
CONFIG_LOCATION directory is created.
- The copy list held prime-gaming.json but not epic-games.json or
gog.json, although migrate_vogler_data.py's locate_source() supports
all three at the data root. A user whose only legacy history was Epic
or GOG would have had the migrator write a completion marker with zero
imported records.
- fgc.db-journal was not copied. Upstream sets no PRAGMA journal_mode,
so SQLite runs in its default rollback-journal mode and a hot journal
left by an unclean stop is needed to recover the database.
Also: CONFIG_LOCATION=/config/data/config.env made CONFIG_FILE and
RUNTIME_CONFIG the same path, and GNU install refuses a self-copy with
status 1, which aborted the "set -e" init script before the application
started. Verified: "install -m 0600 f f" exits 1 with "are the same
file".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(free_games_claimer): keep mode 0600 on the runtime config from creation
The self-copy guard added in 4fd0cd5 dropped "install -m 0600" to a bare
"install" followed by a chmod, which left the credentials in
/config/data/config.env at install's default mode 0755 between the two
commands. Restore the mode on install; the chmod stays for the case
where CONFIG_LOCATION already is the runtime path and install is
skipped.
Verified both branches: different paths and same path each end at mode
600 with exit status 0.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>