Docker
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
[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
|
||||
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Mistborn Bitwarden Service
|
||||
Requires=Mistborn-base.service
|
||||
After=Mistborn-base.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/extra/bitwarden.yml down
|
||||
ExecStartPre=/bin/chown -R --from=root:root root:root /opt/mistborn_volumes/
|
||||
ExecStartPre=/sbin/iptables -I DOCKER-USER -i DIFACE -p tcp --dport 3012 -j MISTBORN_LOG_DROP
|
||||
# Start container when unit is started
|
||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/bitwarden.yml up --build
|
||||
# Stop container when unit is stopped
|
||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/bitwarden.yml down
|
||||
# Post stop
|
||||
ExecStopPost=/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 3012 -j MISTBORN_LOG_DROP
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Mistborn Home Assistant
|
||||
Requires=Mistborn-base.service
|
||||
After=Mistborn-base.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/extra/homeassistant.yml down
|
||||
ExecStartPre=/bin/chown -R --from=root:root root:root /opt/mistborn_volumes/
|
||||
# Start container when unit is started
|
||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/homeassistant.yml up --build
|
||||
# Stop container when unit is stopped
|
||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/homeassistant.yml down
|
||||
# Post stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Mistborn Jellyfin Service
|
||||
Requires=Mistborn-nextcloud.service
|
||||
After=Mistborn-nextcloud.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/extra/jellyfin.yml down
|
||||
ExecStartPre=/bin/chown -R --from=root:root root:root /opt/mistborn_volumes/
|
||||
# Start container when unit is started
|
||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/jellyfin.yml up --build
|
||||
# Stop container when unit is stopped
|
||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/jellyfin.yml down
|
||||
# Post stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Mistborn Nextcloud Service
|
||||
Requires=Mistborn-base.service
|
||||
After=Mistborn-base.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/extra/nextcloud.yml down
|
||||
ExecStartPre=/bin/chown -R --from=root:root root:root /opt/mistborn_volumes/
|
||||
# Start container when unit is started
|
||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/nextcloud.yml up --build
|
||||
# Stop container when unit is stopped
|
||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/nextcloud.yml down
|
||||
# Post stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Mistborn OnlyOffice Service
|
||||
Requires=Mistborn-base.service
|
||||
After=Mistborn-base.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/extra/onlyoffice.yml down
|
||||
ExecStartPre=/bin/chown -R --from=root:root root:root /opt/mistborn_volumes/
|
||||
# Start container when unit is started
|
||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/onlyoffice.yml up --build
|
||||
# Stop container when unit is stopped
|
||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/onlyoffice.yml down
|
||||
# Post stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Mistborn RaspAP Service
|
||||
Requires=Mistborn-base.service
|
||||
After=Mistborn-base.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/extra/raspap.yml down
|
||||
ExecStartPre=/bin/chown -R --from=root:root root:root /opt/mistborn_volumes/
|
||||
# Start container when unit is started
|
||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/raspap.yml up --build
|
||||
# Stop container when unit is stopped
|
||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/raspap.yml down
|
||||
# Post stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Mistborn Rocket Chat Service
|
||||
Requires=Mistborn-base.service
|
||||
After=Mistborn-base.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/extra/rocketchat.yml down
|
||||
ExecStartPre=/bin/chown -R --from=root:root root:root /opt/mistborn_volumes/
|
||||
ExecStartPre=/sbin/iptables -I DOCKER-USER -i DIFACE -p tcp --dport 3001 -j MISTBORN_LOG_DROP
|
||||
# Start container when unit is started
|
||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/rocketchat.yml up --build
|
||||
# Stop container when unit is stopped
|
||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/rocketchat.yml down
|
||||
# Post stop
|
||||
ExecStopPost=/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 3001 -j MISTBORN_LOG_DROP
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,25 @@
|
||||
[Unit]
|
||||
Description=Mistborn Syncthing Service
|
||||
Requires=Mistborn-base.service
|
||||
After=Mistborn-base.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/extra/syncthing.yml down
|
||||
ExecStartPre=/bin/chown -R --from=root:root root:root /opt/mistborn_volumes/
|
||||
ExecStartPre=/sbin/iptables -I DOCKER-USER -i DIFACE -p udp --dport 21027 -j MISTBORN_LOG_DROP
|
||||
ExecStartPre=/sbin/iptables -I DOCKER-USER -i DIFACE -p tcp --dport 22000 -j MISTBORN_LOG_DROP
|
||||
# Start container when unit is started
|
||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/syncthing.yml up --build
|
||||
# Stop container when unit is stopped
|
||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/syncthing.yml down
|
||||
# Post stop
|
||||
ExecStopPost=/sbin/iptables -D DOCKER-USER -i DIFACE -p udp --dport 21027 -j MISTBORN_LOG_DROP
|
||||
ExecStopPost=/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 22000 -j MISTBORN_LOG_DROP
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Mistborn Tor Service
|
||||
Requires=Mistborn-base.service
|
||||
After=Mistborn-base.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/extra/tor.yml down
|
||||
ExecStartPre=/bin/chown -R --from=root:root root:root /opt/mistborn_volumes/
|
||||
ExecStartPre=/sbin/iptables -I DOCKER-USER -i DIFACE -p tcp --dport 9150 -j MISTBORN_LOG_DROP
|
||||
# Start container when unit is started
|
||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/tor.yml up --build
|
||||
# Stop container when unit is stopped
|
||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/tor.yml down
|
||||
# Post stop
|
||||
ExecStopPost=/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 9150 -j MISTBORN_LOG_DROP
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
# install on gateway
|
||||
sudo apt-get install -y hostapd vnstat
|
||||
Reference in New Issue
Block a user