mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
apache app conf
This commit is contained in:
parent
ae2e728c82
commit
842ec27a48
1 changed files with 15 additions and 8 deletions
|
@ -13,6 +13,7 @@ from yunohost_domain import domain_list, domain_add
|
||||||
repo_path = '/var/cache/yunohost/repo'
|
repo_path = '/var/cache/yunohost/repo'
|
||||||
apps_path = '/usr/share/yunohost/apps'
|
apps_path = '/usr/share/yunohost/apps'
|
||||||
apps_setting_path= '/etc/yunohost/apps/'
|
apps_setting_path= '/etc/yunohost/apps/'
|
||||||
|
a2_settings_path = '/etc/yunohost/apache/domains/'
|
||||||
install_tmp = '/tmp/yunohost/install'
|
install_tmp = '/tmp/yunohost/install'
|
||||||
app_tmp_folder = install_tmp + '/from_file'
|
app_tmp_folder = install_tmp + '/from_file'
|
||||||
|
|
||||||
|
@ -197,14 +198,7 @@ def app_install(app, domain, path='/', label=None, public=False, protected=True)
|
||||||
if 'script_path' in manifest['yunohost']:
|
if 'script_path' in manifest['yunohost']:
|
||||||
_exec_app_script(step='install', path=app_tmp_folder +'/'+ manifest['yunohost']['script_path'], var_dict=script_var_dict, app_type=manifest['type'])
|
_exec_app_script(step='install', path=app_tmp_folder +'/'+ manifest['yunohost']['script_path'], var_dict=script_var_dict, app_type=manifest['type'])
|
||||||
|
|
||||||
if is_webapp:
|
if is_webapp: domain_add([domain], web=True)
|
||||||
# Handle domain if ain't already created
|
|
||||||
try:
|
|
||||||
domain_list(filter="virtualdomain="+ domain)
|
|
||||||
except YunoHostError:
|
|
||||||
domain_add([domain], web=True)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Copy files to the right place
|
# Copy files to the right place
|
||||||
try: os.listdir(apps_path)
|
try: os.listdir(apps_path)
|
||||||
|
@ -221,6 +215,19 @@ def app_install(app, domain, path='/', label=None, public=False, protected=True)
|
||||||
|
|
||||||
app_setting_path = apps_setting_path +'/'+ unique_app_id
|
app_setting_path = apps_setting_path +'/'+ unique_app_id
|
||||||
|
|
||||||
|
# Customize apache conf
|
||||||
|
a2_conf_lines = [
|
||||||
|
'Alias '+ path +' '+ app_final_path +'/'+ manifest['launch_path']
|
||||||
|
]
|
||||||
|
|
||||||
|
a2_conf_file = a2_settings_path +'/'+ domain +'.d/'+ unique_app_id +'.app.conf'
|
||||||
|
if os.path.exists(a2_conf_file): os.remove(a2_conf_file)
|
||||||
|
|
||||||
|
with open(a2_conf_file, 'a') as file:
|
||||||
|
for line in a2_conf_lines:
|
||||||
|
file.write(line + '\n')
|
||||||
|
|
||||||
|
|
||||||
# TMP: Remove old settings
|
# TMP: Remove old settings
|
||||||
if os.path.exists(app_setting_path): shutil.rmtree(app_setting_path)
|
if os.path.exists(app_setting_path): shutil.rmtree(app_setting_path)
|
||||||
os.makedirs(app_setting_path)
|
os.makedirs(app_setting_path)
|
||||||
|
|
Loading…
Add table
Reference in a new issue