Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .local.env
Original file line number Diff line number Diff line change
@@ -3,12 +3,12 @@ AUTH_SERVICE_HOST=http://auth:4000
FLASK_ENV=development
FQDN=http://localhost
NODE_ENV=development
SUPER_ADMINS=["Y2lzY29zcGFyazovL3VzL1BFT1BMRS9kODRkZjI1MS1iYmY3LTRlZTEtOTM1OS00Y2I0MGIyOTBhN2I"]
SUPER_ADMINS=["Y2lzY29zcGFyazovL3VzL1BFT1BMRS80ZGM1OWMzMS0wYjJmLTQ2MDMtYTI5NS04NzU4ZTM1MDE2ZmE"]

# UI
DANGEROUSLY_DISABLE_HOST_CHECK=true
HOST=0.0.0.0
PORT=3000

# FEATURE FLAGS
BOT_2_0_0=true
BOT_2_0_0=false
6 changes: 3 additions & 3 deletions .production.env
Original file line number Diff line number Diff line change
@@ -5,11 +5,11 @@ FQDN=https://qutexbot.com
NODE_ENV=production
AUTHOR_NAME=Ava Thorn
AUTHOR_EMAIL=avatheavian@gmail.com
DEBUG_EMAIL=avthorn@cisco.com
SUPER_ADMINS=["Y2lzY29zcGFyazovL3VzL1BFT1BMRS9kODRkZjI1MS1iYmY3LTRlZTEtOTM1OS00Y2I0MGIyOTBhN2I"]
DEBUG_EMAIL=avatheavian@cisco.com
SUPER_ADMINS=["Y2lzY29zcGFyazovL3VzL1BFT1BMRS80ZGM1OWMzMS0wYjJmLTQ2MDMtYTI5NS04NzU4ZTM1MDE2ZmE"]
MONGO_INITDB_ROOT_USERNAME=root
MONGO_INITDB_DATABASE=qutex
MONGO_INITDB_ROOT_PASSWORD_FILE=/run/secrets/mongoPassword

# FEATURE FLAGS
BOT_2_0_0=true
BOT_2_0_0=false
50 changes: 25 additions & 25 deletions docker-compose.build.yml
Original file line number Diff line number Diff line change
@@ -6,31 +6,31 @@ services:
bot:
build:
context: ./services/bot
ui:
build:
context: services/ui/
projects:
build:
context: .
dockerfile: services/_api_service_template/Dockerfile
args:
SERVICE_PREFIX: projects
users:
build:
context: .
dockerfile: services/_api_service_template/Dockerfile
args:
SERVICE_PREFIX: users
auth:
build:
context: .
dockerfile: services/_api_service_template/Dockerfile
args:
SERVICE_PREFIX: auth
mongo_ui:
build:
context: .
dockerfile: Dockerfile.mongoexpress
# ui:
# build:
# context: services/ui/
# projects:
# build:
# context: .
# dockerfile: services/_api_service_template/Dockerfile
# args:
# SERVICE_PREFIX: projects
# users:
# build:
# context: .
# dockerfile: services/_api_service_template/Dockerfile
# args:
# SERVICE_PREFIX: users
# auth:
# build:
# context: .
# dockerfile: services/_api_service_template/Dockerfile
# args:
# SERVICE_PREFIX: auth
# mongo_ui:
# build:
# context: .
# dockerfile: Dockerfile.mongoexpress
mongo_backup:
build:
context: services/mongo_backup
96 changes: 48 additions & 48 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -26,54 +26,54 @@ services:
- ./services/bot:/app
- ./services/bot/tsconfig.json:/app/tsconfig.json
- ./services/bot/package.json:/app/package.json
ui:
<<: *interactive
image: qutex_ui:latest
build:
context: services/ui/
args:
DEVELOPMENT: "true"
env_file: *env_files
volumes:
- ./services/ui/src:/qutex/src
- ./services/ui/public:/qutex/public
- compiled_css:/qutex/src/assets/css
projects:
<<: *interactive
image: qutex_projects:latest
build:
context: .
dockerfile: services/_api_service_template/Dockerfile
args:
SERVICE_PREFIX: projects
env_file: *env_files
volumes:
- ./services/projects/api:/projects/api
- ./services/projects/documents:/projects/documents
users:
<<: *interactive
image: qutex_users:latest
build:
context: .
dockerfile: services/_api_service_template/Dockerfile
args:
SERVICE_PREFIX: users
env_file: *env_files
volumes:
- ./services/users/api:/users/api
- ./services/users/documents:/users/documents
auth:
<<: *interactive
image: qutex_auth:latest
build:
context: .
dockerfile: services/_api_service_template/Dockerfile
args:
SERVICE_PREFIX: auth
env_file: *env_files
volumes:
- ./services/auth/api:/auth/api
- ./services/auth/documents:/auth/documents
# ui:
# <<: *interactive
# image: qutex_ui:latest
# build:
# context: services/ui/
# args:
# DEVELOPMENT: "true"
# env_file: *env_files
# volumes:
# - ./services/ui/src:/qutex/src
# - ./services/ui/public:/qutex/public
# - compiled_css:/qutex/src/assets/css
# projects:
# <<: *interactive
# image: qutex_projects:latest
# build:
# context: .
# dockerfile: services/_api_service_template/Dockerfile
# args:
# SERVICE_PREFIX: projects
# env_file: *env_files
# volumes:
# - ./services/projects/api:/projects/api
# - ./services/projects/documents:/projects/documents
# users:
# <<: *interactive
# image: qutex_users:latest
# build:
# context: .
# dockerfile: services/_api_service_template/Dockerfile
# args:
# SERVICE_PREFIX: users
# env_file: *env_files
# volumes:
# - ./services/users/api:/users/api
# - ./services/users/documents:/users/documents
# auth:
# <<: *interactive
# image: qutex_auth:latest
# build:
# context: .
# dockerfile: services/_api_service_template/Dockerfile
# args:
# SERVICE_PREFIX: auth
# env_file: *env_files
# volumes:
# - ./services/auth/api:/auth/api
# - ./services/auth/documents:/auth/documents
migrate:
image: qutex_bot:latest
build:
137 changes: 69 additions & 68 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -10,10 +10,11 @@ services:
<<: *common
image: ghcr.io/amthorn/qutex/qutex_nginx:${QUTEX_VERSION:-latest}
depends_on:
- ui
- auth
- projects
- users
# - ui
# - auth
# - projects
# - users
- bot
environment:
CERTBOT_EMAIL: avatheavian@gmail.com
RENEWAL_INTERVAL: 8d
@@ -32,51 +33,51 @@ services:
image: ghcr.io/amthorn/qutex/qutex_bot:${QUTEX_VERSION:-latest}
depends_on:
- mongo
ports:
- target: 3000
published: 3000
mode: host
# ports:
# - target: 3000
# published: 3000
# mode: host
secrets:
- token
- mongoPassword
ui:
<<: *common
image: ghcr.io/amthorn/qutex/qutex_ui:${QUTEX_VERSION:-latest}
depends_on:
- mongo
- bot
# - api
build:
context: services/ui/
projects:
<<: *common
image: ghcr.io/amthorn/qutex/qutex_projects:${QUTEX_VERSION:-latest}
depends_on:
- mongo
- auth
secrets:
- mongoPassword
users:
<<: *common
image: ghcr.io/amthorn/qutex/qutex_users:${QUTEX_VERSION:-latest}
depends_on:
- auth
secrets:
- token
- mongoPassword
auth:
<<: *common
image: ghcr.io/amthorn/qutex/qutex_auth:${QUTEX_VERSION:-latest}
depends_on:
- redis
- mongo
secrets:
- privateKey
- token
- mongoPassword
redis:
restart: always
image: redis:6.2.1
# ui:
# <<: *common
# image: ghcr.io/amthorn/qutex/qutex_ui:${QUTEX_VERSION:-latest}
# depends_on:
# - mongo
# - bot
# # - api
# build:
# context: services/ui/
# projects:
# <<: *common
# image: ghcr.io/amthorn/qutex/qutex_projects:${QUTEX_VERSION:-latest}
# depends_on:
# - mongo
# - auth
# secrets:
# - mongoPassword
# users:
# <<: *common
# image: ghcr.io/amthorn/qutex/qutex_users:${QUTEX_VERSION:-latest}
# depends_on:
# - auth
# secrets:
# - token
# - mongoPassword
# auth:
# <<: *common
# image: ghcr.io/amthorn/qutex/qutex_auth:${QUTEX_VERSION:-latest}
# depends_on:
# - redis
# - mongo
# secrets:
# - privateKey
# - token
# - mongoPassword
# redis:
# restart: always
# image: redis:6.2.1
migrate:
depends_on:
- mongo
@@ -95,20 +96,20 @@ services:
- mongo_volume:/data/db
secrets:
- mongoPassword
mongo_ui:
image: mongo-express:1.0.0-alpha
depends_on:
- mongo
environment:
ME_CONFIG_MONGODB_SERVER: mongo
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD_FILE: /run/secrets/mongoPassword
ME_CONFIG_SITE_BASEURL: /admin/mongo/
ME_CONFIG_OPTIONS_NO_DELETE: "true"
ME_CONFIG_OPTIONS_READONLY: "true"
ME_CONFIG_MONGODB_ENABLE_ADMIN: "true"
secrets:
- mongoPassword
# mongo_ui:
# image: mongo-express:1.0.0-alpha
# depends_on:
# - mongo
# environment:
# ME_CONFIG_MONGODB_SERVER: mongo
# ME_CONFIG_MONGODB_ADMINUSERNAME: root
# ME_CONFIG_MONGODB_ADMINPASSWORD_FILE: /run/secrets/mongoPassword
# ME_CONFIG_SITE_BASEURL: /admin/mongo/
# ME_CONFIG_OPTIONS_NO_DELETE: "true"
# ME_CONFIG_OPTIONS_READONLY: "true"
# ME_CONFIG_MONGODB_ENABLE_ADMIN: "true"
# secrets:
# - mongoPassword
mongo_backup:
image: ghcr.io/amthorn/qutex/qutex_mongo_backup:${QUTEX_VERSION:-latest}
environment:
@@ -124,14 +125,14 @@ services:
- ./mongo_backups:/backup
secrets:
- mongoPassword
redis_ui:
image: rediscommander/redis-commander
environment:
REDIS_HOST: redis
REDIS_PORT: "6379"
URL_PREFIX: /admin/redis
ports:
- 8081:8081
# redis_ui:
# image: rediscommander/redis-commander
# environment:
# REDIS_HOST: redis
# REDIS_PORT: "6379"
# URL_PREFIX: /admin/redis
# ports:
# - 8081:8081
secrets:
token:
file: secrets/prod/token
122 changes: 66 additions & 56 deletions services/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -1,77 +1,87 @@
upstream ui {
server ui:3000;
}
# upstream ui {
# server ui:3000;
# }

