Fixes in scripts for fedora

This commit is contained in:
absurdo 2022-10-26 12:57:06 +02:00
parent d54f94379b
commit 4914a1f0e7
8 changed files with 77 additions and 17 deletions

View file

@ -514,11 +514,11 @@ def pastafari2_make_task():
task_execute=import_module(task_file)
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={'mysql_password': ''})
if config.reloader:
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={})
send_task=request.args.get('send_task', '')
error=0

23
app.py
View file

@ -0,0 +1,23 @@
from modules.pastafari2 import pastafari_app
from modules.pastafari2.models.pastafari2 import ServerDbTask
from paramecio2.libraries.db.webmodel import WebModel
try:
import ujson as json
except:
import json
server=ServerDbTask()
@pastafari_app.route('/test')
def test():
conn=WebModel.connection()
cursor=conn.query('select * from serverdbtask')
arr_row=[]
for row in cursor:
arr_row.append(row)
return json.dumps(arr_row)

View file

@ -28,7 +28,13 @@ def scandir(mydir, config_parser, arr_dir=OrderedDict(), father=''):
if 'modules' in config_parser:
for k, v in config_parser['modules'].items():
#arr_dir[father][os.path.basename(mydir)].append([config_parser['modules'][k], s.dumps({'file': mydir+'/'+k+'.py'}), 1])
arr_dir[father][os.path.basename(mydir)].append([config_parser['modules'][k], mydir+'/'+k+'.py', 1])
form=0
if 'form' in config_parser:
if k in config_parser['form']:
form=config_parser['form'][k]
arr_dir[father][os.path.basename(mydir)].append([config_parser['modules'][k], mydir+'/'+k+'.py', 1, form])
elif os.path.isdir(mydir+'/'+one_path):

View file

@ -22,3 +22,7 @@ elif linux_distro=='debian':
if call('sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y git', shell=True) > 0:
print('Error, cannot install git...')
exit(1)
elif linux_distro=='rocky' or linux_distro=='fedora':
if call("sudo dnf install -y git", shell=True) > 0:
print('Error, cannot install git...')
exit(1)

View file

@ -19,6 +19,16 @@ elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then
sudo pacman -Syu --noconfirm python python-pip
elif [[ $DISTRO =~ ^NAME=\"Rocky ]]; then
sudo dnf install -y python python-pip
#Install EPEL
dnf config-manager --set-enabled crb
sudo dnf install -y \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
sudo dnf upgrade -y
else
echo "Sorry, Linux distro not supported"

View file

@ -30,3 +30,9 @@ elif linux_distro=='debian':
if call(update_command, shell=True) > 0:
print('Error, cannot upgrade server...')
exit(1)
elif linux_distro=='rocky' or linux_distro=='fedora':
if call("sudo dnf upgrade -y", shell=True) > 0:
print('Error, cannot upgrade server...')
exit(1)

View file

@ -5,4 +5,5 @@ description=Install databases daemon in server standalone, for example mysql or
[modules]
mysql/standalone_mysql=Standalone mysql server, MySQL is the most famous database sql server in the web
[form]
mysql/standalone_mysql=1

View file

@ -8,6 +8,11 @@
</select>
</p>
<%def name="show_tasks(task_folder, separator)">
<%
form_set=""
%>
<!--<ul class="superul">-->
% if task_folder in select_task:
@ -19,6 +24,7 @@
%if script[1][2]==1:
<option value="${script[1][1]}">
${script[1][0].split(',')[0].strip()}
<%form_set+='<input type="hidden" name="'+script[1][1]+'" id="'+script[1][1].replace('/', '_')+'_form" value="'+str(script[1][3])+'">\n'%>
</option>
% endif
% endfor
@ -51,6 +57,7 @@
% endif
<!--</ul>-->
${form_set|n}
</%def>
<p>
<select name="task" id="task">
@ -162,6 +169,7 @@ $(document).ready(function () {
else {
//Make a normal submit to url_task for make_task form
if($('#'+task.replace(/\//g, '_')+'_form').val()==1) {
var form=$("<form/>", { 'action': url_task, 'method': 'POST'});
@ -176,6 +184,8 @@ $(document).ready(function () {
return false;
}
}
}
$('#layer_loading').show();