diff --git a/Config/MailServer/docker-compose.yml b/Config/MailServer/docker-compose.yml deleted file mode 100644 index 0be82a6..0000000 --- a/Config/MailServer/docker-compose.yml +++ /dev/null @@ -1,37 +0,0 @@ -# MailServer configuration. -# This is a revised version of the original work here: -# https://github.com/docker-mailserver/docker-mailserver - -services: - mailserver: - image: docker.io/mailserver/docker-mailserver:latest - container_name: mailserver - # If the FQDN for your mail-server is only two labels (eg: example.com), - # you can assign this entirely to `hostname` and remove `domainname`. - hostname: mail - domainname: hyperling.com - env_file: mailserver.env - # More information about the mail-server ports: - # https://docker-mailserver.github.io/docker-mailserver/edge/config/security/understanding-the-ports/ - # To avoid conflicts with yaml base-60 float, DO NOT remove the quotation marks. - ports: - - "25:25" # SMTP (explicit TLS => STARTTLS) - - "143:143" # IMAP4 (explicit TLS => STARTTLS) - - "465:465" # ESMTP (implicit TLS) - - "587:587" # ESMTP (explicit TLS => STARTTLS) - - "993:993" # IMAP4 (implicit TLS) - volumes: - - /opt/Docker/Volumes/MailServer/data:/var/mail/ - - /opt/Docker/Volumes/MailServer/state:/var/mail-state/ - - /opt/Docker/Volumes/MailServer/logs:/var/log/mail/ - - /opt/Docker/Volumes/MailServer/config:/tmp/docker-mailserver/ - - /etc/localtime:/etc/localtime:ro - restart: always - stop_grace_period: 1m - cap_add: - - NET_ADMIN - healthcheck: - test: "ss --listening --tcp | grep -P 'LISTEN.+:smtp' || exit 1" - timeout: 3s - retries: 0 - diff --git a/Config/ReverseProxy/Dockerfile.disabled b/Config/ReverseProxy/Dockerfile.disabled new file mode 100644 index 0000000..83e0ad4 --- /dev/null +++ b/Config/ReverseProxy/Dockerfile.disabled @@ -0,0 +1,11 @@ +# 2022-10-05 Hyperling +# Move config to nginx container. +# This is because nginx image does not play well with Volumes. +# Nextcloud and MariaDB created files in their folders fine, but nginx stays empty. + +FROM nginx + +COPY ./config/nginx.conf /etc/nginx/nginx.conf + +COPY ./config/conf.d/* /etc/nginx/conf.d/ + diff --git a/Config/ReverseProxy/config/conf.d/test.conf b/Config/ReverseProxy/config/conf.d/test.conf new file mode 100644 index 0000000..4b8c2a9 --- /dev/null +++ b/Config/ReverseProxy/config/conf.d/test.conf @@ -0,0 +1,2 @@ +# 2022-10-05 Hyperling +# Just a dummy test file. diff --git a/Config/ReverseProxy/config/nginx.conf b/Config/ReverseProxy/config/nginx.conf new file mode 100644 index 0000000..c8c359b --- /dev/null +++ b/Config/ReverseProxy/config/nginx.conf @@ -0,0 +1,34 @@ +# 2022-10-05 Hyperling + +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +} + diff --git a/bin/install.sh b/bin/install.sh old mode 100755 new mode 100644 index b22ade6..ec33895 --- a/bin/install.sh +++ b/bin/install.sh @@ -4,19 +4,55 @@ # Original comands came from here: https://docs.docker.com/engine/install/debian/ # usage: install.sh -apt purge docker docker-engine docker.io containerd runc +## Variables ## -apt update && -apt install -y ca-certificates curl gnupg lsb-release && -mkdir -p /etc/apt/keyrings && -curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && -echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ - $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && -apt update && -apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin && -exit 0 +os=`grep ^'NAME=' /etc/os-release` +pkgmgr="" + +## Validations ## + +if [[ "$os" == *"Debian"* ]]; then + repo="debian" + pkgmgr="apt" +elif [[ "$os" == *"Ubuntu"* ]]; then + repo="ubuntu" + pkgmgr="apt" +elif [[ $os == "Arch Linux" ]]; then + pkgmgr="pacman" +else + echo "Distribution not yet supported." && + exit 1 +fi +echo "os=$os" +echo "repo=$repo" +echo "pkgmgr=$pkgmgr" + +## Main ## + +if [[ "$pkgmgr" == "apt" ]]; then + apt purge docker docker-engine docker.io containerd runc + + apt update && + apt install -y ca-certificates curl gnupg lsb-release && + mkdir -p /etc/apt/keyrings && + curl -fsSL https://download.docker.com/linux/$repo/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$repo \ + $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && + apt update && + apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin && + + echo "Success!" && + exit 0 +elif [[ $pkgmgr == "pacman" ]]; then + pacman -Rcns --noconfirm *docker* + + pacman -Sy --noconfirm docker docker-compose && + echo "Success!" && + exit 0 +fi + +## Error ## echo "ERROR: Installation failed!" exit 1 - diff --git a/bin/start.sh b/bin/start.sh index 2674428..bc73f0e 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -9,6 +9,7 @@ cd $DOCKER_HOME/Config for dir in `ls`; do [ -d $dir ] && cd $dir || continue pwd + [ -e Dockerfile ] && docker compose build [ -e docker-compose.yml ] && docker compose up -d cd .. done