Fixes for archlinux
This commit is contained in:
parent
1700734c2a
commit
04ddeb761e
6 changed files with 55 additions and 11 deletions
|
|
@ -528,7 +528,7 @@ def pastafari2_make_task():
|
||||||
if config.reloader:
|
if config.reloader:
|
||||||
reload(task_execute)
|
reload(task_execute)
|
||||||
|
|
||||||
task_first=task_execute.ServerTask('', db, remote_user='root', remote_password='', private_key='./ssh/id_rsa', password_key='', remote_path='pastafari2', task_id=0, data={})
|
task_first=task_execute.ServerTask('', db, remote_user='root', remote_password='', private_key='./ssh/id_rsa', password_key='', remote_path='pastafari2', task_id=0, data=dict(request.args))
|
||||||
|
|
||||||
send_task=request.args.get('send_task', '')
|
send_task=request.args.get('send_task', '')
|
||||||
|
|
||||||
|
|
@ -550,17 +550,17 @@ def pastafari2_make_task():
|
||||||
|
|
||||||
if hasattr(task_first, 'form'):
|
if hasattr(task_first, 'form'):
|
||||||
|
|
||||||
url_exec=url_for('.pastafari2_make_task', send_task=1)
|
url_exec=url_for('.pastafari2_make_task', send_task=1, **request.args)
|
||||||
|
|
||||||
links='<a href="'+url_for('admin_app.pastafari2_dashboard')+'">'+I18n.lang('pastafari2', 'servers', 'Servers')+'</a>'
|
links='<a href="'+url_for('admin_app.pastafari2_dashboard')+'">'+I18n.lang('pastafari2', 'servers', 'Servers')+'</a>'
|
||||||
|
|
||||||
path_module='admin_app.pastafari2_dashboard'
|
path_module='admin_app.pastafari2_dashboard'
|
||||||
|
|
||||||
if hasattr(task_first, 'links'):
|
if hasattr(task_first, 'links'):
|
||||||
links=task_firs.links
|
links=task_first.links
|
||||||
|
|
||||||
if hasattr(task_first, 'path_module'):
|
if hasattr(task_first, 'path_module'):
|
||||||
links=task_firs.path_module
|
path_module=task_first.path_module
|
||||||
|
|
||||||
return t.load_template('maketask.phtml', title=I18n.lang('pastafari2', 'make_task', 'Make task'), form=task_first.form(t, yes_error=False, pass_values=False), url_exec=url_exec, ids=json_ids, task_file=task_path, links=links, path_module=path_module)
|
return t.load_template('maketask.phtml', title=I18n.lang('pastafari2', 'make_task', 'Make task'), form=task_first.form(t, yes_error=False, pass_values=False), url_exec=url_exec, ids=json_ids, task_file=task_path, links=links, path_module=path_module)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,13 +50,44 @@ if linux_distro=='debian':
|
||||||
print('Error, cannot install MariaDB...')
|
print('Error, cannot install MariaDB...')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
print('Setting the password...')
|
||||||
|
|
||||||
elif linux_distro=='arch':
|
elif linux_distro=='arch':
|
||||||
|
|
||||||
if subprocess.call("sudo pacman -S --noconfirm mariadb", shell=True) > 0:
|
if subprocess.call("sudo pacman -S --noconfirm mariadb expect", shell=True) > 0:
|
||||||
print('Error, cannot install MariaDB...')
|
print('Error, cannot install MariaDB...')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
if subprocess.call("sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql", shell=True) > 0:
|
||||||
|
print('Error, cannot execute mariadb-install-db')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
if subprocess.call("sudo systemctl restart mariadb", shell=True) > 0:
|
||||||
|
print('Error, cannot start mariadb')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
if subprocess.call("sudo MYSQL_PASS=%s ./modules/pastafari2/scripts/servers/databases/mariadb/mysql_secure.sh" % args.password, shell=True) > 0:
|
||||||
|
|
||||||
|
print('Error, cannot set the password')
|
||||||
|
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
if args.ip:
|
||||||
|
|
||||||
|
print('Changing IP to listen...')
|
||||||
|
|
||||||
|
if subprocess.call("sudo sed -i 's/^\[server\]$/[server]\\n\\nbind-address = {}/g' /etc/my.cnf.d/server.cnf".format(args.ip), shell=True) > 0:
|
||||||
|
print('Error, cannot install MariaDB...')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
else:
|
||||||
|
print('Listen localhost by default...')
|
||||||
|
|
||||||
|
|
||||||
|
if subprocess.call("sudo systemctl enable mariadb", shell=True) > 0:
|
||||||
|
print('Error, cannot start mariadb')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
elif linux_distro=='rocky' or linux_distro=='alma' or linux_distro=='fedora':
|
elif linux_distro=='rocky' or linux_distro=='alma' or linux_distro=='fedora':
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ sleep(1)
|
||||||
|
|
||||||
if linux_distro=='arch':
|
if linux_distro=='arch':
|
||||||
|
|
||||||
|
# if call("sudo pacman -S --noconfirm --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si", shell=True) > 0:
|
||||||
|
|
||||||
if call("sudo pacman -S --noconfirm git", shell=True) > 0:
|
if call("sudo pacman -S --noconfirm git", shell=True) > 0:
|
||||||
print('Error, cannot install git...')
|
print('Error, cannot install git...')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ if [[ $DISTRO =~ ^Debian ]] || [[ $DISTRO =~ ^Ubuntu ]]; then
|
||||||
|
|
||||||
elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then
|
elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then
|
||||||
|
|
||||||
pacman -Syu sudo
|
pacman -Syu --noconfirm sudo
|
||||||
|
|
||||||
sudo pacman -S --noconfirm python python-pip sudo augeas python-virtualenv
|
sudo pacman -S --noconfirm python python-pip sudo augeas python-virtualenv
|
||||||
|
|
||||||
|
|
@ -99,7 +99,7 @@ sudo /opt/certbot/bin/pip install certbot certbot
|
||||||
|
|
||||||
echo "0 0,12 * * * root /opt/certbot/bin/python -c 'import random; import time; time.sleep(random.random() * 3600)' && sudo certbot renew -q" | sudo tee -a /etc/crontab > /dev/null
|
echo "0 0,12 * * * root /opt/certbot/bin/python -c 'import random; import time; time.sleep(random.random() * 3600)' && sudo certbot renew -q" | sudo tee -a /etc/crontab > /dev/null
|
||||||
|
|
||||||
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
|
sudo ln -sf /opt/certbot/bin/certbot /usr/bin/certbot
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import pwd
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
import distro
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='A script for install leviathan user')
|
parser = argparse.ArgumentParser(description='A script for install leviathan user')
|
||||||
|
|
||||||
|
|
@ -191,6 +192,16 @@ if check_url.match(args.url_stats):
|
||||||
print('{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Tools installed..."}')
|
print('{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Tools installed..."}')
|
||||||
|
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
|
linux_distro=distro.id()
|
||||||
|
|
||||||
|
# sudo su - %s -s /bin/bash -c 'mkdir -p %s'
|
||||||
|
|
||||||
|
if linux_distro=='arch':
|
||||||
|
print('Add utilities for archlinux distro...')
|
||||||
|
if call("sudo su - %s -s /bin/bash -c 'sudo pacman -S --noconfirm --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si --noconfirm --needed'" % args.user, shell=True) > 0:
|
||||||
|
print('Error, cannot add utilities for archlinux')
|
||||||
|
exit(1)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<%inherit file="dashboard.phtml"/>
|
<%inherit file="dashboard.phtml"/>
|
||||||
<%block name="content">
|
<%block name="content">
|
||||||
${links|n}
|
${links|n}
|
||||||
<form method="post" name="update_servers" id="update_servers" action="${url_exec}">
|
<form method="post" name="update_servers" id="update_servers" action="${url_exec|n}">
|
||||||
${form|n}
|
${form|n}
|
||||||
<input type="hidden" name="ids" value="${ids|h}" />
|
<input type="hidden" name="ids" value="${ids|h}" />
|
||||||
<input type="hidden" name="task" value="${task_file}" />
|
<input type="hidden" name="task" value="${task_file}" />
|
||||||
${csrf_token()|n}
|
<br />
|
||||||
<p><input type="submit" value="${lang('pastafari','execute_task', 'Execute task')}" /></p>
|
<p><input type="submit" value="${lang('pastafari','execute_task', 'Execute task')}" /></p>
|
||||||
</form>
|
</form>
|
||||||
${links|n}
|
${links|n}
|
||||||
|
|
@ -15,7 +15,7 @@ ${links|n}
|
||||||
<script language="Javascript" src="${make_media_url('js/jsutils/ajax_list.js', 'monit')}"></script>
|
<script language="Javascript" src="${make_media_url('js/jsutils/ajax_list.js', 'monit')}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
var options={url: "${url_exec}", loading: '#layer_loading', success: function (data) {
|
var options={url: "${url_exec|n}", loading: '#layer_loading', success: function (data) {
|
||||||
|
|
||||||
task_id=data.task_id;
|
task_id=data.task_id;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue