mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
skipped url bugfix in ssowat conf
This commit is contained in:
parent
fe3936e42b
commit
56ee75f256
1 changed files with 8 additions and 27 deletions
|
@ -543,7 +543,7 @@ def app_setting(app, key, value=None):
|
||||||
|
|
||||||
with open(settings_file, 'w') as f:
|
with open(settings_file, 'w') as f:
|
||||||
yaml.safe_dump(app_settings, f, default_flow_style=False)
|
yaml.safe_dump(app_settings, f, default_flow_style=False)
|
||||||
|
|
||||||
|
|
||||||
def app_checkport(port):
|
def app_checkport(port):
|
||||||
"""
|
"""
|
||||||
|
@ -569,7 +569,7 @@ def app_checkurl(url, app=None):
|
||||||
url = url[8:]
|
url = url[8:]
|
||||||
elif "http://" == url[:7]:
|
elif "http://" == url[:7]:
|
||||||
url = url[7:]
|
url = url[7:]
|
||||||
|
|
||||||
if url[-1:] != '/':
|
if url[-1:] != '/':
|
||||||
url = url + '/'
|
url = url + '/'
|
||||||
|
|
||||||
|
@ -600,13 +600,13 @@ def app_checkurl(url, app=None):
|
||||||
def app_initdb(user, password=None, db=None, sql=None):
|
def app_initdb(user, password=None, db=None, sql=None):
|
||||||
"""
|
"""
|
||||||
Create database and initialize it with optionnal attached script
|
Create database and initialize it with optionnal attached script
|
||||||
|
|
||||||
Keyword arguments:
|
Keyword arguments:
|
||||||
user -- Name of the DB user
|
user -- Name of the DB user
|
||||||
password -- Password for the user
|
password -- Password for the user
|
||||||
db -- Database name (optionnal)
|
db -- Database name (optionnal)
|
||||||
sql -- Initial SQL file
|
sql -- Initial SQL file
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if db is None:
|
if db is None:
|
||||||
db = user
|
db = user
|
||||||
|
@ -639,27 +639,9 @@ def app_ssowatconf():
|
||||||
|
|
||||||
with open('/etc/yunohost/current_host', 'r') as f:
|
with open('/etc/yunohost/current_host', 'r') as f:
|
||||||
main_domain = f.readline().rstrip()
|
main_domain = f.readline().rstrip()
|
||||||
|
|
||||||
domains = domain_list()['Domains']
|
domains = domain_list()['Domains']
|
||||||
|
|
||||||
apps = {}
|
|
||||||
for app in os.listdir(apps_setting_path):
|
|
||||||
app_settings = app_info(raw=True, app=app)['settings']
|
|
||||||
if 'domain' in app_settings:
|
|
||||||
if 'path' not in app_settings:
|
|
||||||
app_settings['path'] = '/'
|
|
||||||
if 'mode' not in app_settings:
|
|
||||||
app_settings['mode'] = 'private'
|
|
||||||
if 'allowed_users' not in app_settings:
|
|
||||||
app_settings['allowed_users'] = ''
|
|
||||||
|
|
||||||
apps[app] = {
|
|
||||||
'domain': app_settings['domain'],
|
|
||||||
'path': app_settings['path'],
|
|
||||||
'mode': app_settings['mode'],
|
|
||||||
'allowed_users': app_settings['allowed_users']
|
|
||||||
}
|
|
||||||
|
|
||||||
users = {}
|
users = {}
|
||||||
for user in user_list()['Users']:
|
for user in user_list()['Users']:
|
||||||
users[user['Username']] = app_map(user=user['Username'])
|
users[user['Username']] = app_map(user=user['Username'])
|
||||||
|
@ -676,9 +658,8 @@ def app_ssowatconf():
|
||||||
'Email': 'mail'
|
'Email': 'mail'
|
||||||
},
|
},
|
||||||
'domains': domains,
|
'domains': domains,
|
||||||
'skipped_urls': ['https://'+ main_domain +'/ynhadmin'],
|
'skipped_urls': [main_domain +'/ynhadmin'],
|
||||||
'unprotected_urls': [],
|
'unprotected_urls': [],
|
||||||
'apps': apps,
|
|
||||||
'users': users
|
'users': users
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -785,10 +766,10 @@ def _fetch_app_from_git(app):
|
||||||
url = url + "/archive/"+ str(app_info['git']['revision']) + ".zip"
|
url = url + "/archive/"+ str(app_info['git']['revision']) + ".zip"
|
||||||
if os.system('wget "'+ url +'" -O "'+ app_tmp_folder +'.zip"') == 0:
|
if os.system('wget "'+ url +'" -O "'+ app_tmp_folder +'.zip"') == 0:
|
||||||
return _extract_app_from_file(app_tmp_folder +'.zip', remove=True)
|
return _extract_app_from_file(app_tmp_folder +'.zip', remove=True)
|
||||||
|
|
||||||
app_tmp_folder = install_tmp +'/'+ app
|
app_tmp_folder = install_tmp +'/'+ app
|
||||||
if os.path.exists(app_tmp_folder): shutil.rmtree(app_tmp_folder)
|
if os.path.exists(app_tmp_folder): shutil.rmtree(app_tmp_folder)
|
||||||
|
|
||||||
git_result = os.system('git clone '+ app_info['git']['url'] +' -b '+ app_info['git']['branch'] +' '+ app_tmp_folder)
|
git_result = os.system('git clone '+ app_info['git']['url'] +' -b '+ app_info['git']['branch'] +' '+ app_tmp_folder)
|
||||||
git_result_2 = os.system('cd '+ app_tmp_folder +' && git reset --hard '+ str(app_info['git']['revision']))
|
git_result_2 = os.system('cd '+ app_tmp_folder +' && git reset --hard '+ str(app_info['git']['revision']))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue