Fix in apache
This commit is contained in:
parent
d3bc7701d2
commit
0eb82d0f86
2 changed files with 20 additions and 10 deletions
13
admin/app.py
13
admin/app.py
|
|
@ -35,6 +35,11 @@ t.env.directories=admin_t.env.directories
|
||||||
t.env.directories.insert(1, os.path.dirname(__file__).replace('/admin', '')+'/templates/admin')
|
t.env.directories.insert(1, os.path.dirname(__file__).replace('/admin', '')+'/templates/admin')
|
||||||
t.env.directories.insert(2, '../pastafari2/templates/admin')
|
t.env.directories.insert(2, '../pastafari2/templates/admin')
|
||||||
|
|
||||||
|
system_path='./ssh/'
|
||||||
|
|
||||||
|
if hasattr(config, 'pastafari_system_path'):
|
||||||
|
system_path=config.pastafari_system_path
|
||||||
|
|
||||||
@admin_app.route('/webservers/servers/')
|
@admin_app.route('/webservers/servers/')
|
||||||
def webservers():
|
def webservers():
|
||||||
|
|
||||||
|
|
@ -505,7 +510,7 @@ def save_virtualhost():
|
||||||
|
|
||||||
#user=config_task.remote_user
|
#user=config_task.remote_user
|
||||||
|
|
||||||
ssh_key_priv='./ssh/id_rsa'
|
ssh_key_priv=system_path+'id_rsa'
|
||||||
|
|
||||||
#run_task(self, server, path, name_task, codename_task, description_task, data={}, user='', password='', where_sql_server='', url='', ssh_key_priv='', ssh_key_password='', send_task=True)
|
#run_task(self, server, path, name_task, codename_task, description_task, data={}, user='', password='', where_sql_server='', url='', ssh_key_priv='', ssh_key_password='', send_task=True)
|
||||||
# user=user, password='', where_sql_server=where_sql, ssh_key_priv=ssh_key_priv, url='', data=data, send_task=True
|
# user=user, password='', where_sql_server=where_sql, ssh_key_priv=ssh_key_priv, url='', data=data, send_task=True
|
||||||
|
|
@ -603,7 +608,7 @@ def delete_virtualhost():
|
||||||
|
|
||||||
sshtask=SSHTask(db)
|
sshtask=SSHTask(db)
|
||||||
|
|
||||||
ssh_key_priv='./ssh/id_rsa'
|
ssh_key_priv=system_path+'id_rsa'
|
||||||
|
|
||||||
if not sshtask.run_task(arr_server['ip'], 'modules.apache.tasks.apache.apache.delete_vhost', 'Remove Apache virtualhost', 'remove_apache_virtualhost', 'Task for remove a virtualhost to Apache Server', {'domain': domain, 'email': config.portal_email, 'webserver_id': arr_webserver['id'], 'user': username, 'root_dir': root_dir, 'cgi_type': ''}, config_task.remote_user, '', '', url_for('admin_app.virtualhost', webserver_id=webserver_id), ssh_key_priv=ssh_key_priv, ssh_key_password='', send_task=True, ssh_port=arr_server['ssh_port']):
|
if not sshtask.run_task(arr_server['ip'], 'modules.apache.tasks.apache.apache.delete_vhost', 'Remove Apache virtualhost', 'remove_apache_virtualhost', 'Task for remove a virtualhost to Apache Server', {'domain': domain, 'email': config.portal_email, 'webserver_id': arr_webserver['id'], 'user': username, 'root_dir': root_dir, 'cgi_type': ''}, config_task.remote_user, '', '', url_for('admin_app.virtualhost', webserver_id=webserver_id), ssh_key_priv=ssh_key_priv, ssh_key_password='', send_task=True, ssh_port=arr_server['ssh_port']):
|
||||||
|
|
||||||
|
|
@ -875,7 +880,7 @@ def save_edit_virtualhost():
|
||||||
|
|
||||||
#user=config_task.remote_user
|
#user=config_task.remote_user
|
||||||
|
|
||||||
ssh_key_priv='./ssh/id_rsa'
|
ssh_key_priv=system_path+'id_rsa'
|
||||||
|
|
||||||
#run_task(self, server, path, name_task, codename_task, description_task, data={}, user='', password='', where_sql_server='', url='', ssh_key_priv='', ssh_key_password='', send_task=True)
|
#run_task(self, server, path, name_task, codename_task, description_task, data={}, user='', password='', where_sql_server='', url='', ssh_key_priv='', ssh_key_password='', send_task=True)
|
||||||
# user=user, password='', where_sql_server=where_sql, ssh_key_priv=ssh_key_priv, url='', data=data, send_task=True
|
# user=user, password='', where_sql_server=where_sql, ssh_key_priv=ssh_key_priv, url='', data=data, send_task=True
|
||||||
|
|
@ -951,7 +956,7 @@ def change_user_password():
|
||||||
|
|
||||||
sshtask=SSHTask(db)
|
sshtask=SSHTask(db)
|
||||||
|
|
||||||
ssh_key_priv='./ssh/id_rsa'
|
ssh_key_priv=system_path+'id_rsa'
|
||||||
|
|
||||||
#'password': password
|
#'password': password
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,20 +5,25 @@
|
||||||
</%block>
|
</%block>
|
||||||
<%block name="content">
|
<%block name="content">
|
||||||
<h3>${hostname}</h3>
|
<h3>${hostname}</h3>
|
||||||
<p><a href="${url_for('admin_app.webservers')}">${lang('webservers', 'webservers_list', 'Webservers list')}</a> >> ${lang('webservers', 'websites', 'Websites')}</p>
|
<p>${_('Filter by user')}:
|
||||||
<p><a href="${url_for('admin_app.add_virtualhost', webserver_id=webserver_id)}">${lang('webservers', 'add_new_website', 'Add new website')}</a><!-- - <a href="${url_for('admin_app.users_list')}">${lang('webservers', 'webserver_users', 'Webserver users')}</a>--></p>
|
<select name="user_vhost">
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</p>
|
||||||
|
<p><a href="${url_for('admin_app.webservers')}">${_('Webservers list')}</a> >> ${_('Websites')}</p>
|
||||||
|
<p><a href="${url_for('admin_app.add_virtualhost', webserver_id=webserver_id)}">${_('Add new website')}</a><!-- - <a href="${url_for('admin_app.users_list')}">${lang('webservers', 'webserver_users', 'Webserver users')}</a>--></p>
|
||||||
<div id="table_servers">
|
<div id="table_servers">
|
||||||
</div>
|
</div>
|
||||||
<p><a href="${url_for('admin_app.webservers')}">${lang('webservers', 'webservers_list', 'Webservers list')}</a> >> ${lang('webservers', 'websites', 'Websites')}</p>
|
<p><a href="${url_for('admin_app.webservers')}">${_('Webservers list')}</a> >> ${_('Websites')}</p>
|
||||||
<div id="popup_change" style="display:none;">
|
<div id="popup_change" style="display:none;">
|
||||||
<div class="title title_popup" style="">
|
<div class="title title_popup" style="">
|
||||||
${lang('webservers', 'change_user_ssh_key', 'Change user ssh key for access')} <a href="#" class="close_icon close_popup"><i class="fa fa-window-close" aria-hidden="true"></i></a>
|
${lang('webservers', 'change_user_ssh_key', 'Change user ssh key for access')} <a href="#" class="close_icon close_popup"><i class="fa fa-window-close" aria-hidden="true"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="cont cont_popup" style="">
|
<div class="cont cont_popup" style="">
|
||||||
${lang('webservers', 'explain_change_ssh_access', 'If you want SSH access with this user, you can add a ssh pub key here.')}
|
${_('If you want SSH access with this user, you can add a ssh pub key here.')}
|
||||||
<form method="post" action="" id="form_change_password">
|
<form method="post" action="" id="form_change_password">
|
||||||
<div class="form">
|
<div class="form">
|
||||||
<p><label for="username">${lang('webservers', 'username', 'Username')}:</label> <span id="username_label"></span><input type="hidden" name="user" id="user_form" value=""/></p>
|
<p><label for="username">${_('Username')}:</label> <span id="username_label"></span><input type="hidden" name="user" id="user_form" value=""/></p>
|
||||||
<!--<p><label>User password
|
<!--<p><label>User password
|
||||||
<i class="fa fa-question-circle tooltip" data-tooltip-content="#tooltip_password_content" style="cursor:pointer;"></i>
|
<i class="fa fa-question-circle tooltip" data-tooltip-content="#tooltip_password_content" style="cursor:pointer;"></i>
|
||||||
|
|
||||||
|
|
@ -29,7 +34,7 @@
|
||||||
<p><label>Repeat User password</label><input type="password" class="" name="repeat_password" id="repeat_password_form" value="" /> <span class="error" id="repeat_password_error"></span></p>-->
|
<p><label>Repeat User password</label><input type="password" class="" name="repeat_password" id="repeat_password_form" value="" /> <span class="error" id="repeat_password_error"></span></p>-->
|
||||||
<p><label>SSH Pub Key</label><textarea name="ssh_pub_key" id="ssh_pub_key"></textarea></span><span class="error" id="ssh_pub_key_error"></span></p>
|
<p><label>SSH Pub Key</label><textarea name="ssh_pub_key" id="ssh_pub_key"></textarea></span><span class="error" id="ssh_pub_key_error"></span></p>
|
||||||
</div>
|
</div>
|
||||||
<input type="submit" value="${lang('webservers', 'change_ssh_key', 'Change SSH key')}" />
|
<input type="submit" value="${_('Change SSH key')}" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue