mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
change app privacy 'mode'
This commit is contained in:
parent
3ba251e049
commit
8c7405c073
2 changed files with 8 additions and 12 deletions
|
@ -269,12 +269,10 @@ app:
|
||||||
default: "/"
|
default: "/"
|
||||||
-l:
|
-l:
|
||||||
full: --label
|
full: --label
|
||||||
--public:
|
-m:
|
||||||
action: store_true
|
full: --mode
|
||||||
default: false
|
help: level of protectness of the app (public|protected|private)
|
||||||
--protected:
|
default: 'private'
|
||||||
action: store_true
|
|
||||||
default: true
|
|
||||||
|
|
||||||
### app_remove() TODO: Write help
|
### app_remove() TODO: Write help
|
||||||
remove:
|
remove:
|
||||||
|
|
|
@ -141,7 +141,7 @@ def app_list(offset=None, limit=None, filter=None, raw=False):
|
||||||
|
|
||||||
return list_dict
|
return list_dict
|
||||||
|
|
||||||
def app_install(app, domain, path='/', label=None, public=False, protected=True):
|
def app_install(app, domain, path='/', label=None, mode='private'):
|
||||||
"""
|
"""
|
||||||
Install selected app
|
Install selected app
|
||||||
|
|
||||||
|
@ -150,8 +150,7 @@ def app_install(app, domain, path='/', label=None, public=False, protected=True)
|
||||||
domain -- Web domain for the app
|
domain -- Web domain for the app
|
||||||
path -- Subpath of the domain
|
path -- Subpath of the domain
|
||||||
label -- User defined name for the app
|
label -- User defined name for the app
|
||||||
public -- Allow app public access
|
mode -- public|private|protected
|
||||||
protected -- App is protected by the SSO
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Win | Fail
|
Win | Fail
|
||||||
|
@ -227,7 +226,6 @@ def app_install(app, domain, path='/', label=None, public=False, protected=True)
|
||||||
for line in a2_conf_lines:
|
for line in a2_conf_lines:
|
||||||
file.write(line + '\n')
|
file.write(line + '\n')
|
||||||
|
|
||||||
os.system('service apache2 reload')
|
|
||||||
|
|
||||||
# Copy files to the right place
|
# Copy files to the right place
|
||||||
try: os.listdir(apps_path)
|
try: os.listdir(apps_path)
|
||||||
|
@ -239,6 +237,7 @@ def app_install(app, domain, path='/', label=None, public=False, protected=True)
|
||||||
|
|
||||||
os.system('cp -a "'+ app_tmp_folder +'" "'+ app_final_path +'"')
|
os.system('cp -a "'+ app_tmp_folder +'" "'+ app_final_path +'"')
|
||||||
os.system('chown -R www-data: "'+ app_final_path +'"')
|
os.system('chown -R www-data: "'+ app_final_path +'"')
|
||||||
|
if is_webapp: os.system('service apache2 reload')
|
||||||
shutil.rmtree(app_final_path + manifest['yunohost']['script_path'])
|
shutil.rmtree(app_final_path + manifest['yunohost']['script_path'])
|
||||||
|
|
||||||
app_setting_path = apps_setting_path +'/'+ unique_app_id
|
app_setting_path = apps_setting_path +'/'+ unique_app_id
|
||||||
|
@ -255,8 +254,7 @@ def app_install(app, domain, path='/', label=None, public=False, protected=True)
|
||||||
'last_update': manifest['lastUpdate'],
|
'last_update': manifest['lastUpdate'],
|
||||||
'install_time': int(time.time()),
|
'install_time': int(time.time()),
|
||||||
'name': manifest['name'],
|
'name': manifest['name'],
|
||||||
'public': public,
|
'mode': mode,
|
||||||
'protected': protected,
|
|
||||||
'domain': domain,
|
'domain': domain,
|
||||||
'path': path,
|
'path': path,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue