@@ -16,28 +16,33 @@ data = json.load(sys.stdin)
1616
1717# Generate Password
1818
19+
1920def generate_random_password (length ):
2021 # Generate random bytes and convert them to a hexadecimal string
2122 random_bytes = os .urandom (length )
2223 password = random_bytes .hex ()
2324 return password [:length ]
2425
25- #This is specific to you module, so you need to change it accordingly.
26+
27+ # This is specific to you module, so you need to change it accordingly.
2628
2729# configure postgres db variables
28- POSTGRES_USER = "postgres"
29- POSTGRES_PASSWORD = generate_random_password (16 )
30- POSTGRES_DB = "passwordpusher"
30+ POSTGRES_USER = "postgres"
31+ POSTGRES_PASSWORD = generate_random_password (16 )
32+ POSTGRES_DB = "passwordpusher"
3133postgres_config = {
3234 "POSTGRES_USER" : POSTGRES_USER ,
3335 "POSTGRES_PASSWORD" : POSTGRES_PASSWORD ,
34- "POSTGRES_DB" : POSTGRES_DB
36+ "POSTGRES_DB" : POSTGRES_DB ,
3537}
3638agent .write_envfile ("database.env" , postgres_config )
3739# DATABASE_URL: 'postgres://passwordpusher_user:passwordpusher_passwd@postgres:5432/passwordpusher_db'
38- DATABASE_URL = f"postgres://{ POSTGRES_USER } :{ POSTGRES_PASSWORD } @postgresql-app:5432/{ POSTGRES_DB } "
40+ DATABASE_URL = (
41+ f"postgres://{ POSTGRES_USER } :{ POSTGRES_PASSWORD } @postgresql-app:5432/{ POSTGRES_DB } "
42+ )
3943database_url_config = {
40- "DATABASE_URL" : DATABASE_URL
44+ "DATABASE_URL" : DATABASE_URL ,
45+ "SECRET_KEY_BASE" : generate_random_password (64 ),
4146}
4247agent .write_envfile ("database-url.env" , database_url_config )
43- #agent.dump_env()
48+ # agent.dump_env()
0 commit comments