Commit 75535969 authored by Mustafa Gezen's avatar Mustafa Gezen 🏗
Browse files

Add database_url and import_logs_dir

parent 5439462b
......@@ -34,5 +34,4 @@ koji_session = koji.ClientSession(koji_config["server"], koji_config)
activate_session(koji_session, koji_config)
mbs_client = MBSClient(settings.mbs_url)
message_cipher = Fernet(settings.message_secret)
cookie_cipher = Fernet(settings.cookie_secret)
lookaside_session = Lookaside(settings.storage_addr)
......@@ -27,11 +27,11 @@ class Settings(BaseSettings):
gitlab_api_key: str
session_secret: str
message_secret: str
cookie_secret: str
tag_prefix: str = "rocky"
active_point_releases: List[str] = ["3", "4"]
default_point_release: str = "3"
redis_url: str = "redis://localhost"
database_url: str = "postgres://postgres:postgres@localhost/dbuild"
production: bool = False
debug: bool = False
......@@ -45,6 +45,7 @@ class Settings(BaseSettings):
version: int = 8
no_storage_download: bool = False
no_storage_upload: bool = False
import_logs_dir: str = "/tmp"
# mbs
mbs_url: str
......@@ -80,7 +81,7 @@ if settings.default_point_release not in settings.active_point_releases:
raise Exception("Default point release not active.")
TORTOISE_ORM = {
"connections": {"default": "postgres://postgres:postgres@localhost/dbuild"},
"connections": {"default": settings.database_url},
"apps": {
"distrobuild": {
"models": [
......
......@@ -60,7 +60,7 @@ async def import_project(import_id: int, source_rpm: str, module_mode: bool = Fa
args.append("--single-tag")
args.append(single_tag)
f = open(f"/tmp/import-{import_id}.log", "w")
f = open(f"{settings.import_logs_dir}/import-{import_id}.log", "w")
proc = await asyncio.create_subprocess_exec("srpmproc", *args, stdout=asyncio.subprocess.PIPE, stderr=f)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment