Skip to content

Commit

Permalink
Fix configuration issues upgrading Debian installs (#1636)
Browse files Browse the repository at this point in the history
  • Loading branch information
dekkers authored Aug 22, 2023
1 parent aefa727 commit 0915c90
Show file tree
Hide file tree
Showing 34 changed files with 93 additions and 52 deletions.
3 changes: 1 addition & 2 deletions boefjes/debian/install
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
packaging/deb/data/etc/kat/* etc/kat
packaging/deb/data/usr/lib/systemd/system/* usr/lib/systemd/system
packaging/deb/data/usr/bin/* usr/bin
packaging/deb/data/usr/* usr
11 changes: 5 additions & 6 deletions boefjes/packaging/deb/data/etc/kat/boefjes.conf
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
QUEUE_URI=

OCTOPOES_API=http://localhost:8001

BYTES_API=http://localhost:8002
# OCTOPOES_API=http://localhost:8001
# BYTES_API=http://localhost:8002
BYTES_USERNAME=bytes
BYTES_PASSWORD=

KATALOGUS_DB_URI=
KATALOGUS_API=http://localhost:8003
SCHEDULER_API=http://localhost:8004
# KATALOGUS_API=http://localhost:8003
# SCHEDULER_API=http://localhost:8004

BOEFJES_LOG_CFG=/etc/kat/boefjes.logging.json
# BOEFJES_LOG_CFG=/etc/kat/boefjes.logging.json
1 change: 1 addition & 0 deletions boefjes/packaging/deb/data/usr/bin/update-katalogus-db
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

set -ae
source /usr/lib/kat/boefjes.defaults
source /etc/kat/boefjes.conf
cd /opt/venvs/kat-boefjes/lib/python*/site-packages

Expand Down
6 changes: 6 additions & 0 deletions boefjes/packaging/deb/data/usr/lib/kat/boefjes.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OCTOPOES_API=http://localhost:8001
BYTES_API=http://localhost:8002
KATALOGUS_API=http://localhost:8003
SCHEDULER_API=http://localhost:8004

BOEFJES_LOG_CFG=/etc/kat/boefjes.logging.json
2 changes: 1 addition & 1 deletion boefjes/packaging/deb/data/usr/lib/systemd/system/kat-boefjes.service
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ User=kat
Group=kat
SyslogIdentifier=kat-boefjes
WorkingDirectory=/opt/venvs/kat-boefjes/lib/python3.9/site-packages
# TODO: don't load env here
EnvironmentFile=/usr/lib/kat/boefjes.defaults
EnvironmentFile=/etc/kat/boefjes.conf
ExecStart=/opt/venvs/kat-boefjes/bin/python -m boefjes boefje
Restart=on-failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ User=kat
Group=kat
SyslogIdentifier=kat-katalogus
WorkingDirectory=/opt/venvs/kat-boefjes/lib/python3.9/site-packages
# TODO: don't load env here
EnvironmentFile=/usr/lib/kat/boefjes.defaults
EnvironmentFile=/etc/kat/boefjes.conf
ExecStart=/opt/venvs/kat-boefjes/bin/python -m gunicorn \
--access-logfile - \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ User=kat
Group=kat
SyslogIdentifier=kat-normalizers
WorkingDirectory=/opt/venvs/kat-boefjes/lib/python3.9/site-packages
# TODO: don't load env here
EnvironmentFile=/usr/lib/kat/boefjes.defaults
EnvironmentFile=/etc/kat/boefjes.conf
ExecStart=/opt/venvs/kat-boefjes/bin/python -m boefjes normalizer
Restart=on-failure
Expand Down
4 changes: 4 additions & 0 deletions bytes/bytes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def __call__(self, settings: BaseSettings) -> Dict[str, Any]:
logging.warning("Deprecation: %s is deprecated, use %s instead", old_name.upper(), new_name.upper())
d[new_name[len(env_prefix) :]] = env_vars[old_name]

# We previously accepted an empty value for this field
if "rfc3161_provider" in d and not d["rfc3161_provider"]:
del d["rfc3161_provider"]

return d


Expand Down
3 changes: 1 addition & 2 deletions bytes/debian/install
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
packaging/deb/data/etc/kat/* etc/kat
packaging/deb/data/usr/lib/systemd/system/* usr/lib/systemd/system
packaging/deb/data/usr/bin/* usr/bin
packaging/deb/data/usr/* usr
9 changes: 4 additions & 5 deletions bytes/packaging/deb/data/etc/kat/bytes.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
BYTES_SECRET=
BYTES_USERNAME=bytes
BYTES_PASSWORD=
BYTES_ACCESS_TOKEN_EXPIRE_MINUTES=1000
# BYTES_ACCESS_TOKEN_EXPIRE_MINUTES=1000

# Bytes DB
BYTES_DB_URI=

# QUEUE for messages other services in KAT listen to
QUEUE_URI=

# Optional environment variables
BYTES_LOG_FILE=/var/log/kat-bytes/bytes.log
BYTES_DATA_DIR=/var/lib/kat-bytes/
BYTES_LOG_CFG=/etc/kat/bytes.logging.conf
# BYTES_LOG_FILE=/var/log/kat-bytes/bytes.log
# BYTES_DATA_DIR=/var/lib/kat-bytes/
# BYTES_LOG_CFG=/etc/kat/bytes.logging.conf
1 change: 1 addition & 0 deletions bytes/packaging/deb/data/usr/bin/update-bytes-db
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

set -ae
source /usr/lib/kat/bytes.defaults
source /etc/kat/bytes.conf
cd /opt/venvs/kat-bytes/lib/python*/site-packages
/opt/venvs/kat-bytes/bin/python -m alembic --config bytes/alembic.ini upgrade head
4 changes: 4 additions & 0 deletions bytes/packaging/deb/data/usr/lib/kat/bytes.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BYTES_ACCESS_TOKEN_EXPIRE_MINUTES=1000
BYTES_LOG_FILE=/var/log/kat-bytes/bytes.log
BYTES_DATA_DIR=/var/lib/kat-bytes/
BYTES_LOG_CFG=/etc/kat/bytes.logging.conf
1 change: 1 addition & 0 deletions bytes/packaging/deb/data/usr/lib/systemd/system/kat-bytes.service
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ User=kat
Group=kat
SyslogIdentifier=kat-bytes
WorkingDirectory=/opt/venvs/kat-bytes/
EnvironmentFile=/usr/lib/kat/bytes.defaults
EnvironmentFile=/etc/kat/bytes.conf
ExecStart=/opt/venvs/kat-bytes/bin/python -m gunicorn \
--access-logfile - \
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion keiko/debian/install
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
packaging/deb/data/etc/kat/* etc/kat
packaging/deb/data/usr/lib/systemd/system/* usr/lib/systemd/system
packaging/deb/data/usr/* usr
templates/* /etc/kat/keiko/templates
glossaries/* /etc/kat/keiko/glossaries
assets/* /etc/kat/keiko/assets
20 changes: 10 additions & 10 deletions keiko/packaging/deb/data/etc/kat/keiko.conf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# File path to the log configuration file, default: "logging.json"
KEIKO_LOG_CFG=/etc/kat/keiko.logging.json
# File path to the log configuration file
# KEIKO_LOG_CFG=/etc/kat/keiko.logging.json

# File path to templates folder, default: "templates"
KEIKO_TEMPLATES_FOLDER=/etc/kat/keiko/templates
# File path to templates folder
# KEIKO_TEMPLATES_FOLDER=/etc/kat/keiko/templates

# File path to glossaries folder, default: "glossaries"
KEIKO_GLOSSARIES_FOLDER=/etc/kat/keiko/glossaries
# File path to glossaries folder
# KEIKO_GLOSSARIES_FOLDER=/etc/kat/keiko/glossaries

# File path to reports folder, default: "reports"
KEIKO_REPORTS_FOLDER=/var/lib/kat-keiko/reports
# File path to reports folder
# KEIKO_REPORTS_FOLDER=/var/lib/kat-keiko/reports

# File path to assets folder, default: "assets"
KEIKO_ASSETS_FOLDER=/etc/kat/keiko/assets
# File path to assets folder
# KEIKO_ASSETS_FOLDER=/etc/kat/keiko/assets
5 changes: 5 additions & 0 deletions keiko/packaging/deb/data/usr/lib/kat/keiko.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
KEIKO_ASSETS_FOLDER=/etc/kat/keiko/assets
KEIKO_GLOSSARIES_FOLDER=/etc/kat/keiko/glossaries
KEIKO_LOG_CFG=/etc/kat/keiko.logging.json
KEIKO_REPORTS_FOLDER=/var/lib/kat-keiko/reports
KEIKO_TEMPLATES_FOLDER=/etc/kat/keiko/templates
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ User=kat
Group=kat
SyslogIdentifier=kat-keiko
WorkingDirectory=/opt/venvs/kat-keiko/
EnvironmentFile=/usr/lib/kat/keiko.defaults
EnvironmentFile=/etc/kat/keiko.conf
ExecStart=/opt/venvs/kat-keiko/bin/python -m gunicorn \
--access-logfile - \
Expand Down
3 changes: 1 addition & 2 deletions mula/debian/install
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
packaging/deb/data/etc/kat/* etc/kat
packaging/deb/data/usr/lib/systemd/system/* usr/lib/systemd/system
packaging/deb/data/usr/bin/* usr/bin
packaging/deb/data/usr/* usr
12 changes: 6 additions & 6 deletions mula/packaging/deb/data/etc/kat/mula.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Host address, default: localhost
SCHEDULER_API_HOST=localhost
# SCHEDULER_API_HOST=localhost

# Host api server port, default: 8000
SCHEDULER_API_PORT=8004
# SCHEDULER_API_PORT=8004

# File path to the log configuration file, default is "../../../logging.json"
SCHEDULER_LOG_CFG=/etc/kat/mula.logging.json
# SCHEDULER_LOG_CFG=/etc/kat/mula.logging.json

# RabbitMQ host address
QUEUE_URI=

# Host url's of external service connectors
KATALOGUS_API=http://localhost:8003
BYTES_API=http://localhost:8002
OCTOPOES_API=http://localhost:8001
# KATALOGUS_API=http://localhost:8003
# BYTES_API=http://localhost:8002
# OCTOPOES_API=http://localhost:8001

# Bytes specific api credentials
BYTES_USERNAME=bytes
Expand Down
1 change: 1 addition & 0 deletions mula/packaging/deb/data/usr/bin/update-mula-db
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

set -ae
source /usr/lib/kat/mula.defaults
source /etc/kat/mula.conf
cd /opt/venvs/kat-mula/lib/python*/site-packages
/opt/venvs/kat-mula/bin/python -m alembic --config scheduler/alembic.ini upgrade head
6 changes: 6 additions & 0 deletions mula/packaging/deb/data/usr/lib/kat/mula.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SCHEDULER_API_HOST=localhost
SCHEDULER_API_PORT=8004
SCHEDULER_LOG_CFG=/etc/kat/mula.logging.json
KATALOGUS_API=http://localhost:8003
BYTES_API=http://localhost:8002
OCTOPOES_API=http://localhost:8001
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ User=kat
Group=kat
SyslogIdentifier=kat-mula
WorkingDirectory=/opt/venvs/kat-mula/
# TODO: don't load env here. It exposes the values over dbus IPC
EnvironmentFile=/usr/lib/kat/mula.defaults
EnvironmentFile=/etc/kat/mula.conf
ExecStart=/opt/venvs/kat-mula/bin/python -m scheduler
Restart=on-failure
Expand Down
7 changes: 6 additions & 1 deletion mula/scheduler/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ def __call__(self, settings: BaseSettings) -> Dict[str, Any]:
# ...but old variable has been explicitly set through env
if new_name not in env_vars and old_name in env_vars:
logging.warning("Deprecation: %s is deprecated, use %s instead", old_name.upper(), new_name.upper())
d[new_name[len(env_prefix) :]] = env_vars[old_name]
if new_name == "queue_uri":
d["host_mutation"] = env_vars[old_name]
d["host_raw_data"] = env_vars[old_name]
d["host_normalizer_meta"] = env_vars[old_name]
else:
d[new_name[len(env_prefix) :]] = env_vars[old_name]

return d

Expand Down
2 changes: 1 addition & 1 deletion octopoes/debian/install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
packaging/deb/data/etc/kat/* etc/kat
packaging/deb/data/usr/lib/systemd/system/* usr/lib/systemd/system
packaging/deb/data/usr/* usr
6 changes: 3 additions & 3 deletions octopoes/packaging/deb/data/etc/kat/octopoes.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
XTDB_URI="http://localhost:3000"
# XTDB_URI="http://localhost:3000"
QUEUE_URI=
OCTOPOES_LOG_CFG=/etc/kat/octopoes.logging.yml
KATALOGUS_API=http://localhost:8003
# OCTOPOES_LOG_CFG=/etc/kat/octopoes.logging.yml
# KATALOGUS_API=http://localhost:8003
3 changes: 3 additions & 0 deletions octopoes/packaging/deb/data/usr/lib/kat/octopoes.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
XTDB_URI="http://localhost:3000"
OCTOPOES_LOG_CFG=/etc/kat/octopoes.logging.yml
KATALOGUS_API=http://localhost:8003
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ User=kat
Group=kat
SyslogIdentifier=kat-octopoes-worker
WorkingDirectory=/opt/venvs/kat-octopoes
EnvironmentFile=/usr/lib/kat/octopoes.defaults
EnvironmentFile=/etc/kat/octopoes.conf
ExecStart=/opt/venvs/kat-octopoes/bin/python -m celery -A octopoes.tasks.tasks worker -B -s /tmp/celerybeat-schedule --loglevel=WARNING
Restart=on-failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ User=kat
Group=kat
SyslogIdentifier=kat-octopoes
WorkingDirectory=/opt/venvs/kat-octopoes
EnvironmentFile=/usr/lib/kat/octopoes.defaults
EnvironmentFile=/etc/kat/octopoes.conf
ExecStart=/opt/venvs/kat-octopoes/bin/python -m gunicorn \
--access-logfile - \
Expand Down
3 changes: 1 addition & 2 deletions rocky/debian/install
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
packaging/deb/data/etc/kat/* etc/kat
packaging/deb/data/usr/bin/* usr/bin
packaging/deb/data/usr/lib/systemd/system/kat-rocky.service usr/lib/systemd/system
packaging/deb/data/usr/* usr
OOI_database_seed.json usr/share/kat-rocky
14 changes: 7 additions & 7 deletions rocky/packaging/deb/data/etc/kat/rocky.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Django settings
SECRET_KEY=
DEBUG="False"
TWOFACTOR_ENABLED="True"
# DEBUG="False"
# TWOFACTOR_ENABLED="True"
DJANGO_ALLOWED_HOSTS="localhost"
DJANGO_CSRF_TRUSTED_ORIGINS="https://localhost"

Expand All @@ -16,11 +16,11 @@ ROCKY_DB_PORT=5432
QUEUE_URI=

# External services
OCTOPOES_API=http://localhost:8001
SCHEDULER_API=http://localhost:8004
KATALOGUS_API=http://localhost:8003
KEIKO_API=http://localhost:8005
BYTES_API=http://localhost:8002
# OCTOPOES_API=http://localhost:8001
# SCHEDULER_API=http://localhost:8004
# KATALOGUS_API=http://localhost:8003
# KEIKO_API=http://localhost:8005
# BYTES_API=http://localhost:8002
BYTES_USERNAME=bytes
BYTES_PASSWORD=

Expand Down
1 change: 1 addition & 0 deletions rocky/packaging/deb/data/usr/bin/rocky-cli
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

set -ae
source /usr/lib/kat/rocky.defaults
source /etc/kat/rocky.conf

/opt/venvs/kat-rocky/bin/manage.py "$@"
5 changes: 5 additions & 0 deletions rocky/packaging/deb/data/usr/lib/kat/rocky.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
OCTOPOES_API=http://localhost:8001
SCHEDULER_API=http://localhost:8004
KATALOGUS_API=http://localhost:8003
KEIKO_API=http://localhost:8005
BYTES_API=http://localhost:8002
1 change: 1 addition & 0 deletions rocky/packaging/deb/data/usr/lib/systemd/system/kat-rocky.service
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ User=kat
Group=kat
SyslogIdentifier=kat-rocky
WorkingDirectory=/opt/venvs/kat-rocky/
EnvironmentFile=/usr/lib/kat/rocky.defaults
EnvironmentFile=/etc/kat/rocky.conf
ExecStart=/opt/venvs/kat-rocky/bin/uwsgi --ini /etc/kat/rocky.uwsgi.ini
Restart=on-failure
Expand Down

0 comments on commit 0915c90

Please sign in to comment.