Mudanças entre as edições de "Gogs"
De MochilaWiki
Ir para navegaçãoIr para pesquisarLinha 3: | Linha 3: | ||
<source lang="bash"> | <source lang="bash"> | ||
apt install git mysql-server | apt install git mysql-server | ||
− | wget https://cdn.gogs.io/0.11. | + | wget https://cdn.gogs.io/0.11.86/gogs_0.11.86_linux_amd64.tar.gz |
− | tar zxvf gogs_0.11. | + | tar zxvf gogs_0.11.86_linux_amd64.tar.gz |
mv gogs /opt/ | mv gogs /opt/ | ||
</source> | </source> |
Edição das 02h28min de 20 de novembro de 2019
Instalação
apt install git mysql-server
wget https://cdn.gogs.io/0.11.86/gogs_0.11.86_linux_amd64.tar.gz
tar zxvf gogs_0.11.86_linux_amd64.tar.gz
mv gogs /opt/
wget -O /etc/init.d/gogs https://gist.githubusercontent.com/leo-bianchi/a9581a42e478130ad4612a185151d385/raw/7bcc42930ba457d0c1b5e5ff173ad5d6a3e6a721/gogs
sed -i '18s/etc/opt/g' /etc/init.d/gogs
chmod +x /etc/init.d/gogs
useradd -m -d /home/git -s /bin/false git
chown git: /home/git
chown -R git: /opt/gogs/
/etc/init.d/gogs restart
update-rc.d -f gogs defaults
base de dados
GRANT ALL PRIVILEGES ON gogs.* TO 'gogs'@'localhost' identified by 'xu9AeMek';
CREATE DATABASE gogs CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
flush privileges;
- Configuração atual do arquivo de configuração:
server {
listen 80;
server_name git.quijaua.net;
return 301 https://git.quijaua.net$request_uri;
location / {
proxy_pass http://localhost: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;
proxy_set_header X-Forwarded-Proto $scheme;
rewrite ^/(.*) /$1 break;
rewrite ^/$ /$1 break;
proxy_read_timeout 90;
}
}
server {
server_name git.quijaua.net;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/git.quijaua.net/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/git.quijaua.net/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
location / {
proxy_pass http://localhost: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;
proxy_set_header X-Forwarded-Proto $scheme;
rewrite ^/(.*) /$1 break;
rewrite ^/$ /$1 break;
proxy_read_timeout 90;
}
}
Backup
su - git --shell /bin/bash
cd /opt/gogs/
./gogs backup
https://discuss.gogs.io/t/how-to-backup-restore-and-migrate/991
Referências
- https://gogs.io/docs/intro/faqs
- https://discuss.gogs.io/t/gogs-is-not-working-with-nginx-https-proxy/309/6
- https://gist.github.com/thiemok/f7ad440c2d358e531e4a3945603420cd
- https://www.digitalocean.com/community/tutorials/how-to-set-up-gogs-on-ubuntu-14-04
- Client / API
- http://blog.aeciopires.com/conhecendo-o-gogs/