it-wiki:git:gitea
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
it-wiki:git:gitea [2020/02/06 11:38] – [Step 3: Installing Gitea] marko | it-wiki:git:gitea [2020/02/11 09:29] (aktuell) – [Step 1: Preparing the system] marko | ||
---|---|---|---|
Zeile 30: | Zeile 30: | ||
Next, create a user to run Gitea: | Next, create a user to run Gitea: | ||
<code bash> | <code bash> | ||
- | adduser --system | + | adduser --system --shell /bin/bash --home /home/gitea gitea |
</ | </ | ||
Zeile 159: | Zeile 159: | ||
UNIX_SOCKET_PERMISSION = 666 | UNIX_SOCKET_PERMISSION = 666 | ||
</ | </ | ||
+ | |||
+ | ===== Step 5: Setting Up the Reverse Proxy ===== | ||
+ | Stop Nginx if it is running, as certbot will need to bind to port 80: | ||
+ | <code bash> | ||
+ | systemctl stop nginx.service | ||
+ | </ | ||
+ | |||
+ | Use the following command to obtain a certificate for your domain: | ||
+ | <code bash> | ||
+ | certbot certonly --standalone --agree-tos -m your_email@example.com -d your_domain | ||
+ | </ | ||
+ | |||
+ | Let's Encrypt will verify domain ownership before issuing the certificate. Your certificate, | ||
+ | |||
+ | We can now configure Nginx. Create a new configuration file: | ||
+ | <code bash> | ||
+ | $EDITOR / | ||
+ | </ | ||
+ | |||
+ | And enter the following configuration: | ||
+ | <code bash> | ||
+ | server { | ||
+ | listen 80; | ||
+ | listen [::]:80; | ||
+ | server_name your_domain; | ||
+ | return 301 https:// | ||
+ | access_log / | ||
+ | error_log / | ||
+ | } | ||
+ | server { | ||
+ | listen 443 ssl; | ||
+ | listen [::]:443 ssl; | ||
+ | server_name your_domain; | ||
+ | ssl on; | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | location / { | ||
+ | proxy_pass http:// | ||
+ | } | ||
+ | access_log / | ||
+ | error_log / | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The first server block simply serves to redirect all HTTP requests to HTTPS. The second block listens for HTTPS connections and proxies them to the unix socket on which we configured Gitea to listen. | ||
+ | |||
+ | Once you've saved the above configuration, | ||
+ | <code bash> | ||
+ | ln -s / | ||
+ | </ | ||
+ | |||
+ | Check for any syntax errors with and edit your configuration accordingly: | ||
+ | <code bash> | ||
+ | nginx -t | ||
+ | </ | ||
+ | |||
+ | Finally, start Nginx and Gitea: | ||
+ | <code bash> | ||
+ | systemctl start nginx.service gitea.service | ||
+ | </ | ||
+ | |||
+ | Your Gitea instance should now be running successfully. If you did not create an administrator account using the initial web installer, the first user to sign up will be given the administrator role. | ||
+ | |||
+ | ===== Optional Steps ===== | ||
+ | ==== Logging Configuration ==== | ||
+ | By default, Gitea logs messages of severity level Info and above. You will most likely want to change that to Warn or Error. To do so, open / | ||
+ | <code bash> | ||
+ | [log] | ||
+ | MODE = file | ||
+ | LEVEL = warn | ||
+ | ROOT_PATH = / | ||
+ | </ | ||
+ | |||
+ | Restart Gitea for the changes to take effect: | ||
+ | <code bash> | ||
+ | systemctl restart gitea.service | ||
+ | </ | ||
+ | |||
+ | ==== Separate SSH server ==== | ||
+ | Gitea can alternatively use its own SSH server. To enable it, add the following line to the [server] configuration section: | ||
+ | |||
+ | <code bash> | ||
+ | START_SSH_SERVER = true | ||
+ | </ | ||
+ | |||
+ | And change the SSH port to any number above 1000, for instance: | ||
+ | <code bash> | ||
+ | SSH_PORT = 2222 | ||
+ | </ | ||
+ | |||
+ | Then restart Gitea to apply the changes. |
it-wiki/git/gitea.1580989114.txt.gz · Zuletzt geändert: von marko