Skip to content

Commit

Permalink
Prefix all environment variables with OFFSPOT_DEMO
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Mar 26, 2024
1 parent 3d20093 commit 991438d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To install the demo, you have to:
- copy the `contrib/environment` file to `/etc/demo/environment`
- could be any other appropriate location, but then you have to modify `<src_path>/systemd-unit/demo-offspot.service`
- customize this file as needed
- automatically load the environment data in your user session: `source /etc/demo/environment`
- automatically load the environment data in your user session: `echo "export \$(grep -v '^#' /etc/demo/environment | xargs) && env | grep OFFSPOT_DEMO" | tee /etc/profile.d/demo-env.sh`
- setup the demo: run `demo-setup`

## Tooling
Expand Down
8 changes: 4 additions & 4 deletions contrib/environment
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
OFFSPOT_DEMO_FQDN="demo.hotspot.kiwix.org"

# URL of the Image to watch / deploy (either autoimage URL or email URL)
OFFSPOT_IMAGE_URL="https://api.imager.kiwix.org/auto-images/offspot-demo/json"
OFFSPOT_DEMO_IMAGE_URL="https://api.imager.kiwix.org/auto-images/offspot-demo/json"

# Folder where everything will be deployed
TARGET_DIR="/data"
OFFSPOT_DEMO_TARGET_DIR="/data"

# Location of the image
IMAGE_PATH="/demo/image.img"
OFFSPOT_DEMO_IMAGE_PATH="/demo/image.img"

# OCI plateform to use (by default, offspot is linux/aarch64 but usually demo will run on linux/amd64)
OCI_PLATFORM="linux/amd64"
OFFSPOT_DEMO_OCI_PLATFORM="linux/amd64"

# Email adress for acme to receive notifications about expiring/expired certificates
OFFSPOT_DEMO_TLS_EMAIL="[email protected]"
8 changes: 4 additions & 4 deletions src/offspot_demo/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

OFFSPOT_IMAGE_ID = "offspot-demo"
OFFSPOT_IMAGE_URL = os.getenv(
"OFFSPOT_IMAGE_URL",
"OFFSPOT_DEMO_IMAGE_URL",
f"https://api.imager.kiwix.org/auto-images/{OFFSPOT_IMAGE_ID}/json",
)
TARGET_DIR = Path(os.getenv("TARGET_DIR", "/data"))
IMAGE_PATH = Path(os.getenv("IMAGE_PATH", "/demo/image.img"))
TARGET_DIR = Path(os.getenv("OFFSPOT_DEMO_TARGET_DIR", "/data"))
IMAGE_PATH = Path(os.getenv("OFFSPOT_DEMO_IMAGE_PATH", "/demo/image.img"))
LAST_IMAGE_DEPLOYED_PATH = Path("/demo/last_image")

FQDN = os.getenv("OFFSPOT_DEMO_FQDN", "demo.hostpot.kiwix.org")
Expand Down Expand Up @@ -41,7 +41,7 @@
# in order not to be purged by deploy
DOCKER_LABEL_MAINT = "maintenance"

OCI_PLATFORM = os.getenv("OCI_PLATFORM", "linux/amd64")
OCI_PLATFORM = os.getenv("OFFSPOT_DEMO_OCI_PLATFORM", "linux/amd64")


class Mode(enum.Enum):
Expand Down

0 comments on commit 991438d

Please sign in to comment.