File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 3737 - name : SKIP_CONTROL_URL
3838 value :
3939 " http://haproxy-kubernetes-ingress.default.svc.cluster.local/control"
40+ - name : PG_HOST
41+ value : " rhn-pg.default.svc.cluster.local"
Original file line number Diff line number Diff line change 66import time
77import os
88
9+ SKIP_CONTROL_URL = os .environ .get ("SKIP_CONTROL_URL" )
10+
11+ PG_HOST = os .environ .get ("PG_HOST" , "db" )
12+ PG_PORT = int (os .environ .get ("PG_PORT" , 5432 ))
13+ PG_DATABASE = os .environ .get ("PG_DATABASE" , "postgres" )
14+ PG_USER = os .environ .get ("PG_USER" , "postgres" )
15+ PG_PASSWORD = os .environ .get ("PG_PASSWORD" , "change_me" )
16+
917
1018def get_db ():
1119 conn = psycopg2 .connect (
12- host = "db" ,
13- user = "postgres" ,
14- password = "change_me" ,
20+ host = PG_HOST ,
21+ port = PG_PORT ,
22+ user = PG_USER ,
23+ password = PG_PASSWORD ,
24+ dbname = PG_DATABASE ,
1525 )
16-
1726 return conn
1827
1928
2029app = Flask (__name__ )
21-
2230app .secret_key = b"53cr37_changeme"
2331
24- SKIP_CONTROL_URL = os .environ .get ("SKIP_CONTROL_URL" )
25-
2632
2733@app .before_request
2834def ensure_session_cookie ():
You can’t perform that action at this time.
0 commit comments