Commit c2fae452 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch '1133-update' into 'development'

Resolve "Update"

Closes #1133

See merge request !1875
parents 90eae865 13dc375a
......@@ -19,7 +19,6 @@ npm-debug.log
/.buildpath
/.project
composer.lock
package-lock.json
local.log
......
......@@ -64,21 +64,6 @@ prepare_node:
- branches
- tags
prepare_composer:
stage: prepare
image: registry.metager.de/open-source/composer/master
variables:
COMPOSER_HOME: "$CI_PROJECT_DIR/.composer"
script:
- composer install --no-dev
artifacts:
paths:
- vendor
cache:
key: "metager-${CI_JOB_NAME}"
paths:
- .composer
review:
variables:
HELM_UPGRADE_VALUES_FILE: .gitlab/review-apps-values.yaml
......
C:37:"PHPUnit\Runner\DefaultTestResultCache":1522:{a:2:{s:7:"defects";a:13:{s:44:"Tests\Browser\StaticPagesTest::testStartpage";i:4;s:46:"Tests\Browser\StaticPagesTest::testDatenschutz";i:4;s:40:"Tests\Browser\StaticPagesTest::testHilfe";i:4;s:42:"Tests\Browser\StaticPagesTest::testSpenden";i:4;s:38:"Tests\Browser\StaticPagesTest::testApp";i:4;s:42:"Tests\Browser\StaticPagesTest::testKontakt";i:4;s:39:"Tests\Browser\StaticPagesTest::testTeam";i:4;s:40:"Tests\Browser\StaticPagesTest::testAbout";i:4;s:42:"Tests\Browser\StaticPagesTest::testImpress";i:4;s:41:"Tests\Browser\StaticPagesTest::testPlugin";i:4;s:41:"Tests\Browser\StaticPagesTest::testWidget";i:4;s:50:"Tests\Browser\StaticPagesTest::testWebsearchWidget";i:4;s:51:"Tests\Browser\StaticPagesTest::testSitesearchWidget";i:4;}s:5:"times";a:13:{s:44:"Tests\Browser\StaticPagesTest::testStartpage";d:1.179;s:46:"Tests\Browser\StaticPagesTest::testDatenschutz";d:3.296;s:40:"Tests\Browser\StaticPagesTest::testHilfe";d:1.095;s:42:"Tests\Browser\StaticPagesTest::testSpenden";d:1.585;s:38:"Tests\Browser\StaticPagesTest::testApp";d:1.036;s:42:"Tests\Browser\StaticPagesTest::testKontakt";d:1.468;s:39:"Tests\Browser\StaticPagesTest::testTeam";d:1.155;s:40:"Tests\Browser\StaticPagesTest::testAbout";d:1.016;s:42:"Tests\Browser\StaticPagesTest::testImpress";d:1.105;s:41:"Tests\Browser\StaticPagesTest::testPlugin";d:1.171;s:41:"Tests\Browser\StaticPagesTest::testWidget";d:1.071;s:50:"Tests\Browser\StaticPagesTest::testWebsearchWidget";d:1.025;s:51:"Tests\Browser\StaticPagesTest::testSitesearchWidget";d:1.099;}}}
\ No newline at end of file
......@@ -66,6 +66,12 @@ COPY config/nginx-default.conf /etc/nginx/sites-available/default
RUN sed -i 's/fastcgi_pass phpfpm:9000;/fastcgi_pass localhost:9000;/g' /etc/nginx/sites-available/default
COPY --chown=root:www-data . /html
COPY ./helpers/installComposer.sh /usr/bin/installComposer
RUN chmod +x /usr/bin/installComposer && \
/usr/bin/installComposer && \
rm /usr/bin/installComposer && \
composer install --no-dev
WORKDIR /html
EXPOSE 80
......
......@@ -60,7 +60,14 @@ RUN mkdir -p /run/php && \
WORKDIR /html
EXPOSE 80
COPY ./helpers/installComposer.sh /usr/bin/installComposer
RUN chmod +x /usr/bin/installComposer && \
/usr/bin/installComposer && \
rm /usr/bin/installComposer
CMD chown -R root:www-data storage/logs/metager bootstrap/cache && \
chmod -R g+w storage/logs/metager bootstrap/cache && \
cron -L /dev/stdout && \
composer install && \
php-fpm7.4
......@@ -2,4 +2,5 @@ README.md
CHANGELOG.md
vendor/*
node_modules/*
storage/logs/*
\ No newline at end of file
storage/logs/*
helpers/*
\ No newline at end of file
......@@ -2,7 +2,7 @@
namespace App\Exceptions;
use Exception;
use Throwable;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
......@@ -27,10 +27,10 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $exception
* @param \Throwable $exception
* @return void
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
parent::report($exception);
}
......@@ -39,10 +39,10 @@ class Handler extends ExceptionHandler
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @param \Throwable $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
if ($request->is('*/meta/meta.ger3*')) {
$registry = \Prometheus\CollectorRegistry::getDefault();
......
......@@ -47,10 +47,11 @@ class HumanVerification extends Controller
if ($request->getMethod() == 'POST') {
\App\PrometheusExporter::CaptchaAnswered();
$lockedKey = $user["lockedKey"];
$key = $request->input('captcha');
$key = strtolower($key);
if (!$hasher->check($key, $lockedKey)) {
$rules = ['captcha' => 'required|captcha_api:' . $lockedKey . ',math'];
$validator = validator()->make(request()->all(), $rules);
if($validator->fails()) {
$captcha = Captcha::create("default", true);
$user["lockedKey"] = $captcha["key"];
HumanVerification::saveUser($user);
......
......@@ -119,7 +119,7 @@ class LanguageController extends Controller
foreach ($languages as $lang => $value) {
if ($lang !== $to) {
$langs = array_add($langs, $lang, $lang);
$langs[$lang] = $lang;
}
}
if (!isset($languages[$to])) {
......
......@@ -10,8 +10,8 @@ use LaravelLocalization;
use Mail;
use Log;
use Validator;
use \IBAN;
use \IBANCountry;
use \PHP_IBAN\IBAN;
use \PHP_IBAN\IBANCountry;
class MailController extends Controller
{
......
......@@ -149,7 +149,7 @@ class MetaGer
$focusPages = [];
foreach ($this->request->all() as $key => $value) {
if (starts_with($key, 'engine_') && $value === 'on') {
if (stripos($key, 'engine_') === 0 && $value === 'on') {
$focusPages[] = $key;
}
}
......@@ -1684,7 +1684,7 @@ class MetaGer
$foki = array_keys($sumaFile['foki']);
foreach ($cookies as $key => $value) {
if (starts_with($key, [$this->getFokus() . "_setting_", $this->getFokus() . "_engine_", $this->getFokus() . "_blpage"])) {
if (in_array($key, [$this->getFokus() . "_setting_", $this->getFokus() . "_engine_", $this->getFokus() . "_blpage"])) {
$count++;
continue;
}
......
......@@ -2,6 +2,7 @@
namespace App\Models;
/* Die Klasse Result sammelt alle Informationen über ein einzelnes Suchergebnis.
* Die Results werden von den Suchmaschinenspezifischen Parser-Skripten erstellt.
*/
......@@ -424,7 +425,7 @@ class Result
*/
public function getUrlElements($url)
{
if (!starts_with($url, "http")) {
if (stripos($url, "http") !== 0) {
$url = "http://" . $url;
}
......
......@@ -8,54 +8,42 @@
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"endclothing/prometheus_client_php": "^1.0",
"fideloper/proxy": "^4.0",
"globalcitizen/php-iban": "^2.6",
"php": "^7.3|^8.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"globalcitizen/php-iban": "^4.0.0",
"guzzlehttp/guzzle": "^7.0.1",
"jenssegers/agent": "^2.6",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"laravel/framework": "^8.40",
"laravel/tinker": "^2.5",
"mcamara/laravel-localization": "1.6.*",
"mews/captcha": "^2.2",
"symfony/dom-crawler": "^4.1"
"mews/captcha": "^3.2.6",
"promphp/prometheus_client_php": "^2.2",
"symfony/dom-crawler": "^5.2"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3",
"browserstack/browserstack-local": "^1.1",
"filp/whoops": "^2.9",
"fzaninotto/faker": "^1.4",
"laravel/dusk": "^5.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"php-webdriver/webdriver": "^1.6",
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
"laravel/dusk": "^6.15",
"php-webdriver/webdriver": "^1.6"
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
......@@ -67,5 +55,17 @@
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
\ No newline at end of file
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
This diff is collapsed.
......@@ -213,6 +213,7 @@ return [
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
......
......@@ -4,112 +4,107 @@ return [
/*
|--------------------------------------------------------------------------
| Mail Driver
| Default Mailer
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
|
| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill",
| "ses", "sparkpost", "log"
|
*/
*/
'driver' => env('MAIL_DRIVER', 'smtp'),
'default' => env('MAIL_MAILER', 'smtp'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
*/
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
|
*/
*/
'port' => env('MAIL_PORT', 587),
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
],
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'ses' => [
'transport' => 'ses',
],
'from' => [
'address' => null,
'name' => null,
],
'mailgun' => [
'transport' => 'mailgun',
],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'postmark' => [
'transport' => 'postmark',
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
],
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'username' => env('MAIL_USERNAME'),
'array' => [
'transport' => 'array',
],
],
/*
|--------------------------------------------------------------------------
| SMTP Server Password
| Global "From" Address
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
*/
'password' => env('MAIL_PASSWORD'),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| Sendmail System Path
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
*/
'sendmail' => '/usr/sbin/sendmail -bs',
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];
];
\ No newline at end of file
......@@ -161,7 +161,7 @@ return [
|
*/
'secure' => env('SESSION_SECURE_COOKIE', false),
'secure' => env('SESSION_SECURE_COOKIE'),
/*
|--------------------------------------------------------------------------
......
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
......
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use DB;
use Hash;
class UsersSeeder extends Seeder
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment