diff --git a/.env.example b/.env.example index ab8f68072..952d224e9 100644 --- a/.env.example +++ b/.env.example @@ -1,39 +1,24 @@ ############################################################################################################ # Development Environment -# Userid for the user that will run the application inside the container +# User and group id for the user that will run the application inside the container +# Run in your terminal: `id -u` and `id -g` and that's the results USERID= +GROUPID= ############################################################################################################ APP_NAME=Laravel +APP_SERVICE=php APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost -LOG_CHANNEL=stack -LOG_DEPRECATIONS_CHANNEL=null -LOG_LEVEL=debug - DB_CONNECTION=pgsql DB_HOST=postgres DB_PORT=5432 DB_DATABASE=coolify -DB_USERNAME=sail +DB_USERNAME=coolify DB_PASSWORD=password -BROADCAST_DRIVER=log -CACHE_DRIVER=file -FILESYSTEM_DISK=local -QUEUE_CONNECTION=sync -SESSION_DRIVER=file -SESSION_LIFETIME=120 - -MAIL_MAILER=smtp -MAIL_HOST=mailpit -MAIL_PORT=1025 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS="hello@example.com" -MAIL_FROM_NAME="${APP_NAME}" \ No newline at end of file +QUEUE_CONNECTION=database diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 000000000..77a715a14 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,29 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "*" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: | + docker run --rm -u "$(id -u):$(id -g)" \ + -v "$(pwd):/app" \ + -w /app composer:2 \ + composer install --ignore-platform-reqs + TAG=$(date +%s) ./vendor/bin/sail build + TAG=$(date +%s) ./vendor/bin/sail up -d + sleep 1 + ./vendor/bin/sail ps + # Now to create .env + # Await database is created + # pest diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index fd4edd2bf..000000000 --- a/Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM serversideup/php:8.2-fpm-nginx - -ARG NODE_VERSION=18 -ARG POSTGRES_VERSION=15 - -RUN apt-get update \ - && curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \ - && apt-get install -y nodejs \ - && npm install -g npm - -RUN apt-get install -y php-pgsql - -RUN apt-get -y autoremove \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* - -# Adding test ssh key -RUN mkdir -p ~/.ssh -RUN echo "-----BEGIN OPENSSH PRIVATE KEY-----\n\ - b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\n\ - QyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevAAAAJi/QySHv0Mk\n\ - hwAAAAtzc2gtZWQyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevA\n\ - AAAECBQw4jg1WRT2IGHMncCiZhURCts2s24HoDS0thHnnRKVuGmoeGq/pojrsyP1pszcNV\n\ - uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==\n\ - -----END OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_ed25519 -RUN chmod 0600 ~/.ssh/id_ed25519 \ No newline at end of file diff --git a/app/Http/Livewire/RunCommand.php b/app/Http/Livewire/RunCommand.php new file mode 100755 index 000000000..76425e012 --- /dev/null +++ b/app/Http/Livewire/RunCommand.php @@ -0,0 +1,54 @@ +isKeepAliveOn = true; + + $this->activity = coolifyProcess($this->command, 'testing-host'); + } + + public function runSleepingBeauty() + { + $this->isKeepAliveOn = true; + + $this->activity = coolifyProcess('x=1; while [ $x -le 40 ]; do sleep 0.1 && echo "Welcome $x times" $(( x++ )); done', 'testing-host'); + } + + public function runDummyProjectBuild() + { + $this->isKeepAliveOn = true; + + $this->activity = coolifyProcess(<<activity?->refresh(); + + if (data_get($this->activity, 'properties.exitCode') !== null) { + $this->isKeepAliveOn = false; + } + } +} diff --git a/app/Jobs/ExecuteCoolifyProcess.php b/app/Jobs/ExecuteCoolifyProcess.php new file mode 100755 index 000000000..8dca3bc00 --- /dev/null +++ b/app/Jobs/ExecuteCoolifyProcess.php @@ -0,0 +1,132 @@ +timeStart = hrtime(true); + + $user = $this->activity->getExtraProperty('user'); + $destination = $this->activity->getExtraProperty('destination'); + $port = $this->activity->getExtraProperty('port'); + $command = $this->activity->getExtraProperty('command'); + + $delimiter = 'EOF-COOLIFY-SSH'; + + $sshCommand = 'ssh ' + . '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ' + . '-o PasswordAuthentication=no ' + . '-o RequestTTY=no ' + // Quiet mode. Causes most warning and diagnostic messages to be suppressed. + // Errors are still out put. This is to silence for example, that warning + // Permanently added to the list of known hosts. + . '-q ' + . "-p {$port} " + . "{$user}@{$destination} " + . " 'bash -se' << \\$delimiter" . PHP_EOL + . $command . PHP_EOL + . $delimiter; + + $process = Process::start($sshCommand, $this->handleOutput(...)); + + $processResult = $process->wait(); + + $status = match ($processResult->exitCode()) { + 0 => ProcessStatus::FINISHED, + default => ProcessStatus::ERROR, + }; + + $this->activity->properties = $this->activity->properties->merge([ + 'exitCode' => $processResult->exitCode(), + 'stdout' => $processResult->output(), + 'stderr' => $processResult->errorOutput(), + 'status' => $status, + ]); + + $this->activity->save(); + + return $processResult; + } + + protected function handleOutput(string $type, string $output) + { + $this->currentTime = $this->elapsedTime(); + + if ($type === 'out') { + $this->stdOutIncremental .= $output; + } else { + $this->stdErrIncremental .= $output; + } + + $this->activity->description .= $output; + + if ($this->isAfterLastThrottle()) { + // Let's write to database. + DB::transaction(function () { + $this->activity->save(); + $this->lastWriteAt = $this->currentTime; + }); + } + } + + /** + * Decides if it's time to write again to database. + * + * @return bool + */ + protected function isAfterLastThrottle() + { + // If DB was never written, then we immediately decide we have to write. + if ($this->lastWriteAt === 0) { + return true; + } + + return ($this->currentTime - $this->throttleIntervalMS) > $this->lastWriteAt; + } + + protected function elapsedTime(): int + { + $timeMs = (hrtime(true) - $this->timeStart) / 1_000_000; + + return intval($timeMs); + } +} diff --git a/app/Services/CoolifyProcess.php b/app/Services/CoolifyProcess.php new file mode 100644 index 000000000..16071ebd7 --- /dev/null +++ b/app/Services/CoolifyProcess.php @@ -0,0 +1,47 @@ +activity = activity() + ->withProperties([ + 'type' => 'COOLIFY_PROCESS', + 'user' => $this->user, + 'destination' => $this->destination, + 'port' => $this->port, + 'command' => $this->command, + 'status' => ProcessStatus::HOLDING, + ]) + ->log("Awaiting to start command...\n\n"); + } + + public function __invoke(): Activity|ProcessResult + { + $job = new ExecuteCoolifyProcess($this->activity); + + if (app()->environment('testing')) { + return $job->handle(); + } + + dispatch($job); + + return $this->activity; + } + + +} diff --git a/app/Services/ProcessStatus.php b/app/Services/ProcessStatus.php new file mode 100644 index 000000000..a835d29d3 --- /dev/null +++ b/app/Services/ProcessStatus.php @@ -0,0 +1,11 @@ + $destination, + 'command' => $command, + ]); + + $activityLog = $process(); + + return $activityLog; + } +} diff --git a/composer.json b/composer.json index 4958668f0..2b626323e 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,10 @@ "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^10.0", "laravel/sanctum": "^3.2", - "laravel/tinker": "^2.8" + "laravel/tinker": "^2.8", + "livewire/livewire": "^2.12", + "spatie/laravel-activitylog": "^4.7", + "spatie/laravel-ray": "^1.32" }, "require-dev": { "fakerphp/faker": "^1.9.1", @@ -17,10 +20,14 @@ "laravel/sail": "^1.18", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^7.0", + "pestphp/pest": "^2.0", "phpunit/phpunit": "^10.0", "spatie/laravel-ignition": "^2.0" }, "autoload": { + "files": [ + "bootstrap/helpers.php" + ], "psr-4": { "App\\": "app/", "Database\\Factories\\": "database/factories/", diff --git a/composer.lock b/composer.lock index 9976cf5ae..bad962709 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "121ea3a2fffe49b3ef9aa4d064b28c19", + "content-hash": "5b876c04da75e4ae5fab21efa402fd45", "packages": [ { "name": "brick/math", @@ -1709,6 +1709,79 @@ ], "time": "2022-04-17T13:12:02+00:00" }, + { + "name": "livewire/livewire", + "version": "v2.12.3", + "source": { + "type": "git", + "url": "https://github.com/livewire/livewire.git", + "reference": "019b1e69d8cd8c7e749eba7a38e4fa69ecbc8f74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/livewire/livewire/zipball/019b1e69d8cd8c7e749eba7a38e4fa69ecbc8f74", + "reference": "019b1e69d8cd8c7e749eba7a38e4fa69ecbc8f74", + "shasum": "" + }, + "require": { + "illuminate/database": "^7.0|^8.0|^9.0|^10.0", + "illuminate/support": "^7.0|^8.0|^9.0|^10.0", + "illuminate/validation": "^7.0|^8.0|^9.0|^10.0", + "league/mime-type-detection": "^1.9", + "php": "^7.2.5|^8.0", + "symfony/http-kernel": "^5.0|^6.0" + }, + "require-dev": { + "calebporzio/sushi": "^2.1", + "laravel/framework": "^7.0|^8.0|^9.0|^10.0", + "mockery/mockery": "^1.3.1", + "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0", + "orchestra/testbench-dusk": "^5.2|^6.0|^7.0|^8.0", + "phpunit/phpunit": "^8.4|^9.0", + "psy/psysh": "@stable" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Livewire\\LivewireServiceProvider" + ], + "aliases": { + "Livewire": "Livewire\\Livewire" + } + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Livewire\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Caleb Porzio", + "email": "calebporzio@gmail.com" + } + ], + "description": "A front-end framework for Laravel.", + "support": { + "issues": "https://github.com/livewire/livewire/issues", + "source": "https://github.com/livewire/livewire/tree/v2.12.3" + }, + "funding": [ + { + "url": "https://github.com/livewire", + "type": "github" + } + ], + "time": "2023-03-03T20:12:38+00:00" + }, { "name": "monolog/monolog", "version": "3.3.1", @@ -2278,6 +2351,59 @@ ], "time": "2023-02-25T19:38:58+00:00" }, + { + "name": "pimple/pimple", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a94b3a4db7fb774b3d78dad2315ddc07629e1bed", + "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1 || ^2.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^5.4@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container", + "homepage": "https://pimple.symfony.com", + "keywords": [ + "container", + "dependency injection" + ], + "support": { + "source": "https://github.com/silexphp/Pimple/tree/v3.5.0" + }, + "time": "2021-10-28T11:13:42+00:00" + }, { "name": "psr/container", "version": "2.0.2", @@ -2943,6 +3069,430 @@ ], "time": "2023-01-12T18:13:24+00:00" }, + { + "name": "spatie/backtrace", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/backtrace.git", + "reference": "ec4dd16476b802dbdc6b4467f84032837e316b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/ec4dd16476b802dbdc6b4467f84032837e316b8c", + "reference": "ec4dd16476b802dbdc6b4467f84032837e316b8c", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "ext-json": "*", + "phpunit/phpunit": "^9.3", + "spatie/phpunit-snapshot-assertions": "^4.2", + "symfony/var-dumper": "^5.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Backtrace\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van de Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A better backtrace", + "homepage": "https://github.com/spatie/backtrace", + "keywords": [ + "Backtrace", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/backtrace/tree/1.4.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/spatie", + "type": "github" + }, + { + "url": "https://spatie.be/open-source/support-us", + "type": "other" + } + ], + "time": "2023-03-04T08:57:24+00:00" + }, + { + "name": "spatie/laravel-activitylog", + "version": "4.7.3", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-activitylog.git", + "reference": "ec65a478a909b8df1b4f0c3c45de2592ca7639e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-activitylog/zipball/ec65a478a909b8df1b4f0c3c45de2592ca7639e5", + "reference": "ec65a478a909b8df1b4f0c3c45de2592ca7639e5", + "shasum": "" + }, + "require": { + "illuminate/config": "^8.0 || ^9.0 || ^10.0", + "illuminate/database": "^8.69 || ^9.27 || ^10.0", + "illuminate/support": "^8.0 || ^9.0 || ^10.0", + "php": "^8.0", + "spatie/laravel-package-tools": "^1.6.3" + }, + "require-dev": { + "ext-json": "*", + "orchestra/testbench": "^6.23 || ^7.0 || ^8.0", + "pestphp/pest": "^1.20" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\Activitylog\\ActivitylogServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\Activitylog\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + }, + { + "name": "Sebastian De Deyne", + "email": "sebastian@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + }, + { + "name": "Tom Witkowski", + "email": "dev.gummibeer@gmail.com", + "homepage": "https://gummibeer.de", + "role": "Developer" + } + ], + "description": "A very simple activity logger to monitor the users of your website or application", + "homepage": "https://github.com/spatie/activitylog", + "keywords": [ + "activity", + "laravel", + "log", + "spatie", + "user" + ], + "support": { + "issues": "https://github.com/spatie/laravel-activitylog/issues", + "source": "https://github.com/spatie/laravel-activitylog/tree/4.7.3" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2023-01-25T17:04:51+00:00" + }, + { + "name": "spatie/laravel-package-tools", + "version": "1.14.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-package-tools.git", + "reference": "bab62023a4745a61170ad5424184533685e73c2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/bab62023a4745a61170ad5424184533685e73c2d", + "reference": "bab62023a4745a61170ad5424184533685e73c2d", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^9.28|^10.0", + "php": "^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.5", + "orchestra/testbench": "^7.7|^8.0", + "pestphp/pest": "^1.22", + "phpunit/phpunit": "^9.5.24", + "spatie/pest-plugin-test-time": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\LaravelPackageTools\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "role": "Developer" + } + ], + "description": "Tools for creating Laravel packages", + "homepage": "https://github.com/spatie/laravel-package-tools", + "keywords": [ + "laravel-package-tools", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-package-tools/issues", + "source": "https://github.com/spatie/laravel-package-tools/tree/1.14.2" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2023-03-14T16:41:21+00:00" + }, + { + "name": "spatie/laravel-ray", + "version": "1.32.3", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-ray.git", + "reference": "8c7ea86c8092bcfe7a046f640b6ac9e5d7ec98cd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/8c7ea86c8092bcfe7a046f640b6ac9e5d7ec98cd", + "reference": "8c7ea86c8092bcfe7a046f640b6ac9e5d7ec98cd", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/contracts": "^7.20|^8.19|^9.0|^10.0", + "illuminate/database": "^7.20|^8.19|^9.0|^10.0", + "illuminate/queue": "^7.20|^8.19|^9.0|^10.0", + "illuminate/support": "^7.20|^8.19|^9.0|^10.0", + "php": "^7.4|^8.0", + "spatie/backtrace": "^1.0", + "spatie/ray": "^1.37", + "symfony/stopwatch": "4.2|^5.1|^6.0", + "zbateson/mail-mime-parser": "^1.3.1|^2.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.3", + "laravel/framework": "^7.20|^8.19|^9.0|^10.0", + "orchestra/testbench-core": "^5.0|^6.0|^7.0|^8.0", + "pestphp/pest": "^1.22", + "phpstan/phpstan": "^0.12.93", + "phpunit/phpunit": "^9.3", + "spatie/pest-plugin-snapshots": "^1.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.29.x-dev" + }, + "laravel": { + "providers": [ + "Spatie\\LaravelRay\\RayServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Spatie\\LaravelRay\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily debug Laravel apps", + "homepage": "https://github.com/spatie/laravel-ray", + "keywords": [ + "laravel-ray", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-ray/issues", + "source": "https://github.com/spatie/laravel-ray/tree/1.32.3" + }, + "funding": [ + { + "url": "https://github.com/sponsors/spatie", + "type": "github" + }, + { + "url": "https://spatie.be/open-source/support-us", + "type": "other" + } + ], + "time": "2023-03-03T13:37:21+00:00" + }, + { + "name": "spatie/macroable", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/macroable.git", + "reference": "ec2c320f932e730607aff8052c44183cf3ecb072" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/macroable/zipball/ec2c320f932e730607aff8052c44183cf3ecb072", + "reference": "ec2c320f932e730607aff8052c44183cf3ecb072", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0|^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Macroable\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A trait to dynamically add methods to a class", + "homepage": "https://github.com/spatie/macroable", + "keywords": [ + "macroable", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/macroable/issues", + "source": "https://github.com/spatie/macroable/tree/2.0.0" + }, + "time": "2021-03-26T22:39:02+00:00" + }, + { + "name": "spatie/ray", + "version": "1.37.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/ray.git", + "reference": "a915e327f04c0fbed3bdd26e076e39feea091062" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/ray/zipball/a915e327f04c0fbed3bdd26e076e39feea091062", + "reference": "a915e327f04c0fbed3bdd26e076e39feea091062", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "php": "^7.3|^8.0", + "ramsey/uuid": "^3.0|^4.1", + "spatie/backtrace": "^1.1", + "spatie/macroable": "^1.0|^2.0", + "symfony/stopwatch": "^4.0|^5.1|^6.0", + "symfony/var-dumper": "^4.2|^5.1|^6.0" + }, + "require-dev": { + "illuminate/support": "6.x|^8.18|^9.0", + "nesbot/carbon": "^2.63", + "pestphp/pest": "^1.22", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5", + "spatie/phpunit-snapshot-assertions": "^4.2", + "spatie/test-time": "^1.2" + }, + "type": "library", + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\Ray\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Debug with Ray to fix problems faster", + "homepage": "https://github.com/spatie/ray", + "keywords": [ + "ray", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/ray/issues", + "source": "https://github.com/spatie/ray/tree/1.37.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/spatie", + "type": "github" + }, + { + "url": "https://spatie.be/open-source/support-us", + "type": "other" + } + ], + "time": "2023-03-06T07:22:28+00:00" + }, { "name": "symfony/console", "version": "v6.2.7", @@ -3901,6 +4451,89 @@ ], "time": "2022-11-03T14:55:06+00:00" }, + { + "name": "symfony/polyfill-iconv", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-iconv.git", + "reference": "927013f3aac555983a5059aada98e1907d842695" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/927013f3aac555983a5059aada98e1907d842695", + "reference": "927013f3aac555983a5059aada98e1907d842695", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-iconv": "*" + }, + "suggest": { + "ext-iconv": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Iconv\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Iconv extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "iconv", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, { "name": "symfony/polyfill-intl-grapheme", "version": "v1.27.0", @@ -4711,6 +5344,68 @@ ], "time": "2023-03-01T10:32:47+00:00" }, + { + "name": "symfony/stopwatch", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", + "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/service-contracts": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v6.2.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-02-14T08:44:56+00:00" + }, { "name": "symfony/string", "version": "v6.2.7", @@ -5406,9 +6101,354 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" + }, + { + "name": "zbateson/mail-mime-parser", + "version": "2.4.0", + "source": { + "type": "git", + "url": "https://github.com/zbateson/mail-mime-parser.git", + "reference": "20b3e48eb799537683780bc8782fbbe9bc25934a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zbateson/mail-mime-parser/zipball/20b3e48eb799537683780bc8782fbbe9bc25934a", + "reference": "20b3e48eb799537683780bc8782fbbe9bc25934a", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.7.0|^2.0", + "php": ">=7.1", + "pimple/pimple": "^3.0", + "zbateson/mb-wrapper": "^1.0.1", + "zbateson/stream-decorators": "^1.0.6" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "*", + "mikey179/vfsstream": "^1.6.0", + "phpstan/phpstan": "*", + "phpunit/phpunit": "<10" + }, + "suggest": { + "ext-iconv": "For best support/performance", + "ext-mbstring": "For best support/performance" + }, + "type": "library", + "autoload": { + "psr-4": { + "ZBateson\\MailMimeParser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Zaahid Bateson" + }, + { + "name": "Contributors", + "homepage": "https://github.com/zbateson/mail-mime-parser/graphs/contributors" + } + ], + "description": "MIME email message parser", + "homepage": "https://mail-mime-parser.org", + "keywords": [ + "MimeMailParser", + "email", + "mail", + "mailparse", + "mime", + "mimeparse", + "parser", + "php-imap" + ], + "support": { + "docs": "https://mail-mime-parser.org/#usage-guide", + "issues": "https://github.com/zbateson/mail-mime-parser/issues", + "source": "https://github.com/zbateson/mail-mime-parser" + }, + "funding": [ + { + "url": "https://github.com/zbateson", + "type": "github" + } + ], + "time": "2023-02-14T22:58:03+00:00" + }, + { + "name": "zbateson/mb-wrapper", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/zbateson/mb-wrapper.git", + "reference": "faf35dddfacfc5d4d5f9210143eafd7a7fe74334" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zbateson/mb-wrapper/zipball/faf35dddfacfc5d4d5f9210143eafd7a7fe74334", + "reference": "faf35dddfacfc5d4d5f9210143eafd7a7fe74334", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-iconv": "^1.9", + "symfony/polyfill-mbstring": "^1.9" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "*", + "phpstan/phpstan": "*", + "phpunit/phpunit": "<=9.0" + }, + "suggest": { + "ext-iconv": "For best support/performance", + "ext-mbstring": "For best support/performance" + }, + "type": "library", + "autoload": { + "psr-4": { + "ZBateson\\MbWrapper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Zaahid Bateson" + } + ], + "description": "Wrapper for mbstring with fallback to iconv for encoding conversion and string manipulation", + "keywords": [ + "charset", + "encoding", + "http", + "iconv", + "mail", + "mb", + "mb_convert_encoding", + "mbstring", + "mime", + "multibyte", + "string" + ], + "support": { + "issues": "https://github.com/zbateson/mb-wrapper/issues", + "source": "https://github.com/zbateson/mb-wrapper/tree/1.2.0" + }, + "funding": [ + { + "url": "https://github.com/zbateson", + "type": "github" + } + ], + "time": "2023-01-11T23:05:44+00:00" + }, + { + "name": "zbateson/stream-decorators", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/zbateson/stream-decorators.git", + "reference": "7466ff45d249c86b96267a83cdae68365ae1787e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zbateson/stream-decorators/zipball/7466ff45d249c86b96267a83cdae68365ae1787e", + "reference": "7466ff45d249c86b96267a83cdae68365ae1787e", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.9 | ^2.0", + "php": ">=7.1", + "zbateson/mb-wrapper": "^1.0.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "*", + "phpstan/phpstan": "*", + "phpunit/phpunit": "<=9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ZBateson\\StreamDecorators\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Zaahid Bateson" + } + ], + "description": "PHP psr7 stream decorators for mime message part streams", + "keywords": [ + "base64", + "charset", + "decorators", + "mail", + "mime", + "psr7", + "quoted-printable", + "stream", + "uuencode" + ], + "support": { + "issues": "https://github.com/zbateson/stream-decorators/issues", + "source": "https://github.com/zbateson/stream-decorators/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/zbateson", + "type": "github" + } + ], + "time": "2023-01-11T23:22:44+00:00" } ], "packages-dev": [ + { + "name": "brianium/paratest", + "version": "v7.1.2", + "source": { + "type": "git", + "url": "https://github.com/paratestphp/paratest.git", + "reference": "10e66ccdad397200f8129a034f0d3bf8cbe4c524" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/10e66ccdad397200f8129a034f0d3bf8cbe4c524", + "reference": "10e66ccdad397200f8129a034f0d3bf8cbe4c524", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-simplexml": "*", + "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", + "jean85/pretty-package-versions": "^2.0.5", + "php": "~8.1.0 || ~8.2.0", + "phpunit/php-code-coverage": "^10.0.2", + "phpunit/php-file-iterator": "^4.0.1", + "phpunit/php-timer": "^6.0", + "phpunit/phpunit": "^10.0.17", + "sebastian/environment": "^6.0", + "symfony/console": "^6.2.7", + "symfony/process": "^6.2.7" + }, + "require-dev": { + "doctrine/coding-standard": "^11.1.0", + "ext-pcov": "*", + "ext-posix": "*", + "infection/infection": "^0.26.19", + "phpstan/phpstan": "^1.10.7", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.10", + "phpstan/phpstan-strict-rules": "^1.5", + "squizlabs/php_codesniffer": "^3.7.2", + "symfony/filesystem": "^6.2.7" + }, + "bin": [ + "bin/paratest", + "bin/paratest.bat", + "bin/paratest_for_phpstorm" + ], + "type": "library", + "autoload": { + "psr-4": { + "ParaTest\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Scaturro", + "email": "scaturrob@gmail.com", + "role": "Developer" + }, + { + "name": "Filippo Tessarotto", + "email": "zoeslam@gmail.com", + "role": "Developer" + } + ], + "description": "Parallel testing for PHP", + "homepage": "https://github.com/paratestphp/paratest", + "keywords": [ + "concurrent", + "parallel", + "phpunit", + "testing" + ], + "support": { + "issues": "https://github.com/paratestphp/paratest/issues", + "source": "https://github.com/paratestphp/paratest/tree/v7.1.2" + }, + "funding": [ + { + "url": "https://github.com/sponsors/Slamdunk", + "type": "github" + }, + { + "url": "https://paypal.me/filippotessarotto", + "type": "paypal" + } + ], + "time": "2023-03-20T15:15:41+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "time": "2022-05-02T15:47:09+00:00" + }, { "name": "fakerphp/faker", "version": "v1.21.0", @@ -5477,6 +6517,67 @@ }, "time": "2022-12-13T13:54:32+00:00" }, + { + "name": "fidry/cpu-core-counter", + "version": "0.5.1", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/b58e5a3933e541dc286cc91fc4f3898bbc6f1623", + "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^9.5.26 || ^8.5.31", + "theofidry/php-cs-fixer-config": "^1.0", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/0.5.1" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2022-12-24T12:35:10+00:00" + }, { "name": "filp/whoops", "version": "2.15.1", @@ -5599,6 +6700,65 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "jean85/pretty-package-versions", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/ae547e455a3d8babd07b96966b17d7fd21d9c6af", + "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.0.0", + "php": "^7.1|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.17", + "jean85/composer-provided-replaced-stub-package": "^1.0", + "phpstan/phpstan": "^0.12.66", + "phpunit/phpunit": "^7.5|^8.5|^9.4", + "vimeo/psalm": "^4.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A library to get pretty versions strings of installed dependencies", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "support": { + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.5" + }, + "time": "2021-10-08T21:21:46+00:00" + }, { "name": "laravel/pint", "version": "v1.6.0", @@ -5862,17 +7022,80 @@ "time": "2023-03-08T13:26:56+00:00" }, { - "name": "nunomaduro/collision", - "version": "v7.1.2", + "name": "myclabs/php-enum", + "version": "1.8.4", "source": { "type": "git", - "url": "https://github.com/nunomaduro/collision.git", - "reference": "f502ff3b2051124c89b4dd3a8a497ca65f3ce26c" + "url": "https://github.com/myclabs/php-enum.git", + "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/f502ff3b2051124c89b4dd3a8a497ca65f3ce26c", - "reference": "f502ff3b2051124c89b4dd3a8a497ca65f3ce26c", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/a867478eae49c9f59ece437ae7f9506bfaa27483", + "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "1.*", + "vimeo/psalm": "^4.6.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + }, + "classmap": [ + "stubs/Stringable.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "support": { + "issues": "https://github.com/myclabs/php-enum/issues", + "source": "https://github.com/myclabs/php-enum/tree/1.8.4" + }, + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum", + "type": "tidelift" + } + ], + "time": "2022-08-04T09:53:51+00:00" + }, + { + "name": "nunomaduro/collision", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/collision.git", + "reference": "8ee125cb0888cf694b559caa015e104f577bb4f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/8ee125cb0888cf694b559caa015e104f577bb4f0", + "reference": "8ee125cb0888cf694b559caa015e104f577bb4f0", "shasum": "" }, "require": { @@ -5886,13 +7109,13 @@ }, "require-dev": { "brianium/paratest": "^7.1.1", - "laravel/framework": "^10.3.3", + "laravel/framework": "^10.4.1", "laravel/pint": "^1.6.0", "laravel/sail": "^1.21.2", "laravel/sanctum": "^3.2.1", "laravel/tinker": "^2.8.1", "nunomaduro/larastan": "^2.5.1", - "orchestra/testbench-core": "^8.0.5", + "orchestra/testbench-core": "^8.1.0", "pestphp/pest": "^2.0.0", "phpunit/phpunit": "^10.0.16", "sebastian/environment": "^6.0.0", @@ -5955,7 +7178,237 @@ "type": "patreon" } ], - "time": "2023-03-14T14:34:49+00:00" + "time": "2023-03-19T17:08:17+00:00" + }, + { + "name": "pestphp/pest", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest.git", + "reference": "9d0cd32e3f9286d03f66636a395632972a66a52e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest/zipball/9d0cd32e3f9286d03f66636a395632972a66a52e", + "reference": "9d0cd32e3f9286d03f66636a395632972a66a52e", + "shasum": "" + }, + "require": { + "brianium/paratest": "^7.1.2", + "nunomaduro/collision": "^7.2.0", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest-plugin": "^2.0.0", + "pestphp/pest-plugin-arch": "^2.0.1", + "php": "^8.1.0", + "phpunit/phpunit": "^10.0.17" + }, + "conflict": { + "phpunit/phpunit": ">10.0.17", + "webmozart/assert": "<1.11.0" + }, + "require-dev": { + "pestphp/pest-dev-tools": "^2.5.0", + "symfony/process": "^6.2.7" + }, + "bin": [ + "bin/pest" + ], + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Plugins\\Bail", + "Pest\\Plugins\\Cache", + "Pest\\Plugins\\Coverage", + "Pest\\Plugins\\Init", + "Pest\\Plugins\\Environment", + "Pest\\Plugins\\Help", + "Pest\\Plugins\\Memory", + "Pest\\Plugins\\Printer", + "Pest\\Plugins\\ProcessIsolation", + "Pest\\Plugins\\Profile", + "Pest\\Plugins\\Retry", + "Pest\\Plugins\\Version", + "Pest\\Plugins\\Parallel" + ] + } + }, + "autoload": { + "files": [ + "src/Functions.php", + "src/Pest.php" + ], + "psr-4": { + "Pest\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An elegant PHP Testing Framework.", + "keywords": [ + "framework", + "pest", + "php", + "test", + "testing", + "unit" + ], + "support": { + "issues": "https://github.com/pestphp/pest/issues", + "source": "https://github.com/pestphp/pest/tree/v2.0.2" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2023-03-20T17:52:35+00:00" + }, + { + "name": "pestphp/pest-plugin", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin.git", + "reference": "e46455b40f620f5d29e1b0bdbc41ae8b7506d4fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin/zipball/e46455b40f620f5d29e1b0bdbc41ae8b7506d4fd", + "reference": "e46455b40f620f5d29e1b0bdbc41ae8b7506d4fd", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0.0", + "php": "^8.1" + }, + "conflict": { + "pestphp/pest": "<2.0" + }, + "require-dev": { + "composer/composer": "^2.5.4", + "pestphp/pest": "^2.0.0", + "pestphp/pest-dev-tools": "^2.5.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Pest\\Plugin\\Manager" + }, + "autoload": { + "psr-4": { + "Pest\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest plugin manager", + "keywords": [ + "framework", + "manager", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin/tree/v2.0.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2023-03-20T10:01:55+00:00" + }, + { + "name": "pestphp/pest-plugin-arch", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-arch.git", + "reference": "8bb489c635b386188bf725b0fd0415262d633903" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/8bb489c635b386188bf725b0fd0415262d633903", + "reference": "8bb489c635b386188bf725b0fd0415262d633903", + "shasum": "" + }, + "require": { + "pestphp/pest-plugin": "^2.0.0", + "php": "^8.1", + "ta-tikoma/phpunit-architecture-test": "^0.7.1" + }, + "require-dev": { + "pestphp/pest": "^2.0.1", + "pestphp/pest-dev-tools": "^2.5.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/Autoload.php" + ], + "psr-4": { + "Pest\\Arch\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Arch plugin for Pest PHP.", + "keywords": [ + "arch", + "architecture", + "framework", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-arch/tree/v2.0.1" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2023-03-20T15:14:41+00:00" }, { "name": "phar-io/manifest", @@ -6068,6 +7521,219 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "1534aea9bde19a5c85c5d1e1f834ab63f4c5dcf5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/1534aea9bde19a5c85c5d1e1f834ab63f4c5dcf5", + "reference": "1534aea9bde19a5c85c5d1e1f834ab63f4c5dcf5", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.0", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" + }, + "require-dev": { + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.0" + }, + "time": "2023-03-12T10:13:29+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.16.1", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "e27e92d939e2e3636f0a1f0afaba59692c0bf571" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/e27e92d939e2e3636f0a1f0afaba59692c0bf571", + "reference": "e27e92d939e2e3636f0a1f0afaba59692c0bf571", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.16.1" + }, + "time": "2023-02-07T18:11:17+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "10.0.2", @@ -6388,16 +8054,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.0.16", + "version": "10.0.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "07d386a11ac7094032900f07cada1c8975d16607" + "reference": "b75eddcabca052312ae38c8a2bc69ff1a7b89b77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/07d386a11ac7094032900f07cada1c8975d16607", - "reference": "07d386a11ac7094032900f07cada1c8975d16607", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b75eddcabca052312ae38c8a2bc69ff1a7b89b77", + "reference": "b75eddcabca052312ae38c8a2bc69ff1a7b89b77", "shasum": "" }, "require": { @@ -6468,7 +8134,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.16" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.17" }, "funding": [ { @@ -6484,7 +8151,7 @@ "type": "tidelift" } ], - "time": "2023-03-13T09:02:40+00:00" + "time": "2023-03-20T14:42:33+00:00" }, { "name": "sebastian/cli-parser", @@ -7394,68 +9061,6 @@ ], "time": "2023-02-07T11:34:05+00:00" }, - { - "name": "spatie/backtrace", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/backtrace.git", - "reference": "ec4dd16476b802dbdc6b4467f84032837e316b8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/backtrace/zipball/ec4dd16476b802dbdc6b4467f84032837e316b8c", - "reference": "ec4dd16476b802dbdc6b4467f84032837e316b8c", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "ext-json": "*", - "phpunit/phpunit": "^9.3", - "spatie/phpunit-snapshot-assertions": "^4.2", - "symfony/var-dumper": "^5.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Backtrace\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van de Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "A better backtrace", - "homepage": "https://github.com/spatie/backtrace", - "keywords": [ - "Backtrace", - "spatie" - ], - "support": { - "source": "https://github.com/spatie/backtrace/tree/1.4.0" - }, - "funding": [ - { - "url": "https://github.com/sponsors/spatie", - "type": "github" - }, - { - "url": "https://spatie.be/open-source/support-us", - "type": "other" - } - ], - "time": "2023-03-04T08:57:24+00:00" - }, { "name": "spatie/flare-client-php", "version": "1.3.5", @@ -7762,6 +9367,66 @@ ], "time": "2023-02-16T09:57:23+00:00" }, + { + "name": "ta-tikoma/phpunit-architecture-test", + "version": "0.7.1", + "source": { + "type": "git", + "url": "https://github.com/ta-tikoma/phpunit-architecture-test.git", + "reference": "1f4466e8faf8d7edd1ae26656f39bf9447c5fa38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ta-tikoma/phpunit-architecture-test/zipball/1f4466e8faf8d7edd1ae26656f39bf9447c5fa38", + "reference": "1f4466e8faf8d7edd1ae26656f39bf9447c5fa38", + "shasum": "" + }, + "require": { + "myclabs/php-enum": "^1.8.4", + "nikic/php-parser": "^4.15.4", + "php": "^8.1.0", + "phpdocumentor/reflection-docblock": "^5.3.0", + "phpunit/phpunit": "^9.6.5|^10.0.16", + "symfony/finder": "^6.2.7" + }, + "require-dev": { + "laravel/pint": "^1.6.0", + "phpstan/phpstan": "^1.10.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPUnit\\Architecture\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ni Shi", + "email": "futik0ma011@gmail.com" + }, + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Methods for testing application architecture", + "keywords": [ + "architecture", + "phpunit", + "stucture", + "test", + "testing" + ], + "support": { + "issues": "https://github.com/ta-tikoma/phpunit-architecture-test/issues", + "source": "https://github.com/ta-tikoma/phpunit-architecture-test/tree/0.7.1" + }, + "time": "2023-03-17T01:38:35+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.1", diff --git a/config/ray.php b/config/ray.php new file mode 100644 index 000000000..08598c4e8 --- /dev/null +++ b/config/ray.php @@ -0,0 +1,108 @@ + env('RAY_ENABLED', true), + + /* + * When enabled, all cache events will automatically be sent to Ray. + */ + 'send_cache_to_ray' => env('SEND_CACHE_TO_RAY', false), + + /* + * When enabled, all things passed to `dump` or `dd` + * will be sent to Ray as well. + */ + 'send_dumps_to_ray' => env('SEND_DUMPS_TO_RAY', true), + + /* + * When enabled all job events will automatically be sent to Ray. + */ + 'send_jobs_to_ray' => env('SEND_JOBS_TO_RAY', false), + + /* + * When enabled, all things logged to the application log + * will be sent to Ray as well. + */ + 'send_log_calls_to_ray' => env('SEND_LOG_CALLS_TO_RAY', true), + + /* + * When enabled, all queries will automatically be sent to Ray. + */ + 'send_queries_to_ray' => env('SEND_QUERIES_TO_RAY', false), + + /** + * When enabled, all duplicate queries will automatically be sent to Ray. + */ + 'send_duplicate_queries_to_ray' => env('SEND_DUPLICATE_QUERIES_TO_RAY', false), + + /* + * When enabled, slow queries will automatically be sent to Ray. + */ + 'send_slow_queries_to_ray' => env('SEND_SLOW_QUERIES_TO_RAY', false), + + /** + * Queries that are longer than this number of milliseconds will be regarded as slow. + */ + 'slow_query_threshold_in_ms' => env('RAY_SLOW_QUERY_THRESHOLD_IN_MS', 500), + + /* + * When enabled, all requests made to this app will automatically be sent to Ray. + */ + 'send_requests_to_ray' => env('SEND_REQUESTS_TO_RAY', false), + + /** + * When enabled, all Http Client requests made by this app will be automatically sent to Ray. + */ + 'send_http_client_requests_to_ray' => env('SEND_HTTP_CLIENT_REQUESTS_TO_RAY', false), + + /* + * When enabled, all views that are rendered automatically be sent to Ray. + */ + 'send_views_to_ray' => env('SEND_VIEWS_TO_RAY', false), + + /* + * When enabled, all exceptions will be automatically sent to Ray. + */ + 'send_exceptions_to_ray' => env('SEND_EXCEPTIONS_TO_RAY', true), + + /* + * When enabled, all deprecation notices will be automatically sent to Ray. + */ + 'send_deprecated_notices_to_ray' => env('SEND_DEPRECATED_NOTICES_TO_RAY', false), + + /* + * The host used to communicate with the Ray app. + * When using Docker on Mac or Windows, you can replace localhost with 'host.docker.internal' + * When using Docker on Linux, you can replace localhost with '172.17.0.1' + * When using Homestead with the VirtualBox provider, you can replace localhost with '10.0.2.2' + * When using Homestead with the Parallels provider, you can replace localhost with '10.211.55.2' + */ + 'host' => env('RAY_HOST', 'host.docker.internal'), + + /* + * The port number used to communicate with the Ray app. + */ + 'port' => env('RAY_PORT', 23517), + + /* + * Absolute base path for your sites or projects in Homestead, + * Vagrant, Docker, or another remote development server. + */ + 'remote_path' => env('RAY_REMOTE_PATH', null), + + /* + * Absolute base path for your sites or projects on your local + * computer where your IDE or code editor is running on. + */ + 'local_path' => env('RAY_LOCAL_PATH', null), + + /* + * When this setting is enabled, the package will not try to format values sent to Ray. + */ + 'always_send_raw_values' => false, +]; diff --git a/database/migrations/2023_03_20_112410_create_activity_log_table.php b/database/migrations/2023_03_20_112410_create_activity_log_table.php new file mode 100755 index 000000000..7c05bc892 --- /dev/null +++ b/database/migrations/2023_03_20_112410_create_activity_log_table.php @@ -0,0 +1,27 @@ +create(config('activitylog.table_name'), function (Blueprint $table) { + $table->bigIncrements('id'); + $table->string('log_name')->nullable(); + $table->text('description'); + $table->nullableMorphs('subject', 'subject'); + $table->nullableMorphs('causer', 'causer'); + $table->json('properties')->nullable(); + $table->timestamps(); + $table->index('log_name'); + }); + } + + public function down() + { + Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name')); + } +} diff --git a/database/migrations/2023_03_20_112411_add_event_column_to_activity_log_table.php b/database/migrations/2023_03_20_112411_add_event_column_to_activity_log_table.php new file mode 100755 index 000000000..7b797fd5e --- /dev/null +++ b/database/migrations/2023_03_20_112411_add_event_column_to_activity_log_table.php @@ -0,0 +1,22 @@ +table(config('activitylog.table_name'), function (Blueprint $table) { + $table->string('event')->nullable()->after('subject_type'); + }); + } + + public function down() + { + Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) { + $table->dropColumn('event'); + }); + } +} diff --git a/database/migrations/2023_03_20_112412_add_batch_uuid_column_to_activity_log_table.php b/database/migrations/2023_03_20_112412_add_batch_uuid_column_to_activity_log_table.php new file mode 100755 index 000000000..8f7db6654 --- /dev/null +++ b/database/migrations/2023_03_20_112412_add_batch_uuid_column_to_activity_log_table.php @@ -0,0 +1,22 @@ +table(config('activitylog.table_name'), function (Blueprint $table) { + $table->uuid('batch_uuid')->nullable()->after('properties'); + }); + } + + public function down() + { + Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) { + $table->dropColumn('batch_uuid'); + }); + } +} diff --git a/database/migrations/2023_03_20_112810_create_jobs_table.php b/database/migrations/2023_03_20_112810_create_jobs_table.php new file mode 100755 index 000000000..6098d9b12 --- /dev/null +++ b/database/migrations/2023_03_20_112810_create_jobs_table.php @@ -0,0 +1,32 @@ +bigIncrements('id'); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('jobs'); + } +}; diff --git a/docker-compose.yaml b/docker-compose.yaml index dc02e3db8..253554a26 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,24 +1,32 @@ version: '3.8' services: php: + image: "coolify:${TAG:-4}" build: - context: . + context: ./docker/dev dockerfile: Dockerfile + args: + WWWGROUP: '${WWWGROUP}' ports: - "${APP_PORT:-8000}:80" - "${VITE_PORT:-5173}:${VITE_PORT:-5173}" environment: - PGID: "${USERID:-9999}" - PUID: "${USERID:-9999}" - SSL_MODE: 'off' + WWWUSER: "${WWWUSER}" + LARAVEL_SAIL: 1 + XDEBUG_MODE: "${SAIL_XDEBUG_MODE:-off}" + XDEBUG_CONFIG: "${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}" volumes: - - .:/var/www/html:cached + - .:/var/www/html + networks: + - coolify postgres: image: postgres:15-alpine ports: - "${FORWARD_DB_PORT:-5432}:5432" volumes: - db-coolify:/var/lib/postgresql/data + networks: + - coolify environment: POSTGRES_USER: "${DB_USERNAME}" POSTGRES_PASSWORD: "${DB_PASSWORD}" @@ -34,11 +42,22 @@ services: ] retries: 3 timeout: 5s - mailpit: - image: "axllent/mailpit:latest" - ports: - - "${FORWARD_MAILPIT_PORT:-1025}:1025" - - "${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025" + testing-host: + container_name: coolify-testing-host + image: coolify-testing-host + build: + dockerfile: Dockerfile + context: ./docker/testing-host + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./docker/testing-host/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf + networks: + - coolify + volumes: db-coolify: driver: local + +networks: + coolify: + driver: bridge diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile new file mode 100644 index 000000000..239bf9fa8 --- /dev/null +++ b/docker/dev/Dockerfile @@ -0,0 +1,93 @@ +FROM ubuntu:22.04 + +ARG WWWGROUP +ARG TARGETPLATFORM + +ARG NODE_VERSION=18 +ARG POSTGRES_VERSION=14 + +# https://download.docker.com/linux/static/stable/ +ARG DOCKER_VERSION=20.10.18 +# https://github.com/docker/compose/releases +# Reverted to 2.6.1 because of this https://github.com/docker/compose/issues/9704. 2.9.0 still has a bug. +ARG DOCKER_COMPOSE_VERSION=2.6.1 +# https://github.com/buildpacks/pack/releases +ARG PACK_VERSION=v0.27.0 + +WORKDIR /var/www/html + +ENV DEBIAN_FRONTEND noninteractive +ENV TZ=UTC + +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update \ + && apt-get install -y gnupg gosu curl ca-certificates zip unzip git git-lfs supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils \ + && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /usr/share/keyrings/ppa_ondrej_php.gpg > /dev/null \ + && echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \ + && apt-get update \ + && apt-get install -y php8.2-cli php8.2-dev \ + php8.2-pgsql php8.2-sqlite3 php8.2-gd \ + php8.2-curl \ + php8.2-imap php8.2-mysql php8.2-mbstring \ + php8.2-xml php8.2-zip php8.2-bcmath php8.2-soap \ + php8.2-intl php8.2-readline \ + php8.2-ldap \ + php8.2-msgpack php8.2-igbinary php8.2-redis php8.2-swoole \ + php8.2-memcached php8.2-pcov php8.2-xdebug \ + && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \ + && curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \ + && apt-get install -y nodejs \ + && npm install -g npm \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarn.gpg >/dev/null \ + && echo "deb [signed-by=/usr/share/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ + && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/pgdg.gpg >/dev/null \ + && echo "deb [signed-by=/usr/share/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ + && apt-get update \ + && apt-get install -y yarn \ + && apt-get install -y mysql-client \ + && apt-get install -y postgresql-client-$POSTGRES_VERSION \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.2 + +RUN groupadd --force -g $WWWGROUP sail +RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail + +USER sail +RUN mkdir -p ~/.ssh +RUN echo "-----BEGIN OPENSSH PRIVATE KEY-----\n\ +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\n\ +QyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevAAAAJi/QySHv0Mk\n\ +hwAAAAtzc2gtZWQyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevA\n\ +AAAECBQw4jg1WRT2IGHMncCiZhURCts2s24HoDS0thHnnRKVuGmoeGq/pojrsyP1pszcNV\n\ +uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==\n\ +-----END OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_ed25519 +RUN chmod 0600 ~/.ssh/id_ed25519 + +USER root + +COPY start-container /usr/local/bin/start-container +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY php.ini /etc/php/8.2/cli/conf.d/99-sail.ini +RUN chmod +x /usr/local/bin/start-container + +# Install Docker CLI, Docker Compose, and Pack +RUN mkdir -p ~/.docker/cli-plugins +RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-$DOCKER_VERSION -o /usr/bin/docker +RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-$DOCKER_COMPOSE_VERSION -o ~/.docker/cli-plugins/docker-compose -o /home/sail/.docker/cli-plugins/docker-compose +RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/pack-$PACK_VERSION -o /usr/local/bin/pack +RUN curl -sSL https://nixpacks.com/install.sh | bash + +RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack +RUN chmod +x /usr/local/bin/pack + +RUN mkdir -p /home/sail/.docker/cli-plugins +RUN cp ~/.docker/cli-plugins/docker-compose /home/sail/.docker/cli-plugins/docker-compose +RUN chown -R sail:sail /home/sail + +EXPOSE 8000 + +ENTRYPOINT ["start-container"] diff --git a/docker/dev/php.ini b/docker/dev/php.ini new file mode 100644 index 000000000..66d04d5be --- /dev/null +++ b/docker/dev/php.ini @@ -0,0 +1,4 @@ +[PHP] +post_max_size = 100M +upload_max_filesize = 100M +variables_order = EGPCS diff --git a/docker/dev/start-container b/docker/dev/start-container new file mode 100644 index 000000000..b86439907 --- /dev/null +++ b/docker/dev/start-container @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +if [ ! -z "$WWWUSER" ]; then + usermod -u $WWWUSER sail +fi + +if [ ! -d /.composer ]; then + mkdir /.composer +fi + +chmod -R ugo+rw /.composer + +if [ $# -gt 0 ]; then + exec gosu $WWWUSER "$@" +else + exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf +fi diff --git a/docker/dev/supervisord.conf b/docker/dev/supervisord.conf new file mode 100644 index 000000000..a2ff48927 --- /dev/null +++ b/docker/dev/supervisord.conf @@ -0,0 +1,27 @@ +[supervisord] +nodaemon=true +user=root +logfile=/var/log/supervisor/supervisord.log +pidfile=/var/run/supervisord.pid + +[program:php] +command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80 +user=sail +environment=LARAVEL_SAIL="1" +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 + +[program:laravel-worker] +process_name=%(program_name)s_%(process_num)02d +command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan queue:listen +user=sail +autostart=true +autorestart=true +stopasgroup=true +killasgroup=true +numprocs=8 +redirect_stderr=true +stdout_logfile=/var/www/html/storage/logs/worker.log +stopwaitsecs=3600 diff --git a/docker/staging/Dockerfile b/docker/staging/Dockerfile new file mode 100644 index 000000000..ccfda8f89 --- /dev/null +++ b/docker/staging/Dockerfile @@ -0,0 +1,20 @@ +FROM serversideup/php:8.2-fpm-nginx + +ARG NODE_VERSION=18 +ARG POSTGRES_VERSION=15 + +RUN apt-get update \ + && curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \ + && apt-get install -y nodejs \ + && npm install -g npm + +RUN apt-get install -y php-pgsql openssh-client + +RUN apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* + +USER root + +# S6 Overlay config +COPY --chmod=755 etc/s6-overlay/ /etc/s6-overlay/ diff --git a/docker/staging/etc/s6-overlay/s6-rc.d/queue-worker/run b/docker/staging/etc/s6-overlay/s6-rc.d/queue-worker/run new file mode 100644 index 000000000..23dddd030 --- /dev/null +++ b/docker/staging/etc/s6-overlay/s6-rc.d/queue-worker/run @@ -0,0 +1,2 @@ +#!/command/execlineb -P +su webuser -c "php /var/www/html/artisan queue:listen --tries=3" diff --git a/docker/staging/etc/s6-overlay/s6-rc.d/queue-worker/type b/docker/staging/etc/s6-overlay/s6-rc.d/queue-worker/type new file mode 100644 index 000000000..5883cff0c --- /dev/null +++ b/docker/staging/etc/s6-overlay/s6-rc.d/queue-worker/type @@ -0,0 +1 @@ +longrun diff --git a/docker/staging/etc/s6-overlay/s6-rc.d/user/contents.d/queue-worker b/docker/staging/etc/s6-overlay/s6-rc.d/user/contents.d/queue-worker new file mode 100644 index 000000000..e69de29bb diff --git a/docker/testing-host/Dockerfile b/docker/testing-host/Dockerfile new file mode 100644 index 000000000..8125614f0 --- /dev/null +++ b/docker/testing-host/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:22.04 + +ARG TARGETPLATFORM + +# https://download.docker.com/linux/static/stable/ +ARG DOCKER_VERSION=20.10.18 +# https://github.com/docker/compose/releases +# Reverted to 2.6.1 because of this https://github.com/docker/compose/issues/9704. 2.9.0 still has a bug. +ARG DOCKER_COMPOSE_VERSION=2.6.1 +# https://github.com/buildpacks/pack/releases +ARG PACK_VERSION=v0.27.0 + +ENV DEBIAN_FRONTEND noninteractive +ENV TZ=UTC + +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update \ + && apt-get install -y gnupg gosu curl ca-certificates zip unzip git git-lfs supervisor \ + sqlite3 libcap2-bin libpng-dev python2 dnsutils openssh-server sudo \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Setup sshd +RUN ssh-keygen -A +RUN mkdir -p /run/sshd + +# Install Docker CLI, Docker Compose, and Pack +RUN mkdir -p ~/.docker/cli-plugins +RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-$DOCKER_VERSION -o /usr/bin/docker +RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-$DOCKER_COMPOSE_VERSION -o ~/.docker/cli-plugins/docker-compose +RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/pack-$PACK_VERSION -o /usr/local/bin/pack +RUN curl -sSL https://nixpacks.com/install.sh | bash +RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack +RUN groupadd docker + +# Setup coolify user +RUN useradd -ms /bin/bash coolify +RUN usermod -aG sudo coolify +RUN usermod -aG docker coolify +RUN echo 'coolify ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# Setup ssh'ing into the destination as Coolify User +USER coolify +RUN mkdir -p ~/.ssh +RUN echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFuGmoeGq/pojrsyP1pszcNVuZx9iFkCELtxrh31QJ68 coolify@coolify-instance" >> ~/.ssh/authorized_keys + +USER root + +# Setup ssh'ing into the destination as Root +RUN mkdir -p ~/.ssh +RUN echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFuGmoeGq/pojrsyP1pszcNVuZx9iFkCELtxrh31QJ68 coolify@coolify-instance" >> ~/.ssh/authorized_keys + +EXPOSE 22 + +COPY start-container /usr/local/bin/start-container +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf +RUN chmod +x /usr/local/bin/start-container + +WORKDIR /root + +# Prepare projects +RUN mkdir -p projects +COPY dummy-project projects/dummy-project + +ENTRYPOINT ["start-container"] diff --git a/docker/testing-host/dummy-project/Dockerfile b/docker/testing-host/dummy-project/Dockerfile new file mode 100644 index 000000000..e18a991dd --- /dev/null +++ b/docker/testing-host/dummy-project/Dockerfile @@ -0,0 +1,31 @@ +FROM ubuntu:22.04 + +ARG WWWGROUP + +WORKDIR /var/www/html + +ENV DEBIAN_FRONTEND noninteractive +ENV TZ=UTC + +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update \ + && apt-get install -y gnupg gosu curl ca-certificates zip unzip git git-lfs supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils \ + && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /usr/share/keyrings/ppa_ondrej_php.gpg > /dev/null \ + && echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \ + && apt-get update \ + && apt-get install -y php8.2-cli php8.2-dev \ + php8.2-curl php8.2-mbstring php8.2-xml php8.2-zip php8.2-bcmath \ + php8.2-intl php8.2-readline php8.2-msgpack php8.2-igbinary \ + && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.2 + +EXPOSE 8000 + +COPY . . + +ENTRYPOINT ["php", "-S", "0.0.0.0:8000"] diff --git a/docker/testing-host/dummy-project/docker-compose.yml b/docker/testing-host/dummy-project/docker-compose.yml new file mode 100644 index 000000000..ea23501c2 --- /dev/null +++ b/docker/testing-host/dummy-project/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3" + +services: + dummy-project: + image: dummy-project + build: + context: . + dockerfile: Dockerfile + extra_hosts: + - "host.docker.internal:host-gateway" diff --git a/docker/testing-host/dummy-project/index.php b/docker/testing-host/dummy-project/index.php new file mode 100644 index 000000000..42cfa8699 --- /dev/null +++ b/docker/testing-host/dummy-project/index.php @@ -0,0 +1,3 @@ + {{ $slot }} + + diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php new file mode 100644 index 000000000..f69d56d92 --- /dev/null +++ b/resources/views/components/layout.blade.php @@ -0,0 +1,24 @@ + + + + + + + {{ $title ?? 'Coolify' }} + + @vite(['resources/js/app.js', 'resources/css/app.css']) + @livewireStyles + + + + @auth + + @endauth +
+ {{ $slot }} +
+ + @livewireScripts + + + diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php new file mode 100644 index 000000000..8635e6cfc --- /dev/null +++ b/resources/views/components/navbar.blade.php @@ -0,0 +1,15 @@ + diff --git a/resources/views/demo.blade.php b/resources/views/demo.blade.php new file mode 100644 index 000000000..3247b6d59 --- /dev/null +++ b/resources/views/demo.blade.php @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/views/livewire/run-command.blade.php b/resources/views/livewire/run-command.blade.php new file mode 100755 index 000000000..aa7aeaddd --- /dev/null +++ b/resources/views/livewire/run-command.blade.php @@ -0,0 +1,29 @@ +
+
+ + + + + +
+
+ + + @if ($isKeepAliveOn || $manualKeepAlive) + Polling... + @endif +
+ @isset($activity?->id) +
+ Activity: {{ $activity?->id ?? 'waiting' }} +
+
 {{ data_get($activity, 'description') }}
