Advertisement
Justman10000

Manage Gitea

Jun 28th, 2023 (edited)
928
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.90 KB | None | 0 0
  1. // To install
  2. # You need a database system! I recommed MySQL/MariaDB: https://pastebin.com/CxsPHAE7
  3.  
  4. useradd -M -s /usr/sbin/nologin gitea
  5.  
  6. mkdir /home/gitea
  7. cd /home/gitea
  8. # The version of you Gitea instance! To see all exists versions, got to https://dl.gitea.com/gitea
  9. version=1.20.0-rc2
  10. wget https://dl.gitea.com/gitea/$version/gitea-$version-linux-amd64
  11. mv gitea-$version-linux-amd64 gitea
  12. chmod -R 777 .
  13. sudo -u gitea screen -S Gitea ./gitea
  14.  
  15. # Now we setup a service for Gitea
  16. cat << EOF > /etc/systemd/system/gitea.service
  17. [Unit]
  18. Description=Gitea
  19. After=network.target
  20. Wants=network-online.target
  21.  
  22. [Service]
  23. Restart=always
  24. Type=simple
  25. ExecStart=sudo -u gitea /home/gitea/gitea
  26. Environment=
  27.  
  28. [Install]
  29. WantedBy=multi-user.target
  30. EOF
  31.  
  32. # Enable
  33. systemctl enable gitea
  34. # And start Gitea with
  35. systemctl start gitea
  36.  
  37. // To uninstall
  38. sudo -u gitea screen -X gitea quit
  39. rm -r /home/gitea
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement