Add Gitea

This commit is contained in:
Mathias Teier 2021-04-02 19:16:09 +02:00
parent 29feb5f433
commit a219b17996
No known key found for this signature in database
GPG Key ID: 8CE851A755C27766
5 changed files with 78 additions and 11 deletions

17
gitea/docker-compose.yml Normal file
View File

@ -0,0 +1,17 @@
version: "2.4"
services:
server:
image: gitea/gitea:1.13.6
container_name: gitea
environment:
USER_UID: 1000
USER_GID: 1000
DOMAIN: "git.kagent.at"
restart: unless-stopped
volumes:
- /var/gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "2222:22"

26
gitea/start.yml Normal file
View File

@ -0,0 +1,26 @@
---
- hosts: teier.eu
gather_facts: no
tasks:
- name: Check dc directory
stat:
path: /dc/gitea
register: gitea_dc_dir_stat
- name: Create gitea dc directory
file:
path: /dc/gitea
state: directory
mode: 0755
group: root
owner: root
when: gitea_dc_dir_stat.islnk is not defined
- name: Copy compose file
copy:
src: docker-compose.yml
dest: /dc/gitea/
- name: Start gitea
shell: "cd /dc/gitea && docker-compose up -d"

View File

@ -16,16 +16,6 @@
owner: root owner: root
when: mail_dc_dir_stat.islnk is not defined when: mail_dc_dir_stat.islnk is not defined
- name: Copy mailserver.env
copy:
src: mailserver.env
dest: /dc/mail/
- name: Copy setup.sh
copy:
src: setup.sh
dest: /dc/mail/
- name: Copy compose file - name: Copy compose file
copy: copy:
src: docker-compose.yml src: docker-compose.yml

View File

@ -20,7 +20,7 @@
shell: "rm -f /etc/nginx/sites-enabled/*" shell: "rm -f /etc/nginx/sites-enabled/*"
- name: Get Certificate - name: Get Certificate
shell: certbot certonly --standalone --preferred-challenges http -m mathias.teier@icloud.com --agree-tos -n -d teier.eu -d cloud.teier.eu -d nummus.teier.eu -d www.teier.eu -d collabora.teier.eu -d matrix.teier.eu shell: certbot certonly --standalone --preferred-challenges http -m mathias.teier@icloud.com --agree-tos -n -d teier.eu -d cloud.teier.eu -d nummus.teier.eu -d www.teier.eu -d collabora.teier.eu -d matrix.teier.eu -d kagent.at -d www.kagent.at -d git.kagent.at
- name: Install nginx server config - name: Install nginx server config
copy: copy:

34
nginx/sites/gitea Normal file
View File

@ -0,0 +1,34 @@
server {
listen 80;
server_name git.kagent.at;
return 301 https://git.kagent.at:443$request_uri;
}
server {
listen 443 ssl http2;
server_name git.kagent.at;
ssl on;
ssl_certificate /etc/letsencrypt/live/teier.eu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/teier.eu/privkey.pem;
location / {
proxy_pass http://127.0.0.1:3000/;
# Configuration for WebSockets
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_cache off;
# Configuration for ServerSentEvents
proxy_buffering off;
# Configuration for LongPolling or if your KeepAliveInterval is longer than 60 seconds
proxy_read_timeout 100s;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options "SAMEORIGIN";
}
}