diff --git a/api/checkConnection.php b/api/checkConnection.php deleted file mode 100644 index 9b667d7f5..000000000 --- a/api/checkConnection.php +++ /dev/null @@ -1,24 +0,0 @@ - true, - ]); -} else { - echo json_encode([ - 'connected' => false, - ]); -} diff --git a/api/checkOS.php b/api/checkOS.php deleted file mode 100644 index 204c8b600..000000000 --- a/api/checkOS.php +++ /dev/null @@ -1,8 +0,0 @@ - $operating_system, -]); diff --git a/api/update.php b/api/update.php deleted file mode 100644 index e67a40792..000000000 --- a/api/update.php +++ /dev/null @@ -1,72 +0,0 @@ - $success, - 'output' => $output, - 'retval' => $retval, - 'command' => $cmd, - 'php' => basename($_SERVER['PHP_SELF']), - ]; -} else { - $LogData = [ - 'success' => 'false', - 'command' => $cmd, - 'php' => basename($_SERVER['PHP_SELF']), - ]; -} - -$LogString = json_encode($LogData); -if ($config['dev']['loglevel'] > 1) { - logError($LogData); -} -echo $LogString; diff --git a/config/config.inc.php b/config/config.inc.php index ae56de53a..2409a04c6 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -301,8 +301,6 @@ $config['login']['password'] = ''; $config['protect']['admin'] = true; $config['protect']['localhost_admin'] = true; -$config['protect']['update'] = true; -$config['protect']['localhost_update'] = true; $config['protect']['index'] = false; $config['protect']['localhost_index'] = false; $config['protect']['index_redirect'] = 'login'; diff --git a/dependencies.php b/dependencies.php deleted file mode 100644 index f2529a042..000000000 --- a/dependencies.php +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - <?=$config['ui']['branding']?> - - - - - - - - - - - - - - - - - - - - - - - - - -
-

dependencies check

-

-
- -
- - - -
- - - - - - - - - - - - diff --git a/lib/configsetup.inc.php b/lib/configsetup.inc.php index e8275911b..369812724 100644 --- a/lib/configsetup.inc.php +++ b/lib/configsetup.inc.php @@ -290,13 +290,6 @@ 'name' => 'DISKUSAGEBUTTON', 'value' => 'diskusage-btn', ], - 'dependencies_button' => [ - 'view' => 'basic', - 'type' => 'button', - 'placeholder' => 'dependencies_check', - 'name' => 'DEPENDENCIESBUTTON', - 'value' => 'dependencies-btn', - ], ], 'frontpage' => [ 'view' => 'basic', @@ -2640,13 +2633,6 @@ 'name' => 'CHECKVERSIONBUTTON', 'value' => 'checkversion-btn', ], - 'updater_button' => [ - 'view' => 'basic', - 'type' => 'hidden', - 'placeholder' => 'updater', - 'name' => 'UPDATERBUTTON', - 'value' => 'updater-btn', - ], ], 'power' => [ 'view' => 'basic', diff --git a/login/index.php b/login/index.php index f5d7472cc..3677f70a7 100644 --- a/login/index.php +++ b/login/index.php @@ -75,10 +75,6 @@

-

- - -

diff --git a/resources/lang/de.json b/resources/lang/de.json index 3e89a9570..f93baabed 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -15,9 +15,7 @@ "authentication:protect_localhost_admin": "Admin-Panel beim Zugriff über localhost schützen", "authentication:protect_localhost_index": "Startbildschirm beim Zugriff über localhost schützen", "authentication:protect_localhost_manual": "Handbuch & FAQ beim Zugriff über localhost schützen", - "authentication:protect_localhost_update": "Updater beim Zugriff über localhost schützen", "authentication:protect_manual": "Handbuch & FAQ schützen", - "authentication:protect_update": "Updater schützen", "auto_reload": "Photobooth wird automatisch neu geladen...", "available_version": "Verfügbar:", "bootconfig": "config.txt", @@ -220,9 +218,7 @@ "manual:authentication:protect_localhost_admin": "Wenn deaktiviert, kann auf das Admin-Panel über localhost ohne Benutzername und Passwort zugegriffen werden.", "manual:authentication:protect_localhost_index": "Wenn deaktiviert, kann auf die Startseite über localhost ohne Benutzername und Passwort zugegriffen werden.", "manual:authentication:protect_localhost_manual": "Wenn deaktiviert, kann auf das Handbuch und FAQ über localhost ohne Benutzername und Passwort zugegriffen werden.", - "manual:authentication:protect_localhost_update": "Wenn deaktiviert, kann auf den Updater über localhost ohne Benutzername und Passwort zugegriffen werden.", "manual:authentication:protect_manual": "Wenn aktiviert, kann auf das Handbuch und das FAQ nur zugegriffen werden, wenn ein Benutzername und ein Passwort eingegeben werden.", - "manual:authentication:protect_update": "Wenn diese Option aktiviert ist, kann auf den Updater nur zugegriffen werden, wenn ein Benutzername und ein Passwort eingegeben werden.", "manual:collage:collage_background": "Geben Sie den Pfad des Hintergrundes ein, der nach der Aufnahme auf Ihre Collage angewendet wird.", "manual:collage:collage_cntdwn_time": "Legen Sie Ihre Countdown-Zeit fest, welche zwischen den Bildern für eine Collage verwendet wird.", "manual:collage:collage_continuous": "Collage ohne Unterbrechung aufnehmen.", @@ -597,7 +593,6 @@ "translate": "Übersetzen", "unsupported_os": "Betriebssystem nicht unterstützt!", "update_available": "Es ist ein Update verfügbar.", - "update_check_git": "Prüfe Git-Repository...", "update_commit_backup": "Zum aktualisieren committen & sichern Sie Ihre Änderungen!", "update_committing": "Änderungen werden committet...", "update_done": "Erfolgreich Aktualisiert!", diff --git a/resources/lang/en.json b/resources/lang/en.json index 5de498136..d8c5b9d2c 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -15,16 +15,12 @@ "authentication:protect_localhost_admin": "Protect admin panel on localhost access", "authentication:protect_localhost_index": "Protect start screen on localhost access", "authentication:protect_localhost_manual": "Protect manual & FAQ on localhost access", - "authentication:protect_localhost_update": "Protect updater on localhost access", "authentication:protect_manual": "Protect manual & FAQ", - "authentication:protect_update": "Protect updater", "auto_reload": "Photobooth reloads automatically...", "available_version": "Available:", "bootconfig": "config.txt", "busy": "Processing ...", "busyCollage": "Processing Collage ...", - "check_connection": "Checking connection...", - "check_dependencies": "Checking installed dependencies...", "check_version": "Check online", "cheese": "Cheeeeeeeese!", "cheeseCollage": "Cheeeeeeeese Collageeeeeeeeeee!", @@ -80,7 +76,6 @@ "debugpanel:autorefresh": "Auto-Refresh", "degrees": "°", "delete": "Delete", - "dependencies_check": "Installed dependencies", "dev_debugpanel": "Debug panel", "devlog": "Photobooth log", "disk_usage": "Disk Usage", @@ -142,7 +137,6 @@ "general:database_file": "Database file name", "general:database_rebuild": "Rebuild image database", "general:delete_no_request": "Delete images without confirm request", - "general:dependencies_button": "Check installed dependencies", "general:dev_debugpanel": "Debug Panel", "general:dev_demo_images": "Use Demo Images", "general:dev_loglevel": "Loglevel", @@ -220,9 +214,7 @@ "manual:authentication:protect_localhost_admin": "If disabled, admin panel can be accessed without username and password from localhost.", "manual:authentication:protect_localhost_index": "If disabled, start screen can be accessed without username and password from localhost.", "manual:authentication:protect_localhost_manual": "If disabled, manual and FAQ can be accessed without username and password from localhost.", - "manual:authentication:protect_localhost_update": "If disabled, updater can be accessed without username and password from localhost.", "manual:authentication:protect_manual": "If enabled, manual and FAQ can only be accessed if a username and password is entered.", - "manual:authentication:protect_update": "If enabled, updater can only be accessed if a username and password is entered.", "manual:collage:collage_background": "Enter the path of the background which is applied to your collage after taking it.", "manual:collage:collage_cntdwn_time": "Set your countdown time between pictures while taking a collage.", "manual:collage:collage_continuous": "Take collage without interrupption.", @@ -309,7 +301,6 @@ "manual:general:database_file": "Name of the database file.", "manual:general:database_rebuild": "Rebuild the images database. Normally not required but can be used to fix a corrupted database file.", "manual:general:delete_no_request": "If enabled, images will be deleted without a confirm request. Delete of images can't be undone!", - "manual:general:dependencies_button": "This will check if needed dependencies are installed.", "manual:general:dev_debugpanel": "Opens the debug panel in a separate window. Make sure you set the loglevel to 1 (or above) for more information.", "manual:general:dev_demo_images": "If enabled, sample pictures will be used instead taking a picture.", "manual:general:dev_loglevel": "Define the loglevel. 0 = minimal logging, 1 = advanced logging, 2 = expert logging", @@ -520,17 +511,13 @@ "manual:userinterface:ui_shutter_cheese_img": "If shutter animation is enabled and this is not none the UI will display an image instead of the shutter text. The image stays visible until the photo is received from the camera.", "manual:userinterface:ui_style": "Choose a start page styling. To use custom styling please create and use \"/template/custom.template.php\" and \"/resources/css/custom_style.css\", if one of these files is not readable we will fallback to default theme.", "manual:version:check_version": "This will check online against the Github repository for the latest Photobooth version.", - "manual:version:updater_button": "This will check if Photobooth can be updated and perform the update. Only works on Linux if Photobooth was installed via git.", "milliseconds": "ms", "multiplied": "x", "myconfig": "My Config", "newCollage": "New Collage", "newPhoto": "New Picture", "nextPhoto": "Next Picture", - "no_connection": "Not internect connection!", "no_preview": "No preview available.", - "ok": "ok", - "os_check": "Checking OS...", "path": "Path:", "percent": "%", "pictures": "Pictures", @@ -677,22 +664,7 @@ "test_update_available": "There is a test update available.", "toggleFullscreen": "Toggle Fullscreen", "translate": "Translate", - "unsupported_os": "Unsupported OS!", "update_available": "There is an update available.", - "update_check_git": "Checking git repository...", - "update_commit_backup": "Commit & backup your changes to update!", - "update_committing": "Committing your changes...", - "update_done": "Updated!", - "update_error": "Something went wrong!", - "update_fail": "Failed! Check console log for more informations!", - "update_git_commit": "Commit & Backup", - "update_git_commited": "Changes committed!", - "update_no_git": "Not a git repo! Automated update not possible!", - "update_ready": "Ready to update!", - "update_running": "Updating... Please be patient! Update might take a while! ...", - "update_to_dev": "Update to latest development Version", - "update_to_stable": "Update to latest Stable v3", - "updater": "Updater", "use_button": "Use Buzzer to take a Picture", "userinterface": "User interface", "userinterface:background_admin": "Admin panel background image path", @@ -767,6 +739,5 @@ "using_latest_version": "You are using the latest version of photobooth.", "version": "Version", "version:check_version": "Photobooth version", - "version:updater_button": "Update Photobooth (git)", "wait_message": "Please wait..." } diff --git a/resources/lang/fr.json b/resources/lang/fr.json index b601dee76..4715e2563 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -14,9 +14,7 @@ "authentication:protect_localhost_admin": "Protéger le panneau d'administration avec l'accès localhost", "authentication:protect_localhost_index": "Protéger l'écran de démarrage lors de l'accès localhost", "authentication:protect_localhost_manual": "Protéger le manuel et la FAQ lors de l'accès localhost", - "authentication:protect_localhost_update": "Protéger la mise à jour lors de l'accès localhost", "authentication:protect_manual": "Protéger le manuel et la FAQ", - "authentication:protect_update": "Protéger la mise à jour", "auto_reload": "Actualisation automatique du Photobooth...", "available_version": "Disponible :", "bootconfig": "config.txt", @@ -213,9 +211,7 @@ "manual:authentication:protect_localhost_admin": "Si désactivé, le panneau administrateur est accessible sans nom d'utilisateur et mot de passe de localhost.", "manual:authentication:protect_localhost_index": "Si désactivé, le panneau administrateur est accessible sans nom d'utilisateur et mot de passe de localhost.", "manual:authentication:protect_localhost_manual": "Si désactivé, le manuel et la FAQ peuvent être accédés sans nom d'utilisateur et mot de passe de localhost.", - "manual:authentication:protect_localhost_update": "Si désactivé, la mise à jour est accessible sans nom d'utilisateur et mot de passe de localhost.", "manual:authentication:protect_manual": "Si activé, le manuel et la FAQ ne sont accessibles que si un nom d'utilisateur et un mot de passe sont definis.", - "manual:authentication:protect_update": "Si activé, la mise à jour n'est accessible que si un nom d'utilisateur et un mot de passe sont saisis.", "manual:collage:collage_cntdwn_time": "Définissez votre temps de compte à rebours entre les photos lors de la prise d'un collage.", "manual:collage:collage_continuous": "Prendre un photo montage sans interruption.", "manual:collage:collage_continuous_time": "Contrôler le temps où une photo est visible sur un collage continu avant de prendre la photo suivante.", @@ -592,7 +588,6 @@ "translate": "Traduire", "unsupported_os": "OS non pris en charge !", "update_available": "Il y a une mise à jour disponible", - "update_check_git": "Vérification du répertoire git ...", "update_commit_backup": "Valider et sauvegarder vos modifications pour mettre à jour !", "update_committing": "Validation de vos modifications ...", "update_done": "Mis à jour !", diff --git a/resources/lang/it.json b/resources/lang/it.json index 5394f7337..fba8d19b1 100644 --- a/resources/lang/it.json +++ b/resources/lang/it.json @@ -15,9 +15,7 @@ "authentication:protect_localhost_admin": "Proteggi il pannello di amministrazione sull'accesso localhost", "authentication:protect_localhost_index": "Proteggi la schermata iniziale sull'accesso localhost", "authentication:protect_localhost_manual": "Proteggi il manuale e le FAQ sull'accesso da localhost", - "authentication:protect_localhost_update": "Proteggi l'updater dall'accesso da localhost", "authentication:protect_manual": "Proteggi il manuale & le FAQ", - "authentication:protect_update": "Proteggi l'updater", "auto_reload": "Il Photobooth si ricarica automaticamente...", "available_version": "Disponibile:", "bootconfig": "config.txt", @@ -220,9 +218,7 @@ "manual:authentication:protect_localhost_admin": "Se disabilitato, è possibile accedere al pannello di amministrazione senza nome utente e password da localhost.", "manual:authentication:protect_localhost_index": "Se disabilitata, è possibile accedere alla schermata iniziale senza nome utente e password da localhost.", "manual:authentication:protect_localhost_manual": "Se disabilitato, è possibile accedere al manuale e alle FAQ senza nome utente e password da localhost.", - "manual:authentication:protect_localhost_update": "Se disabilitato, l'updater può essere utilizzato senza nome utente e password da localhost.", "manual:authentication:protect_manual": "Se abilitato, è possibile accedere al manuale e alle FAQ solo se viene inserito un nome utente e una password.", - "manual:authentication:protect_update": "Se abilitata, è possibile accedere all'updater solo se viene inserito un nome utente e una password.", "manual:collage:collage_background": "Inserisci il percorso dello sfondo che sarà applicato al collage dopo lo scatto.", "manual:collage:collage_cntdwn_time": "Imposta il conto alla rovescia tra le foto mentre fai un collage.", "manual:collage:collage_continuous": "Esegui un collage senza interruzioni.", @@ -628,7 +624,6 @@ "translate": "Traduci", "unsupported_os": "OS Non supportato!", "update_available": "C'è un aggiornamento disponibile.", - "update_check_git": "Controllo repository git...", "update_commit_backup": "Committa e fai il backup delle tue modifiche per aggiornare!", "update_committing": "Committando le tue modifiche...", "update_done": "Aggiornato!", diff --git a/resources/lang/no.json b/resources/lang/no.json index 24cb5b6e8..4d85030d9 100644 --- a/resources/lang/no.json +++ b/resources/lang/no.json @@ -14,9 +14,7 @@ "authentication:protect_localhost_admin": "Beskytt administrasjonspanel ved localhost tilgang", "authentication:protect_localhost_index": "Beskytt startskjerm ved localhost tilgang", "authentication:protect_localhost_manual": "Beskytt bruksanvisning og FAQ ved localhost tilgang", - "authentication:protect_localhost_update": "Beskytt oppdatering ved localhost tilgang", "authentication:protect_manual": "Beskytt bruksanvisning og FAQ", - "authentication:protect_update": "Beskytt oppdatering", "auto_reload": "Photoboothen laster automatisk inn på nytt...", "available_version": "Tilgjengelig:", "bootconfig": "config.txt", diff --git a/resources/sh/check-dependencies.sh b/resources/sh/check-dependencies.sh deleted file mode 100644 index 14e7aceac..000000000 --- a/resources/sh/check-dependencies.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -# Stop on the first sign of trouble -set -e - -WEBSERVER=( - 'libapache2-mod-php' - 'nginx' - 'lighttpd' -) - -COMMON_PACKAGES=( - 'git' - 'curl' - 'yarn' - 'ffmpeg' - 'gphoto2' - 'libimage-exiftool-perl' - 'nodejs' - 'php-gd' - 'php-zip' - 'python3' - 'python3-gphoto2' - 'python3-psutil' - 'python3-zmq' - 'rsync' - 'udisks2' - 'v4l2loopback-dkms' - 'v4l-utils' -) - -MISSING_PACKAGES=() - -echo "[Info] Checking for webserver..." -for server in "${WEBSERVER[@]}"; do - if [ $(dpkg-query -W -f='${Status}' ${server} 2>/dev/null | grep -c "ok installed") -eq 1 ]; then - echo "[Webserver] ${server} used." - if [[ ${server} == "nginx" || ${server} == "lighttpd" ]]; then - echo "[NOTE] You're using ${server} as your Webserver." - echo "[NOTE] For a no-hassle-setup Apache2 Webserver is recommend!" - if [ $(dpkg-query -W -f='${Status}' php-fpm 2>/dev/null | grep -c "ok installed") -eq 1 ]; then - echo "[Package] php-fpm installed already" - else - echo "[WARNING] Missing common package: php-fpm" - fi - fi - fi -done - -echo "" -echo "" - -echo "[Info] Checking common software..." -for package in "${COMMON_PACKAGES[@]}"; do - if [ $(dpkg-query -W -f='${Status}' ${package} 2>/dev/null | grep -c "ok installed") -eq 1 ]; then - echo "[Package] ${package} installed already" - else - echo "[WARNING] Missing common package: ${package}" - MISSING_PACKAGES+=("${package}") - fi -done - -echo "" -echo "" - -if [[ ${MISSING_PACKAGES[@]} ]]; then - echo "[RESULT] Missing common packages:" - for dependencie in "${MISSING_PACKAGES[@]}" - do - echo $dependencie - done - echo "[WARNING] Please install missing common packages!" -else - echo "[RESULT] No common packages missing." - echo "[OK]" - -fi - diff --git a/resources/sh/check-github.sh b/resources/sh/check-github.sh deleted file mode 100644 index e1941a518..000000000 --- a/resources/sh/check-github.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# Stop on the first sign of trouble -set -e - -inside_git_repo="$(git rev-parse --is-inside-work-tree 2>/dev/null)" - -if [ $inside_git_repo == 'true' ]; -then - if [ -z "$(git status --porcelain)" ]; - then - echo "true" - else - echo "commit" - fi -else - echo "false" -fi - diff --git a/resources/sh/commit.sh b/resources/sh/commit.sh deleted file mode 100644 index 5d8266a49..000000000 --- a/resources/sh/commit.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Stop on the first sign of trouble -# set -e - -date=$(date +"%Y%m%d-%H-%M") -get_username="$(git config user.name)" -set_username="$(git config user.name Photobooth)" -get_useremail="$(git config user.email)" -set_useremail="$(git config user.email Photobooth@localhost)" - -if [ -z "$get_username" ]; -then - echo "git user.name not set!" - echo "Setting git user.name." - $set_username - get_username="$(git config user.name)" -fi - -if [ -z "$get_useremail" ]; -then - echo "git user.email not set!" - echo "Setting git user.email." - $set_useremail - get_useremail="$(git config user.email)" -fi - -echo "git user.name: $get_username" -echo "git user.email: $get_useremail" - -git add --all -git commit -a -m "backup changes" -git checkout -b "backup-$date" -echo "Backup done to branch: backup-$date" - diff --git a/resources/sh/update-dev.sh b/resources/sh/update-dev.sh deleted file mode 100644 index 09a9adaab..000000000 --- a/resources/sh/update-dev.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Stop on the first sign of trouble -set -e - -git fetch origin -git checkout origin/dev -git submodule update --init -yarn install -yarn build -echo "Update completed!" -echo "Checked out on HEAD:" -git log --format="%h %s" -n 1 - diff --git a/resources/sh/update-stable.sh b/resources/sh/update-stable.sh deleted file mode 100644 index ae586bc17..000000000 --- a/resources/sh/update-stable.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Stop on the first sign of trouble -set -e - -git fetch origin -git checkout origin/stable3 -git submodule update --init -yarn install -yarn build -echo "Update completed!" - diff --git a/src/js/admin.js b/src/js/admin.js index 3ec4632d6..a034230ee 100644 --- a/src/js/admin.js +++ b/src/js/admin.js @@ -79,20 +79,6 @@ $(function () { return false; }); - $('#updater-btn').on('click', function (e) { - e.preventDefault(); - location.assign('../update.php'); - - return false; - }); - - $('#dependencies-btn').on('click', function (e) { - e.preventDefault(); - location.assign('../dependencies.php'); - - return false; - }); - $('#databaserebuild-btn').on('click', function (e) { e.preventDefault(); const elem = $(this); diff --git a/src/js/dependencies.js b/src/js/dependencies.js deleted file mode 100644 index 002c0ef2e..000000000 --- a/src/js/dependencies.js +++ /dev/null @@ -1,73 +0,0 @@ -/* globals photoboothTools */ - -const dependencies = (function () { - // vars - const api = {}; - - let command; - - // init - api.init = function () { - api.checkOS(); - }; - - api.checkOS = function () { - jQuery - .post('api/checkOS.php') - .done(function (result) { - photoboothTools.console.log('Operating system: ' + result.os); - const checkDependencies = photoboothTools.getTranslation('check_dependencies'), - unsupportedOs = photoboothTools.getTranslation('unsupported_os'); - - if (result.os == 'linux') { - $('.white-box').append($('

').text(result.os)); - $('.white-box').append($('

').text(checkDependencies)); - api.runCmd('check-deps'); - } else { - $('.white-box').append($('

').text(unsupportedOs)); - $('.white-box').append($('

').text(result.os)); - } - }) - .fail(function (xhr, status, result) { - photoboothTools.console.log('Operating system check failed: ', result); - }); - }; - - api.runCmd = function ($mode) { - command = { - mode: $mode - }; - - photoboothTools.console.log('Run' + $mode); - - jQuery - .post('api/update.php', command) - .done(function (result) { - photoboothTools.console.log($mode, 'result: ', result); - const updateError = photoboothTools.getTranslation('update_error'); - - if (result.success) { - if ($mode == 'check-deps') { - // eslint-disable-next-line - result.output.forEach(function (item, index, array) { - $('.white-box').append($('

').text(item)); - }); - } - } else { - $('.white-box').append($('

').text(updateError)); - } - }) - .fail(function (xhr, status, result) { - const updateFail = photoboothTools.getTranslation('update_fail'); - $('.white-box').append($('

').text(updateFail)); - photoboothTools.console.log($mode, 'result: ', result); - }); - }; - - return api; -})(); - -// Init on domready -$(function () { - dependencies.init(); -}); diff --git a/src/js/update.js b/src/js/update.js deleted file mode 100644 index de73b8681..000000000 --- a/src/js/update.js +++ /dev/null @@ -1,159 +0,0 @@ -/* globals photoboothTools */ - -const updater = (function () { - // vars - const api = {}; - - let command; - - // init - api.init = function () { - $('.gitCommit').hide(); - $('.updateDev').hide(); - $('.updateStable').hide(); - api.checkOS(); - }; - - api.checkOS = function () { - jQuery - .post('api/checkOS.php') - .done(function (result) { - photoboothTools.console.log('Operating system: ' + result.os); - const checkConnection = photoboothTools.getTranslation('check_connection'), - unsupportedOs = photoboothTools.getTranslation('unsupported_os'); - - if (result.os == 'linux') { - $('.white-box').append($('

