Gitea – Pasos para montarlo

Pasos realizados por mari. Pueden ser de ayuda si se requiere montar gitea en algún momento.

Gitea

  • apt install git
  • apt install nginx-full
  • apt install certbot
  • apt install sqlite3
  • adduser –disabled-login –gecos ‘gitea’ git
  • mkdir /home/git/www
  • nano /home/git/www/index.html
  • chown -R git:git /home/git/www
  • nano /etc/cron.d/certbot
  • #añadir hook al final
  • 0 */12 * * * root test -x /usr/bin/certbot && perl -e ‘sleep int(rand(3600))’ && certbot -q renew –renew-hook “/etc/init.d/nginx reload”
  • /etc/init.d/cron reload

La configuración de Nginx

  • nano /etc/nginx/sites-available/git.loquesea.dominio.com
server{
listen 80;
server_name git.loquesea.dominio.com;
location /.well-known/acme-challenge {
root /home/git/www;
}
location / {
root /home/git/www;
}
}
  • ln -s /etc/nginx/sites-available/git.loquesea.dominio.com /etc/nginx/sites-enabled/git.loquesea.dominio.com
  • /etc/init.d/nginx reload
  • certbot certonly –rsa-key-size 4096 –webroot -w /home/git/www/ -d git.loquesea.dominio.com
  • nano /etc/nginx/sites-enabled/git.loquesea.dominio.com
server{
listen 80;
server_name git.loquesea.dominio.com;

location /.well-known/acme-challenge {
root /home/git/www;
}
location / {
return 301 https://$host$request_uri; 
}
}

server{
listen 443;
ssl on;
server_name git.loquesea.dominio.com;
ssl_certificate /etc/letsencrypt/live/git.loquesea.dominio.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/git.loquesea.dominio.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:3000; 
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#max_body_size will allow you to upload a large git repository
client_max_body_size 100M;
}
}

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *