From 0399f9953796bc258ee12bfdf3fd04302617ec9f Mon Sep 17 00:00:00 2001 From: titoko titoko Date: Tue, 3 Dec 2013 17:45:15 +0100 Subject: [PATCH 1/3] yunohost app skipped_uri --- yunohost_app.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/yunohost_app.py b/yunohost_app.py index 5ba9c169..24e5688e 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -686,6 +686,17 @@ def app_ssowatconf(): for user in user_list()['Users']: users[user['Username']] = app_map(user=user['Username']) + skipped_uri=[] + apps={} + for app in app_list()['Apps']: + with open(apps_setting_path + app['ID'] +'/settings.yml') as f: + app_settings = yaml.load(f) + if 'skipped_uris' in app_settings: + skipped_uri=[app_settings['domain'] + app_settings['path'][:-1] + item for item in app_settings['skipped_uris'].split(',')] + + for domain in domains: + skipped_uri.extend([domain +'/ynhadmin', domain +'/ynhapi']) + conf_dict = { 'portal_domain': main_domain, 'portal_path': '/ynhsso/', @@ -698,7 +709,7 @@ def app_ssowatconf(): 'Email': 'mail' }, 'domains': domains, - 'skipped_urls': [main_domain +'/ynhadmin', main_domain +'/ynhapi'], + 'skipped_urls': skipped_uri, 'unprotected_urls': [], 'users': users } From b333c5e5b481a3a6834a5a361fc3a5e38db0c4ed Mon Sep 17 00:00:00 2001 From: titoko Date: Tue, 3 Dec 2013 20:54:56 +0100 Subject: [PATCH 2/3] fix custom app --- yunohost_app.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yunohost_app.py b/yunohost_app.py index 24e5688e..4c2bb197 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -148,7 +148,9 @@ def app_list(offset=None, limit=None, filter=None, raw=False): if original_app in app_dict: app_dict[app] = app_dict[original_app] continue - app_dict[app] = { 'orphan': True } + with open( apps_setting_path + app +'/manifest.json') as json_manifest: + app_dict[app] = {"manifest":json.loads(str(json_manifest.read()))} + app_dict[app]['manifest']['orphan']=True#{ 'orphan': True } if len(app_dict) > (0 + offset) and limit > 0: sorted_app_dict = {} @@ -409,11 +411,13 @@ def app_install(app, label=None, args=None): except: args_dict = {} + # Execute App install script os.system('chown -hR admin: '+ install_tmp) + # Move scripts and manifest to the right place + os.system('cp '+ app_tmp_folder +'/manifest.json ' + app_setting_path) + os.system('cp -R ' + app_tmp_folder +'/scripts '+ app_setting_path) if hook_exec(app_tmp_folder + '/scripts/install', args_dict) == 0: - # Move scripts and manifest to the right place - os.system('mv "'+ app_tmp_folder +'/manifest.json" "'+ app_tmp_folder +'/scripts" '+ app_setting_path) shutil.rmtree(app_tmp_folder) os.system('chmod -R 400 '+ app_setting_path) os.system('chown -R root: '+ app_setting_path) @@ -685,7 +689,7 @@ def app_ssowatconf(): users = {} for user in user_list()['Users']: users[user['Username']] = app_map(user=user['Username']) - + skipped_uri=[] apps={} for app in app_list()['Apps']: @@ -697,6 +701,7 @@ def app_ssowatconf(): for domain in domains: skipped_uri.extend([domain +'/ynhadmin', domain +'/ynhapi']) + conf_dict = { 'portal_domain': main_domain, 'portal_path': '/ynhsso/', From acb4094193219d45c2790904a95378705cf97da5 Mon Sep 17 00:00:00 2001 From: titoko Date: Tue, 3 Dec 2013 21:02:34 +0100 Subject: [PATCH 3/3] Update yunohost_app.py --- yunohost_app.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/yunohost_app.py b/yunohost_app.py index 4c2bb197..956884d4 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -150,7 +150,7 @@ def app_list(offset=None, limit=None, filter=None, raw=False): continue with open( apps_setting_path + app +'/manifest.json') as json_manifest: app_dict[app] = {"manifest":json.loads(str(json_manifest.read()))} - app_dict[app]['manifest']['orphan']=True#{ 'orphan': True } + app_dict[app]['manifest']['orphan']=True if len(app_dict) > (0 + offset) and limit > 0: sorted_app_dict = {} @@ -411,7 +411,6 @@ def app_install(app, label=None, args=None): except: args_dict = {} - # Execute App install script os.system('chown -hR admin: '+ install_tmp) # Move scripts and manifest to the right place @@ -689,7 +688,7 @@ def app_ssowatconf(): users = {} for user in user_list()['Users']: users[user['Username']] = app_map(user=user['Username']) - + skipped_uri=[] apps={} for app in app_list()['Apps']: @@ -701,7 +700,6 @@ def app_ssowatconf(): for domain in domains: skipped_uri.extend([domain +'/ynhadmin', domain +'/ynhapi']) - conf_dict = { 'portal_domain': main_domain, 'portal_path': '/ynhsso/',