Skip to content

fix: update-config can actually run, and removes files deleted upstream - #16

Open
s950tx16wasr10 wants to merge 1 commit into
mainfrom
fix/update-config-autoclean
Open

fix: update-config can actually run, and removes files deleted upstream#16
s950tx16wasr10 wants to merge 1 commit into
mainfrom
fix/update-config-autoclean

Conversation

@s950tx16wasr10

Copy link
Copy Markdown
Contributor

Two bugs that combined to make config sync silently broken. `title_screens/images/novahippie.png` was deleted from the config repo but stayed on the live server because:

  1. `globals.env` never exported `TGS_INSTANCE_ROOT`. `update-config.sh` and `parse-server.sh` both reference it, so every TGS-triggered invocation died with "TGS_INSTANCE_ROOT: unbound variable" the moment PreCompile or RepoFetch fired. The script was effectively a no-op.

  2. `git reset --hard origin/main` doesn't drop untracked files. Files commit-deleted upstream linger as untracked in the working tree. The original comment correctly warned against `git clean -fdx` (would wipe operator-managed media in `jukebox_music/`, `title_music/`, `reboot_themes/`), but unscoped `git clean -fd` would still catch top-level operator uploads. The fix scopes `git clean -fd` to the dirs that are 100% repo-managed: `${SERVER}/` and `title_screens/`.

Live server already patched out-of-band so the title screen is correct right now:

  • `/etc/tgs-EventScripts.d/reduxstation/globals.env` has `TGS_INSTANCE_ROOT` appended.
  • `/tgs_instances/.../title_screens/images/novahippie.png` removed via `git clean -fd title_screens/`.
  • Event scripts also symlinked from `/etc/tgs-EventScripts.d/reduxstation/` into `/tgs_instances/ReduxStation/Configuration/EventScripts/` (that wiring was missing too — TGS6 looks in the per-instance EventScripts dir, not `/etc/`).

A `deploy/install-eventscripts.sh` re-run on the host picks up these tracked fixes.

Two bugs that combined to make the config sync silently broken. The
title_screens/images/novahippie.png file was deleted from the config
repo but stayed on the live server because:

1. globals.env never exported TGS_INSTANCE_ROOT. update-config.sh and
   parse-server.sh both reference it, so every invocation died with
   "TGS_INSTANCE_ROOT: unbound variable" the moment TGS triggered
   PreCompile or RepoFetch. The script was effectively a no-op.

2. Even after that, `git reset --hard origin/main` doesn't drop
   untracked files, and files commit-deleted upstream linger as
   untracked in the working tree. The original comment correctly
   warned against `git clean -fdx` (would wipe operator-managed media
   in jukebox_music/, title_music/, reboot_themes/) but unscoped
   `git clean -fd` would catch top-level operator uploads too. The fix
   limits the clean to dirs that are 100% repo-managed: ${SERVER}/ and
   title_screens/.

Live server already patched out-of-band:
- /etc/tgs-EventScripts.d/reduxstation/globals.env has TGS_INSTANCE_ROOT
  appended.
- /tgs_instances/.../title_screens/images/novahippie.png removed by
  `git clean -fd title_screens/`.

A redeploy-host run will pick up these tracked fixes via install-eventscripts.sh.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant