2021-03-15 21:51:51 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import argparse
|
|
|
|
|
|
|
|
from imaginaerraum_door_admin.webapp import create_application
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser()
|
2021-04-10 11:46:56 +00:00
|
|
|
parser.add_argument("--key_file", default='/root/flask_keys', help="Path to file with Flask SECRET_KEY and SECURITY_PASSWORD_SALT")
|
2021-03-15 21:51:51 +00:00
|
|
|
parser.add_argument("--token_file", default="/etc/door_tokens", help="path to the file with door tokens and users")
|
2021-03-21 14:53:33 +00:00
|
|
|
parser.add_argument("--nfc_socket", default="/tmp/nfc.sock", help="socket for handling NFC reader commands")
|
2021-03-15 21:51:51 +00:00
|
|
|
parser.add_argument("--template_folder", default="templates", help="path to Flask templates folder")
|
|
|
|
parser.add_argument("--static_folder", default="static", help="path to Flask static folder")
|
2021-08-23 18:30:50 +00:00
|
|
|
parser.add_argument("--admin_file", default="/etc/admins.conf", help="Path to file for creating super admin users")
|
2021-04-10 15:25:27 +00:00
|
|
|
parser.add_argument("--log_file", default="/var/log/webinterface.log", help="Path to flask log file")
|
|
|
|
parser.add_argument("--nfc_log", default="/var/log/nfc.log", help="Path to nfc log file")
|
2021-04-06 20:40:02 +00:00
|
|
|
parser.add_argument("--ldap_url", default="ldaps://ldap.imaginaerraum.de",
|
2021-03-22 20:22:51 +00:00
|
|
|
help="URL for LDAP server for alternative user authorization")
|
2021-03-15 21:51:51 +00:00
|
|
|
parser.add_argument("--mqtt_host", default="10.10.21.2", help="IP address of MQTT broker")
|
2021-04-10 11:46:56 +00:00
|
|
|
parser.add_argument("--flask_port", default=80, help="Port for running the Flask server")
|
2021-03-15 21:51:51 +00:00
|
|
|
parser.add_argument("--mail_server", default="smtp.googlemail.com", help="email server for sending security messages")
|
|
|
|
parser.add_argument("--mail_port", default=465, help="port for security email server")
|
|
|
|
parser.add_argument("--mail_use_tls", default=False, help="use TLS for security emails")
|
|
|
|
parser.add_argument("--mail_use_ssl", default=True, help="use SSL for security emails")
|
|
|
|
parser.add_argument("--mail_username", default="admin@example.com", help="email account for sending security messages")
|
|
|
|
parser.add_argument("--mail_password", default="password", help="Password for email account")
|
|
|
|
config = parser.parse_args()
|
|
|
|
|
|
|
|
app = create_application(config)
|
2021-04-10 11:46:56 +00:00
|
|
|
app.run(host='0.0.0.0', port=config.flask_port)
|