diff --git a/.gitlab/deployment_scripts/update_secret.sh b/.gitlab/deployment_scripts/update_secret.sh index 522e46aca6f2886df03dd4e4f05b518ea4718dba..78738550b823a330f05de3674b86ad20834444aa 100755 --- a/.gitlab/deployment_scripts/update_secret.sh +++ b/.gitlab/deployment_scripts/update_secret.sh @@ -9,7 +9,6 @@ HELM_RELEASE_NAME=${HELM_RELEASE_NAME%%*(-)} kubectl -n $KUBE_NAMESPACE create secret generic ${HELM_RELEASE_NAME} \ --from-file=${ENV_PRODUCTION} \ --from-file=${SUMAS} \ - --from-file=${SUMASEN} \ --from-file=${ADBLACKLIST_DOMAINS} \ --from-file=${ADBLACKLIST_URL} \ --from-file=${BLACKLIST_DESCRIPTION_URL} \ diff --git a/build/fpm/entrypoint/validate_laravel.sh b/build/fpm/entrypoint/validate_laravel.sh index 55ee21b019e6230005e4a0facf21d608f6f55c07..ebb3838fd705262151cf2495b82fa693a87fb42f 100755 --- a/build/fpm/entrypoint/validate_laravel.sh +++ b/build/fpm/entrypoint/validate_laravel.sh @@ -8,10 +8,6 @@ if [ ! -f "$BASE_DIR/config/sumas.json" ]; then cp $BASE_DIR/config/sumas.json.example $BASE_DIR/config/sumas.json fi -if [ ! -f "$BASE_DIR/config/sumasEn.json" ]; then - cp $BASE_DIR/config/sumas.json.example $BASE_DIR/config/sumasEn.json -fi - if [ ! -d "$BASE_DIR/database/databases/" ]; then mkdir -p "$BASE_DIR/database/databases/" fi diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 9af9f4bef28dfa076fc7ad67c2dd727d03b11eda..5bb6730cbeb872983a65b260813150839b4ed05a 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -60,9 +60,6 @@ spec: - name: secrets mountPath: /metager/metager_app/config/sumas.json subPath: SUMAS - - name: secrets - mountPath: /metager/metager_app/config/sumasEn.json - subPath: SUMASEN - name: secrets mountPath: /metager/metager_app/config/blacklistDomains.txt subPath: BLACKLIST_DOMAINS diff --git a/metager/app/Console/Commands/MonthlyRequestsGather.php b/metager/app/Console/Commands/MonthlyRequestsGather.php index ef9b138a816e43f389360c7b36f8efd94a1ae8a0..343e6f1307a75b63c43f984f46097329972cc431 100644 --- a/metager/app/Console/Commands/MonthlyRequestsGather.php +++ b/metager/app/Console/Commands/MonthlyRequestsGather.php @@ -43,13 +43,10 @@ class MonthlyRequestsGather extends Command { # Read in the suma Files $sumaFile = config_path('sumas.json'); - $sumaEnFile = config_path('sumasEn.json'); - if (file_exists($sumaFile) && file_exists($sumaEnFile)) { + if (file_exists($sumaFile)) { $sumas = json_decode(file_get_contents($sumaFile)); - $sumasEn = json_decode(file_get_contents($sumaEnFile)); $this->gatherLogs($sumas); - $this->gatherLogs($sumasEn); foreach ($this->values as $name => $value) { $entry = DB::table('monthlyrequests')->where(['name' => $name])->first(); @@ -63,7 +60,6 @@ class MonthlyRequestsGather extends Command } $this->disableOverusedEngines($sumaFile, $sumas); - $this->disableOverusedEngines($sumaEnFile, $sumasEn); DB::disconnect('mysql'); } } @@ -115,7 +111,6 @@ class MonthlyRequestsGather extends Command $this->values[$sumaName] = intval($currentValue); } } - } } } diff --git a/metager/app/Http/Controllers/FokiLoader.php b/metager/app/Http/Controllers/FokiLoader.php deleted file mode 100644 index a71e69729d7858f67c32903d44e25e109cd8c1c5..0000000000000000000000000000000000000000 --- a/metager/app/Http/Controllers/FokiLoader.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace App\Http\Controllers; - -use App; - -class FokiLoader -{ - public static function loadFoki() - { - $sumaFile = ""; - if (App::isLocale('en')) { - $sumaFile = config_path() . "/sumasEn.xml"; - } else { - $sumaFile = config_path() . "/sumas.xml"; - } - - $xml = \simplexml_load_file($sumaFile); - $sumas = $xml->xpath("suma"); - - $foki = []; - foreach ($sumas as $suma) { - if ((!isset($suma['disabled']) || $suma['disabled'] === "") && (!isset($suma['userSelectable']) || $suma['userSelectable']->__toString() === "1")) { - if (isset($suma['type'])) { - $f = explode(",", $suma['type']->__toString()); - foreach ($f as $tmp) { - $displayName = $suma['displayName']->__toString(); - $url = isset($suma['homepage']) ? $suma['homepage']->__toString() : "https://metager.de"; - $foki[$tmp][$suma['name']->__toString()] = ['displayName' => $displayName, 'url' => $url]; - } - } else { - $displayName = $suma['displayName']->__toString(); - $url = isset($suma['homepage']) ? $suma['homepage']->__toString() : "https://metager.de"; - $foki["andere"][$suma['name']->__toString()] = ['displayName' => $displayName, 'url' => $url]; - } - } - } - - return $foki; - } -} diff --git a/metager/app/Http/Controllers/SearchEngineList.php b/metager/app/Http/Controllers/SearchEngineList.php index 4cdbdc43fc1bc7e7cb154530b7b0d9b063d25b56..65ca36ab8605ffbb1f017ea94bc4eddf98a55d75 100644 --- a/metager/app/Http/Controllers/SearchEngineList.php +++ b/metager/app/Http/Controllers/SearchEngineList.php @@ -9,12 +9,9 @@ class SearchEngineList extends Controller { function index() { - $suma_file = ""; - if (App::isLocale("en")) { - $suma_file = config_path() . "/sumasEn.json"; - } else { - $suma_file = config_path() . "/sumas.json"; - } + + $suma_file = config_path() . "/sumas.json"; + if (empty($suma_file)) { abort(404); } diff --git a/metager/app/MetaGer.php b/metager/app/MetaGer.php index 45cac0ae5bf148145042950eb14ef1a6159a142a..226ec1e60d4342d6cd04899ef667d67d828fce4d 100644 --- a/metager/app/MetaGer.php +++ b/metager/app/MetaGer.php @@ -1748,12 +1748,7 @@ class MetaGer public static function getLanguageFile() { - $locale = LaravelLocalization::getCurrentLocale(); - if ($locale === "en") { - return config_path('sumasEn.json'); - } else { - return config_path('sumas.json'); - } + return config_path('sumas.json'); } public function getLang() diff --git a/metager/config/.gitignore b/metager/config/.gitignore index ea281d5f7c70a452763db8b6005fb75d7a909bac..e35db70e1f8134483e802bbad4f1fcb4f47fb293 100644 --- a/metager/config/.gitignore +++ b/metager/config/.gitignore @@ -1,7 +1,4 @@ -sumas.xml -sumasEn.xml sumas.json -sumasEn.json blacklistUrl.txt blacklistDomains.txt spam.txt \ No newline at end of file