Use lsyncd to push files to gitlab pages server

Server itself in future commit
This commit is contained in:
Jake Howard 2020-09-05 16:24:47 +01:00
parent 1487915bbc
commit e579edc758
Signed by: jake
GPG Key ID: 57AFB45680EDD477
4 changed files with 48 additions and 0 deletions

View File

@ -14,6 +14,7 @@ services:
volumes:
- /mnt/tank/app-data/gitlab/config:/etc/gitlab
- /mnt/tank/app-data/gitlab/data:/var/opt/gitlab
- /mnt/tank/app-data/gitlab/pages:/mnt/pages
tmpfs:
- /var/log/gitlab
restart: unless-stopped
@ -45,3 +46,16 @@ services:
restart: unless-stopped
volumes:
- /mnt/tank/dbs/redis/gitlab:/data
lsyncd:
image: theorangeone/lsyncd:latest
environment:
- PUID=998
- PGID=998
restart: unless-stopped
volumes:
- /mnt/tank/app-data/gitlab/pages:/mnt/pages:ro
- /mnt/tank/app-data/gitlab/lsyncd/lsyncd.lua:/config/lsyncd.lua:ro
- /mnt/tank/app-data/gitlab/lsyncd/id_ed25519.pub:/config/.ssh/id_ed25519.pub
- /mnt/tank/app-data/gitlab/lsyncd/id_ed25519:/config/.ssh/id_ed25519
- /mnt/tank/app-data/gitlab/lsyncd/known_hosts:/config/.ssh/known_hosts

View File

@ -28,3 +28,9 @@ gitlab_rails['gitlab_default_theme'] = 2
nginx['real_ip_trusted_addresses'] = ['0.0.0.0/0']
nginx['real_ip_header'] = 'X-Forwarded-For'
gitlab_pages['enable'] = false
pages_external_url "https://pages.theorangeone.net"
pages_nginx['enable'] = false
gitlab_rails['pages_path'] = "/mnt/pages"
gitlab_pages['external_http'] = ['0.0.0.0:8808']

View File

@ -0,0 +1,19 @@
settings {
logfile = "/tmp/lsyncd.log",
statusFile = "/tmp/lsyncd.status",
}
sync {
default.rsyncssh,
source = "/mnt/pages",
host = "user@{{ wireguard.clients.walker.ip }}",
targetdir = "/config/pages",
delay = 10,
rsync = {
archive = true,
compress = true
},
ssh = {
port = 8222
}
}

View File

@ -15,3 +15,12 @@
validate: /usr/bin/docker-compose -f %s config
notify: restart gitlab
become: true
- name: Install lsyncd config
template:
src: files/lsyncd.lua
dest: /mnt/tank/app-data/gitlab/lsyncd/lsyncd.lua
mode: "{{ docker_compose_file_mask }}"
owner: "998"
notify: restart gitlab
become: true