Compare commits

..

6 Commits

5 changed files with 7 additions and 14 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -6,7 +6,9 @@ services:
image: mathwave/sprint-repo:certupdater
command: worker
environment:
MINIO_HOST: "minio.develop.sprinthub.ru"
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
MONGO_HOST: "mongo.develop.sprinthub.ru"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
STAGE: "development"
volumes:
@@ -14,8 +16,6 @@ services:
networks:
- configurator
- queues-development
- minio-development
- mongo-development
deploy:
mode: replicated
restart_policy:
@@ -31,7 +31,3 @@ networks:
external: true
queues-development:
external: true
minio-development:
external: true
mongo-development:
external: true

View File

@@ -6,7 +6,9 @@ services:
image: mathwave/sprint-repo:certupdater
command: worker
environment:
MINIO_HOST: "minio.sprinthub.ru"
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_PROD
MONGO_HOST: "mongo.sprinthub.ru"
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
STAGE: "production"
volumes:
@@ -14,8 +16,6 @@ services:
networks:
- configurator
- queues
- minio
- mongo
deploy:
mode: replicated
restart_policy:
@@ -31,7 +31,3 @@ networks:
external: true
queues:
external: true
minio:
external: true
mongo:
external: true

View File

@@ -1,7 +1,7 @@
import os
from minio import Minio
MINIO_HOST = "minio:9000"
MINIO_HOST = os.getenv("MINIO_HOST", "localhost") + ":9000"
MINIO_ACCESS_KEY = os.getenv("MINIO_ACCESS_KEY", "serviceminioadmin")
MINIO_SECRET_KEY = os.getenv("MINIO_SECRET_KEY", "minioadmin")

View File

@@ -4,11 +4,12 @@ import os
MONGO_USER = os.getenv("MONGO_USER", "mongo")
MONGO_PASSWORD = os.getenv("MONGO_PASSWORD", "password")
MONGO_HOST = os.getenv("MONGO_HOST", "localhost")
class Mongo:
def __init__(self):
url = f"mongodb://{MONGO_USER}:{MONGO_PASSWORD}@mongo:27017/"
url = f"mongodb://{MONGO_USER}:{MONGO_PASSWORD}@{MONGO_HOST}:27017/"
self.client: pymongo.MongoClient = pymongo.MongoClient(url)
self.database = self.client.get_database("certupdater")
self.hosts_collection.create_index([