').text(result.os)); - $('.white-box').append($('

').text(checkConnection)); - api.checkConnection(); - } else { - $('.white-box').append($('

').text(unsupportedOs)); - $('.white-box').append($('

').text(result.os)); - } - }) - .fail(function (xhr, status, result) { - photoboothTools.console.log('Operating system check failed: ', result); - }); - }; - - api.checkConnection = function () { - jQuery - .post('api/checkConnection.php') - .done(function (result) { - photoboothTools.console.log('Connected: ', result); - const ok = photoboothTools.getTranslation('ok'), - noConnection = photoboothTools.getTranslation('no_connection'), - updateCheckGit = photoboothTools.getTranslation('update_check_git'); - - if (result.connected === true) { - $('.white-box').append($('

').text(ok)); - $('.white-box').append($('

').text(updateCheckGit)); - api.runCmd('check-git'); - } else { - $('.white-box').append($('

').text(noConnection)); - } - }) - .fail(function (xhr, status, result) { - photoboothTools.console.log('Checking connection failed: ', result); - }); - }; - - api.runCmd = function ($mode) { - command = { - mode: $mode - }; - - photoboothTools.console.log('Run ' + $mode); - - jQuery - .post('api/update.php', command) - .done(function (result) { - photoboothTools.console.log($mode, 'result: ', result); - const updateCommitBackup = photoboothTools.getTranslation('update_commit_backup'), - updateReady = photoboothTools.getTranslation('update_ready'), - updateNoGit = photoboothTools.getTranslation('update_no_git'), - updateGitCommited = photoboothTools.getTranslation('update_git_commited'), - updateDone = photoboothTools.getTranslation('update_done'), - updateError = photoboothTools.getTranslation('update_error'), - ok = photoboothTools.getTranslation('ok'); - - if (result.success) { - if ($mode === 'check-git') { - if (result.output == 'commit') { - $('.white-box').append($('

