Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ LOGGING_SMTP_CREDENTIALS_EMAIL=alerts@example.com
LOGGING_SMTP_CREDENTIALS_PASSWORD=changeme
LOGGING_SMTP_SECURE=()
LOGGING_SMTP_TIMEOUT=3

CORS_ALLOWED_HOST=https://example.com
9 changes: 9 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"CONTAINER_HOSTING_SSH_SETUP_HANDLER_API_KEY"
)
DOKKU_WRAPPER_FULL_PATH = os.getenv("DOKKU_WRAPPER_FULL_PATH")
CORS_ALLOWED_HOST = os.getenv("CORS_ALLOWED_HOST")
# Default port to 5000
# See https://dokku.com/docs~v0.15.5/networking/port-management/#:~:text=Applications%20not%20using-,EXPOSE,-Any%20application%20that

Expand Down Expand Up @@ -146,6 +147,7 @@ async def homepage(request):
"github_authorize_url_existing_repo": github_authorize_url_existing_repo,
"request": request,
},
headers={"Access-Control-Allow-Origin": CORS_ALLOWED_HOST},
)


Expand Down Expand Up @@ -577,6 +579,13 @@ def add_flask_quickstart():
f"./tmp-cloned-repos/{APP_NAME}/src",
dirs_exist_ok=True,
)
# Embed APP_NAME into deployed app
subprocess.run(
f"sed -i 's/Flaskr/Flaskr {APP_NAME}/g' web/templates/base.html",
shell=True,
cwd=f"./tmp-cloned-repos/{APP_NAME}/src",
)

# add/commit framework files to repo
index = repo.index
index.add([f"{BASE_PATH}tmp-cloned-repos/{APP_NAME}/src/web"])
Expand Down
Loading