mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Check if installed
This commit is contained in:
parent
5568743006
commit
75fb9d5a8a
1 changed files with 3 additions and 1 deletions
|
@ -19,6 +19,7 @@ if not __debug__:
|
||||||
gettext.install('YunoHost')
|
gettext.install('YunoHost')
|
||||||
|
|
||||||
dev = False
|
dev = False
|
||||||
|
installed = True
|
||||||
action_dict = {}
|
action_dict = {}
|
||||||
api = APIResource()
|
api = APIResource()
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ def http_exec(request, **kwargs):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
# Simple HTTP auth
|
# Simple HTTP auth
|
||||||
else:
|
elif installed:
|
||||||
authorized = request.getUser() == 'admin'
|
authorized = request.getUser() == 'admin'
|
||||||
pwd = request.getPassword()
|
pwd = request.getPassword()
|
||||||
if dev and 'api_key' in request.args:
|
if dev and 'api_key' in request.args:
|
||||||
|
@ -203,6 +204,7 @@ def main():
|
||||||
try:
|
try:
|
||||||
with open('/etc/yunohost/installed') as f: pass
|
with open('/etc/yunohost/installed') as f: pass
|
||||||
except IOError:
|
except IOError:
|
||||||
|
installed = False
|
||||||
api = APIResource()
|
api = APIResource()
|
||||||
api.register('POST', '/postinstall', http_exec)
|
api.register('POST', '/postinstall', http_exec)
|
||||||
api.register('OPTIONS', '/postinstall', http_exec)
|
api.register('OPTIONS', '/postinstall', http_exec)
|
||||||
|
|
Loading…
Reference in a new issue