diff --git a/.gitignore b/.gitignore index 9d85ddf63..0be87eac1 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ yarn-error.log /.bash_history /_volumes +# Temp while developing Proxy deployment resources/recipes .lesshst diff --git a/app/Data/ServerMetadata.php b/app/Data/ServerMetadata.php new file mode 100644 index 000000000..af4340b38 --- /dev/null +++ b/app/Data/ServerMetadata.php @@ -0,0 +1,13 @@ +route('dashboard'); } + $activity = Activity::query() ->where('properties->type', '=', 'deployment') ->where('properties->uuid', '=', $deployment_uuid) diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php new file mode 100644 index 000000000..b76acefa0 --- /dev/null +++ b/app/Http/Controllers/ServerController.php @@ -0,0 +1,16 @@ + $server, + ]); + } +} diff --git a/app/Http/Livewire/ActivityMonitor.php b/app/Http/Livewire/ActivityMonitor.php new file mode 100644 index 000000000..56d04d851 --- /dev/null +++ b/app/Http/Livewire/ActivityMonitor.php @@ -0,0 +1,44 @@ +activity = Activity::query() + ->find($this->activityId); + } + + public function newMonitorActivity($activityId) + { + $this->activityId = $activityId; + + $this->hydrateActivity(); + + $this->isPollingActive = true; + } + + public function polling() + { + $this->hydrateActivity(); + + if (data_get($this->activity, 'properties.exitCode') !== null) { + $this->isPollingActive = false; + } + } + + public function render() + { + return view('livewire.activity-monitor'); + } +} diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php new file mode 100644 index 000000000..b01db728c --- /dev/null +++ b/app/Http/Livewire/Server/Proxy.php @@ -0,0 +1,30 @@ +server = $server; + } + + public function runInstallProxy() + { + $activity = remoteProcess(['ls -alh'], $this->server); + + $this->emit('newMonitorActivity', $activity->id); + } + + public function render() + { + return view('livewire.server.proxy'); + } +} diff --git a/app/Models/Server.php b/app/Models/Server.php index d72bf0b5d..96253d290 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -2,6 +2,9 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Builder; +use Spatie\SchemalessAttributes\Casts\SchemalessAttributes; + class Server extends BaseModel { protected static function booted() @@ -28,10 +31,18 @@ class Server extends BaseModel { return $this->hasMany(SwarmDocker::class); } + public $casts = [ + 'extra_attributes' => SchemalessAttributes::class, + ]; + public function scopeWithExtraAttributes(): Builder + { + return $this->extra_attributes->modelScope(); + } public function privateKey() { return $this->belongsTo(PrivateKey::class); } + public function settings() { return $this->hasOne(ServerSetting::class); diff --git a/composer.json b/composer.json index 71826d98a..11be2b584 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,7 @@ "license": "MIT", "require": { "php": "^8.2", + "doctrine/dbal": "^3.6", "guzzlehttp/guzzle": "^7.5.0", "laravel/fortify": "^v1.16.0", "laravel/framework": "^v10.7.1", @@ -18,6 +19,7 @@ "spatie/laravel-data": "^3.4.3", "spatie/laravel-ray": "^1.32.4", "spatie/url": "^2.2", + "spatie/laravel-schemaless-attributes": "^2.4", "symfony/yaml": "^6.2", "visus/cuid2": "^2.0.0" }, diff --git a/composer.lock b/composer.lock index a21b1cbb8..2a2840720 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": "edc1042455661505e65373a55fed9b81", + "content-hash": "76cbf08c8a60e542b25b1d96f9f4e265", "packages": [ { "name": "bacon/bacon-qr-code", @@ -240,6 +240,211 @@ }, "time": "2022-10-27T11:44:00+00:00" }, + { + "name": "doctrine/cache", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2022-05-20T20:07:39+00:00" + }, + { + "name": "doctrine/dbal", + "version": "3.6.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "b4bd1cfbd2b916951696d82e57d054394d84864c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/b4bd1cfbd2b916951696d82e57d054394d84864c", + "reference": "b4bd1cfbd2b916951696d82e57d054394d84864c", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/deprecations": "^0.5.3|^1", + "doctrine/event-manager": "^1|^2", + "php": "^7.4 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" + }, + "require-dev": { + "doctrine/coding-standard": "11.1.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2022.3", + "phpstan/phpstan": "1.10.9", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.6", + "psalm/plugin-phpunit": "0.18.4", + "squizlabs/php_codesniffer": "3.7.2", + "symfony/cache": "^5.4|^6.0", + "symfony/console": "^4.4|^5.4|^6.0", + "vimeo/psalm": "4.30.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/3.6.2" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "time": "2023-04-14T07:25:38+00:00" + }, { "name": "doctrine/deprecations", "version": "v1.0.0", @@ -283,6 +488,97 @@ }, "time": "2022-05-02T15:47:09+00:00" }, + { + "name": "doctrine/event-manager", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/750671534e0241a7c50ea5b43f67e23eb5c96f32", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.28" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/2.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2022-10-12T20:59:15+00:00" + }, { "name": "doctrine/inflector", "version": "2.0.6", @@ -1390,16 +1686,16 @@ }, { "name": "laravel/sanctum", - "version": "v3.2.4", + "version": "v3.2.5", "source": { "type": "git", "url": "https://github.com/laravel/sanctum.git", - "reference": "c8269dcff3cda261ce113ab9548a0253d709aa91" + "reference": "8ebda85d59d3c414863a7f4d816ef8302faad876" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sanctum/zipball/c8269dcff3cda261ce113ab9548a0253d709aa91", - "reference": "c8269dcff3cda261ce113ab9548a0253d709aa91", + "url": "https://api.github.com/repos/laravel/sanctum/zipball/8ebda85d59d3c414863a7f4d816ef8302faad876", + "reference": "8ebda85d59d3c414863a7f4d816ef8302faad876", "shasum": "" }, "require": { @@ -1452,7 +1748,7 @@ "issues": "https://github.com/laravel/sanctum/issues", "source": "https://github.com/laravel/sanctum" }, - "time": "2023-04-26T18:55:47+00:00" + "time": "2023-05-01T19:39:51+00:00" }, { "name": "laravel/serializable-closure", @@ -2863,16 +3159,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.20.3", + "version": "1.20.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "6c04009f6cae6eda2f040745b6b846080ef069c2" + "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6c04009f6cae6eda2f040745b6b846080ef069c2", - "reference": "6c04009f6cae6eda2f040745b6b846080ef069c2", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", + "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", "shasum": "" }, "require": { @@ -2902,9 +3198,9 @@ "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.20.3" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.20.4" }, - "time": "2023-04-25T09:01:03+00:00" + "time": "2023-05-02T09:19:37+00:00" }, { "name": "pimple/pimple", @@ -3011,6 +3307,55 @@ }, "time": "2022-06-13T21:57:56+00:00" }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, { "name": "psr/clock", "version": "1.0.0", @@ -4105,6 +4450,82 @@ ], "time": "2023-03-23T08:04:54+00:00" }, + { + "name": "spatie/laravel-schemaless-attributes", + "version": "2.4.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-schemaless-attributes.git", + "reference": "ae19842763fe8d5a5059f8a7c0802bee6662b00c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-schemaless-attributes/zipball/ae19842763fe8d5a5059f8a7c0802bee6662b00c", + "reference": "ae19842763fe8d5a5059f8a7c0802bee6662b00c", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^7.0|^8.0|^9.0|^10.0", + "illuminate/database": "^7.0|^8.0|^9.0|^10.0", + "illuminate/support": "^7.0|^8.0|^9.0|^10.0", + "php": "^8.0", + "spatie/laravel-package-tools": "^1.4.3" + }, + "require-dev": { + "brianium/paratest": "^6.2", + "mockery/mockery": "^1.4", + "nunomaduro/collision": "^5.3|^6.0", + "orchestra/testbench": "^6.15|^7.0|^8.0", + "pestphp/pest-plugin-laravel": "^1.3", + "phpunit/phpunit": "^9.5.4" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\SchemalessAttributes\\SchemalessAttributesServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Spatie\\SchemalessAttributes\\": "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": "Add schemaless attributes to Eloquent models", + "homepage": "https://github.com/spatie/laravel-schemaless-attributes", + "keywords": [ + "laravel-schemaless-attributes", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-schemaless-attributes/issues", + "source": "https://github.com/spatie/laravel-schemaless-attributes/tree/2.4.0" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2023-01-14T20:58:52+00:00" + }, { "name": "spatie/macroable", "version": "2.0.0", @@ -4295,16 +4716,16 @@ }, { "name": "symfony/console", - "version": "v6.2.8", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b" + "reference": "12288d9f4500f84a4d02254d4aa968b15488476f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3582d68a64a86ec25240aaa521ec8bc2342b369b", - "reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b", + "url": "https://api.github.com/repos/symfony/console/zipball/12288d9f4500f84a4d02254d4aa968b15488476f", + "reference": "12288d9f4500f84a4d02254d4aa968b15488476f", "shasum": "" }, "require": { @@ -4371,7 +4792,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.8" + "source": "https://github.com/symfony/console/tree/v6.2.10" }, "funding": [ { @@ -4387,7 +4808,7 @@ "type": "tidelift" } ], - "time": "2023-03-29T21:42:15+00:00" + "time": "2023-04-28T13:37:43+00:00" }, { "name": "symfony/css-selector", @@ -4523,16 +4944,16 @@ }, { "name": "symfony/error-handler", - "version": "v6.2.9", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "e95f1273b3953c3b5e5341172dae838bacee11ee" + "reference": "8b7e9f124640cb0611624a9383176c3e5f7d8cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/e95f1273b3953c3b5e5341172dae838bacee11ee", - "reference": "e95f1273b3953c3b5e5341172dae838bacee11ee", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/8b7e9f124640cb0611624a9383176c3e5f7d8cfb", + "reference": "8b7e9f124640cb0611624a9383176c3e5f7d8cfb", "shasum": "" }, "require": { @@ -4574,7 +4995,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.2.9" + "source": "https://github.com/symfony/error-handler/tree/v6.2.10" }, "funding": [ { @@ -4590,7 +5011,7 @@ "type": "tidelift" } ], - "time": "2023-04-11T16:03:19+00:00" + "time": "2023-04-18T13:46:08+00:00" }, { "name": "symfony/event-dispatcher", @@ -4820,16 +5241,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.2.8", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "511a524affeefc191939348823ac75e9921c2112" + "reference": "49adbb92bcb4e3c2943719d2756271e8b9602acc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/511a524affeefc191939348823ac75e9921c2112", - "reference": "511a524affeefc191939348823ac75e9921c2112", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/49adbb92bcb4e3c2943719d2756271e8b9602acc", + "reference": "49adbb92bcb4e3c2943719d2756271e8b9602acc", "shasum": "" }, "require": { @@ -4878,7 +5299,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.2.8" + "source": "https://github.com/symfony/http-foundation/tree/v6.2.10" }, "funding": [ { @@ -4894,20 +5315,20 @@ "type": "tidelift" } ], - "time": "2023-03-29T21:42:15+00:00" + "time": "2023-04-18T13:46:08+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.2.9", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "02246510cf7031726f7237138d61b796b95799b3" + "reference": "81064a65a5496f17d2b6984f6519406f98864215" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/02246510cf7031726f7237138d61b796b95799b3", - "reference": "02246510cf7031726f7237138d61b796b95799b3", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/81064a65a5496f17d2b6984f6519406f98864215", + "reference": "81064a65a5496f17d2b6984f6519406f98864215", "shasum": "" }, "require": { @@ -4989,7 +5410,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.2.9" + "source": "https://github.com/symfony/http-kernel/tree/v6.2.10" }, "funding": [ { @@ -5005,7 +5426,7 @@ "type": "tidelift" } ], - "time": "2023-04-13T16:41:43+00:00" + "time": "2023-04-28T13:50:28+00:00" }, { "name": "symfony/mailer", @@ -5088,16 +5509,16 @@ }, { "name": "symfony/mime", - "version": "v6.2.7", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "62e341f80699badb0ad70b31149c8df89a2d778e" + "reference": "b6c137fc53a9f7c4c951cd3f362b3734c7a97723" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/62e341f80699badb0ad70b31149c8df89a2d778e", - "reference": "62e341f80699badb0ad70b31149c8df89a2d778e", + "url": "https://api.github.com/repos/symfony/mime/zipball/b6c137fc53a9f7c4c951cd3f362b3734c7a97723", + "reference": "b6c137fc53a9f7c4c951cd3f362b3734c7a97723", "shasum": "" }, "require": { @@ -5151,7 +5572,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.2.7" + "source": "https://github.com/symfony/mime/tree/v6.2.10" }, "funding": [ { @@ -5167,7 +5588,7 @@ "type": "tidelift" } ], - "time": "2023-02-24T10:42:00+00:00" + "time": "2023-04-19T09:54:16+00:00" }, { "name": "symfony/polyfill-ctype", @@ -5912,16 +6333,16 @@ }, { "name": "symfony/process", - "version": "v6.2.8", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "75ed64103df4f6615e15a7fe38b8111099f47416" + "reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/75ed64103df4f6615e15a7fe38b8111099f47416", - "reference": "75ed64103df4f6615e15a7fe38b8111099f47416", + "url": "https://api.github.com/repos/symfony/process/zipball/b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e", + "reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e", "shasum": "" }, "require": { @@ -5953,7 +6374,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.2.8" + "source": "https://github.com/symfony/process/tree/v6.2.10" }, "funding": [ { @@ -5969,7 +6390,7 @@ "type": "tidelift" } ], - "time": "2023-03-09T16:20:02+00:00" + "time": "2023-04-18T13:56:57+00:00" }, { "name": "symfony/routing", @@ -6547,16 +6968,16 @@ }, { "name": "symfony/var-dumper", - "version": "v6.2.8", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "d37ab6787be2db993747b6218fcc96e8e3bb4bd0" + "reference": "41a750a23412ca76fdbbf5096943b4134272c1ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d37ab6787be2db993747b6218fcc96e8e3bb4bd0", - "reference": "d37ab6787be2db993747b6218fcc96e8e3bb4bd0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/41a750a23412ca76fdbbf5096943b4134272c1ab", + "reference": "41a750a23412ca76fdbbf5096943b4134272c1ab", "shasum": "" }, "require": { @@ -6615,7 +7036,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.2.8" + "source": "https://github.com/symfony/var-dumper/tree/v6.2.10" }, "funding": [ { @@ -6631,20 +7052,20 @@ "type": "tidelift" } ], - "time": "2023-03-29T21:42:15+00:00" + "time": "2023-04-18T13:46:08+00:00" }, { "name": "symfony/yaml", - "version": "v6.2.7", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e8e6a1d59e050525f27a1f530aa9703423cb7f57" + "reference": "61916f3861b1e9705b18cfde723921a71dd1559d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e8e6a1d59e050525f27a1f530aa9703423cb7f57", - "reference": "e8e6a1d59e050525f27a1f530aa9703423cb7f57", + "url": "https://api.github.com/repos/symfony/yaml/zipball/61916f3861b1e9705b18cfde723921a71dd1559d", + "reference": "61916f3861b1e9705b18cfde723921a71dd1559d", "shasum": "" }, "require": { @@ -6689,7 +7110,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.2.7" + "source": "https://github.com/symfony/yaml/tree/v6.2.10" }, "funding": [ { @@ -6705,7 +7126,7 @@ "type": "tidelift" } ], - "time": "2023-02-16T09:57:23+00:00" + "time": "2023-04-28T13:25:36+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -8019,21 +8440,20 @@ }, { "name": "nyholm/psr7", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/Nyholm/psr7.git", - "reference": "ed7cf98f6562831dbc3c962406b5e49dc8179c8c" + "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/ed7cf98f6562831dbc3c962406b5e49dc8179c8c", - "reference": "ed7cf98f6562831dbc3c962406b5e49dc8179c8c", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/3cb4d163b58589e47b35103e8e5e6a6a475b47be", + "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be", "shasum": "" }, "require": { "php": ">=7.2", - "php-http/message-factory": "^1.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.1 || ^2.0" }, @@ -8044,14 +8464,15 @@ }, "require-dev": { "http-interop/http-factory-tests": "^0.9", - "php-http/psr7-integration-tests": "^1.0@dev", - "phpunit/phpunit": "^7.5 || 8.5 || 9.4", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", "symfony/error-handler": "^4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -8081,7 +8502,7 @@ ], "support": { "issues": "https://github.com/Nyholm/psr7/issues", - "source": "https://github.com/Nyholm/psr7/tree/1.7.0" + "source": "https://github.com/Nyholm/psr7/tree/1.8.0" }, "funding": [ { @@ -8093,20 +8514,20 @@ "type": "github" } ], - "time": "2023-04-20T08:38:48+00:00" + "time": "2023-05-02T11:26:24+00:00" }, { "name": "pestphp/pest", - "version": "v2.5.3", + "version": "v2.6.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "9842e1051d77d3eb1c598dd459b1babfa73a04eb" + "reference": "a34767fa15abd098c763db605fd0fc72665b7f69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/9842e1051d77d3eb1c598dd459b1babfa73a04eb", - "reference": "9842e1051d77d3eb1c598dd459b1babfa73a04eb", + "url": "https://api.github.com/repos/pestphp/pest/zipball/a34767fa15abd098c763db605fd0fc72665b7f69", + "reference": "a34767fa15abd098c763db605fd0fc72665b7f69", "shasum": "" }, "require": { @@ -8123,8 +8544,8 @@ "webmozart/assert": "<1.11.0" }, "require-dev": { - "pestphp/pest-dev-tools": "^2.6.0", - "symfony/process": "^6.2.8" + "pestphp/pest-dev-tools": "^2.8.0", + "symfony/process": "^6.2.10" }, "bin": [ "bin/pest" @@ -8180,7 +8601,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v2.5.3" + "source": "https://github.com/pestphp/pest/tree/v2.6.0" }, "funding": [ { @@ -8192,7 +8613,7 @@ "type": "github" } ], - "time": "2023-04-22T22:14:57+00:00" + "time": "2023-05-01T23:51:14+00:00" }, { "name": "pestphp/pest-plugin", @@ -8438,60 +8859,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "php-http/message-factory", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/4d8778e1c7d405cbb471574821c1ff5b68cc8f57", - "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" - ], - "support": { - "issues": "https://github.com/php-http/message-factory/issues", - "source": "https://github.com/php-http/message-factory/tree/1.1.0" - }, - "time": "2023-04-14T14:16:17+00:00" - }, { "name": "php-webdriver/webdriver", "version": "1.14.0", @@ -9337,16 +9704,16 @@ }, { "name": "sebastian/diff", - "version": "5.0.1", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02" + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02", - "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", "shasum": "" }, "require": { @@ -9392,7 +9759,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" }, "funding": [ { @@ -9400,7 +9767,7 @@ "type": "github" } ], - "time": "2023-03-23T05:12:41+00:00" + "time": "2023-05-01T07:48:21+00:00" }, { "name": "sebastian/environment", @@ -10236,16 +10603,16 @@ }, { "name": "symfony/http-client", - "version": "v6.2.9", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "7daf5d24c21a683164688b95bb73b7a4bd3b32fc" + "reference": "3f5545a91c8e79dedd1a06c4b04e1682c80c42f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/7daf5d24c21a683164688b95bb73b7a4bd3b32fc", - "reference": "7daf5d24c21a683164688b95bb73b7a4bd3b32fc", + "url": "https://api.github.com/repos/symfony/http-client/zipball/3f5545a91c8e79dedd1a06c4b04e1682c80c42f9", + "reference": "3f5545a91c8e79dedd1a06c4b04e1682c80c42f9", "shasum": "" }, "require": { @@ -10304,7 +10671,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.2.9" + "source": "https://github.com/symfony/http-client/tree/v6.2.10" }, "funding": [ { @@ -10320,7 +10687,7 @@ "type": "tidelift" } ], - "time": "2023-04-11T16:03:19+00:00" + "time": "2023-04-20T13:12:48+00:00" }, { "name": "symfony/http-client-contracts", diff --git a/database/migrations/2023_03_24_140711_create_servers_table.php b/database/migrations/2023_03_24_140711_create_servers_table.php index ba62f7977..84e2ab6ba 100644 --- a/database/migrations/2023_03_24_140711_create_servers_table.php +++ b/database/migrations/2023_03_24_140711_create_servers_table.php @@ -21,6 +21,7 @@ return new class extends Migration $table->string('user')->default('root'); $table->foreignId('team_id'); $table->foreignId('private_key_id'); + $table->schemalessAttributes('extra_attributes'); $table->timestamps(); }); } diff --git a/database/seeders/ServerSeeder.php b/database/seeders/ServerSeeder.php index 67b91d825..ea8d389ea 100644 --- a/database/seeders/ServerSeeder.php +++ b/database/seeders/ServerSeeder.php @@ -2,6 +2,8 @@ namespace Database\Seeders; +use App\Data\ServerMetadata; +use App\Enums\ProxyTypes; use App\Models\PrivateKey; use App\Models\Server; use App\Models\Team; @@ -16,12 +18,16 @@ class ServerSeeder extends Seeder { $root_team = Team::find(0); $private_key_1 = PrivateKey::find(1); + Server::create([ 'name' => "testing-local-docker-container", 'description' => "This is a test docker container", 'ip' => "coolify-testing-host", 'team_id' => $root_team->id, 'private_key_id' => $private_key_1->id, + 'extra_attributes' => ServerMetadata::from([ + 'proxy' => ProxyTypes::TRAEFIK_V2->value + ]), ]); Server::create([ 'name' => "testing-local-docker-container-2", @@ -29,6 +35,9 @@ class ServerSeeder extends Seeder 'ip' => "coolify-testing-host-2", 'team_id' => $root_team->id, 'private_key_id' => $private_key_1->id, + 'extra_attributes' => ServerMetadata::from([ + // + ]), ]); } } diff --git a/resources/views/livewire/activity-monitor.blade.php b/resources/views/livewire/activity-monitor.blade.php new file mode 100644 index 000000000..812095706 --- /dev/null +++ b/resources/views/livewire/activity-monitor.blade.php @@ -0,0 +1,17 @@ +
+ @isset($this->activity) + Activity: {{ $this->activity?->id }} + Status: {{ $this->activity?->properties->get('status') }} +
{{
+            \App\Actions\CoolifyTask\RunRemoteProcess::decodeOutput($this->activity)
+        }}
+ @else + Not monitoring any activity. + @endisset + +
diff --git a/resources/views/livewire/server/proxy.blade.php b/resources/views/livewire/server/proxy.blade.php new file mode 100644 index 000000000..91832611c --- /dev/null +++ b/resources/views/livewire/server/proxy.blade.php @@ -0,0 +1,30 @@ +
+

