From 67d2ebbc59a580ab7b36cd2e3966938bad66e82a Mon Sep 17 00:00:00 2001 From: Yax <1949284+kianby@users.noreply.github.com> Date: Wed, 7 Dec 2022 18:57:27 +0100 Subject: [PATCH] setup my server --- baikal/docker-compose.baikal.yml | 28 --------- deluge/docker-compose.deluge.yml | 55 ----------------- dokuwiki/docker-compose.dokuwiki.yml | 26 -------- netdata/docker-compose.netdata.yml | 57 ------------------ photo/docker-compose.lychee.yml | 35 ----------- photo/docker-compose.photonix.yml | 71 ---------------------- photo/docker-compose.photoview.yml | 77 ------------------------ photo/docker-compose.pigallery.yml | 45 -------------- posteio/docker-compose.posteio.yml | 32 ---------- seafile/docker-compose.seafile.yml | 68 --------------------- seafile/start.py | 88 ---------------------------- www/docker-compose.dashy.yml | 40 ------------- 12 files changed, 622 deletions(-) delete mode 100755 baikal/docker-compose.baikal.yml delete mode 100755 deluge/docker-compose.deluge.yml delete mode 100755 dokuwiki/docker-compose.dokuwiki.yml delete mode 100755 netdata/docker-compose.netdata.yml delete mode 100755 photo/docker-compose.lychee.yml delete mode 100755 photo/docker-compose.photonix.yml delete mode 100755 photo/docker-compose.photoview.yml delete mode 100755 photo/docker-compose.pigallery.yml delete mode 100755 posteio/docker-compose.posteio.yml delete mode 100755 seafile/docker-compose.seafile.yml delete mode 100755 seafile/start.py delete mode 100755 www/docker-compose.dashy.yml diff --git a/baikal/docker-compose.baikal.yml b/baikal/docker-compose.baikal.yml deleted file mode 100755 index d80e228..0000000 --- a/baikal/docker-compose.baikal.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: '3.8' - -services: - baikal: - container_name: baikal - image: ckulka/baikal:nginx - networks: - - baikal-frontend - expose: - - 80 - restart: unless-stopped - volumes: - - baikal_data:/var/www/baikal/Specific:rw - - baikal_config:/var/www/baikal/config:rw - labels: - - traefik.enable=true - - traefik.http.routers.baikal.rule=Host(`${HOST_BAIKAL}.${DOMAIN}`) - - traefik.http.routers.baikal.entrypoints=https - - traefik.http.routers.baikal.tls=true - - traefik.docker.network=baikal-frontend - -networks: - baikal-frontend: - name: baikal-frontend - -volumes: - baikal_config: - baikal_data: diff --git a/deluge/docker-compose.deluge.yml b/deluge/docker-compose.deluge.yml deleted file mode 100755 index 686350e..0000000 --- a/deluge/docker-compose.deluge.yml +++ /dev/null @@ -1,55 +0,0 @@ -version: '3.8' - -services: - deluge: - container_name: deluge - image: linuxserver/deluge - restart: unless-stopped - networks: - - deluge-frontend - environment: - DELUGE_LOGLEVEL: info - TZ: ${TZ} - expose: - - 8112 - ports: - - ${DELUGE_TORRENT_PORT}:${DELUGE_TORRENT_PORT}/tcp - - ${DELUGE_TORRENT_PORT}:${DELUGE_TORRENT_PORT}/udp - volumes: - - deluge_config:/config:rw - - deluge_downloads:/downloads:rw - labels: - - traefik.enable=true - - traefik.http.routers.deluge.rule=Host(`${HOST_WWW}.${DOMAIN}`) && PathPrefix(`${PATH_DELUGE}`) - - traefik.http.routers.deluge.entrypoints=https - - traefik.http.routers.deluge.tls=true - - traefik.http.services.deluge.loadbalancer.server.port=8112 - - traefik.http.routers.deluge.middlewares=delugeHeader,sameOriginHeader,delugeRedir,delugePStrip - - traefik.http.middlewares.delugeHeader.headers.customrequestheaders.X-Deluge-Base=${PATH_DELUGE}/ - - traefik.http.middlewares.sameOriginHeader.headers.customrequestheaders.X-Frame-Options=SAMEORIGIN - - traefik.http.middlewares.delugePStrip.stripprefix.prefixes=${PATH_DELUGE} - - traefik.http.middlewares.delugeRedir.redirectregex.regex=^(.*)${PATH_DELUGE}$$ - - traefik.http.middlewares.delugeRedir.redirectregex.replacement=$${1}${PATH_DELUGE}/ - - traefik.docker.network=deluge-frontend - - torrent: - container_name: torrent - image: kianby/nginx-streaming - restart: unless-stopped - networks: - - dmz - volumes: - - deluge_downloads:/downloads:ro - expose: - - 80 - # shortcut to bypass traefik limitation - ports: - - ${DOWNLOAD_HTTP_PORT}:80 - -networks: - deluge-frontend: - name: deluge-frontend - -volumes: - deluge_config: - deluge_downloads: diff --git a/dokuwiki/docker-compose.dokuwiki.yml b/dokuwiki/docker-compose.dokuwiki.yml deleted file mode 100755 index 20a4deb..0000000 --- a/dokuwiki/docker-compose.dokuwiki.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: '3.8' - -services: - dokuwiki: - image: linuxserver/dokuwiki - container_name: dokuwiki - restart: unless-stopped - expose: - - 80 - environment: - - TZ=${TZ} - - APP_URL=/ #optional - volumes: - - ${ROOT_INSTALL}/data/dokuwiki:/config - networks: - - dokuwiki-frontend - labels: - - traefik.enable=true - - traefik.http.routers.dokuwiki.rule=Host(`${HOST_DOKUWIKI}.${DOMAIN}`) - - traefik.http.routers.dokuwiki.entrypoints=https - - traefik.http.routers.dokuwiki.tls=true - - traefik.docker.network=dokuwiki-frontend - -networks: - dokuwiki-frontend: - name: dokuwiki-frontend \ No newline at end of file diff --git a/netdata/docker-compose.netdata.yml b/netdata/docker-compose.netdata.yml deleted file mode 100755 index 8e7efc6..0000000 --- a/netdata/docker-compose.netdata.yml +++ /dev/null @@ -1,57 +0,0 @@ -version: '3.8' -services: - netdata: - image: netdata/netdata - container_name: netdata - hostname: ${HOST_NETDATA}.${DOMAIN} - expose: - - 19999 - restart: unless-stopped - cap_add: - - SYS_PTRACE - security_opt: - - apparmor:unconfined - environment: - - DOCKER_HOST=docker-proxy:2375 - volumes: - - netdataconfig:/etc/netdata - - netdatalib:/var/lib/netdata - - netdatacache:/var/cache/netdata - - /etc/passwd:/host/etc/passwd:ro - - /etc/group:/host/etc/group:ro - - /proc:/host/proc:ro - - /sys:/host/sys:ro - - /etc/os-release:/host/etc/os-release:ro - networks: - - netdata-frontend - - netdata-backend - labels: - - traefik.enable=true - - traefik.http.routers.netdata.rule=Host(`${HOST_NETDATA}.${DOMAIN}`) - - traefik.http.routers.netdata.entrypoints=https - - traefik.http.routers.netdata.tls=true - - traefik.http.routers.netdata.middlewares=auth - - traefik.http.middlewares.auth.basicauth.users=${BASIC_AUTH} - - traefik.docker.network=netdata-frontend - healthcheck: - disable: true - docker-proxy: - image: tecnativa/docker-socket-proxy - container_name: docker-proxy - volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro - environment: - - CONTAINERS=1 - networks: - - netdata-backend - -networks: - netdata-frontend: - name: netdata-frontend - netdata-backend: - name: netdata-backend - -volumes: - netdataconfig: - netdatalib: - netdatacache: \ No newline at end of file diff --git a/photo/docker-compose.lychee.yml b/photo/docker-compose.lychee.yml deleted file mode 100755 index b7939d2..0000000 --- a/photo/docker-compose.lychee.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: '3.8' - -services: - lychee: - container_name: lychee - environment: - - PHP_TZ=${TZ} - - TIMEZONE=${TZ} - image: lycheeorg/lychee - networks: - - photo-frontend - expose: - - 80 - restart: unless-stopped - volumes: - - lychee_conf:/conf - - lychee_uploads:/uploads - - lychee_sym:/sym - labels: - - traefik.enable=true - - traefik.http.routers.photo.rule=Host(`${HOST_LYCHEE}.${DOMAIN}`) - - traefik.http.routers.photo.entrypoints=https - - traefik.http.routers.photo.tls=true - - traefik.docker.network=photo-frontend - -networks: - photo-frontend: - name: photo-frontend - photo-backend: - name: photo-backend - -volumes: - lychee_conf: - lychee_uploads: - lychee_sym: diff --git a/photo/docker-compose.photonix.yml b/photo/docker-compose.photonix.yml deleted file mode 100755 index 31e01ea..0000000 --- a/photo/docker-compose.photonix.yml +++ /dev/null @@ -1,71 +0,0 @@ -version: '3.8' - -services: - postgres: - container_name: photonix-postgres - image: postgres:11.1-alpine - environment: - POSTGRES_DB: photonix - POSTGRES_PASSWORD: password - volumes: - - photonix_db:/var/lib/postgresql/data - networks: - - photo-backend - - redis: - container_name: photonix-redis - image: redis:6.2.2 - networks: - - photo-backend - - photonix: - container_name: photonix - image: photonixapp/photonix:latest - expose: - - 80 - environment: - ENV: prd - POSTGRES_HOST: postgres - POSTGRES_DB: photonix - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password - REDIS_HOST: redis - ALLOWED_HOSTS: '*' - # More configuration options here: https://photonix.org/docs/configuration/ - volumes: -# - ./data/photos:/data/photos - - photonix_raw_photos:/data/raw-photos-processed - - photonix_cache:/data/cache - - photonix_models:/data/models - - type: bind - source: ${ROOT_INSTALL}/data/seafile-fuse - target: /seahub - bind: - propagation: rslave - privileged: true - cap_add: - - SYS_ADMIN - depends_on: - - postgres - - redis - networks: - - photo-backend - - photo-frontend - labels: - - traefik.enable=true - - traefik.http.routers.photo.rule=Host(`${HOST_PHOTONIX}.${DOMAIN}`) - - traefik.http.routers.photo.entrypoints=https - - traefik.http.routers.photo.tls=true - - traefik.docker.network=photo-frontend - -networks: - photo-frontend: - name: photo-frontend - photo-backend: - name: photo-backend - -volumes: - photonix_raw_photos: - photonix_cache: - photonix_models: - photonix_db: \ No newline at end of file diff --git a/photo/docker-compose.photoview.yml b/photo/docker-compose.photoview.yml deleted file mode 100755 index 23011d6..0000000 --- a/photo/docker-compose.photoview.yml +++ /dev/null @@ -1,77 +0,0 @@ -version: '3.8' - -services: - photoview-db: - container_name: photoview-db - image: mariadb:10.5 - restart: unless-stopped - environment: - - MYSQL_DATABASE=photoview - - MYSQL_USER=photoview - - MYSQL_PASSWORD=photosecret - - MYSQL_RANDOM_ROOT_PASSWORD=1 - volumes: - - photoview_db_data:/var/lib/mysql - networks: - - photo-backend - - photoview: - container_name: photoview - image: viktorstrate/photoview:2 - restart: unless-stopped - expose: - - 80 - depends_on: - - photoview-db - networks: - - photo-backend - - photo-frontend - environment: - - PHOTOVIEW_DATABASE_DRIVER=mysql - - PHOTOVIEW_MYSQL_URL=photoview:photosecret@tcp(photoview-db)/photoview - - PHOTOVIEW_LISTEN_IP=photoview - - PHOTOVIEW_LISTEN_PORT=80 - - PHOTOVIEW_MEDIA_CACHE=/app/cache - - # Optional: If you are using Samba/CIFS-Share and experience problems with "directory not found" - # Enable the following Godebug - # - GODEBUG=asyncpreemptoff=1 - - - # Optional: To enable map related features, you need to create a mapbox token. - # A token can be generated for free here https://account.mapbox.com/access-tokens/ - # It's a good idea to limit the scope of the token to your own domain, to prevent others from using it. - - MAPBOX_TOKEN=${MAPBOX_TOKEN} - - volumes: - - photoview_api_cache:/app/cache - - # Change This: to the directory where your photos are located on your server. - # If the photos are located at `/home/user/photos`, then change this value - # to the following: `/home/user/photos:/photos:ro`. - # You can mount multiple paths, if your photos are spread across multiple directories. - #- ./photos_path:/photos:ro - - type: bind - source: ${ROOT_INSTALL}/data/seafile-fuse - target: /photos - bind: - propagation: rslave - privileged: true - cap_add: - - SYS_ADMIN - labels: - - traefik.enable=true - - traefik.http.routers.photo.rule=Host(`${HOST_PHOTOVIEW}.${DOMAIN}`) - - traefik.http.routers.photo.entrypoints=https - - traefik.http.routers.photo.tls=true - - traefik.docker.network=photo-frontend - -networks: - photo-frontend: - name: photo-frontend - photo-backend: - name: photo-backend - -volumes: - photoview_db_data: - photoview_api_cache: \ No newline at end of file diff --git a/photo/docker-compose.pigallery.yml b/photo/docker-compose.pigallery.yml deleted file mode 100755 index d459d66..0000000 --- a/photo/docker-compose.pigallery.yml +++ /dev/null @@ -1,45 +0,0 @@ -version: '3.8' - -services: - pigallery2: - container_name: pigallery2 - environment: - NODE_ENV: production - image: bpatrik/pigallery2:1.9.0-alpine - networks: - - photo-frontend - expose: - - 80 - restart: unless-stopped - volumes: - #/app/data/images - - pigallery_config:/app/data/config:rw - - pigallerydb_data:/app/data/db:rw - - pigallery_tmp:/app/data/tmp:rw - - type: bind - source: ${ROOT_INSTALL}/data/seafile-fuse - target: /seahub - bind: - propagation: rslave - privileged: true - cap_add: - - SYS_ADMIN - healthcheck: - disable: true - labels: - - traefik.enable=true - - traefik.http.routers.photo.rule=Host(`${HOST_PIGALLERY}.${DOMAIN}`) - - traefik.http.routers.photo.entrypoints=https - - traefik.http.routers.photo.tls=true - - traefik.docker.network=photo-frontend - -networks: - photo-frontend: - name: photo-frontend - photo-backend: - name: photo-backend - -volumes: - pigallerydb_data: - pigallery_tmp: - pigallery_config: diff --git a/posteio/docker-compose.posteio.yml b/posteio/docker-compose.posteio.yml deleted file mode 100755 index e95aca6..0000000 --- a/posteio/docker-compose.posteio.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '3.8' - -services: - poste-io: - container_name: poste-io - image: analogic/poste.io - volumes: - - ${ROOT_INSTALL}/data/poste.io:/data - environment: - - TZ=${TZ} - - HTTPS=OFF - restart: unless-stopped - ports: - - "465:465" - - "993:993" - - "25:25" - expose: - - 80 - labels: - - traefik.enable=true - - traefik.http.routers.posteio.rule=Host(`${HOST_MAIL}.${DOMAIN}`) - - traefik.http.routers.posteio.entrypoints=https - - traefik.http.routers.posteio.tls=true - - traefik.docker.network=posteio-frontend - networks: - - posteio-frontend - healthcheck: - disable: true - -networks: - posteio-frontend: - name: portainer-frontend \ No newline at end of file diff --git a/seafile/docker-compose.seafile.yml b/seafile/docker-compose.seafile.yml deleted file mode 100755 index 96c7b60..0000000 --- a/seafile/docker-compose.seafile.yml +++ /dev/null @@ -1,68 +0,0 @@ -version: '3.8' - -services: - seafile-db: - container_name: seafile-db - environment: - MYSQL_LOG_CONSOLE: "true" - MYSQL_ROOT_PASSWORD: ${SEAFILE_DB_ROOT_PASSWORD} - image: mariadb:10.1 - networks: - - seafile-backend - volumes: - - seafile_db:/var/lib/mysql:rw - restart: unless-stopped - seafile-memcached: - container_name: seafile-memcached - entrypoint: memcached -m 256 - image: memcached:1.5.6 - networks: - - seafile-backend - restart: unless-stopped - seafile: - container_name: seafile - depends_on: - - seafile-db - - seafile-memcached - environment: - DB_HOST: seafile-db - DB_ROOT_PASSWD: ${SEAFILE_DB_ROOT_PASSWORD} - SEAFILE_ADMIN_EMAIL: ${SEAFILE_ADMIN_EMAIL} - SEAFILE_ADMIN_PASSWORD: ${SEAFILE_ADMIN_PASSWORD} - SEAFILE_SERVER_HOSTNAME: ${HOST_SEAFILE}.${DOMAIN} - SEAFILE_SERVER_LETSENCRYPT: "false" - TIME_ZONE: ${TZ} - image: seafileltd/seafile-mc:latest - networks: - - seafile-backend - - seafile-frontend - restart: unless-stopped - expose: - - 80 - volumes: - - ${ROOT_INSTALL}/selfhosting/seafile/start.py:/scripts/start.py - - seafile_data:/shared:rw - - type: bind - source: ${ROOT_INSTALL}/data/seafile-fuse - target: /seafile-fuse - bind: - propagation: rshared - privileged: true - cap_add: - - SYS_ADMIN - labels: - - traefik.enable=true - - traefik.http.routers.seafile.rule=Host(`${HOST_SEAFILE}.${DOMAIN}`) - - traefik.http.routers.seafile.entrypoints=https - - traefik.http.routers.seafile.tls=true - - traefik.docker.network=seafile-frontend - -networks: - seafile-frontend: - name: seafile-frontend - seafile-backend: - name: seafile-backend - -volumes: - seafile_db: - seafile_data: diff --git a/seafile/start.py b/seafile/start.py deleted file mode 100755 index d3ce47c..0000000 --- a/seafile/start.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python3 -#coding: UTF-8 - -""" -Starts the seafile/seahub server and watches the controller process. It is -the entrypoint command of the docker container. -""" - -import json -import os -from os.path import abspath, basename, exists, dirname, join, isdir -import shutil -import sys -import time - -from utils import ( - call, get_conf, get_install_dir, get_script, get_command_output, - render_template, wait_for_mysql, setup_logging -) -from upgrade import check_upgrade -from bootstrap import init_seafile_server, is_https, init_letsencrypt, generate_local_nginx_conf - - -shared_seafiledir = '/shared/seafile' -ssl_dir = '/shared/ssl' -generated_dir = '/bootstrap/generated' -installdir = get_install_dir() -topdir = dirname(installdir) - -def watch_controller(): - maxretry = 4 - retry = 0 - while retry < maxretry: - controller_pid = get_command_output('ps aux | grep seafile-controller | grep -v grep || true').strip() - garbage_collector_pid = get_command_output('ps aux | grep /scripts/gc.sh | grep -v grep || true').strip() - if not controller_pid and not garbage_collector_pid: - retry += 1 - else: - retry = 0 - time.sleep(5) - print('seafile controller exited unexpectedly.') - sys.exit(1) - -def main(): - if not exists(shared_seafiledir): - os.mkdir(shared_seafiledir) - if not exists(generated_dir): - os.makedirs(generated_dir) - - if is_https(): - init_letsencrypt() - generate_local_nginx_conf() - call('nginx -s reload') - - wait_for_mysql() - init_seafile_server() - - check_upgrade() - os.chdir(installdir) - - admin_pw = { - 'email': get_conf('SEAFILE_ADMIN_EMAIL', 'me@example.com'), - 'password': get_conf('SEAFILE_ADMIN_PASSWORD', 'asecret'), - } - password_file = join(topdir, 'conf', 'admin.txt') - with open(password_file, 'w') as fp: - json.dump(admin_pw, fp) - - - try: - call('{} start'.format(get_script('seafile.sh'))) - call('{} start'.format(get_script('seahub.sh'))) - call('{} start /seafile-fuse'.format(get_script('seaf-fuse.sh'))) - finally: - if exists(password_file): - os.unlink(password_file) - - print('seafile server is running now.') - try: - watch_controller() - except KeyboardInterrupt: - print('Stopping seafile server.') - sys.exit(0) - -if __name__ == '__main__': - setup_logging() - main() - diff --git a/www/docker-compose.dashy.yml b/www/docker-compose.dashy.yml deleted file mode 100755 index 2bcefc7..0000000 --- a/www/docker-compose.dashy.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: '3.8' - -services: - dashy: - # To build from source, replace 'image: lissy93/dashy' with 'build: .' - # build: . - image: lissy93/dashy - container_name: dashy - # Pass in your config file below, by specifying the path on your host machine - volumes: - - ${ROOT_INSTALL}/data/dashy/config.yml:/app/public/conf.yml - # Set any environmental variables - environment: - - NODE_ENV=production - # Specify your user ID and group ID. You can find this by running `id -u` and `id -g` - # - UID=1000 - # - GID=1000 - # Specify restart policy - restart: unless-stopped - # Configure healthchecks - #healthcheck: - # test: ['CMD', 'node', '/app/services/healthcheck'] - # interval: 1m30s - # timeout: 10s - # retries: 3 - # start_period: 40s - networks: - - wwww-frontend - expose: - - 80 - labels: - - traefik.enable=true - - traefik.http.routers.dashy.rule=Host(`${FQDN_DASHBOARD}`) - - traefik.http.routers.dashy.entrypoints=https - - traefik.http.routers.dashy.tls=true - - traefik.docker.network=wwww-frontend - -networks: - wwww-frontend: - name: wwww-frontend