File tree Expand file tree Collapse file tree 1 file changed +19
-17
lines changed Expand file tree Collapse file tree 1 file changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -352,24 +352,26 @@ def modify_hosts_file(self):
352
352
sys .exit (1 )
353
353
354
354
def set_csrf_and_allowed_hosts (self ):
355
- csrf_trusted_origins = json .dumps (
356
- [
357
- self .url ,
358
- ]
359
- )
360
- allowed_hosts = json .dumps ([self .hostname ])
361
-
362
- # Set environment variables
363
- self .plain_env ["PLAIN_CSRF_TRUSTED_ORIGINS" ] = csrf_trusted_origins
364
- self .custom_process_env ["PLAIN_CSRF_TRUSTED_ORIGINS" ] = csrf_trusted_origins
365
-
366
- self .plain_env ["PLAIN_ALLOWED_HOSTS" ] = allowed_hosts
367
- self .custom_process_env ["PLAIN_ALLOWED_HOSTS" ] = allowed_hosts
355
+ if "PLAIN_CSRF_TRUSTED_ORIGINS" not in os .environ :
356
+ csrf_trusted_origins = json .dumps (
357
+ [
358
+ self .url ,
359
+ ]
360
+ )
361
+ self .plain_env ["PLAIN_CSRF_TRUSTED_ORIGINS" ] = csrf_trusted_origins
362
+ self .custom_process_env ["PLAIN_CSRF_TRUSTED_ORIGINS" ] = csrf_trusted_origins
363
+ click .secho (
364
+ f"Automatically set PLAIN_CSRF_TRUSTED_ORIGINS={ csrf_trusted_origins } " ,
365
+ dim = True ,
366
+ )
368
367
369
- click .secho (
370
- f"Automatically set PLAIN_ALLOWED_HOSTS={ allowed_hosts } PLAIN_CSRF_TRUSTED_ORIGINS={ csrf_trusted_origins } " ,
371
- dim = True ,
372
- )
368
+ if "PLAIN_ALLOWED_HOSTS" not in os .environ :
369
+ allowed_hosts = json .dumps ([self .hostname ])
370
+ self .plain_env ["PLAIN_ALLOWED_HOSTS" ] = allowed_hosts
371
+ self .custom_process_env ["PLAIN_ALLOWED_HOSTS" ] = allowed_hosts
372
+ click .secho (
373
+ f"Automatically set PLAIN_ALLOWED_HOSTS={ allowed_hosts } " , dim = True
374
+ )
373
375
374
376
def run_preflight (self ):
375
377
click .echo ()
You can’t perform that action at this time.
0 commit comments