+
+
Details:
+
{{ json_encode(data_get($activity, 'properties'), JSON_PRETTY_PRINT) }}
+
+ @endisset +
diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index da211600d..2c34fca5d 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -11,8 +11,12 @@

- Hello from Coolify! + Coolify v4

+ +

+ See demo +

diff --git a/routes/web.php b/routes/web.php index d259f33ea..cb09e09d9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -16,3 +16,5 @@ use Illuminate\Support\Facades\Route; Route::get('/', function () { return view('welcome'); }); + +Route::view('/demo', 'demo'); diff --git a/run b/run new file mode 100755 index 000000000..0888bd9d2 --- /dev/null +++ b/run @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# Inspired on https://github.com/adriancooney/Taskfile +# Install an alias, to be able to simply execute `run` => echo 'alias run=./run' >> ~/.aliases +# + +set -e + +function help { + echo "$0 " + echo "Tasks:" + compgen -A function | cat -n +} + +function default { + help +} + +function bash { + docker-compose exec -u $(id -u) php bash +} + +# The user with native SSH capability +function coolify-bash { + docker-compose exec -u coolify php bash +} + +function root-bash { + docker-compose exec php bash +} + +# Usage: ./Taskfile envFile:set FOOBAR abc +# This will set the FOOBAR variable to "abc" in the .env file +function envFile:set { + sed -i "s#^$1=.*#$1=$2#g" .env +} + +TIMEFORMAT="Task completed in %3lR" +time "${@:-default}" diff --git a/tests/Feature/DockerCommandsTest.php b/tests/Feature/DockerCommandsTest.php new file mode 100644 index 000000000..32340a70d --- /dev/null +++ b/tests/Feature/DockerCommandsTest.php @@ -0,0 +1,32 @@ +format('Ymd_his'); + $host = 'testing-host'; + + // Assert there's no containers start with coolify_test_* + $processResult = coolifyProcess($areThereCoolifyTestContainers, $host); + $containers = Output::containerList($processResult->output()); + expect($containers)->toBeEmpty(); + + // start a container nginx -d --name = $containerName + $processResult = coolifyProcess("docker run -d --name {$containerName} nginx", $host); + expect($processResult->successful())->toBeTrue(); + + // docker ps name = $container + $processResult = coolifyProcess($areThereCoolifyTestContainers, $host); + $containers = Output::containerList($processResult->output()); + expect($containers->where('Names', $containerName)->count())->toBe(1); + + // Stop testing containers + $processResult = coolifyProcess("docker stop $(docker ps --filter='name={$coolifyNamePrefix}*' -q)", $host); + expect($processResult->successful())->toBeTrue(); +}); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index 8364a84e2..000000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,19 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -} diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 000000000..50ab1e433 --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,48 @@ +in('Feature'); + +/* +|-------------------------------------------------------------------------- +| Expectations +|-------------------------------------------------------------------------- +| +| When you're writing tests, you often need to check that values meet certain conditions. The +| "expect()" function gives you access to a set of "expectations" methods that you can use +| to assert different things. Of course, you may extend the Expectation API at any time. +| +*/ + +expect()->extend('toBeOne', function () { + return $this->toBe(1); +}); + +/* +|-------------------------------------------------------------------------- +| Functions +|-------------------------------------------------------------------------- +| +| While Pest is very powerful out-of-the-box, you may have some testing code specific to your +| project that you don't want to repeat in every file. Here you can also expose helpers as +| global functions to help you to reduce the number of lines of code in your test files. +| +*/ + +function something() +{ + // .. +} diff --git a/tests/Support/Output.php b/tests/Support/Output.php new file mode 100644 index 000000000..a3bd2c52e --- /dev/null +++ b/tests/Support/Output.php @@ -0,0 +1,17 @@ +reject(fn($line) => empty($line)) + ->map(fn($outputLine) => json_decode($outputLine, flags: JSON_THROW_ON_ERROR)); + } +} diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index 5773b0ceb..44a4f337a 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -1,16 +1,5 @@ assertTrue(true); - } -} +test('that true is true', function () { + expect(true)->toBeTrue(); +});