Skip to content

snap packge pre-seeds /var/snap/gitea/$version/ in install page breaking snap updates #12292

@ogra1

Description

@ogra1
  • Gitea version (or commit ref): v1.12.2 (stable snap channel)
  • Git version:
  • Operating system: Ubuntu Core 18
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When starting the /install page for a fresh installation the writable snap directories are properly set as default (assuming from the $SNAP_DATA variable which contains these versions) i.e.:

/var/snap/gitea/4837/data/gitea.db (when using sqlite)
/root/snap/gitea/4837/gitea-repositories
/var/snap/gitea/4837/lfs
/var/snap/gitea/4837/log

The problem here is that the version numbers end up in app.ini.
Upgrading the snap will fail because when upgrading the version number of the directory name is bumped and read access to the old versioned directory gets denied (the versioned dirs are fully bound to the binary versions of a snap)

Snapd creates symlinks by default to avoid such issues, the pre-seeded values in the install page should instead point to the directory names involving these symlinks i.e.:

/var/snap/gitea/current/data/gitea.db
/root/snap/gitea/current/gitea-repositories
/var/snap/gitea/current/lfs
/var/snap/gitea/current/log
...

...this way upgrades and roll-back will be possible.
...

Screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/distributionThis PR changes something about the packaging of Gitea

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions