Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
fix docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
b3n4kh committed Jun 20, 2023
1 parent 2b689fe commit 0bb1334
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 19 deletions.
File renamed without changes.
25 changes: 11 additions & 14 deletions docker/compose.no_traefik.yml → docker/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ services:
condition: on-failure
max_attempts: 3
environment:
POSTGRES_DB: "${DB_DATABASE}"
POSTGRES_USER: "${DB_USER}"
POSTGRES_DB: "${DB_DATABASE:-taranis}"
POSTGRES_USER: "${DB_USER:-taranis}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
command: ["postgres", "-c", "shared_buffers=${DB_SHARED_BUFFERS:-64MB}", "-c", "max_connections=${DB_MAX_CONNECTIONS:-1000}"]
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${DB_USER} -d ${DB_DATABASE}'"]
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${DB_USER:-taranis} -d ${DB_DATABASE:-taranis}'"]
interval: 10s
timeout: 3s
retries: 3
Expand All @@ -37,7 +37,7 @@ services:
max_attempts: 3
image: "${DOCKER_IMAGE_NAMESPACE}/taranis-ng-core:${TARANIS_NG_TAG:-latest}"
ports:
- "6001:80"
- "${TARANIS_NG_CORE_PORT:-8081}:80"
environment:
DB_URL: "${DB_URL:-database}"
DB_DATABASE: "${DB_DATABASE:-taranis}"
Expand Down Expand Up @@ -76,8 +76,8 @@ services:
image: "${DOCKER_IMAGE_NAMESPACE}/taranis-ng-bots:${TARANIS_NG_TAG}"
environment:
API_KEY: "${API_KEY}"
TARANIS_NG_CORE_URL: "${TARANIS_NG_CORE_URL}"
TARANIS_NG_CORE_SSE: "${TARANIS_NG_CORE_URL}/sse"
TARANIS_NG_CORE_URL: "http://core"
TARANIS_NG_CORE_SSE: "http://core/sse"
WORKERS_PER_CORE: "1"
WEB_CONCURRENCY: "1"
DEBUG: "${DEBUG:-False}"
Expand All @@ -97,7 +97,7 @@ services:
max_attempts: 3
image: "${DOCKER_IMAGE_NAMESPACE}/taranis-ng-collectors:${TARANIS_NG_TAG}"
environment:
TARANIS_NG_CORE_URL: "${TARANIS_NG_CORE_URL}"
TARANIS_NG_CORE_URL: "http://core"
API_KEY: "${API_KEY}"
WORKERS_PER_CORE: "1"
WEB_CONCURRENCY: "1"
Expand All @@ -120,7 +120,7 @@ services:
max_attempts: 3
image: "${DOCKER_IMAGE_NAMESPACE}/taranis-ng-presenters:${TARANIS_NG_TAG}"
environment:
TARANIS_NG_CORE_URL: "${TARANIS_NG_CORE_URL}"
TARANIS_NG_CORE_URL: "http://core"
API_KEY: "${API_KEY}"
WORKERS_PER_CORE: "1"
WEB_CONCURRENCY: "1"
Expand All @@ -143,7 +143,7 @@ services:
max_attempts: 3
image: "${DOCKER_IMAGE_NAMESPACE}/taranis-ng-publishers:${TARANIS_NG_TAG}"
environment:
TARANIS_NG_CORE_URL: "${TARANIS_NG_CORE_URL}"
TARANIS_NG_CORE_URL: "http://core"
API_KEY: "${API_KEY}"
WORKERS_PER_CORE: "1"
WEB_CONCURRENCY: "1"
Expand All @@ -163,14 +163,11 @@ services:
max_attempts: 3
image: "${DOCKER_IMAGE_NAMESPACE}/taranis-ng-gui:${TARANIS_NG_TAG}"
ports:
- "6000:80"
- "${TARANIS_NG_PORT:-8080}:80"
environment:
NGINX_WORKERS: "4"
NGINX_CONNECTIONS: "16"
VITE_TARANIS_NG_URL: "${TARANIS_NG_HTTPS_URI}"
VITE_TARANIS_NG_CORE_API: "${TARANIS_NG_HTTPS_URI}/api/v1"
VITE_TARANIS_NG_CORE_SSE: "${TARANIS_NG_HTTPS_URI}/sse"
VITE_TARANIS_NG_LOCALE: en
VITE_TARANIS_NG_URL: "${TARANIS_NG_HTTPS_URI:-taranis}"
logging:
driver: "json-file"
options:
Expand Down
5 changes: 2 additions & 3 deletions src/core/core/managers/db_seed_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,6 @@ def pre_seed_wordlists():


def pre_seed_default_user():
from werkzeug.security import generate_password_hash
from core.model.organization import Organization
from core.model.user import User

Expand Down Expand Up @@ -1338,7 +1337,7 @@ def pre_seed_default_user():
],
"permissions": [],
"organization": {"id": 1},
"password": generate_password_hash(Config.PRE_SEED_PASSWORD_ADMIN, method="sha256"),
"password": Config.PRE_SEED_PASSWORD_ADMIN,
}
)

Expand Down Expand Up @@ -1370,7 +1369,7 @@ def pre_seed_default_user():
],
"permissions": [],
"organization": {"id": 2},
"password": generate_password_hash(Config.PRE_SEED_PASSWORD_USER, method="sha256"),
"password": Config.PRE_SEED_PASSWORD_USER,
}
)

Expand Down
4 changes: 2 additions & 2 deletions src/core/core/model/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_all_external_json(cls, user, search):
@classmethod
def add_new(cls, data):
user = NewUserSchema().load(data)
user.password = generate_password_hash(user.password, method="sha256")
user.password = generate_password_hash(user.password)
db.session.add(user)
db.session.commit()

Expand All @@ -130,7 +130,7 @@ def update(cls, user_id, data):
data["password"] = ""
updated_user = schema.load(data)
if updated_user.password:
user.password = generate_password_hash(updated_user.password, method="sha256")
user.password = generate_password_hash(updated_user.password)
user.username = updated_user.username
user.name = updated_user.name
user.organization = updated_user.organization
Expand Down
17 changes: 17 additions & 0 deletions src/gui/extras/default.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
upstream core {
server core;
}


server {
listen 80;
server_name _;

location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
}

location /api {
proxy_pass http://core/api/v1;
}

location /api/v1 {
proxy_pass http://core/api/v1;
}


location /sse {
proxy_pass http://core/api/v1;
}

error_page 500 502 503 504 /50x.html;
Expand Down

0 comments on commit 0bb1334

Please sign in to comment.