').text(updateCommitBackup)); - $('.gitCommit').show(); - } else if (result.output == 'true') { - $('.white-box').append($('

').text(ok)); - $('.white-box').append($('

').text(updateReady)); - $('.updateDev').show(); - $('.updateStable').show(); - } else { - $('.white-box').append($('

').text(updateNoGit)); - } - } else if ($mode === 'commit') { - $('.gitCommit').hide(); - if (config.dev.loglevel > 0) { - // eslint-disable-next-line - result.output.forEach(function (item, index, array) { - $('.white-box').append($('

').text(item)); - }); - } - $('.white-box').append($('

').text(updateGitCommited)); - $('.white-box').append($('

').text(updateReady)); - $('.updateDev').show(); - $('.updateStable').show(); - } else if ($mode === 'update-dev' || $mode === 'update-stable') { - if (config.dev.loglevel > 0) { - // eslint-disable-next-line - result.output.forEach(function (item, index, array) { - $('.white-box').append($('

').text(item)); - }); - } - $('.white-box').append($('

').text(updateDone)); - } - } else { - $('.white-box').append($('

').text(updateError)); - } - }) - .fail(function (xhr, status, result) { - const updateFail = photoboothTools.getTranslation('update_fail'); - $('.white-box').append($('

').text(updateFail)); - photoboothTools.console.log($mode, 'result: ', result); - }); - }; - - $('.gitCommit').on('click', function (e) { - e.preventDefault(); - const updateCommitting = photoboothTools.getTranslation('update_committing'); - $('.white-box').append($('

