Remove hardcoded paths for logs and frontend host. Add log path option to sample config.toml file.
This commit is contained in:
parent
39cf3bd070
commit
668157c552
|
@ -54,6 +54,12 @@ def load_env():
|
|||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
if os.environ['LOG_PATH'] != "":
|
||||
configdict['log']['log_path'] = os.environ['LOG_PATH']
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
return configdict
|
||||
|
||||
|
||||
|
|
|
@ -14,3 +14,6 @@ mbox_user = "root"
|
|||
|
||||
[database]
|
||||
db_path = "/var/ticketfrei/db.sqlite"
|
||||
|
||||
[log]
|
||||
log_path = "/var/ticketfrei/error.log"
|
||||
|
|
|
@ -265,7 +265,7 @@ def login_mastodon(user):
|
|||
|
||||
|
||||
logger = logging.getLogger()
|
||||
fh = logging.FileHandler('/var/log/ticketfrei/error.log')
|
||||
fh = logging.FileHandler(config['log']['log_path'])
|
||||
fh.setLevel(logging.DEBUG)
|
||||
logger.addHandler(fh)
|
||||
|
||||
|
@ -273,6 +273,6 @@ application = bottle.default_app()
|
|||
bottle.install(SessionPlugin('/'))
|
||||
|
||||
if __name__ == '__main__':
|
||||
bottle.run(host="0.0.0.0", port=config["web"]["port"])
|
||||
bottle.run(host=config["web"]["host"], port=config["web"]["port"])
|
||||
else:
|
||||
application.catchall = False
|
||||
|
|
Loading…
Reference in a new issue