mirror of
https://github.com/notherealmarco/SLAACsense.git
synced 2025-03-14 06:06:15 +01:00
Move constants declaration to the beginning
This commit is contained in:
parent
069483a54a
commit
e464b15af4
1 changed files with 9 additions and 20 deletions
29
main.py
29
main.py
|
@ -5,16 +5,15 @@ import requests
|
||||||
import ipaddress
|
import ipaddress
|
||||||
import urllib3
|
import urllib3
|
||||||
|
|
||||||
OPNSENSE_URL = ""
|
OPNSENSE_URL = os.getenv("OPNSENSE_URL", None)
|
||||||
OPNSENSE_API_KEY = ""
|
OPNSENSE_API_KEY = os.getenv("OPNSENSE_API_KEY", None)
|
||||||
OPNSENSE_API_SECRET = ""
|
OPNSENSE_API_SECRET = os.getenv("OPNSENSE_API_SECRET", None)
|
||||||
TECHNITIUM_URL = ""
|
TECHNITIUM_URL = os.getenv("TECHNITIUM_URL", None)
|
||||||
TECHNITIUM_TOKEN = ""
|
TECHNITIUM_TOKEN = os.getenv("TECHNITIUM_TOKEN", None)
|
||||||
IPV6_PREFIX = ""
|
DNS_ZONE_SUBNETS = os.getenv("DNS_ZONE_SUBNETS", None)
|
||||||
DNS_ZONE_SUBNETS = ""
|
DO_V4 = (os.getenv("DO_V4", "false").lower() == "true")
|
||||||
DO_V4 = False
|
VERIFY_HTTPS = (os.getenv("VERIFY_HTTPS", "true").lower() == "true")
|
||||||
VERIFY_HTTPS = False
|
CLOCK = int(os.getenv("CLOCK", "30"))
|
||||||
CLOCK = 30
|
|
||||||
|
|
||||||
|
|
||||||
def get_opnsense_data(path):
|
def get_opnsense_data(path):
|
||||||
|
@ -121,16 +120,6 @@ if __name__ == "__main__":
|
||||||
logging.getLogger().setLevel(os.getenv("LOG_LEVEL", "INFO"))
|
logging.getLogger().setLevel(os.getenv("LOG_LEVEL", "INFO"))
|
||||||
logging.info("loading environment...")
|
logging.info("loading environment...")
|
||||||
|
|
||||||
OPNSENSE_URL = os.getenv("OPNSENSE_URL", None)
|
|
||||||
OPNSENSE_API_KEY = os.getenv("OPNSENSE_API_KEY", None)
|
|
||||||
OPNSENSE_API_SECRET = os.getenv("OPNSENSE_API_SECRET", None)
|
|
||||||
TECHNITIUM_URL = os.getenv("TECHNITIUM_URL", None)
|
|
||||||
TECHNITIUM_TOKEN = os.getenv("TECHNITIUM_TOKEN", None)
|
|
||||||
DNS_ZONE_SUBNETS = os.getenv("DNS_ZONE_SUBNETS", None)
|
|
||||||
DO_V4 = (os.getenv("DO_V4", "false").lower() == "true")
|
|
||||||
VERIFY_HTTPS = (os.getenv("VERIFY_HTTPS", "true").lower() == "true")
|
|
||||||
CLOCK = int(os.getenv("CLOCK", "30"))
|
|
||||||
|
|
||||||
if not verify_env():
|
if not verify_env():
|
||||||
logging.error("Missing mandatory environment variables")
|
logging.error("Missing mandatory environment variables")
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
Loading…
Reference in a new issue