').text(updateCommitting)); - api.runCmd('commit'); - $('.gitCommit').blur(); - }); - - $('.updateDev').on('click', function (e) { - e.preventDefault(); - const updateRunning = photoboothTools.getTranslation('update_running'); - $('.white-box').append($('

').text(updateRunning)); - api.runCmd('update-dev'); - $('.updateDev').blur(); - $('.updateDev').hide(); - $('.updateStable').hide(); - }); - - $('.updateStable').on('click', function (e) { - e.preventDefault(); - const updateRunning = photoboothTools.getTranslation('update_running'); - $('.white-box').append($('

').text(updateRunning)); - api.runCmd('update-stable'); - $('.updateStable').blur(); - $('.updateDev').hide(); - $('.updateStable').hide(); - }); - - return api; -})(); - -// Init on domready -$(function () { - updater.init(); -}); diff --git a/src/sass/update.scss b/src/sass/update.scss deleted file mode 100644 index 49f44aa3e..000000000 --- a/src/sass/update.scss +++ /dev/null @@ -1,33 +0,0 @@ -@import 'modules/theme'; -@import 'partials/basic'; -@import 'partials/button'; -@import 'partials/fonts'; -@import 'partials/modal'; -@import 'partials/shape'; - -.updatewrapper { - display: block; - padding: 1em 2em 2em; - position: relative; - overflow-y: auto; - width: 100%; - height: 100%; - text-align: center; - background-color: $mainColor; - background-image: $backgroundImage; - background-position: center center; - background-repeat: no-repeat; - background-size: cover; - background-attachment: fixed; - .btn { - margin-top: 0.2em; - } -} - -.white-box { - background-color: white; - color: black; - white-space: normal; - overflow: scroll; - max-height: 70%; -} diff --git a/update.php b/update.php deleted file mode 100644 index b5354dff0..000000000 --- a/update.php +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - <?=$config['ui']['branding']?> - - - - - - - - - - - - - - - - - - - - - - - - - -

-

Updater (experimental)

-

-
- - - - - - - -
- - - -
- - - - - - - - - - - -