[solved] Gitea snap could use some more documentation

Q: how to reset the admin password when the command line appears to not work??

Fresh install on Ubuntu 22.04. I installed gitea from the snap store, then did a apt install of mysql 5.7.42 from mysql.com’s repo (after adding gpg key, setting up sources.list, etc). Created my gitea user and giteadb in mysql.

Walked through the gitea installation, appeared successful. Looked around, everything appeared to be “working”. Logged out and now it will not let me log back in again.

The app.ini file for the snap appears to be in the following location and I see my a few instances of PASSWORD in it:
/var/snap/gitea/common/conf/app.ini

# gitea -h
SHOWS NOTHING
# gitea --help
SHOWS NOTHING

# gitea
SHOWS NOTHING

# gitea admin change-password --username gitea --password 3uQCQ4:Vah_9 -c “/var/snap/gitea/common/conf/app.ini”
# echo $?
3
< result = UNABLE TO LOGIN >
gitea --config /var/snap/gitea/common/conf/app.ini admin user change-password -u gitea 3uQCQ4_Vah_9
# echo $?
1
< result - UNABLE TO LOGIN >

Stopped snap with:
snap stop gitea
# tried the above again - UNABLE TO LOGIN

Does the gitea snap have to be installed with snap “classic” confinement?

If not, what am I missing here???

This really should NOT be this complicated…

Bob

PS. I checked the mysql database, logged in as the gitea user and the DB seems fine.

Well I uninstalled the snap, dropped the DB and redid the entire install.

It works now.

Except there is NO gitea command line capabilities… same behavior. NOTHING.

So the gitea cli appears broken when installed from a snap.

Please correct me otherwise. I can reproduce this easily in the environment I am in.

No support… figure it out as you go… welcome to “open source”!

So it appears because of the confinement imposed by snap, and because the snap command is a multicall binary (which in turn calls the application you wish to run, with constraints), you have to execute the gitea command as an argument to /usr/bin/snap, and then pass it appropriate arguments, for it to behave normally. So in my case:

# /usr/bin/snap run gitea admin user list

ID   Username Email                         IsActive IsAdmin 2FA
1    gitea    .....
<snip>

You will still receive some errors in the course of running it this way… but at least it’s something.

Would be nice to have some snap specific documentation … (feel free to provide any snap specific documentation links if I am missing it).

One more thing…

While it appears the gitea snap package also contains SQLite3 (and is enabled regardless if it’s used or not), you still need to install git separately.

git not included