diff --git a/1.Base/4.configuration_webinterface/0_setup.py b/1.Base/4.configuration_webinterface/0_setup.py new file mode 100644 index 0000000000000000000000000000000000000000..75294f2df6d526e9fecc29df572bebea90a0feeb --- /dev/null +++ b/1.Base/4.configuration_webinterface/0_setup.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +import utils + + +def setup(interactive=True): + # Create / update admin account + utils.log('Checking admin account') + cmds = list() + cmds.append('apt-get install python3-ubicast-webconf') + # Set password if any + settings = { + "password": utils.get_conf('WEBCONF_PWD', 'changeme'), + "port": utils.get_conf('WEBCONF_PORT', '9999'), + } + with open('webconf.json.template', 'r') as f: + d = f.read() + with open('/etc/webconf.json', 'w') as f: + f.write(d.format(**settings)) diff --git a/1.Base/4.configuration_webinterface/webconf.json.template b/1.Base/4.configuration_webinterface/webconf.json.template new file mode 100644 index 0000000000000000000000000000000000000000..0de2dbfd8ad36b449e516e625234e780e901b19c --- /dev/null +++ b/1.Base/4.configuration_webinterface/webconf.json.template @@ -0,0 +1,5 @@ +{ + "listen_ip": "0.0.0.0", + "password": "{password}", + "port": {port} +}