From 67fe8b08287fd642d210cd28f9c0e96cfe3899b1 Mon Sep 17 00:00:00 2001 From: mb Date: Sun, 30 Oct 2022 15:28:03 +0100 Subject: [PATCH] adding the option to store environment variables in a text file :) --- Makefile | 9 ++++++++- README.md | 21 ++++++++++++--------- config.env | 4 ++++ 3 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 config.env diff --git a/Makefile b/Makefile index 3e66a63..497a70f 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,14 @@ +SHELL := /bin/bash + default: run setup: @if [ ! -d ".venv" ]; then python3 -m venv .venv && .venv/bin/pip install -r requirements.txt; fi -run: +config: + @set -a + @source config.env + @set +a + +run: config @.venv/bin/python octomode.py diff --git a/README.md b/README.md index 0ba8c6d..c84b367 100644 --- a/README.md +++ b/README.md @@ -85,19 +85,22 @@ You can clone this repository to run octomode on your own computer or server. Then you can configure your environment. -You can do this by passing the values on the command-line before running octomode: +You can do this in two ways: + +* by editing the `config.env` file +* by storing the configuration settings as *environment variables* before running octomode: ``` -export OCTOMODE_PORTNUMBER=XXX -export OCTOMODE_PAD_URL=XXX -export OCTOMODE_PAD_API_URL=XXX -export OCTOMODE_PAD_API_KEY=XXX +$ export OCTOMODE_PORTNUMBER=XXX +$ export OCTOMODE_PAD_URL=XXX +$ export OCTOMODE_PAD_API_URL=XXX +$ export OCTOMODE_PAD_API_KEY=XXX ``` -- **OCTOMODE_PORTNUMBER**: optional, default: `5001` -- **OCTOMODE_PAD_URL**: optional, default: `https://pad.vvvvvvaria.org/` -- **OCTOMODE_PAD_API_URL**: optional, default: `https://pad.vvvvvvaria.org/api/1.2.15/` -- **OCTOMODE_PAD_API_KEY**: required, **no default** +- **OCTOMODE_PORTNUMBER**: *optional*, default: `5001` +- **OCTOMODE_PAD_URL**: *optional*, default: `https://pad.vvvvvvaria.org/` +- **OCTOMODE_PAD_API_URL**: *optional*, default: `https://pad.vvvvvvaria.org/api/1.2.15/` +- **OCTOMODE_PAD_API_KEY**: *required*, **no default** (Note: You must provide a value for `OCTOMODE_PAD_API_KEY`.) diff --git a/config.env b/config.env new file mode 100644 index 0000000..4a5d454 --- /dev/null +++ b/config.env @@ -0,0 +1,4 @@ +OCTOMODE_PORTNUMBER=XXX +OCTOMODE_PAD_URL=XXX +OCTOMODE_PAD_API_URL=XXX +OCTOMODE_PAD_API_KEY=XXX