added capability to run a dev container for pa, and if we re-build we create a new .sk and remove old PA_UserState on fresh login. BUG-120 is either fixed by this or at least the log catches it and does not crash now (if we rebuild between re-use)

This commit is contained in:
2024-03-10 23:52:34 +11:00
parent 2665ab086e
commit d86893875d
5 changed files with 29 additions and 16 deletions

View File

@@ -24,7 +24,6 @@ class PA:
hostname = socket.gethostname()
PROD_HOST="pa_web"
# dict to store name of icon in icons.svg so we can use by referece in html
ICON={}
@@ -43,7 +42,7 @@ if hostname == "lappy":
PA_EXIF_AUTOROTATE = './utils/pa_exifautotran'
PA_EXIF_ROTATER = './utils/pa_rotate'
# if we dont set the env or we are explicitly DEV, run web server on localhost & db on mara (port 65432)
elif 'ENV' not in os.environ or os.environ['ENV'] == "development":
elif 'ENV' not in os.environ or os.environ['ENV'] == "development" or os.environ['ENV'] == "container":
PA_JOB_MANAGER_HOST="localhost"
DB_URL = 'postgresql+psycopg2://pa:for_now_pa@mara.ddp.net:65432/pa'
PA_EXIF_AUTOROTATE = './utils/pa_exifautotran'
@@ -56,6 +55,10 @@ elif os.environ['ENV'] == "production":
PA_EXIF_ROTATER = '/code/utils/pa_rotate'
else:
print( "ERROR: I do not know which environment (development, etc.) and which DB (on which host to use)" )
if 'ENV' not in os.environ:
print( f"ERROR: no ENV variable set in the environment" )
else:
print( f"ERROR: ENV is {os.environ['ENV']}" )
exit( -1 )
# PORT number we connect to the pa_job_manager on - by default it runs on the