How to convert Digital Ocean `snap` droplet to binary installation

The Digital Ocean one-click droplet for gitea uses snap, which apparently doesn’t cooperate with 1.19.0. YMMV but I converted my snap installation to a binary installation like so:

  1. ssh into the droplet as root.

  2. Follow the instructions here to download the gitea binary and move it into position, but stop at the heading “Prepare environment”.

  3. Instead, the goal is to use the existing environment in the snap installation, which is stored in /var/snap/gitea/common.

  4. Change the owner and group of this directory to the user git and group git:

     chown -R git:git /var/snap/gitea/common
  5. Follow the instructions here to download a sample systemctl service configuration called gitea.service.

  6. Update these three lines in gitea.service to point at paths within /var/snap/gitea/common:

     ExecStart=/usr/local/bin/gitea web --config /var/snap/gitea/common/conf/app.ini
     Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/snap/gitea/common
  7. Follow the rest of the instructions to automatically start the service on reboot.

     systemctl enable gitea