From 623bc9b74e69b3dc5db390fd955aad20f3f2cf90 Mon Sep 17 00:00:00 2001 From: pierre geeraert Date: Thu, 25 Jun 2026 23:09:37 +0100 Subject: [PATCH] revoke keys and replace them by env variable --- README.md | 20 ++++++++++++++++++-- django_code/apps/betaserie/utils.py | 7 ++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7e512a4..3f947ae 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,25 @@ python django_code/manage.py migrate --database=redirect_db python django_code/manage.py migrate --database=job_db ``` -To make it easy for you to get started with GitLab, here's a list of recommended next steps. -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! +### Setup virtualenv variables +edit venv/bin/activate or .env/bin/activate + +and add the following code +``` +export DB_HOST=localhost +export DB_PORT=5432 +export DB_USERNAME=postgres +export DB_PASSWORD=example +export DB_DATABASE=cloudmanager +export CUSTOM_DB_DATABASE=cloudmanager +export ALLOWED_HOSTS="0.0.0.0,localhost,127.0.0.1" +export DEBUG=true +export bitwarden_access_token="PROVIDED IN BITWARDEN ADMIN INTERFACE" +export bitwarden_organization_id="" +``` + + ## Add your files diff --git a/django_code/apps/betaserie/utils.py b/django_code/apps/betaserie/utils.py index e0d9721..4b5bada 100644 --- a/django_code/apps/betaserie/utils.py +++ b/django_code/apps/betaserie/utils.py @@ -1,6 +1,7 @@ import requests import hashlib from apps.bitwarden.utils import bitwardenUtils +import os class betaserieUtils(): url = "https://api.betaseries.com/members/auth" @@ -12,10 +13,10 @@ class betaserieUtils(): #Adding __ to make the variable private and can't be access outside the class, # only by the class itself ot the subclass - __access_token = "0.7720f24b-4328-41ef-b70b-b419018270a3.nhBoRMSkfrlxqJVZ9W0W1g3lNFrmfI:35muVQz2mO3coR46bIZgcQ==" - __organization_id = "a6361589-badd-4bde-9cb4-af8901161c0d" + __bitwarden_access_token = os.environ.get('bitwarden_access_token') + __bitwarden_organization_id = os.environ.get('bitwarden_organization_id') - bw = bitwardenUtils(__access_token,__organization_id) + bw = bitwardenUtils(__bitwarden_access_token,__bitwarden_organization_id) __betaserie_username = bw.read_value_secret(username_UID) __betaserie_md5_password = bw.read_value_secret(password_UID) -- 2.54.0