Moved repo url and email for letsencrypt to env variables
All checks were successful
AWS Deploy on Push / build (push) Successful in 4m15s
All checks were successful
AWS Deploy on Push / build (push) Successful in 4m15s
This commit is contained in:
26
app.py
26
app.py
@@ -10,24 +10,30 @@ freedns_user = os.environ.get("FREEDNS_User")
|
||||
freedns_password = os.environ.get("FREEDNS_Password")
|
||||
domain_name = os.environ.get("DOMAIN_NAME")
|
||||
ssh_public_key = os.environ.get("SSH_PUBLIC_KEY")
|
||||
repo_url = os.environ.get("REPO_URL")
|
||||
letsencrypt_email = os.environ.get("LETSENCRYPT_EMAIL")
|
||||
|
||||
if not freedns_user or not freedns_password:
|
||||
raise ValueError("FREEDNS_User and FREEDNS_Password environment variables must be set.")
|
||||
required_vars = {
|
||||
"FREEDNS_User": freedns_user,
|
||||
"FREEDNS_Password": freedns_password,
|
||||
"DOMAIN_NAME": domain_name,
|
||||
"SSH_PUBLIC_KEY": ssh_public_key,
|
||||
"REPO_URL": repo_url,
|
||||
"LETSENCRYPT_EMAIL": letsencrypt_email
|
||||
}
|
||||
|
||||
if not domain_name:
|
||||
raise ValueError("DOMAIN_NAME environment variable must be set.")
|
||||
|
||||
if not ssh_public_key: # Check if SSH public key is set
|
||||
raise ValueError("SSH_PUBLIC_KEY environment variable must be set.")
|
||||
# Check for missing required variables
|
||||
missing_vars = [k for k, v in required_vars.items() if not v]
|
||||
if missing_vars:
|
||||
raise ValueError(f"Missing required environment variables: {', '.join(missing_vars)}")
|
||||
|
||||
IptvUpdaterStack(app, "IptvUpdaterStack",
|
||||
freedns_user=freedns_user,
|
||||
freedns_password=freedns_password,
|
||||
domain_name=domain_name,
|
||||
ssh_public_key=ssh_public_key,
|
||||
# If you don't specify 'env', the stack will be deployed to the account and region that are
|
||||
# configured in your AWS CLI profile. Defaulting to the environment where the CLI is configured.
|
||||
# env=cdk.Environment(account=os.getenv('CDK_DEFAULT_ACCOUNT'), region=os.getenv('CDK_DEFAULT_REGION')),
|
||||
repo_url=repo_url,
|
||||
letsencrypt_email=letsencrypt_email
|
||||
)
|
||||
|
||||
app.synth()
|
||||
Reference in New Issue
Block a user