mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: env content_delivery_type variable
This commit is contained in:
parent
746c20d46c
commit
6d97aa2072
3 changed files with 3 additions and 6 deletions
|
|
@ -128,9 +128,8 @@ def get_learnhouse_config() -> LearnHouseConfig:
|
||||||
cookie_config = CookieConfig(domain=cookies_domain)
|
cookie_config = CookieConfig(domain=cookies_domain)
|
||||||
|
|
||||||
env_content_delivery_type = os.environ.get("LEARNHOUSE_CONTENT_DELIVERY_TYPE")
|
env_content_delivery_type = os.environ.get("LEARNHOUSE_CONTENT_DELIVERY_TYPE")
|
||||||
content_delivery_type: str = (
|
content_delivery_type: str = env_content_delivery_type or (
|
||||||
(yaml_config.get("hosting_config", {}).get("content_delivery", {}).get("type"))
|
(yaml_config.get("hosting_config", {}).get("content_delivery", {}).get("type"))
|
||||||
or env_content_delivery_type
|
|
||||||
or "filesystem"
|
or "filesystem"
|
||||||
) # default to filesystem
|
) # default to filesystem
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,6 @@ security:
|
||||||
hosting_config:
|
hosting_config:
|
||||||
domain: learnhouse.app
|
domain: learnhouse.app
|
||||||
ssl: true
|
ssl: true
|
||||||
allowed_origins:
|
|
||||||
- http://localhost:3000
|
|
||||||
- http://localhost:3001
|
|
||||||
cookies_config:
|
cookies_config:
|
||||||
domain: ".localhost"
|
domain: ".localhost"
|
||||||
allowed_regexp: '\b((?:https?://)[^\s/$.?#].[^\s]*)\b'
|
allowed_regexp: '\b((?:https?://)[^\s/$.?#].[^\s]*)\b'
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ async def upload_content(
|
||||||
elif content_delivery == "s3api":
|
elif content_delivery == "s3api":
|
||||||
# Upload to server then to s3 (AWS Keys are stored in environment variables and are loaded by boto3)
|
# Upload to server then to s3 (AWS Keys are stored in environment variables and are loaded by boto3)
|
||||||
# TODO: Improve implementation of this
|
# TODO: Improve implementation of this
|
||||||
|
print("Uploading to s3...")
|
||||||
s3 = boto3.client(
|
s3 = boto3.client(
|
||||||
"s3",
|
"s3",
|
||||||
endpoint_url=learnhouse_config.hosting_config.content_delivery.s3api.endpoint_url,
|
endpoint_url=learnhouse_config.hosting_config.content_delivery.s3api.endpoint_url,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue