refactoring (#116)

- refactoring architecture
- fix incomplete ssh logs
- code editor for scripts in the app
- remove Jobs and SSHCommands
This commit is contained in:
Saeed Vaziry
2024-03-14 20:03:43 +01:00
committed by GitHub
parent cee4a70c3c
commit 428140b931
472 changed files with 24110 additions and 8159 deletions

View File

@ -0,0 +1,21 @@
mkdir -p ~/.logs
mkdir -p ~/.logs/workers
touch ~/.logs/workers/__id__.log
if ! echo '__config__' | sudo tee /etc/supervisor/conf.d/__id__.conf; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! sudo supervisorctl reread; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! sudo supervisorctl update; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! sudo supervisorctl start __id__:*; then
echo 'VITO_SSH_ERROR' && exit 1
fi

View File

@ -0,0 +1,20 @@
if ! sudo supervisorctl stop __id__:*; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! sudo rm -rf ~/.logs/workers/__id__.log; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! sudo rm -rf /etc/supervisor/conf.d/__id__.conf; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! sudo supervisorctl reread; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! sudo supervisorctl update; then
echo 'VITO_SSH_ERROR' && exit 1
fi

View File

@ -0,0 +1,5 @@
sudo DEBIAN_FRONTEND=noninteractive apt-get install supervisor -y
sudo service supervisor enable
sudo service supervisor start

View File

@ -0,0 +1,3 @@
if ! sudo supervisorctl restart __id__:*; then
echo 'VITO_SSH_ERROR' && exit 1
fi

View File

@ -0,0 +1,3 @@
if ! sudo supervisorctl start __id__:*; then
echo 'VITO_SSH_ERROR' && exit 1
fi

View File

@ -0,0 +1,3 @@
if ! sudo supervisorctl stop __id__:*; then
echo 'VITO_SSH_ERROR' && exit 1
fi

View File

@ -0,0 +1,10 @@
[program:__name__]
process_name=%(program_name)s_%(process_num)02d
command=__command__
autostart=__auto_start__
autorestart=__auto_restart__
user=__user__
numprocs=__numprocs__
redirect_stderr=true
stdout_logfile=__log_file__
stopwaitsecs=3600