upstream auth {
server auth:4000;
}
# upstream auth {
# server auth:4000;
# }

upstream projects {
server projects:4000;
}
# upstream projects {
# server projects:4000;
# }

upstream users {
server users:4000;
}
# upstream users {
# server users:4000;
# }

upstream mongo_ui {
server mongo_ui:8081;
}
# upstream mongo_ui {
# server mongo_ui:8081;
# }

server {
listen 80;
server_name qutexbot.com www.qutexbot.com;
location / {
return 301 https://$server_name$request_uri;
}
}
# upstream redis_ui {
# server redis_ui:8081;
# }

server {
listen 443 ssl;
listen 80;
server_name qutexbot.com www.qutexbot.com;
ssl_certificate /etc/letsencrypt/live/qutex/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/qutex/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/qutex/chain.pem;

# React's hot reload feature requires this to work properly
# Only necessary for development
# TODO: build production config
location = /sockjs-node {
proxy_pass http://ui;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
# location = /sockjs-node {
# proxy_pass http://ui;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "Upgrade";
# }

location / {
proxy_pass http://ui;
}
# location / {
# proxy_pass http://ui;
# }

location /api/v1/auth {
proxy_pass http://auth;
}
# location /api/v1/auth {
# proxy_pass http://auth;
# }

location /api/v1/projects {
proxy_pass http://projects;
}
# location /api/v1/projects {
# proxy_pass http://projects;
# }

location /api/v1/users {
proxy_pass http://users;
}
# location /api/v1/users {
# proxy_pass http://users;
# }

location /admin/mongo {
auth_request /superadmin;
proxy_pass http://mongo_ui$request_uri;
location /api/v1/bot/ {
proxy_pass http://bot:3000;
}

location = /superadmin {
internal;
proxy_pass http://auth/api/v1/auth/token/check?role=superadmin;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
# location /admin/mongo {
# auth_request /superadmin;
# proxy_pass http://mongo_ui$request_uri;
# }

# location /admin/redis {
# auth_request /superadmin;
# proxy_pass http://redis_ui$request_uri;
# }

# location = /superadmin {
# internal;
# proxy_pass http://auth/api/v1/auth/token/check?role=superadmin;
# proxy_pass_request_body off;
# proxy_set_header Content-Length "";
# proxy_set_header X-Original-URI $request_uri;
# }

error_page 403 @access_denied;
error_page 404 @not_found;

location @access_denied {
return 302 /access_denied;
}

error_page 404 /not_found;
error_page 403 /access_denied;
}
location @not_found {
return 302 /not_found;
}
}