Skip to content

Commit

Permalink
config: create folders in cwd
Browse files Browse the repository at this point in the history
Use the current working directory by default rather than the instance
path. Real deployments should change these values.

Also disable DEBUG mode by defaults as it's currently not used anywhere.

Since the path are now of type Path, create those.

Signed-off-by: Paul Spooren <mail@aparcar.org>
  • Loading branch information
aparcar committed Apr 13, 2021
1 parent 144deea commit ff86e0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion asu/asu.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create_app(test_config: dict = None) -> Flask:
app.config.from_mapping(test_config)

for option, value in app.config.items():
if option.endswith("_PATH") and isinstance(value, str):
if option.endswith("_PATH") and isinstance(value, (Path, str)):
app.config[option] = Path(value)
app.config[option].mkdir(parents=True, exist_ok=True)

Expand Down
15 changes: 12 additions & 3 deletions misc/config.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# where to store created images
# STORE_PATH="/var/asu/public/store",
from pathlib import Path

# disable test and debug features
TESTING = False
DEBUG = True
DEBUG = False

CA_PUBKEY = "RWSGJBpwejDLf4OApA5SOavh0GBlBFY9FhqxnivUQHpi0/t0QRI98LPW"

# where to find the ImageBuildes
UPSTREAM_URL = "https://downloads.cdn.openwrt.org"


# where to store created images
STORE_PATH = Path.cwd() / "public/store/"

# where to store JSON files
JSON_PATH = Path.cwd() / "public/json/"

# where to store ImageBuilders
CACHE_PATH = Path.cwd() / "cache/"

# supported versions
BRANCHES = [
{
Expand Down

0 comments on commit ff86e0d

Please sign in to comment.