MalacoWiki

wiki of malacology

gitea

gitea是一个go语言构建的轻量代码托管解决方案,可作为GitHub的开源替代。

安装

sudo pacman -S gitea
sudo pacman -S sqlite

配置

vim /etc/gitea/app.ini

配置见 app.ini

nginx

新建/etc/nginx/sites-enabled/it.conf,注意替换 YOUR_DOMAIN YOUR_IP YOUR_KEY_FILE YOUR_CRT_FILE。

server {
            listen 80;
            server_name YOUR_DOMAIN;
            return 301 https://$server_name$request_uri;
}
server {
    listen 443 ssl http2;
    server_name YOUR_DOMAIN;
    ssl_certificate YOUR_CRT_FILE;
    ssl_certificate_key YOUR_KEY_FILE;
    ssl_session_cache builtin:1000 shared:SSL:10m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;
    access_log /var/log/nginx/access.log;
    
    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://YOUR_IP:3000;
        proxy_read_timeout 90;
        proxy_redirect http://YOUR_IP:3000 https://YOUR_DOMAIN;
    }
}

自启

systemctl enable gitea
systemctl start gitea
Last updated on 11 Aug 2021
Published on 11 Aug 2021

Powered by Arch. Copyright by Guoyi.