SIEMbitwardendnscrypthome assistantjellyfinjitsimulti-factor authenticationnextcloudonlyofficepiholeraspberry pirocket.chatsyncthingtorwazuhwireguard
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.8 KiB
38 lines
1.8 KiB
|
6 years ago
|
[Unit]
|
||
|
|
Description=Mistborn Base
|
||
|
|
Requires=docker.service
|
||
|
|
After=docker.service
|
||
|
|
|
||
|
|
[Service]
|
||
|
|
Restart=always
|
||
|
|
User=root
|
||
|
|
Group=docker
|
||
|
|
PermissionsStartOnly=true
|
||
|
|
# Shutdown container (if running) when unit is stopped
|
||
|
|
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/base.yml down
|
||
|
|
ExecStartPre=/bin/chown -R root:root /opt/mistborn_volumes/
|
||
|
|
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/base.yml build
|
||
|
|
ExecStartPre=/bin/systemctl stop systemd-resolved
|
||
|
|
ExecStartPre=/sbin/iptables -I DOCKER-USER -i DIFACE -p udp --dport 53 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStartPre=/sbin/iptables -I DOCKER-USER -i DIFACE -p tcp --dport 53 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStartPre=/sbin/iptables -I DOCKER-USER -i DIFACE -p tcp --dport 80 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStartPre=/sbin/iptables -I DOCKER-USER -i DIFACE -p tcp --dport 5555 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStartPre=/sbin/iptables -A OUTPUT -o DIFACE -p udp --dport 53 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStartPre=/sbin/ip6tables -A OUTPUT -p udp --dport 53 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStartPre=/sbin/resolvconf -u
|
||
|
|
# Start container when unit is started
|
||
|
|
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/base.yml up
|
||
|
|
# Stop container when unit is stopped
|
||
|
|
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/base.yml down
|
||
|
|
# Post stop
|
||
|
|
ExecStopPost=/sbin/iptables -D DOCKER-USER -i DIFACE -p udp --dport 53 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStopPost=/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 53 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStopPost=/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 80 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStopPost=/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 5555 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStopPost=/sbin/iptables -D OUTPUT -o DIFACE -p udp --dport 53 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStopPost=/sbin/ip6tables -D OUTPUT -p udp --dport 53 -j MISTBORN_LOG_DROP
|
||
|
|
ExecStopPost=/bin/systemctl start systemd-resolved
|
||
|
|
|
||
|
|
[Install]
|
||
|
|
WantedBy=multi-user.target
|