diff --git a/content/posts/2023-03-12-gitea-updates/index.md b/content/posts/2023-03-12-gitea-updates/index.md new file mode 100644 index 0000000..a62673e --- /dev/null +++ b/content/posts/2023-03-12-gitea-updates/index.md @@ -0,0 +1,91 @@ ++++ +title = '''Gitea Updates: quick'n'dirty''' +summary = 'After a lot of lookups, a quick reminder in copy&paste mode for me.' +date = '2023-03-12T07:34:46+0100' +categories = [ 'computerstuff' ] +tags = [ 'linux', 'reminders' ] +draft = true + ++++ + +Okay, let's get right into it. + +The gitea stuff is located at `/var/lib/gitea`. + +The gitea config file is located at `/etc/gitea/app.ini`. + +The `gitea.service` file is located at `/etc/systemd/system/gitea.service` and +contains: + +```ini +[Unit] +Description=Gitea +After=syslog.target +After=network.target +After=mysql.service + +[Service] +RestartSec=2s +Type=simple +User=git +Group=git +WorkingDirectory=/var/lib/gitea/ +ExecStart=/var/lib/gitea/gitea web -c /etc/gitea/app.ini +Restart=always +Environment=USER=git HOME=/var/lib/gitea/data/home GITEA_WORK_DIR=/var/lib/gitea + +[Install] +WantedBy=multi-user.target +``` + +Check the [Changelog](https://blog.gitea.io/) for breaking changes. + +Create a backup first (or after renamed the executable file `gitea` to +`gitea.back`): + +```console +# sudo -u git ./gitea.back dump -c /etc/gitea/app.ini +``` + +That creates a file + +```console +# ll gitea-dump* +.rw-------. git git 835 MB Sun Mar 12 07:32:49 2023  gitea-dump-1678602739.zip +``` + +Just for the record: I'll include a recovery routine here, which is basically +unzipping the dump file from above and moving the contained files to the right +directory. + +```console +# unzip gitea-dump-1610949662.zip +# cd gitea-dump-1610949662 +# mv data/conf/app.ini /etc/gitea/app.ini +# mv data/* /var/lib/gitea/data/ +# mv log/* /var/lib/gitea/log/ +# mv repos/* /var/lib/gitea/repositories/ +# chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea + +# mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE for a +full and/or actual version of the recovery process. + +Download the new binary file from . + +I usually download to my root's home folder. + +```console +# wget https://dl.gitea.com/gitea/1.18.5/gitea-1.18.5-linux-amd64 +# cd /var/lib/gitea +# cp gitea gitea.back +# mv ~/gitea-1.18.5-linux-amd64 gitea +# systemctl restart gitea +``` + +That's it.