User Tools

Site Tools


giteainstallation

Gitea Installation

Installing Gitea itself

  1. Download and extract binary
    curl -O https://dl.gitea.io/gitea/1.12.4/gitea-1.12.4-linux-arm64.xz
    xz -d gitea-1.12.4-linux-arm64.xz
  2. Move binary to path
    mv gitea-1.12.4-linux-arm64 /usr/local/bin/gitea
    chmod +x /usr/local/bin/gitea
  3. Create git user
    adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /web/git git
  4. Create directories
    mkdir -p /web/git/lib/{custom,data,log}
    ln -s /web/git/lib /var/lib/gitea
    chown -R git:git /web/git/lib
    chmod -R 750 /web/git/lib
    mkdir /web/git/etc
    ln -s /web/git/etc /etc/gitea
    chown root:git /web/git/etc
    chmod 770 /web/git/etc
  5. Create systemd unit in /etc/systemd/system/gitea.
    [Unit]
    Description=Gitea (Git with a cup of tea)
    After=syslog.target
    After=network.target
     
    [Service]
    RestartSec=2s
    Type=simple
    User=git
    Group=git
    WorkingDirectory=/web/git/lib/
    ExecStart=/usr/local/bin/gitea web --config /web/git/etc/app.ini
    Restart=always
    Environment=USER=git HOME=/web/git GITEA_WORK_DIR=/web/git/lib
     
    [Install]
    WantedBy=multi-user.target
  6. Add unit it to start-full-system.target.wants
    ln -s /etc/systemd/system/gitea /etc/systemd/system/start-full-system.target.wants
    Alternatively, just enable:
    systemctl enable gitea.
  7. Reload units and start Gitea
    systemctl daemon-reload
    systemctl start gitea
  8. Access web server on port 3000, i.e. http://athena:3000/
  9. Click Register to start configuration
  10. Choose SQLite3 or what have you
  11. Change Site Title, SSH Server Domain & Port, Gitea Base URL
  12. Server and Third-Party Service Settings: Disable Self-Registration
  13. Administrator Account Settings: Create a user

nginx Configuration

  1. Stop gitea and change base URL. Change the following line in /web/git/etc/app.ini:
    ROOT_URL         = https://wgratz.net/gitea/
  2. Insert into nginx config:
             location /gitea {
                     return 301 $scheme://$host/gitea/;
             }
             location ^~ /gitea/ {
                     proxy_pass http://localhost:3000;
                     rewrite /gitea(.*) $1 break;
             }
giteainstallation.txt · Last modified: by wolfo

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki