From ed777e957681dccdf1d325e11f81feb4ba20ac06 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Fri, 3 Sep 2021 05:30:34 +0200 Subject: [PATCH] =?UTF-8?q?ripping=20out=20old=20stuff=20that=E2=80=99s=20?= =?UTF-8?q?no=20longer=20needed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 31 ++++++++----------- commands_git.conf | 2 -- commands_ondemand.conf | 2 -- commands_status.conf | 15 --------- internal.css | 61 ------------------------------------ strassenkind.php | 70 ------------------------------------------ 6 files changed, 13 insertions(+), 168 deletions(-) delete mode 100644 commands_git.conf delete mode 100644 commands_ondemand.conf delete mode 100644 commands_status.conf delete mode 100644 internal.css delete mode 100644 strassenkind.php diff --git a/README.md b/README.md index 6bbc688..8657779 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,19 @@ This repository will be automagically pulled by the web server each time somethi Dear Developers, Please use pushes sparingly because it takes a while for the server to replace all code variables. +What this thing does basicalle equates to: +``` +ssh @ +cd /var/www/git +sudo -u www-data -s +rm -rf ./web-deployment +git clone +cd web-deployment +./deployment-script +exit +logout +``` + ## Symlinks The following files and directories are linked to areas where they can be accessed by the web server: * `threadr/` → `threadr.lostcave.ddnss.de/threadr/` (all files acessible by the web server, READMEs get deleted on deployment) @@ -51,24 +64,6 @@ The main index.html on the server. It redirects to ThreadR. This script is executed each time (or most of the time) the repository gets pushed. It contains the commands to execute the code variable replcement system and some other useful tasks. Its working directory is the root of the git repository. -### [strassenkind.php](./strassenkind.php), [internal.css](./internal.css), [commands_status.conf](./commands_status.conf), [commands_ondemand.conf](./commands_ondemand.conf), [commands_git.conf](./commands_git.conf) -~~The internal status page. strassenkind.php is the index, internal.css is the stylesheet strassenkind.php uses -and the .conf files are lists of commands to be executed by the status page. The status page auto-refreshes to display up-to-date information on the commands in commands_status.conf. -It is advised to put commands that have a high disk usage or start/stop/restart/reload system services etc. on the commands_ondemand.conf file as the ondemand status page does not auto-refresh. -The file commands_git.conf contains the commands that would be executed by the deployment WebHook. These are there to provide a fast and simple backup solution. -The alternative to foce-updating ThreadR via the status page would be:~~ -``` -ssh @ -cd /var/www/git -sudo -u www-data -s -rm -rf ./web-deployment -git clone -cd web-deployment -./deployment-script -exit -logout -``` -DEPRECATED: The administration framework will be turned into its own project and completely overhauled. ### [LICENSE.md](./LICENSE.md) A copy of the Apache 2.0 license, the license this project is under ### [NOTICE](./NOTICE) diff --git a/commands_git.conf b/commands_git.conf deleted file mode 100644 index 405329f..0000000 --- a/commands_git.conf +++ /dev/null @@ -1,2 +0,0 @@ -echo "pushd /var/www/git/; rm -rvf web-deployment; git clone git@strassenkind.ip:root/web-deployment.git; popd" | bash - -echo "pushd /var/www/git/web-deployment; chmod +x deployment-script.sh; ./deployment-script.sh; popd" | bash - diff --git a/commands_ondemand.conf b/commands_ondemand.conf deleted file mode 100644 index 607aed5..0000000 --- a/commands_ondemand.conf +++ /dev/null @@ -1,2 +0,0 @@ -sync -echo `cat /var/log/apt-get_update_has_run` "\n"; apt list --upgradable diff --git a/commands_status.conf b/commands_status.conf deleted file mode 100644 index cadbe54..0000000 --- a/commands_status.conf +++ /dev/null @@ -1,15 +0,0 @@ -uptime -free -h -df -h -cat /var/run/reboot-required -who -sensors - -systemctl status apache2.service -systemctl status sshd.service -systemctl status gitea.service -systemctl status mysql.service -systemctl status FAHClient.service - -tail -n 20 /var/www/admin.strassenkind.ip/stdout.log -tail -n 20 /var/www/admin.strassenkind.ip/stderr.log diff --git a/internal.css b/internal.css deleted file mode 100644 index c7a8ee7..0000000 --- a/internal.css +++ /dev/null @@ -1,61 +0,0 @@ -body { - background-color: #B6BDBD; - color: #000000; -} - -/* code blocks */ -pre { - margin-left: 20px; - margin-right: 20px; - margin-top: 0px; - background-color: white; - border-style: solid; - border-color: #888A85; - border-width: 1px; - font-size: 11pt; - font-family: monospace; -} -pre.commandLine { - background-color: #2E3436; - color: #C3F097; -} -/* in-line code block */ -span.codeBlockInText{ - background-color: white; - border-color: black; - border-style: solid; - border-width: 1px; - font-size: 11pt; - font-family: monospace; - padding-left: 5px; - padding-right: 5px; -} -/* code highlighting */ -span.structure { - color: #FCAF3E; - font-weight: bold; -} -span.primitive { - color: #729FCF; - font-weight: bold; -} -span.className { - color: #8AE234; - font-weight: bold; -} -span.type { - color: #729FCF; -} -span.value { - color: #C17D11; -} -span.function { - color: #75507B; -} -span.name { - color: #8AE234; -} -span.comment { - color: #888A85; -} - diff --git a/strassenkind.php b/strassenkind.php deleted file mode 100644 index 6739290..0000000 --- a/strassenkind.php +++ /dev/null @@ -1,70 +0,0 @@ - - - - - Strassenkind Server Status Page - - "; - } - ?> - - -

Strassenkind Server Status

-
- "; - } else { - echo ""; - } - } - - add_button("Run ondemand commands", "ondemand"); - add_button("Force ThreadR update", "git"); - ?> -
- ') === false) { - $command = $command . " 2>&1"; - } - $output = shell_exec($command); - echo "
 " . htmlspecialchars($command, $flags=ENT_DISALLOWED | ENT_HTML5 | ENT_QUOTES) . " 
\n
 " . htmlspecialchars($output, $flags=ENT_DISALLOWED | ENT_HTML5 | ENT_QUOTES) . " 
\n
"; - } - } - - } - - // run ondemand command list if demanded - if (isset($_POST['ondemand'])) { - execute_command_list($ondemand_commands); - } elseif (isset($_POST['git'])) { - execute_command_list($git_commands); - } else { - //run status command list otherwise - execute_command_list($status_commands); - } - ?> - -