Skip to content

Commit

Permalink
Missing properties
Browse files Browse the repository at this point in the history
  • Loading branch information
dchristl committed Dec 30, 2023
1 parent 149a28e commit 09b79c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,4 @@ notes

firmware/nrf5x/_build
firmware/nrf5x/compiled
webserver/data/*.json
webserver/anisette-data/*
!webserver/anisette-data/.gitkeep
webserver/mh_data/*
!webserver/mh_data/.gitkeep
endpoint/data/*.json
4 changes: 4 additions & 0 deletions endpoint/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ def getUser():
def getPass():
return config.get('Settings', 'pass', fallback=None)


def getAnisetteServer():
return config.get('Settings', 'anisette_url', fallback='http://anisette:6969')

def getPort():
return int(config.get('Settings', 'port', fallback='6176'))


def getConfigFile():
return getConfigPath() + '/' + CONFIG_FILE
Expand Down
6 changes: 3 additions & 3 deletions endpoint/mh_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def getAuth(regenerate=False, second_factor='sms'):


Handler = ServerHandler
httpd = HTTPServer(('0.0.0.0', config.PORT), Handler)
httpd = HTTPServer(('0.0.0.0', config.getPort()), Handler)
if os.path.isfile(config.getCertFile()):
logger.info("Certificate file " + config.getCertFile() + " exists, so using SSL")
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
Expand All @@ -137,11 +137,11 @@ def getAuth(regenerate=False, second_factor='sms'):

httpd.socket = ssl_context.wrap_socket(httpd.socket, server_side=True)

logger.info("serving at port " + str(config.PORT) + " over HTTPS")
logger.info("serving at port " + str(config.getPort()) + " over HTTPS")
else:
logger.info("Certificate file " + config.getCertFile() +
" not found, so not using SSL")
logger.info("serving at port " + str(config.PORT) + " over HTTP")
logger.info("serving at port " + str(config.getPort()) + " over HTTP")

try:
httpd.serve_forever()
Expand Down

0 comments on commit 09b79c7

Please sign in to comment.