File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,3 +61,5 @@ LOGGING_SMTP_CREDENTIALS_EMAIL=alerts@example.com
6161LOGGING_SMTP_CREDENTIALS_PASSWORD = changeme
6262LOGGING_SMTP_SECURE = ()
6363LOGGING_SMTP_TIMEOUT = 3
64+
65+ CORS_ALLOWED_HOST = https://example.com
Original file line number Diff line number Diff line change 5757 "CONTAINER_HOSTING_SSH_SETUP_HANDLER_API_KEY"
5858)
5959DOKKU_WRAPPER_FULL_PATH = os .getenv ("DOKKU_WRAPPER_FULL_PATH" )
60+ CORS_ALLOWED_HOST = os .getenv ("CORS_ALLOWED_HOST" )
6061# Default port to 5000
6162# See https://dokku.com/docs~v0.15.5/networking/port-management/#:~:text=Applications%20not%20using-,EXPOSE,-Any%20application%20that
6263
@@ -146,6 +147,7 @@ async def homepage(request):
146147 "github_authorize_url_existing_repo" : github_authorize_url_existing_repo ,
147148 "request" : request ,
148149 },
150+ headers = {"Access-Control-Allow-Origin" : CORS_ALLOWED_HOST },
149151 )
150152
151153
@@ -577,6 +579,13 @@ def add_flask_quickstart():
577579 f"./tmp-cloned-repos/{ APP_NAME } /src" ,
578580 dirs_exist_ok = True ,
579581 )
582+ # Embed APP_NAME into deployed app
583+ subprocess .run (
584+ f"sed -i 's/Flaskr/Flaskr { APP_NAME } /g' web/templates/base.html" ,
585+ shell = True ,
586+ cwd = f"./tmp-cloned-repos/{ APP_NAME } /src" ,
587+ )
588+
580589 # add/commit framework files to repo
581590 index = repo .index
582591 index .add ([f"{ BASE_PATH } tmp-cloned-repos/{ APP_NAME } /src/web" ])
You can’t perform that action at this time.
0 commit comments