summaryrefslogtreecommitdiffstats
path: root/satellit_installer/static_files/slxadmin-init/slxadmin-init.php
diff options
context:
space:
mode:
authorSimon Rettberg2020-12-17 15:08:14 +0100
committerSimon Rettberg2020-12-17 15:08:14 +0100
commitb5c3eb9e01b09367935f558a57633b68a65a1a21 (patch)
treeb6c322f3089192124779b9d7a29c8365eb39533f /satellit_installer/static_files/slxadmin-init/slxadmin-init.php
parent[SSPS] slx-cert: Put hostname in SAN too, chromium requires this (diff)
downloadsetup-scripts-b5c3eb9e01b09367935f558a57633b68a65a1a21.tar.gz
setup-scripts-b5c3eb9e01b09367935f558a57633b68a65a1a21.tar.xz
setup-scripts-b5c3eb9e01b09367935f558a57633b68a65a1a21.zip
[SSPS] Refactor static_files: Submodules with tree
Add submodules (aka directories) to static_files, named according to what component they are for. Add function "install_files" to copy the contents of one of those modules to the root directory. This should make the resulting setup more obvious and require less manual copying of files everywhere.
Diffstat (limited to 'satellit_installer/static_files/slxadmin-init/slxadmin-init.php')
-rw-r--r--satellit_installer/static_files/slxadmin-init/slxadmin-init.php51
1 files changed, 0 insertions, 51 deletions
diff --git a/satellit_installer/static_files/slxadmin-init/slxadmin-init.php b/satellit_installer/static_files/slxadmin-init/slxadmin-init.php
deleted file mode 100644
index ef3f0bd..0000000
--- a/satellit_installer/static_files/slxadmin-init/slxadmin-init.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-
-/*
- * Init script for slx-admin, filling in bwLehrpool specific data into DB.
- * This script should be idempotent and handle upgrades from earlier versions.
- */
-
-$SCRIPTDIR = dirname(__FILE__);
-
-/*
- * Most things should be configurable here
- */
-
-// Where to get available Linux system information from
-$MINILINUX_URL = 'https://bwlp-masterserver.ruf.uni-freiburg.de/netboot/sat_07';
-$MINILINUX_PUBKEY = file_get_contents($SCRIPTDIR . '/gpg-key.asc');
-/*
- * Boilerplate
- */
-
-chdir('/srv/openslx/www/slx-admin') || exit(1);
-
-require_once 'config.php';
-
-// Autoload classes from ./inc which adhere to naming scheme <lowercasename>.inc.php
-spl_autoload_register(function ($class) {
- $file = 'inc/' . preg_replace('/[^a-z0-9]/', '', mb_strtolower($class)) . '.inc.php';
- if (!file_exists($file))
- return;
- require_once $file;
-});
-
-/*
- * Stuff starts here
- */
-
-/*
- * Minilinux update source URL
- */
-
-if ($MINILINUX_PUBKEY === false) {
- echo "Error reading GPG key from file\n";
- exit(1);
-}
-
-Database::exec("INSERT INTO minilinux_source (sourceid, title, url, pubkey)
- VALUES ('bwlp', 'bwLehrpool', :url, :pubkey)
- ON DUPLICATE KEY UPDATE title = VALUES(title), url = VALUES(url), pubkey = VALUES(pubkey)",
- ['url' => $MINILINUX_URL, 'pubkey' => $MINILINUX_PUBKEY]);
-
-exit(0);