Proxy

+ + @if($this->server->extra_attributes->proxy) +
+
+ Proxy type: {{ $this->server->extra_attributes->proxy }} +
+
Features in W11.
+ +
+ @else + No proxy installed. + + + @endif + + + +
diff --git a/resources/views/server/show.blade.php b/resources/views/server/show.blade.php index 1fb710c42..374122442 100644 --- a/resources/views/server/show.blade.php +++ b/resources/views/server/show.blade.php @@ -7,4 +7,7 @@

Network: {{ data_get($docker, 'network') }}

@endforeach @endif +

{{ $server->name }}

+ + diff --git a/routes/web.php b/routes/web.php index deb7be6f0..02ad666e9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6,6 +6,7 @@ use App\Http\Controllers\ProjectController; use App\Models\InstanceSettings; use App\Models\StandaloneDocker; use App\Models\SwarmDocker; +use App\Http\Controllers\ServerController; use Illuminate\Support\Facades\Route; /* @@ -34,6 +35,15 @@ Route::middleware(['auth'])->group(function () { 'destinations' => $destinations->sortBy('name'), ]); })->name('dashboard'); + Route::get('/project/{project_uuid}', [ProjectController::class, 'environments'])->name('project.environments'); + + Route::get('/project/{project_uuid}/{environment_name}', [ProjectController::class, 'resources'])->name('project.resources'); + + Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}', [ProjectController::class, 'application'])->name('project.application'); + Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/deployment/{deployment_uuid}', [ProjectController::class, 'deployment'])->name('project.deployment'); + + Route::get('/server/{server:uuid}', [ServerController::class, 'show'])->name('server.show'); + Route::get('/profile', function () { return view('profile');