Add infra setup: Terraform for DO droplet + Cloudflare DNS, Ansible roles for Gitea, Vaultwarden, and Gitea runner
This commit is contained in:
19
infra/ansible/roles/gitea/templates/docker-compose.yml.j2
Normal file
19
infra/ansible/roles/gitea/templates/docker-compose.yml.j2
Normal file
@@ -0,0 +1,19 @@
|
||||
services:
|
||||
gitea:
|
||||
image: gitea/gitea:{{ gitea_version }}
|
||||
container_name: gitea
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- {{ gitea_data_dir }}/data:/data
|
||||
environment:
|
||||
USER_UID: 1000
|
||||
USER_GID: 1000
|
||||
GITEA__server__DOMAIN: "{{ gitea_domain }}"
|
||||
GITEA__server__ROOT_URL: "https://{{ gitea_domain }}/"
|
||||
GITEA__server__HTTP_PORT: 3000
|
||||
GITEA__server__SSH_DOMAIN: "{{ gitea_domain }}"
|
||||
GITEA__server__SSH_PORT: "{{ gitea_ssh_port }}"
|
||||
GITEA__server__START_SSH_SERVER: "true"
|
||||
ports:
|
||||
- "127.0.0.1:{{ gitea_http_port }}:3000"
|
||||
- "{{ gitea_ssh_port }}:22"
|
||||
24
infra/ansible/roles/gitea/templates/nginx.conf.j2
Normal file
24
infra/ansible/roles/gitea/templates/nginx.conf.j2
Normal file
@@ -0,0 +1,24 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name {{ gitea_domain }};
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name {{ gitea_domain }};
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/cf-origin.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/cf-origin.key;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:{{ gitea_http_port }};
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user