Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1523b914a | ||
|
|
195d4923d7 | ||
|
|
4b268de68c | ||
|
|
a57c529c73 | ||
|
|
445cf2678e | ||
|
|
ce5dfb10fa | ||
|
|
d0a70d60a6 | ||
|
|
84961c793f | ||
|
|
9cb037d27f | ||
|
|
49bad9c7ba | ||
|
|
65ecd7ae7b | ||
|
|
b44a543172 | ||
|
|
1669161d5d | ||
|
|
c2f42d6794 | ||
|
|
53b5381150 | ||
|
|
442b43f472 |
@@ -50,6 +50,7 @@ Within Mistborn is a panel to enable and manage these free extra services (off b
|
|||||||
- [Jellyfin](https://jellyfin.org): The Free Media Software System.
|
- [Jellyfin](https://jellyfin.org): The Free Media Software System.
|
||||||
- [Tor](https://www.torproject.org): The Onion Router. One tool in the arsenal of online security and privacy.
|
- [Tor](https://www.torproject.org): The Onion Router. One tool in the arsenal of online security and privacy.
|
||||||
- [Jitsi](https://jitsi.org): Multi-platform open-source video conferencing
|
- [Jitsi](https://jitsi.org): Multi-platform open-source video conferencing
|
||||||
|
- [Guacamole](https://guacamole.apache.org): A clientless remote desktop gateway that supports standard protocols like VNC, RDP, and SSH.
|
||||||
|
|
||||||
# Quickstart
|
# Quickstart
|
||||||
Tested Operating Systems (in order of thoroughness):
|
Tested Operating Systems (in order of thoroughness):
|
||||||
@@ -69,7 +70,7 @@ The Mistborn docker images exist for these architectures:
|
|||||||
|
|
||||||
| Mistborn Docker Images (hub.docker.com) | Architectures |
|
| Mistborn Docker Images (hub.docker.com) | Architectures |
|
||||||
|------------------------------------------------|---------------------|
|
|------------------------------------------------|---------------------|
|
||||||
| mistborn (django, celery{worker,beat}, flower) | amd64, arm64, arm/v7 |
|
| mistborn (django, celery{worker,beat}) | amd64, arm64, arm/v7 |
|
||||||
| dnscrypt-proxy | amd64, arm64, arm/v7 |
|
| dnscrypt-proxy | amd64, arm64, arm/v7 |
|
||||||
|
|
||||||
Recommended System Specifications:
|
Recommended System Specifications:
|
||||||
@@ -127,6 +128,15 @@ In Mistborn, Gateways are upstream from the VPN server so connections to third-p
|
|||||||
|
|
||||||
The Gateway adds an extra network hop. DNS is still resolved in Mistborn so pihole is still blocking ads.
|
The Gateway adds an extra network hop. DNS is still resolved in Mistborn so pihole is still blocking ads.
|
||||||
|
|
||||||
|
# Remote Desktop
|
||||||
|
Remote desktops enable multiple users to share desktop resources and data. Remote desktops also enable groups to prevent sensitive data from ever entering an endpoint devices such as a smartphone. For reference, some United States Government regulations require controls to protect Controlled Unclassified Information (CUI) that are not feasible to implement on all endpoint devices and remote desktops prevent the data from entering the device (see NIST SP 800-171 3.1.19, CMMC AC.3.022).
|
||||||
|
|
||||||
|
Mistborn enables remote desktop access via the Apache Guacamole extra service, which supports VNC, RDP, SSH, and other protocols.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Guacamole implements its own users and groups access controls to manage access to individual desktops. All Mistborn users must be authenticated with Mistborn (via Wireguard only or MFA) to access the Guacamole interface.
|
||||||
|
|
||||||
# Client to client communication
|
# Client to client communication
|
||||||
By default direct communication between network clients is blocked. Mistborn clients can all talk to Mistborn and communicate via shared services (Jitsi, Nextcloud, etc). Direct client to client communication can be enabled via the "client-to-client" toggle.
|
By default direct communication between network clients is blocked. Mistborn clients can all talk to Mistborn and communicate via shared services (Jitsi, Nextcloud, etc). Direct client to client communication can be enabled via the "client-to-client" toggle.
|
||||||
|
|
||||||
@@ -277,6 +287,7 @@ Mistborn uses the following domains (that can be reached by all Wireguard client
|
|||||||
| Syncthing | syncthing.mistborn | Off |
|
| Syncthing | syncthing.mistborn | Off |
|
||||||
| OnlyOffice | onlyoffice.mistborn | Off |
|
| OnlyOffice | onlyoffice.mistborn | Off |
|
||||||
| Jitsi | jitsi.mistborn | Off |
|
| Jitsi | jitsi.mistborn | Off |
|
||||||
|
| Guacamole | guac.mistborn | Off |
|
||||||
|
|
||||||
# Default Credentials
|
# Default Credentials
|
||||||
These are the default credentials to use in the services you choose to use:
|
These are the default credentials to use in the services you choose to use:
|
||||||
@@ -286,6 +297,7 @@ These are the default credentials to use in the services you choose to use:
|
|||||||
| Pihole | | {{default mistborn password}} |
|
| Pihole | | {{default mistborn password}} |
|
||||||
| Cockpit | cockpit | {{default mistborn password}} |
|
| Cockpit | cockpit | {{default mistborn password}} |
|
||||||
| Nextcloud | mistborn | {{default mistborn password}} |
|
| Nextcloud | mistborn | {{default mistborn password}} |
|
||||||
|
| Guacamole | mistborn | {{default mistborn password }} |
|
||||||
|
|
||||||
You can find the credentials sent to the Docker containers in: `/opt/mistborn/.envs/.production/`
|
You can find the credentials sent to the Docker containers in: `/opt/mistborn/.envs/.production/`
|
||||||
|
|
||||||
@@ -332,7 +344,7 @@ But wait, there's more! You can:
|
|||||||
| Jitsi Meet | [Jitsi Meet](https://play.google.com/store/apps/details?id=org.jitsi.meet) | [Jitsi Meet](https://apps.apple.com/us/app/jitsi-meet/id1165103905) |
|
| Jitsi Meet | [Jitsi Meet](https://play.google.com/store/apps/details?id=org.jitsi.meet) | [Jitsi Meet](https://apps.apple.com/us/app/jitsi-meet/id1165103905) |
|
||||||
| Bitwarden | [Bitwarden](https://play.google.com/store/apps/details?id=com.x8bit.bitwarden) | [Bitwarden](https://apps.apple.com/us/app/bitwarden-password-manager/id1137397744) |
|
| Bitwarden | [Bitwarden](https://play.google.com/store/apps/details?id=com.x8bit.bitwarden) | [Bitwarden](https://apps.apple.com/us/app/bitwarden-password-manager/id1137397744) |
|
||||||
| Jellyfin | [Jellyfin](https://play.google.com/store/apps/details?id=org.jellyfin.mobile) | [Jellyfin](https://apps.apple.com/us/app/jellyfin-mobile/id1480192618) |
|
| Jellyfin | [Jellyfin](https://play.google.com/store/apps/details?id=org.jellyfin.mobile) | [Jellyfin](https://apps.apple.com/us/app/jellyfin-mobile/id1480192618) |
|
||||||
| Home Assistant | [Home Assistant](https://play.google.com/store/apps/details?id=io.homeassistant.companion.android) | |
|
| Home Assistant | [Home Assistant](https://play.google.com/store/apps/details?id=io.homeassistant.companion.android) | [Home Assistant](https://apps.apple.com/us/app/home-assistant/id1099568401) |
|
||||||
| Rocket.Chat | [Rocket.Chat](https://play.google.com/store/apps/details?id=chat.rocket.android) | [Rocket.Chat](https://apps.apple.com/us/app/rocket-chat/id1148741252) |
|
| Rocket.Chat | [Rocket.Chat](https://play.google.com/store/apps/details?id=chat.rocket.android) | [Rocket.Chat](https://apps.apple.com/us/app/rocket-chat/id1148741252) |
|
||||||
|
|
||||||
## TLS Certificate
|
## TLS Certificate
|
||||||
@@ -445,6 +457,7 @@ sudo journalctl -xfu Mistborn-syncthing
|
|||||||
sudo journalctl -xfu Mistborn-jellyfin
|
sudo journalctl -xfu Mistborn-jellyfin
|
||||||
sudo journalctl -xfu Mistborn-nextcloud
|
sudo journalctl -xfu Mistborn-nextcloud
|
||||||
sudo journalctl -xfu Mistborn-jitsi
|
sudo journalctl -xfu Mistborn-jitsi
|
||||||
|
sudo journalctl -xfu Mistborn-guacamole
|
||||||
sudo journalctl -xfu Mistborn-rocketchat
|
sudo journalctl -xfu Mistborn-rocketchat
|
||||||
sudo journalctl -xfu Mistborn-onlyoffice
|
sudo journalctl -xfu Mistborn-onlyoffice
|
||||||
sudo journalctl -xfu Mistborn-tor
|
sudo journalctl -xfu Mistborn-tor
|
||||||
@@ -505,6 +518,7 @@ See the [Mistborn Network Security](https://gitlab.com/cyber5k/mistborn/-/wikis/
|
|||||||
- The generated TLS certificate has an RSA modulus of 4096 bits, is signed with SHA-256, and is good for 397 days. The certificate is checked daily and will regenerate when expiration is within 30 days.
|
- The generated TLS certificate has an RSA modulus of 4096 bits, is signed with SHA-256, and is good for 397 days. The certificate is checked daily and will regenerate when expiration is within 30 days.
|
||||||
- Outbound UDP on port 53 is blocked. All DNS requests should be handled by the dnscrypt_proxy service and if any client, service, etc. tries to circumvent that it is blocked.
|
- Outbound UDP on port 53 is blocked. All DNS requests should be handled by the dnscrypt_proxy service and if any client, service, etc. tries to circumvent that it is blocked.
|
||||||
- Unattended upgrades are set to automatically install operating system security updates.
|
- Unattended upgrades are set to automatically install operating system security updates.
|
||||||
|
- Ownership of mistborn files is set to the system mistborn user and access to environment variables is disabled for users other than the owner.
|
||||||
|
|
||||||
# Roadmap (not necessarily in order)
|
# Roadmap (not necessarily in order)
|
||||||
Many features and refinements are in the works at various stages including:
|
Many features and refinements are in the works at various stages including:
|
||||||
|
|||||||
@@ -158,9 +158,9 @@ services:
|
|||||||
|
|
||||||
pihole:
|
pihole:
|
||||||
container_name: mistborn_production_pihole
|
container_name: mistborn_production_pihole
|
||||||
image: pihole/pihole:v5.5.1
|
image: pihole/pihole:latest
|
||||||
env_file:
|
env_file:
|
||||||
- /opt/mistborn_volumes/base/base.txt
|
- ./.envs/.production/.pihole
|
||||||
ports:
|
ports:
|
||||||
- "${MISTBORN_DNS_BIND_IP}:53:53/tcp"
|
- "${MISTBORN_DNS_BIND_IP}:53:53/tcp"
|
||||||
- "${MISTBORN_DNS_BIND_IP}:53:53/udp"
|
- "${MISTBORN_DNS_BIND_IP}:53:53/udp"
|
||||||
@@ -168,11 +168,12 @@ services:
|
|||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.pihole-http.rule=Host(`pihole.mistborn`)"
|
- "traefik.http.routers.pihole-http.rule=Host(`pihole.mistborn`)"
|
||||||
- "traefik.http.routers.pihole-http.entrypoints=web"
|
- "traefik.http.routers.pihole-http.entrypoints=web"
|
||||||
- "traefik.http.routers.pihole-http.middlewares=mistborn_auth@file"
|
- "traefik.http.routers.pihole-http.middlewares=mistborn_auth@file,add-pihole-admin"
|
||||||
- "traefik.http.routers.pihole-https.rule=Host(`pihole.mistborn`)"
|
- "traefik.http.routers.pihole-https.rule=Host(`pihole.mistborn`)"
|
||||||
- "traefik.http.routers.pihole-https.entrypoints=websecure"
|
- "traefik.http.routers.pihole-https.entrypoints=websecure"
|
||||||
- "traefik.http.routers.pihole-https.middlewares=mistborn_auth@file"
|
- "traefik.http.routers.pihole-https.middlewares=mistborn_auth@file,add-pihole-admin"
|
||||||
- "traefik.http.routers.pihole-https.tls.certresolver=basic"
|
- "traefik.http.routers.pihole-https.tls.certresolver=basic"
|
||||||
|
- "traefik.http.middlewares.add-pihole-admin.addPrefix.prefix=/admin"
|
||||||
- "traefik.http.services.pihole-service.loadbalancer.server.port=80"
|
- "traefik.http.services.pihole-service.loadbalancer.server.port=80"
|
||||||
environment:
|
environment:
|
||||||
- ServerIP=10.2.0.3
|
- ServerIP=10.2.0.3
|
||||||
@@ -182,8 +183,6 @@ services:
|
|||||||
- DNSMASQ_LISTENING=all
|
- DNSMASQ_LISTENING=all
|
||||||
# TZ: 'America/New York'
|
# TZ: 'America/New York'
|
||||||
# Volumes store your data between container upgrades
|
# Volumes store your data between container upgrades
|
||||||
env_file:
|
|
||||||
- ./.envs/.production/.pihole
|
|
||||||
volumes:
|
volumes:
|
||||||
- ../mistborn_volumes/base/pihole/etc-pihole:/etc/pihole/
|
- ../mistborn_volumes/base/pihole/etc-pihole:/etc/pihole/
|
||||||
- ../mistborn_volumes/base/pihole/etc-dnsmasqd:/etc/dnsmasq.d/
|
- ../mistborn_volumes/base/pihole/etc-dnsmasqd:/etc/dnsmasq.d/
|
||||||
|
|||||||
+8
-8
@@ -10,14 +10,14 @@ services:
|
|||||||
- ../../mistborn_volumes/extra/bitwarden:/data
|
- ../../mistborn_volumes/extra/bitwarden:/data
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.bitwarden-http.rule=Host(`bitwarden.mistborn`)"
|
# - "traefik.http.routers.bitwarden-http.rule=Host(`bitwarden.mistborn`)"
|
||||||
- "traefik.http.routers.bitwarden-http.entrypoints=web"
|
# - "traefik.http.routers.bitwarden-http.entrypoints=web"
|
||||||
- "traefik.http.routers.bitwarden-http.middlewares=mistborn_auth@file"
|
# - "traefik.http.routers.bitwarden-http.middlewares=mistborn_auth@file"
|
||||||
- "traefik.http.routers.bitwarden-https.rule=Host(`bitwarden.mistborn`)"
|
# - "traefik.http.routers.bitwarden-https.rule=Host(`bitwarden.mistborn`)"
|
||||||
- "traefik.http.routers.bitwarden-https.entrypoints=websecure"
|
# - "traefik.http.routers.bitwarden-https.entrypoints=websecure"
|
||||||
- "traefik.http.routers.bitwarden-https.middlewares=mistborn_auth@file"
|
# - "traefik.http.routers.bitwarden-https.middlewares=mistborn_auth@file"
|
||||||
- "traefik.http.routers.bitwarden-https.tls.certresolver=basic"
|
# - "traefik.http.routers.bitwarden-https.tls.certresolver=basic"
|
||||||
- "traefik.http.services.bitwarden-service.loadbalancer.server.port=80"
|
# - "traefik.http.services.bitwarden-service.loadbalancer.server.port=80"
|
||||||
ports:
|
ports:
|
||||||
- 3012:3012/tcp
|
- 3012:3012/tcp
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
# services
|
||||||
|
services:
|
||||||
|
# guacd
|
||||||
|
guacd:
|
||||||
|
container_name: mistborn_production_guacd
|
||||||
|
image: guacamole/guacd
|
||||||
|
networks:
|
||||||
|
guacnetwork:
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ../../mistborn_volumes/extra/guacamole/drive:/drive:rw
|
||||||
|
- ../../mistborn_volumes/extra/guacamole/record:/record:rw
|
||||||
|
|
||||||
|
|
||||||
|
# postgres
|
||||||
|
guac_postgres:
|
||||||
|
container_name: mistborn_production_guac_postgres
|
||||||
|
env_file:
|
||||||
|
- ../.envs/.production/.guacamole
|
||||||
|
environment:
|
||||||
|
PGDATA: /var/lib/postgresql/data/guacamole
|
||||||
|
image: postgres
|
||||||
|
networks:
|
||||||
|
guacnetwork:
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ../../mistborn_volumes/extra/guacamole/init:/docker-entrypoint-initdb.d:ro
|
||||||
|
- ../../mistborn_volumes/extra/guacamole/data:/var/lib/postgresql/data:rw
|
||||||
|
|
||||||
|
|
||||||
|
# guacamole
|
||||||
|
guacamole:
|
||||||
|
container_name: mistborn_production_guacamole
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.guacamole-http.rule=Host(`guac.mistborn`)"
|
||||||
|
- "traefik.http.routers.guacamole-http.entrypoints=web"
|
||||||
|
- "traefik.http.routers.guacamole-http.middlewares=mistborn_auth@file,add-guacamole"
|
||||||
|
- "traefik.http.routers.guacamole-https.rule=Host(`guac.mistborn`)"
|
||||||
|
- "traefik.http.routers.guacamole-https.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.guacamole-https.middlewares=mistborn_auth@file,add-guacamole"
|
||||||
|
- "traefik.http.routers.guacamole-https.tls.certresolver=basic"
|
||||||
|
- "traefik.http.middlewares.add-guacamole.addPrefix.prefix=/guacamole"
|
||||||
|
- "traefik.http.services.guacamole-service.loadbalancer.server.port=8080"
|
||||||
|
depends_on:
|
||||||
|
- guacd
|
||||||
|
- guac_postgres
|
||||||
|
environment:
|
||||||
|
GUACD_HOSTNAME: guacd
|
||||||
|
GUACD_PORT: 4822
|
||||||
|
#GUACAMOLE_HOME: /config
|
||||||
|
env_file:
|
||||||
|
- ../.envs/.production/.guacamole
|
||||||
|
image: guacamole/guacamole
|
||||||
|
links:
|
||||||
|
- guacd
|
||||||
|
networks:
|
||||||
|
guacnetwork:
|
||||||
|
#ports:
|
||||||
|
## enable next line if not using nginx
|
||||||
|
## - 8080:8080/tcp # Guacamole is on :8080/guacamole, not /.
|
||||||
|
## enable next line when using nginx
|
||||||
|
#- 8080/tcp
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
# networks
|
||||||
|
# create a network 'guacnetwork' in mode 'bridged'
|
||||||
|
networks:
|
||||||
|
guacnetwork:
|
||||||
|
driver: bridge
|
||||||
@@ -3,7 +3,7 @@ version: '3'
|
|||||||
services:
|
services:
|
||||||
# Frontend
|
# Frontend
|
||||||
jitsi-web:
|
jitsi-web:
|
||||||
image: jitsi/web:stable-5142-3
|
image: jitsi/web:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
#ports:
|
#ports:
|
||||||
#- '${HTTP_PORT}:80'
|
#- '${HTTP_PORT}:80'
|
||||||
@@ -111,7 +111,7 @@ services:
|
|||||||
|
|
||||||
# XMPP server
|
# XMPP server
|
||||||
jitsi-prosody:
|
jitsi-prosody:
|
||||||
image: jitsi/prosody:stable-5142-3
|
image: jitsi/prosody:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
expose:
|
expose:
|
||||||
- '5222'
|
- '5222'
|
||||||
@@ -182,7 +182,7 @@ services:
|
|||||||
|
|
||||||
# Focus component
|
# Focus component
|
||||||
jitsi-jicofo:
|
jitsi-jicofo:
|
||||||
image: jitsi/jicofo:stable-5142-3
|
image: jitsi/jicofo:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ${CONFIG}/jicofo:/config:Z
|
- ${CONFIG}/jicofo:/config:Z
|
||||||
@@ -213,7 +213,7 @@ services:
|
|||||||
|
|
||||||
# Video bridge
|
# Video bridge
|
||||||
jitsi-jvb:
|
jitsi-jvb:
|
||||||
image: jitsi/jvb:stable-5142-3
|
image: jitsi/jvb:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- '${JVB_PORT}:${JVB_PORT}/udp'
|
- '${JVB_PORT}:${JVB_PORT}/udp'
|
||||||
|
|||||||
+1
-1
Submodule modules/mistborn-cli updated: 00986bcb7f...73e0c37abd
+35
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SERVICE="$1"
|
||||||
|
|
||||||
|
export MISTBORN_HOME=/opt/mistborn
|
||||||
|
export SERVICE_ENV_INSTALLER="${MISTBORN_HOME}/scripts/subinstallers/extra/${SERVICE}.sh"
|
||||||
|
export SERVICE_ENV_FILE="${MISTBORN_HOME}/.envs/.production/.${SERVICE}"
|
||||||
|
|
||||||
|
# read in global variables
|
||||||
|
set -a
|
||||||
|
source ${MISTBORN_HOME}/.env
|
||||||
|
source ${MISTBORN_HOME}/.envs/.production/.django
|
||||||
|
source ${MISTBORN_HOME}/.envs/.production/.postgres
|
||||||
|
source ${MISTBORN_HOME}/.envs/.production/.pihole
|
||||||
|
set +a
|
||||||
|
|
||||||
|
if [[ -f "${SERVICE_ENV_INSTALLER}" ]]; then
|
||||||
|
|
||||||
|
if [[ -f "${SERVICE_ENV_FILE}" ]]; then
|
||||||
|
echo "Environment file already exists."
|
||||||
|
else
|
||||||
|
|
||||||
|
# create env file for service
|
||||||
|
echo "Creating environment file"
|
||||||
|
source $SERVICE_ENV_INSTALLER $SERVICE_ENV_FILE
|
||||||
|
chown mistborn:mistborn $SERVICE_ENV_FILE
|
||||||
|
chmod 600 $SERVICE_ENV_FILE
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "No subinstaller found."
|
||||||
|
fi
|
||||||
Vendored
+3
@@ -11,6 +11,7 @@ source /opt/mistborn/scripts/subinstallers/platform.sh
|
|||||||
# setup env file
|
# setup env file
|
||||||
echo "" | sudo tee ${VAR_FILE}
|
echo "" | sudo tee ${VAR_FILE}
|
||||||
sudo chown mistborn:mistborn ${VAR_FILE}
|
sudo chown mistborn:mistborn ${VAR_FILE}
|
||||||
|
sudo chmod 600 ${VAR_FILE}
|
||||||
|
|
||||||
# MISTBORN_DNS_BIND_IP
|
# MISTBORN_DNS_BIND_IP
|
||||||
|
|
||||||
@@ -58,4 +59,6 @@ done
|
|||||||
# default interface
|
# default interface
|
||||||
sudo find /etc/systemd/system/ -type f -name 'Mistborn*' | xargs sudo sed -i "s/DIFACE/$iface/"
|
sudo find /etc/systemd/system/ -type f -name 'Mistborn*' | xargs sudo sed -i "s/DIFACE/$iface/"
|
||||||
|
|
||||||
|
echo "DIFACE=${iface}" | sudo tee -a ${VAR_FILE}
|
||||||
|
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
|
|||||||
+13
-17
@@ -59,13 +59,18 @@ echo -e "| | | | \__ \ |_| |_) | (_) | | | | | |"
|
|||||||
echo -e "|_| |_|_|___/\__|_.__/ \___/|_| |_| |_|"
|
echo -e "|_| |_|_|___/\__|_.__/ \___/|_| |_| |_|"
|
||||||
echo -e ""
|
echo -e ""
|
||||||
|
|
||||||
# INPUT default admin password
|
sudo rm -rf /opt/mistborn 2>/dev/null || true
|
||||||
if [ -z "${MISTBORN_DEFAULT_PASSWORD}" ]; then
|
|
||||||
read -p "(Mistborn) Set default admin password: " -s MISTBORN_DEFAULT_PASSWORD
|
# clone to /opt and change directory
|
||||||
echo
|
echo "Cloning $GIT_BRANCH branch from mistborn repo"
|
||||||
else
|
sudo git clone https://gitlab.com/cyber5k/mistborn.git -b $GIT_BRANCH /opt/mistborn
|
||||||
echo "MISTBORN_DEFAULT_PASSWORD is already set"
|
sudo chown -R $USER:$USER /opt/mistborn
|
||||||
fi
|
pushd .
|
||||||
|
cd /opt/mistborn
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
# MISTBORN_DEFAULT_PASSWORD
|
||||||
|
source ./scripts/subinstallers/passwd.sh
|
||||||
|
|
||||||
# Install Cockpit?
|
# Install Cockpit?
|
||||||
if [ -z "${MISTBORN_INSTALL_COCKPIT}" ]; then
|
if [ -z "${MISTBORN_INSTALL_COCKPIT}" ]; then
|
||||||
@@ -85,16 +90,6 @@ else
|
|||||||
echo "SSH key exists for $USER"
|
echo "SSH key exists for $USER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo rm -rf /opt/mistborn 2>/dev/null || true
|
|
||||||
|
|
||||||
# clone to /opt and change directory
|
|
||||||
echo "Cloning $GIT_BRANCH branch from mistborn repo"
|
|
||||||
sudo git clone https://gitlab.com/cyber5k/mistborn.git -b $GIT_BRANCH /opt/mistborn
|
|
||||||
sudo chown -R $USER:$USER /opt/mistborn
|
|
||||||
pushd .
|
|
||||||
cd /opt/mistborn
|
|
||||||
git submodule update --init --recursive
|
|
||||||
|
|
||||||
# initial load update package list
|
# initial load update package list
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
|
||||||
@@ -248,6 +243,7 @@ sudo resolvconf -u 1>/dev/null 2>&1
|
|||||||
|
|
||||||
echo "backup up original volumes folder"
|
echo "backup up original volumes folder"
|
||||||
sudo mkdir -p ../mistborn_backup
|
sudo mkdir -p ../mistborn_backup
|
||||||
|
sudo chmod 700 ../mistborn_backup
|
||||||
sudo tar -czf ../mistborn_backup/mistborn_volumes_backup.tar.gz ../mistborn_volumes 1>/dev/null 2>&1
|
sudo tar -czf ../mistborn_backup/mistborn_volumes_backup.tar.gz ../mistborn_volumes 1>/dev/null 2>&1
|
||||||
|
|
||||||
# clean docker
|
# clean docker
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ User=root
|
|||||||
Group=docker
|
Group=docker
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
# Shutdown container (if running) when unit is stopped
|
# Shutdown container (if running) when unit is stopped
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/bitwarden.yml down
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh bitwarden docker-compose -f /opt/mistborn/extra/bitwarden.yml down
|
||||||
|
|
||||||
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport 3012 -j MISTBORN_LOG_DROP
|
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport 3012 -j MISTBORN_LOG_DROP
|
||||||
# Start container when unit is started
|
# Start container when unit is started
|
||||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/bitwarden.yml up --build
|
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh bitwarden docker-compose -f /opt/mistborn/extra/bitwarden.yml up --build
|
||||||
# Stop container when unit is stopped
|
# Stop container when unit is stopped
|
||||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/bitwarden.yml down
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh bitwarden docker-compose -f /opt/mistborn/extra/bitwarden.yml down
|
||||||
# Post stop
|
# Post stop
|
||||||
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 3012 -j MISTBORN_LOG_DROP
|
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 3012 -j MISTBORN_LOG_DROP
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Mistborn Guacamole
|
||||||
|
Requires=Mistborn-base.service
|
||||||
|
After=Mistborn-base.service
|
||||||
|
PartOf=Mistborn-base.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=always
|
||||||
|
User=root
|
||||||
|
Group=docker
|
||||||
|
PermissionsStartOnly=true
|
||||||
|
# Shutdown container (if running) when unit is stopped
|
||||||
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh guacamole docker-compose -f /opt/mistborn/extra/guacamole.yml down
|
||||||
|
|
||||||
|
# Start container when unit is started
|
||||||
|
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh guacamole docker-compose -f /opt/mistborn/extra/guacamole.yml up --build
|
||||||
|
# Stop container when unit is stopped
|
||||||
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh guacamole docker-compose -f /opt/mistborn/extra/guacamole.yml down
|
||||||
|
# Post stop
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -10,12 +10,12 @@ User=root
|
|||||||
Group=docker
|
Group=docker
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
# Shutdown container (if running) when unit is stopped
|
# Shutdown container (if running) when unit is stopped
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/homeassistant.yml down
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh homeassistant docker-compose -f /opt/mistborn/extra/homeassistant.yml down
|
||||||
|
|
||||||
# Start container when unit is started
|
# Start container when unit is started
|
||||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/homeassistant.yml up --build
|
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh homeassistant docker-compose -f /opt/mistborn/extra/homeassistant.yml up --build
|
||||||
# Stop container when unit is stopped
|
# Stop container when unit is stopped
|
||||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/homeassistant.yml down
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh homeassistant docker-compose -f /opt/mistborn/extra/homeassistant.yml down
|
||||||
# Post stop
|
# Post stop
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ User=root
|
|||||||
Group=docker
|
Group=docker
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
# Shutdown container (if running) when unit is stopped
|
# Shutdown container (if running) when unit is stopped
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/jellyfin.yml down
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh jellyfin docker-compose -f /opt/mistborn/extra/jellyfin.yml down
|
||||||
|
|
||||||
# Start container when unit is started
|
# Start container when unit is started
|
||||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/jellyfin.yml up --build
|
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh jellyfin docker-compose -f /opt/mistborn/extra/jellyfin.yml up --build
|
||||||
# Stop container when unit is stopped
|
# Stop container when unit is stopped
|
||||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/jellyfin.yml down
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh jellyfin docker-compose -f /opt/mistborn/extra/jellyfin.yml down
|
||||||
# Post stop
|
# Post stop
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -9,20 +9,18 @@ Restart=always
|
|||||||
User=root
|
User=root
|
||||||
Group=docker
|
Group=docker
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
EnvironmentFile=/opt/mistborn/.envs/.production/.jitsi
|
|
||||||
|
|
||||||
# Shutdown container (if running) when unit is stopped
|
# Shutdown container (if running) when unit is stopped
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/jitsi-meet.yml down
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh jitsi docker-compose -f /opt/mistborn/extra/jitsi-meet.yml down
|
||||||
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh jitsi /opt/mistborn/scripts/services/jitsi/iptables_up.sh
|
||||||
|
|
||||||
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p udp --dport $JVB_PORT -j MISTBORN_LOG_DROP
|
|
||||||
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport $JVB_TCP_PORT -j MISTBORN_LOG_DROP
|
|
||||||
# Start container when unit is started
|
# Start container when unit is started
|
||||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/jitsi-meet.yml up --build
|
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh jitsi docker-compose -f /opt/mistborn/extra/jitsi-meet.yml up --build
|
||||||
|
|
||||||
# Stop container when unit is stopped
|
# Stop container when unit is stopped
|
||||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/jitsi-meet.yml down
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh jitsi docker-compose -f /opt/mistborn/extra/jitsi-meet.yml down
|
||||||
# Post stop
|
# Post stop
|
||||||
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p udp --dport $JVB_PORT -j MISTBORN_LOG_DROP
|
ExecStopPost=-/opt/mistborn/scripts/wrappers/mistborn_docker.sh jitsi /opt/mistborn/scripts/services/jitsi/iptables_down.sh
|
||||||
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport $JVB_TCP_PORT -j MISTBORN_LOG_DROP
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -6,16 +6,16 @@ PartOf=Mistborn-base.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Restart=always
|
Restart=always
|
||||||
User=www-data
|
User=root
|
||||||
Group=docker
|
Group=docker
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
# Shutdown container (if running) when unit is stopped
|
# Shutdown container (if running) when unit is stopped
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/nextcloud.yml down
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh nextcloud docker-compose -f /opt/mistborn/extra/nextcloud.yml down
|
||||||
|
|
||||||
# Start container when unit is started
|
# Start container when unit is started
|
||||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/nextcloud.yml up --build
|
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh nextcloud docker-compose -f /opt/mistborn/extra/nextcloud.yml up --build
|
||||||
# Stop container when unit is stopped
|
# Stop container when unit is stopped
|
||||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/nextcloud.yml down
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh nextcloud docker-compose -f /opt/mistborn/extra/nextcloud.yml down
|
||||||
# Post stop
|
# Post stop
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ User=root
|
|||||||
Group=docker
|
Group=docker
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
# Shutdown container (if running) when unit is stopped
|
# Shutdown container (if running) when unit is stopped
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/onlyoffice.yml down
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh onlyoffice docker-compose -f /opt/mistborn/extra/onlyoffice.yml down
|
||||||
|
|
||||||
# Start container when unit is started
|
# Start container when unit is started
|
||||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/onlyoffice.yml up --build
|
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh onlyoffice docker-compose -f /opt/mistborn/extra/onlyoffice.yml up --build
|
||||||
# Stop container when unit is stopped
|
# Stop container when unit is stopped
|
||||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/onlyoffice.yml down
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh onlyoffice docker-compose -f /opt/mistborn/extra/onlyoffice.yml down
|
||||||
# Post stop
|
# Post stop
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -9,15 +9,14 @@ Restart=always
|
|||||||
User=root
|
User=root
|
||||||
Group=docker
|
Group=docker
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
EnvironmentFile=/opt/mistborn/.env
|
|
||||||
# Shutdown container (if running) when unit is stopped
|
# Shutdown container (if running) when unit is stopped
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/rocketchat.yml down
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh rocketchat docker-compose -f /opt/mistborn/extra/rocketchat.yml down
|
||||||
|
|
||||||
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport 3001 -j MISTBORN_LOG_DROP
|
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport 3001 -j MISTBORN_LOG_DROP
|
||||||
# Start container when unit is started
|
# Start container when unit is started
|
||||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/rocketchat.yml up --build
|
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh rocketchat docker-compose -f /opt/mistborn/extra/rocketchat.yml up --build
|
||||||
# Stop container when unit is stopped
|
# Stop container when unit is stopped
|
||||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/rocketchat.yml down
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh rocketchat docker-compose -f /opt/mistborn/extra/rocketchat.yml down
|
||||||
# Post stop
|
# Post stop
|
||||||
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 3001 -j MISTBORN_LOG_DROP
|
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 3001 -j MISTBORN_LOG_DROP
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ User=root
|
|||||||
Group=docker
|
Group=docker
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
# Shutdown container (if running) when unit is stopped
|
# Shutdown container (if running) when unit is stopped
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/syncthing.yml down
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh syncthing docker-compose -f /opt/mistborn/extra/syncthing.yml down
|
||||||
|
|
||||||
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p udp --dport 21027 -j MISTBORN_LOG_DROP
|
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p udp --dport 21027 -j MISTBORN_LOG_DROP
|
||||||
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport 22000 -j MISTBORN_LOG_DROP
|
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport 22000 -j MISTBORN_LOG_DROP
|
||||||
# Start container when unit is started
|
# Start container when unit is started
|
||||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/syncthing.yml up --build
|
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh syncthing docker-compose -f /opt/mistborn/extra/syncthing.yml up --build
|
||||||
# Stop container when unit is stopped
|
# Stop container when unit is stopped
|
||||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/syncthing.yml down
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh syncthing docker-compose -f /opt/mistborn/extra/syncthing.yml down
|
||||||
# Post stop
|
# 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 udp --dport 21027 -j MISTBORN_LOG_DROP
|
||||||
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 22000 -j MISTBORN_LOG_DROP
|
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 22000 -j MISTBORN_LOG_DROP
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ User=root
|
|||||||
Group=docker
|
Group=docker
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
# Shutdown container (if running) when unit is stopped
|
# Shutdown container (if running) when unit is stopped
|
||||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/tor.yml down
|
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh tor docker-compose -f /opt/mistborn/extra/tor.yml down
|
||||||
|
|
||||||
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport 9150 -j MISTBORN_LOG_DROP
|
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport 9150 -j MISTBORN_LOG_DROP
|
||||||
# Start container when unit is started
|
# Start container when unit is started
|
||||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/tor.yml up --build
|
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh tor docker-compose -f /opt/mistborn/extra/tor.yml up --build
|
||||||
# Stop container when unit is stopped
|
# Stop container when unit is stopped
|
||||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/tor.yml down
|
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh tor docker-compose -f /opt/mistborn/extra/tor.yml down
|
||||||
# Post stop
|
# Post stop
|
||||||
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 9150 -j MISTBORN_LOG_DROP
|
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 9150 -j MISTBORN_LOG_DROP
|
||||||
|
|
||||||
|
|||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ -f "/opt/mistborn_volumes/extra/guacamole/init/initdb.sql" ]]; then
|
||||||
|
echo "initdb.sql exists. Proceeding."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p /opt/mistborn_volumes/extra/guacamole/init/ >/dev/null 2>&1
|
||||||
|
chmod -R +x /opt/mistborn_volumes/extra/guacamole/init/
|
||||||
|
docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgres > /opt/mistborn_volumes/extra/guacamole/init/initdb.sql
|
||||||
|
|
||||||
|
# grab values in initdb.sql to replace
|
||||||
|
HEXSTRINGS=($(egrep -o [0-9a-fA-F]{64} /opt/mistborn_volumes/extra/guacamole/init/initdb.sql))
|
||||||
|
|
||||||
|
# reset default password in init.db
|
||||||
|
SALT=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice('0123456789ABCDEF') for x in range(64)]))")
|
||||||
|
GUAC_PASSWORD_HASHED=$(echo -n "${MISTBORN_DEFAULT_PASSWORD}${SALT}" | sha256sum | awk '{print $1}' | tr a-z A-Z)
|
||||||
|
|
||||||
|
sed -i "s/${HEXSTRINGS[1]}/$SALT/" /opt/mistborn_volumes/extra/guacamole/init/initdb.sql
|
||||||
|
sed -i "s/${HEXSTRINGS[0]}/$GUAC_PASSWORD_HASHED/" /opt/mistborn_volumes/extra/guacamole/init/initdb.sql
|
||||||
|
sed -i "s/guacadmin/mistborn/g" /opt/mistborn_volumes/extra/guacamole/init/initdb.sql
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
iptables -w -D DOCKER-USER -i $DIFACE -p udp --dport $JVB_PORT -j MISTBORN_LOG_DROP
|
||||||
|
iptables -w -D DOCKER-USER -i $DIFACE -p tcp --dport $JVB_TCP_PORT -j MISTBORN_LOG_DROP
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
iptables -w -I DOCKER-USER -i $DIFACE -p udp --dport $JVB_PORT -j MISTBORN_LOG_DROP
|
||||||
|
iptables -w -I DOCKER-USER -i $DIFACE -p tcp --dport $JVB_TCP_PORT -j MISTBORN_LOG_DROP
|
||||||
Executable
+10
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# generate bitwarden .env files
|
||||||
|
BITWARDEN_PROD_FILE="$1"
|
||||||
|
echo "WEBSOCKET_ENABLED=true" > $BITWARDEN_PROD_FILE
|
||||||
|
echo "SIGNUPS_ALLOWED=true" >> $BITWARDEN_PROD_FILE
|
||||||
|
|
||||||
|
echo "MISTBORN_SERVICE_DOMAIN=bitwarden.mistborn" >> $BITWARDEN_PROD_FILE
|
||||||
|
echo "MISTBORN_SERVICE_NAME=bitwarden" >> $BITWARDEN_PROD_FILE
|
||||||
|
echo "MISTBORN_SERVICE_PORT=80" >> $BITWARDEN_PROD_FILE
|
||||||
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Guacamole
|
||||||
|
GUAC_PROD_FILE="$1"
|
||||||
|
GUAC_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")
|
||||||
|
echo "POSTGRES_HOST=guac_postgres" > $GUAC_PROD_FILE
|
||||||
|
echo "POSTGRES_HOSTNAME=guac_postgres" > $GUAC_PROD_FILE
|
||||||
|
echo "POSTGRES_PORT=5432" >> $GUAC_PROD_FILE
|
||||||
|
echo "POSTGRES_DB=guacamole_db" >> $GUAC_PROD_FILE
|
||||||
|
echo "POSTGRES_DATABASE=guacamole_db" >> $GUAC_PROD_FILE
|
||||||
|
echo "POSTGRES_USER=guac_user" >> $GUAC_PROD_FILE
|
||||||
|
echo "POSTGRES_PASSWORD=$GUAC_PASSWORD" >> $GUAC_PROD_FILE
|
||||||
|
echo "MISTBORN_DEFAULT_PASSWORD=$MISTBORN_DEFAULT_PASSWORD" >> $GUAC_PROD_FILE
|
||||||
Executable
+12
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# JITSI
|
||||||
|
JITSI_PROD_FILE="$1"
|
||||||
|
cp ${MISTBORN_HOME}/scripts/conf/jitsi.env $JITSI_PROD_FILE
|
||||||
|
mkdir -p ${MISTBORN_HOME}/.envs/.production/.jitsi-cfg/{web/letsencrypt,transcripts,prosody,jicofo,jvb}
|
||||||
|
sed -i "s/JICOFO_COMPONENT_SECRET.*/JICOFO_COMPONENT_SECRET=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
||||||
|
sed -i "s/JICOFO_AUTH_PASSWORD.*/JICOFO_AUTH_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
||||||
|
sed -i "s/JVB_AUTH_PASSWORD.*/JVB_AUTH_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
||||||
|
sed -i "s/JIGASI_XMPP_PASSWORD.*/JIGASI_XMPP_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
||||||
|
sed -i "s/JIBRI_RECORDER_PASSWORD.*/JIBRI_RECORDER_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
||||||
|
sed -i "s/JIBRI_XMPP_PASSWORD.*/JIBRI_XMPP_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# generate nextcloud .env files
|
||||||
|
NEXTCLOUD_PROD_FILE="$1"
|
||||||
|
#NEXTCLOUD_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")
|
||||||
|
NEXTCLOUD_PASSWORD="${MISTBORN_DEFAULT_PASSWORD}"
|
||||||
|
echo "NEXTCLOUD_ADMIN_USER=mistborn" > $NEXTCLOUD_PROD_FILE
|
||||||
|
echo "NEXTCLOUD_ADMIN_PASSWORD=$NEXTCLOUD_PASSWORD" >> $NEXTCLOUD_PROD_FILE
|
||||||
|
echo "NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.mistborn" >> $NEXTCLOUD_PROD_FILE
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# generate onlyoffice .env files
|
||||||
|
ONLYOFFICE_PROD_FILE="$1"
|
||||||
|
JWT_SECRET="${MISTBORN_DEFAULT_PASSWORD}"
|
||||||
|
echo "JWT_ENABLED=true" > $ONLYOFFICE_PROD_FILE
|
||||||
|
echo "JWT_SECRET=$JWT_SECRET" >> $ONLYOFFICE_PROD_FILE
|
||||||
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# generate rocketchat .env files
|
||||||
|
ROCKETCHAT_PROD_FILE="$1"
|
||||||
|
#ROCKETCHAT_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")
|
||||||
|
ROCKETCHAT_PASSWORD="${MISTBORN_DEFAULT_PASSWORD}"
|
||||||
|
echo "ROCKETCHAT_USER=bot" > $ROCKETCHAT_PROD_FILE
|
||||||
|
echo "ROCKETCHAT_ROOM=GENERAL" >> $ROCKETCHAT_PROD_FILE
|
||||||
|
echo "BOT_NAME=bot" >> $ROCKETCHAT_PROD_FILE
|
||||||
|
echo "ROCKETCHAT_PASSWORD=$ROCKETCHAT_PASSWORD" >> $ROCKETCHAT_PROD_FILE
|
||||||
|
|
||||||
|
# docker environment
|
||||||
|
echo "MISTBORN_BIND_IP=${MISTBORN_BIND_IP}" >> $ROCKETCHAT_PROD_FILE
|
||||||
@@ -4,6 +4,7 @@ figlet "Mistborn: Container Credentials"
|
|||||||
|
|
||||||
# generate production .env file for Django
|
# generate production .env file for Django
|
||||||
mkdir -p ./.envs/.production
|
mkdir -p ./.envs/.production
|
||||||
|
chmod 700 ./.envs
|
||||||
DJANGO_PROD_FILE="./.envs/.production/.django"
|
DJANGO_PROD_FILE="./.envs/.production/.django"
|
||||||
DJANGO_SECRET_KEY=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(50)]))")
|
DJANGO_SECRET_KEY=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(50)]))")
|
||||||
#CELERY_FLOWER_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")
|
#CELERY_FLOWER_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")
|
||||||
@@ -22,6 +23,7 @@ echo "#SENTRY_DNS=" >> $DJANGO_PROD_FILE
|
|||||||
echo "MISTBORN_INSTALL_COCKPIT=$MISTBORN_INSTALL_COCKPIT" >> $DJANGO_PROD_FILE
|
echo "MISTBORN_INSTALL_COCKPIT=$MISTBORN_INSTALL_COCKPIT" >> $DJANGO_PROD_FILE
|
||||||
echo "MISTBORN_PORTAL_IP=10.2.3.1" >> $DJANGO_PROD_FILE
|
echo "MISTBORN_PORTAL_IP=10.2.3.1" >> $DJANGO_PROD_FILE
|
||||||
echo "MISTBORN_PORTAL_PORT=5000" >> $DJANGO_PROD_FILE
|
echo "MISTBORN_PORTAL_PORT=5000" >> $DJANGO_PROD_FILE
|
||||||
|
chmod 600 $DJANGO_PROD_FILE
|
||||||
|
|
||||||
# generate production .env file for postgresql
|
# generate production .env file for postgresql
|
||||||
POSTGRES_PROD_FILE="./.envs/.production/.postgres"
|
POSTGRES_PROD_FILE="./.envs/.production/.postgres"
|
||||||
@@ -31,6 +33,7 @@ echo "POSTGRES_PORT=5432" >> $POSTGRES_PROD_FILE
|
|||||||
echo "POSTGRES_DB=mistborn" >> $POSTGRES_PROD_FILE
|
echo "POSTGRES_DB=mistborn" >> $POSTGRES_PROD_FILE
|
||||||
echo "POSTGRES_USER=prod" >> $POSTGRES_PROD_FILE
|
echo "POSTGRES_USER=prod" >> $POSTGRES_PROD_FILE
|
||||||
echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" >> $POSTGRES_PROD_FILE
|
echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" >> $POSTGRES_PROD_FILE
|
||||||
|
chmod 600 $POSTGRES_PROD_FILE
|
||||||
|
|
||||||
|
|
||||||
# generate production .env file for pihole
|
# generate production .env file for pihole
|
||||||
@@ -39,42 +42,4 @@ PIHOLE_PROD_FILE="./.envs/.production/.pihole"
|
|||||||
WEBPASSWORD="$1"
|
WEBPASSWORD="$1"
|
||||||
echo "TZ=\"America/New York\"" > $PIHOLE_PROD_FILE
|
echo "TZ=\"America/New York\"" > $PIHOLE_PROD_FILE
|
||||||
echo "WEBPASSWORD=$WEBPASSWORD" >> $PIHOLE_PROD_FILE
|
echo "WEBPASSWORD=$WEBPASSWORD" >> $PIHOLE_PROD_FILE
|
||||||
|
chmod 600 $PIHOLE_PROD_FILE
|
||||||
# generate rocketchat .env files
|
|
||||||
ROCKETCHAT_PROD_FILE="./.envs/.production/.rocketchat"
|
|
||||||
#ROCKETCHAT_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")
|
|
||||||
ROCKETCHAT_PASSWORD="$1"
|
|
||||||
echo "ROCKETCHAT_USER=bot" > $ROCKETCHAT_PROD_FILE
|
|
||||||
echo "ROCKETCHAT_ROOM=GENERAL" >> $ROCKETCHAT_PROD_FILE
|
|
||||||
echo "BOT_NAME=bot" >> $ROCKETCHAT_PROD_FILE
|
|
||||||
echo "ROCKETCHAT_PASSWORD=$ROCKETCHAT_PASSWORD" >> $ROCKETCHAT_PROD_FILE
|
|
||||||
|
|
||||||
# generate nextcloud .env files
|
|
||||||
NEXTCLOUD_PROD_FILE="./.envs/.production/.nextcloud"
|
|
||||||
#NEXTCLOUD_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")
|
|
||||||
NEXTCLOUD_PASSWORD="$1"
|
|
||||||
echo "NEXTCLOUD_ADMIN_USER=mistborn" > $NEXTCLOUD_PROD_FILE
|
|
||||||
echo "NEXTCLOUD_ADMIN_PASSWORD=$NEXTCLOUD_PASSWORD" >> $NEXTCLOUD_PROD_FILE
|
|
||||||
echo "NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.mistborn" >> $NEXTCLOUD_PROD_FILE
|
|
||||||
|
|
||||||
# generate onlyoffice .env files
|
|
||||||
ONLYOFFICE_PROD_FILE="./.envs/.production/.onlyoffice"
|
|
||||||
JWT_SECRET="$1"
|
|
||||||
echo "JWT_ENABLED=true" > $ONLYOFFICE_PROD_FILE
|
|
||||||
echo "JWT_SECRET=$JWT_SECRET" >> $ONLYOFFICE_PROD_FILE
|
|
||||||
|
|
||||||
# generate bitwarden .env files
|
|
||||||
BITWARDEN_PROD_FILE="./.envs/.production/.bitwarden"
|
|
||||||
echo "WEBSOCKET_ENABLED=true" > $BITWARDEN_PROD_FILE
|
|
||||||
echo "SIGNUPS_ALLOWED=true" >> $BITWARDEN_PROD_FILE
|
|
||||||
|
|
||||||
# JITSI
|
|
||||||
JITSI_PROD_FILE="./.envs/.production/.jitsi"
|
|
||||||
cp ./scripts/conf/jitsi.env $JITSI_PROD_FILE
|
|
||||||
mkdir -p ./.envs/.production/.jitsi-cfg/{web/letsencrypt,transcripts,prosody,jicofo,jvb}
|
|
||||||
sed -i "s/JICOFO_COMPONENT_SECRET.*/JICOFO_COMPONENT_SECRET=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
|
||||||
sed -i "s/JICOFO_AUTH_PASSWORD.*/JICOFO_AUTH_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
|
||||||
sed -i "s/JVB_AUTH_PASSWORD.*/JVB_AUTH_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
|
||||||
sed -i "s/JIGASI_XMPP_PASSWORD.*/JIGASI_XMPP_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
|
||||||
sed -i "s/JIBRI_RECORDER_PASSWORD.*/JIBRI_RECORDER_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
|
||||||
sed -i "s/JIBRI_XMPP_PASSWORD.*/JIBRI_XMPP_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE"
|
|
||||||
|
|||||||
Executable
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# INPUT default admin password
|
||||||
|
while [ -z "${MISTBORN_DEFAULT_PASSWORD}" ] || [ ${MISTBORN_DEFAULT_PASSWORD} =~ ^[A-Za-z0-9_]+$ ]; do
|
||||||
|
echo
|
||||||
|
echo "(Mistborn) The default admin password may only container alphanumeric characters and _"
|
||||||
|
read -p "(Mistborn) Set default admin password: " -s MISTBORN_DEFAULT_PASSWORD
|
||||||
|
echo
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "MISTBORN_DEFAULT_PASSWORD is set"
|
||||||
|
echo
|
||||||
Executable
+50
@@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SERVICE="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
export MISTBORN_HOME="/opt/mistborn"
|
||||||
|
export MISTBORN_SERVICE_FILE=${MISTBORN_HOME}/.envs/.production/.${SERVICE}
|
||||||
|
export MISTBORN_SERVICE_INIT=${MISTBORN_HOME}/scripts/services/${SERVICE}/init.sh
|
||||||
|
|
||||||
|
# check and create file if needed
|
||||||
|
${MISTBORN_HOME}/scripts/env/check_env_file.sh ${SERVICE}
|
||||||
|
|
||||||
|
# read in variables
|
||||||
|
set -a
|
||||||
|
source ${MISTBORN_HOME}/.env
|
||||||
|
|
||||||
|
if [[ -f "${MISTBORN_SERVICE_FILE}" ]]; then
|
||||||
|
echo "Loading service variables"
|
||||||
|
source ${MISTBORN_SERVICE_FILE}
|
||||||
|
else
|
||||||
|
echo "No service variables to load. Proceeding."
|
||||||
|
fi
|
||||||
|
set +a
|
||||||
|
|
||||||
|
# call traefik-extra
|
||||||
|
if [[ ! -z "${MISTBORN_SERVICE_NAME}" ]] && \
|
||||||
|
[[ ! -z "${MISTBORN_SERVICE_DOMAIN}" ]] && \
|
||||||
|
[[ ! -z "${MISTBORN_SERVICE_PORT}" ]]; then
|
||||||
|
|
||||||
|
echo "Populating traefik routes"
|
||||||
|
|
||||||
|
mistborn-cli traefik-extra \
|
||||||
|
--domain-name ${MISTBORN_SERVICE_DOMAIN} \
|
||||||
|
--service-name ${MISTBORN_SERVICE_NAME} \
|
||||||
|
--web-port ${MISTBORN_SERVICE_PORT}
|
||||||
|
else
|
||||||
|
echo "Not populating traefik routes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# init script
|
||||||
|
if [[ -f "${MISTBORN_SERVICE_INIT}" ]]; then
|
||||||
|
echo "Running init script"
|
||||||
|
${MISTBORN_SERVICE_INIT}
|
||||||
|
else
|
||||||
|
echo "No init script. Proceeding."
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
Reference in New Issue
Block a user