Add domain_root_only restriction to app manifests

And add app label to app map
This commit is contained in:
Nicolas 2013-07-23 19:28:44 +02:00
parent 81b460f74d
commit 44eca531a2

View file

@ -221,6 +221,7 @@ def app_map(app=None, raw=False):
'label': app_settings['label'], 'label': app_settings['label'],
'uid': app_settings['uid'], 'uid': app_settings['uid'],
'instance': app_settings['instance'], 'instance': app_settings['instance'],
'mode': app_settings['mode'],
} }
else: else:
result['https://'+app_settings['domain']+app_settings['path']] = app_settings['label'] result['https://'+app_settings['domain']+app_settings['path']] = app_settings['label']
@ -408,6 +409,9 @@ def app_install(app, domain, path='/', label=None, mode='private'):
if app_path in path and app_path.count('/') < path.count('/'): if app_path in path and app_path.count('/') < path.count('/'):
raise YunoHostError(1, _("Unable to install app at this location")) raise YunoHostError(1, _("Unable to install app at this location"))
if path != '/' and lvl(manifest, 'yunohost', 'webapp', 'domain_root_only') and is_true(manifest['yunohost']['domain_root_only']):
raise YunoHostError(1, _("App must be installed to domain root"))
########################################## ##########################################
# Fetch or extract sources # # Fetch or extract sources #