Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c65fdd34 authored by Florent VINCENT's avatar Florent VINCENT 👾
Browse files

force local network separation staging / prod (and some cleanup)

parent 6caa4176
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -13,3 +13,4 @@ WIREGUARD_IP=127.0.0.1
REPO_BASE=/mnt/repo-base/staging-spot
FILTRON_PORT=8088
MORTY_PORT=8089
INTERNAL_NETWORK_NAME=staging-spot-default
 No newline at end of file
+6 −2
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ deploy:spot.eeo.one.backend1:
    SPOT_NGINX_DOCKER_TAG: ${CI_COMMIT_REF_SLUG}
    WIREGUARD_IP: ${BACKEND1_WG_IP}
    REPO_BASE: /mnt/repo-base/staging-spot
    INTERNAL_NETWORK_NAME: staging-spot-default
    FILTRON_PORT: 8088
    MORTY_PORT: 8089
  script:
@@ -123,6 +124,7 @@ deploy:spot.eeo.one.backend2:
    SPOT_NGINX_DOCKER_TAG: ${CI_COMMIT_REF_SLUG}
    WIREGUARD_IP: ${BACKEND2_WG_IP}
    REPO_BASE: /mnt/repo-base/staging-spot
    INTERNAL_NETWORK_NAME: staging-spot-default
    FILTRON_PORT: 8088
    MORTY_PORT: 8089
  script:
@@ -150,12 +152,13 @@ deploy:spot.ecloud.global.backend1:
    SPOT_NGINX_DOCKER_TAG: ${CI_COMMIT_REF_SLUG}
    WIREGUARD_IP: ${BACKEND1_WG_IP}
    REPO_BASE: /mnt/repo-base/production-spot
    INTERNAL_NETWORK_NAME: spot-default
    FILTRON_PORT: 8098
    MORTY_PORT: 8099
  script:
    - echo "Deploying to $CI_ENVIRONMENT_NAME ($SSH_USER@$BACKEND1_HOST - $BACKEND1_WG_IP - $WIREGUARD_IP)" 
    - docker-compose pull
    - docker-compose up -d --scale tor-socks-proxy=5
    - docker-compose up -d
    - docker-compose restart filtron

deploy:spot.ecloud.global.backend2:
@@ -177,11 +180,12 @@ deploy:spot.ecloud.global.backend2:
    SPOT_NGINX_DOCKER_TAG: ${CI_COMMIT_REF_SLUG}
    WIREGUARD_IP: ${BACKEND2_WG_IP}
    REPO_BASE: /mnt/repo-base/production-spot
    INTERNAL_NETWORK_NAME: spot-default
    FILTRON_PORT: 8098
    MORTY_PORT: 8099
  script:
    - echo "Deploying to $CI_ENVIRONMENT_NAME ($SSH_USER@$BACKEND2_HOST - $BACKEND2_WG_IP - $WIREGUARD_IP)" 
    - docker-compose pull
    - docker-compose up -d --scale tor-socks-proxy=5
    - docker-compose up -d
    - docker-compose restart filtron
+7 −20
Original line number Diff line number Diff line
@@ -14,19 +14,18 @@ services:
    logging: *default-logging
    restart: unless-stopped
    networks:
      - staging-spot-default
      - ${INTERNAL_NETWORK_NAME}
    command: redis-server --maxmemory 8G --maxmemory-policy allkeys-lru

  spot:
    image: registry.gitlab.e.foundation:5000/e/cloud/my-spot:${SPOT_DOCKER_TAG}
    # container_name: spot
    build:
      context: .
      dockerfile: Dockerfile
    logging: *default-logging
    restart: unless-stopped
    networks:
      - staging-spot-default
      - ${INTERNAL_NETWORK_NAME}
    environment:
      SEARX_SECRET: "${SEARX_SECRET}"
      SEARX_MORTY_URL: "${SEARX_MORTY_URL}"
@@ -47,34 +46,29 @@ services:
    logging: *default-logging
    restart: unless-stopped
    networks:
      - staging-spot-default
      - ${INTERNAL_NETWORK_NAME}
    environment:
      SEARX_MORTY_URL: "${SEARX_MORTY_URL}"

  filtron:
    image: dalf/filtron:latest
    # container_name: spot-filtron
    logging: *default-logging
    restart: unless-stopped
    command: -listen :3000 -rules /etc/filtron/rules.json -target spot-nginx
    networks:
      - staging-spot-default
      - ${INTERNAL_NETWORK_NAME}
      - spot-wireguarded
    ports:
      - ${WIREGUARD_IP}:${FILTRON_PORT}:3000
    volumes:
      - ${REPO_BASE}/etc/filtron/rules.json:/etc/filtron/rules.json
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.filtron.rule=Host(`${SPOT_HOSTNAME}`)"

  morty:
    image: dalf/morty:latest
    # container_name: spot-morty
    logging: *default-logging
    restart: unless-stopped
    networks:
      - staging-spot-default
      - ${INTERNAL_NETWORK_NAME}
      - spot-wireguarded
    ports:
      - ${WIREGUARD_IP}:${MORTY_PORT}:3000
@@ -82,19 +76,12 @@ services:
      DEBUG: "false"
      MORTY_ADDRESS: ":3000"
      MORTY_KEY: "${SEARX_MORTY_KEY}"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.morty.rule=Host(`${SPOT_MORTY_HOSTNAME}`)"

  tor-socks-proxy:
    image: peterdavehello/tor-socks-proxy:latest
    logging: *default-logging
    restart: unless-stopped
    networks:
      - staging-spot-default 

networks:
  staging-spot-default:
    external: true
  spot-default:
    external: true
  spot-wireguarded:
    external: true