Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • lupa/compose.libre.sh
  • libre.sh/compose.libre.sh
  • ecobytes/compose.libre.sh
  • jordan.mitchell/compose.libre.sh
  • timothee/compose.libre.sh
5 results
Show changes
Showing
with 42 additions and 275 deletions
[Unit]
Description=Hourly backup of www and mysql content.
# Dependency binding
BindsTo=u@%i.service
[Timer]
OnActiveSec=20
OnUnitActiveSec=60min
AccuracySec=50min
[Unit]
Description=Back up data from %i
[Service]
Type=oneshot
TimeoutStartSec=3000
WorkingDirectory=/data/domains/%i/
EnvironmentFile=/etc/environment
ExecStartPre=-/bin/docker kill clean-%i
ExecStartPre=-/bin/docker rm clean-%i
ExecStartPre=-/bin/docker kill backup-%i
ExecStartPre=-/bin/docker rm backup-%i
ExecStartPre=/bin/bash -euxc ' \
/bin/docker run \
--rm \
--name clean-%i \
-e PASSPHRASE \
-v /root:/root \
indiepaas/duplicity \
remove-older-than 10D \
sftp://${BACKUP_DESTINATION}//data/%i'
ExecStartPre=/bin/bash -euxc '/data/domains/%i/BACKUP'
ExecStart=/bin/bash -euxc ' \
/bin/docker run \
--rm \
--name backup-%i \
-e PASSPHRASE \
-h backup.container \
--cpu-shares=40 \
-e PASSPHRASE \
-v /dev/random:/dev/random \
-v /dev/urandom:/dev/urandom \
-v /root:/root \
-v /data/domains/%i:/backup indiepaas/duplicity \
--volsize 500 \
--full-if-older-than 7D \
--asynchronous-upload \
--encrypt-key ${ENCRYPT_KEY} \
/backup \
sftp://${BACKUP_DESTINATION}//data/%i'
[Unit]
Description=Hourly backup of www and mysql content.
# Dependency binding
BindsTo=universal@%i.service
[Timer]
OnActiveSec=20
OnUnitActiveSec=60min
AccuracySec=50min
[Unit]
Description=%p
# Requirements
Requires=docker.service
Requires=etcd.service
# Dependency ordering
After=docker.service
After=etcd.service
Before=haproxy.service
[Service]
Restart=always
RestartSec=20
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill %p
ExecStartPre=-/usr/bin/docker rm %p
ExecStart=/usr/bin/docker run \
--rm \
--name %p \
-v /data/runtime/haproxy/:/etc/haproxy/ \
-v /var/run/docker.sock:/var/run/docker.sock \
indiepaas/confd
ExecReload=/usr/bin/docker restart %p
ExecStop=/usr/bin/docker stop %p
[Install]
WantedBy=multi-user.target
[Unit]
Description=%p for %i etcd registration
# Requirements
Requires=etcd.service
# Dependency binding
BindsTo=u@%i.service
[Service]
Type=oneshot
RemainAfterExit=yes
Environment=URL=%i
ExecStart=/bin/bash -xc ' \
ip=""; \
while [ -z $ip ]; \
do \
container_name=`echo ${URL}_web_1 | sed "s/\.//g" | sed "s/-//g"`; \
ip=`docker inspect --format \'{{.NetworkSettings.IPAddress}}\' $container_name`; \
sleep 1; \
done; \
etcdctl --peers 172.17.42.1:4001 set /services/web/%i \'{"ip":"\'$ip\'", "port":"80"}\';'
ExecStop=-/usr/bin/etcdctl rm /services/web/%i
[Unit]
Description=%p for %i etcd registration
# Requirements
Requires=etcd.service
# Dependency binding
BindsTo=universal@%i.service
[Service]
Type=oneshot
RemainAfterExit=yes
Environment=URL=%i
ExecStart=/bin/bash -xc ' \
ip=""; \
while [ -z $ip ]; \
do \
container_name=`echo ${URL}_web_1 | sed "s/\.//g" | sed "s/-//g"`; \
ip=`docker inspect --format \'{{.NetworkSettings.IPAddress}}\' $container_name`; \
sleep 1; \
done; \
etcdctl --peers 172.17.42.1:4001 set /services/web/%i \'{"ip":"\'$ip\'", "port":"80"}\';'
ExecStop=-/usr/bin/etcdctl rm /services/web/%i
[Service]
Type=oneshot
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
ExecStart=/opt/bin/dump_all.sh
[Unit]
Description=Run dump all dayly
[Timer]
OnCalendar=*-*-* 00:15:30
[Install]
WantedBy=timers.target
[Unit]
Description=Git pull on every git repo
[Service]
Type=oneshot
TimeoutStartSec=0
ExecStart=/bin/bash -euxc ' \
for directory in `find /data/domains/ -mindepth 3 -name .git -type d -prune -not -path "*/owncloud/data/*"`;do \
cd $directory; cd ..;\
git pull; \
done'
[Unit]
Description=Git pull every 5 minutes
[Timer]
OnBootSec=5min
OnUnitActiveSec=5min
[Install]
WantedBy=multi-user.target
[Path]
PathExists=/data/runtime/haproxy/haproxy.cfg
[Install]
WantedBy=multi-user.target
[Unit]
Description=%p
# Requirements
Requires=docker.service
# Dependency ordering
After=docker.service
[Service]
Restart=always
RestartSec=20
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill %p
ExecStartPre=-/usr/bin/docker rm %p
ExecStart=/usr/bin/docker run \
--rm \
--name %p \
-v /data/runtime/haproxy:/etc/haproxy \
-p 80:80 \
-p 443:443 \
indiepaas/haproxy
ExecReload=/usr/bin/docker restart %p
ExecStop=/usr/bin/docker stop %p
[Service]
Type=oneshot
ExecStart=/libre.sh/utils/mail-mon.sh
[Unit] [Unit]
Description=Daily timer for OCSP stapling Description=Run mail mon hourly and on boot
[Timer] [Timer]
OnBootSec=15min OnBootSec=15min
OnUnitActiveSec=1day OnUnitActiveSec=1h
[Install] [Install]
WantedBy=multi-user.target WantedBy=timers.target
[Unit]
Description=Get the OCSP data from the cert provider
[Service]
Type=oneshot
TimeoutStartSec=0
ExecStart=/bin/bash -euxc ' \
for cert in `ls /data/runtime/haproxy/approved-certs/*.pem`;do \
/data/indiehosters/utils/ocsp.sh $cert; \
done; \
systemctl restart haproxy; \
rm /tmp/*.crt'
[Unit]
Description=%p
# Requirements
Requires=docker.service
# Dependency ordering
After=docker.service
[Service]
Restart=always
RestartSec=20
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill %p
ExecStartPre=-/usr/bin/docker rm %p
ExecStart=/usr/bin/docker run \
--rm \
--name rsyslog \
-v /data/runtime/dev:/dev \
-v /data/runtime/log:/var/log \
indiepaas/rsyslog
ExecReload=/usr/bin/docker restart %p
ExecStop=/usr/bin/docker stop %p
[Install]
WantedBy=multi-user.target
...@@ -12,10 +12,12 @@ Restart=always ...@@ -12,10 +12,12 @@ Restart=always
RestartSec=10 RestartSec=10
TimeoutStartSec=60 TimeoutStartSec=60
TimeoutStopSec=15 TimeoutStopSec=15
WorkingDirectory=/media/diskb/backup/ EnvironmentFile=-/system/%i/env
ExecStartPre=-/opt/bin/docker-compose rm -f Environment=HOSTNAME=%H
ExecStart=/opt/bin/docker-compose up WorkingDirectory=/system/%i/
ExecStop=/opt/bin/docker-compose stop ExecStartPre=-docker-compose rm -f
ExecStart=/bin/bash -euxc "docker-compose up"
ExecStop=docker-compose stop
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
[Unit] [Unit]
Description=Turn on swap Description=Turn on swap
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=/sbin/swapon /data/swap RemainAfterExit=true
ExecStartPre=-/bin/bash -euxc ' \
fallocate -l 8192m /swap &&\
chmod 600 /swap &&\
mkswap /swap'
ExecStart=/sbin/swapon /swap
ExecStop=/sbin/swapoff /swap
[Install] [Install]
WantedBy=local.target WantedBy=local.target
...@@ -3,25 +3,21 @@ Description=%p-%i ...@@ -3,25 +3,21 @@ Description=%p-%i
# Requirements # Requirements
Requires=docker.service Requires=docker.service
Requires=d-u@%i.service
Requires=b-u@%i.timer
# Dependency ordering # Dependency ordering
After=docker.service After=docker.service
Before=d-u@%i.service
Before=b-u@%i.timer
[Service] [Service]
Restart=always Restart=always
RestartSec=10 RestartSec=10
TimeoutStartSec=60 TimeoutStartSec=60
TimeoutStopSec=15 TimeoutStopSec=15
EnvironmentFile=-/data/domains/%i/env
Environment=HOSTNAME=%H
WorkingDirectory=/data/domains/%i/ WorkingDirectory=/data/domains/%i/
ExecStartPre=/bin/cp /data/domains/%i/TLS/%i.pem /data/runtime/haproxy/approved-certs/%i.pem ExecStartPre=-docker-compose rm -f
ExecStartPre=-/opt/bin/docker-compose rm -f ExecStart=/bin/bash -euxc "LETSENCRYPT_HOST=%i VIRTUAL_HOST=%i,www.%i docker-compose up"
ExecStart=/opt/bin/docker-compose up ExecStop=docker-compose stop
ExecStop=/opt/bin/docker-compose stop
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
[Unit]
Description=%p-%i
# Requirements
Requires=docker.service
Requires=discovery-u@%i.service
Requires=backup-u@%i.timer
# Dependency ordering
After=docker.service
Before=discovery-u@%i.service
Before=backup-u@%i.timer
[Service]
Restart=always
RestartSec=10
TimeoutStartSec=60
TimeoutStopSec=15
WorkingDirectory=/data/domains/%i/
ExecStartPre=/bin/cp /data/domains/%i/TLS/%i.pem /data/runtime/haproxy/approved-certs/%i.pem
ExecStart=/bin/bash -euxc '/data/domains/%i/RUN'
ExecStop=/bin/bash -euxc '/data/domains/%i/STOP'
[Install]
WantedBy=multi-user.target