fix docker ssh issue by downgrading phpseclib

This commit is contained in:
Saeed Vaziry
2025-06-19 21:25:25 +02:00
parent 632a56bf4d
commit 9a3578f3ac
8 changed files with 43 additions and 23 deletions

View File

@ -20,7 +20,8 @@ public function check(Server $server): Server
$server->status = ServerStatus::READY; $server->status = ServerStatus::READY;
$server->save(); $server->save();
} }
} catch (Throwable) { } catch (Throwable $e) {
throw $e;
$server->status = ServerStatus::DISCONNECTED; $server->status = ServerStatus::DISCONNECTED;
$server->save(); $server->save();
Notifier::send($server, new ServerDisconnected($server)); Notifier::send($server, new ServerDisconnected($server));

View File

@ -114,8 +114,12 @@ public function import(Request $request): RedirectResponse
} }
File::move($extractPath.'/ssh-public.key', storage_path('ssh-public.key')); File::move($extractPath.'/ssh-public.key', storage_path('ssh-public.key'));
File::move($extractPath.'/ssh-private.pem', storage_path('ssh-private.pem')); File::move($extractPath.'/ssh-private.pem', storage_path('ssh-private.pem'));
File::moveDirectory($extractPath.'/key-pairs', storage_path('app/key-pairs'), true); if (File::exists($extractPath.'/key-pairs')) {
File::moveDirectory($extractPath.'/server-logs', storage_path('app/server-logs'), true); move_directory($extractPath.'/key-pairs', storage_path('app/key-pairs'));
}
if (File::exists($extractPath.'/server-logs')) {
move_directory($extractPath.'/server-logs', storage_path('app/server-logs'));
}
return redirect()->route('vito-settings') return redirect()->route('vito-settings')
->with('success', 'Settings imported successfully.'); ->with('success', 'Settings imported successfully.');

View File

@ -277,3 +277,21 @@ function git_path(): ?string
return array_find($paths, fn ($path) => is_executable($path)); return array_find($paths, fn ($path) => is_executable($path));
} }
function move_directory(string $from, string $to): void
{
// Remove any stale destination
if (File::exists($to)) {
File::deleteDirectory($to);
}
// Ensure parent of $to exists
File::ensureDirectoryExists(dirname($to));
// Copy + delete (works across mounts / volumes)
if (! File::copyDirectory($from, $to)) {
throw new RuntimeException("Could not copy [$from] to [$to]");
}
File::deleteDirectory($from);
}

View File

@ -20,7 +20,7 @@
"laravel/tinker": "^2.8", "laravel/tinker": "^2.8",
"mobiledetect/mobiledetectlib": "^4.8", "mobiledetect/mobiledetectlib": "^4.8",
"opcodesio/log-viewer": "^3.17", "opcodesio/log-viewer": "^3.17",
"phpseclib/phpseclib": "~3.0", "phpseclib/phpseclib": "3.0.43",
"spatie/laravel-route-attributes": "^1.24", "spatie/laravel-route-attributes": "^1.24",
"tightenco/ziggy": "^2.5" "tightenco/ziggy": "^2.5"
}, },

26
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "f9540de1e2dd90b20d9fe05386e75252", "content-hash": "fc8ee6c13042c4df2cd39b59c4d80ac1",
"packages": [ "packages": [
{ {
"name": "aws/aws-crt-php", "name": "aws/aws-crt-php",
@ -62,16 +62,16 @@
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.345.0", "version": "3.346.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "61b4675bc02db8d7f3e1ba6931dc827c5ae23aa8" "reference": "27401e70b1b01114e4e228861933eb7b78630be7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/61b4675bc02db8d7f3e1ba6931dc827c5ae23aa8", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/27401e70b1b01114e4e228861933eb7b78630be7",
"reference": "61b4675bc02db8d7f3e1ba6931dc827c5ae23aa8", "reference": "27401e70b1b01114e4e228861933eb7b78630be7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -153,9 +153,9 @@
"support": { "support": {
"forum": "https://github.com/aws/aws-sdk-php/discussions", "forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues", "issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.345.0" "source": "https://github.com/aws/aws-sdk-php/tree/3.346.1"
}, },
"time": "2025-06-17T18:09:42+00:00" "time": "2025-06-19T18:05:45+00:00"
}, },
{ {
"name": "bacon/bacon-qr-code", "name": "bacon/bacon-qr-code",
@ -3566,16 +3566,16 @@
}, },
{ {
"name": "phpseclib/phpseclib", "name": "phpseclib/phpseclib",
"version": "3.0.44", "version": "3.0.43",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpseclib/phpseclib.git", "url": "https://github.com/phpseclib/phpseclib.git",
"reference": "1d0b5e7e1434678411787c5a0535e68907cf82d9" "reference": "709ec107af3cb2f385b9617be72af8cf62441d02"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/1d0b5e7e1434678411787c5a0535e68907cf82d9", "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/709ec107af3cb2f385b9617be72af8cf62441d02",
"reference": "1d0b5e7e1434678411787c5a0535e68907cf82d9", "reference": "709ec107af3cb2f385b9617be72af8cf62441d02",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3656,7 +3656,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/phpseclib/phpseclib/issues", "issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.44" "source": "https://github.com/phpseclib/phpseclib/tree/3.0.43"
}, },
"funding": [ "funding": [
{ {
@ -3672,7 +3672,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-06-15T09:59:26+00:00" "time": "2024-12-14T21:12:59+00:00"
}, },
{ {
"name": "pragmarx/google2fa", "name": "pragmarx/google2fa",

View File

@ -1,7 +1,7 @@
services: services:
app: app:
build: build:
context: ./vendor/laravel/sail/runtimes/8.2 context: ./vendor/laravel/sail/runtimes/8.4
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
WWWGROUP: '${WWWGROUP}' WWWGROUP: '${WWWGROUP}'
@ -24,7 +24,7 @@ services:
depends_on: { } depends_on: { }
worker: worker:
build: build:
context: ./vendor/laravel/sail/runtimes/8.2 context: ./vendor/laravel/sail/runtimes/8.4
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
WWWGROUP: '${WWWGROUP}' WWWGROUP: '${WWWGROUP}'

View File

@ -12,7 +12,7 @@ services:
extra_hosts: extra_hosts:
- 'host.docker.internal:host-gateway' - 'host.docker.internal:host-gateway'
ports: ports:
- '${APP_PORT:-80}:80' - '${APP_PORT:-8000}:80'
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}' - '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
volumes: volumes:
- "vito-storage:/var/www/html/storage" - "vito-storage:/var/www/html/storage"

View File

@ -50,9 +50,6 @@ if [ ! -f "$INIT_FLAG" ]; then
# create sqlite database # create sqlite database
touch /var/www/html/storage/database.sqlite touch /var/www/html/storage/database.sqlite
# install default plugins
php /var/www/html/artisan plugins:install https://github.com/vitodeploy/laravel-octane-plugin
# create the flag file to indicate completion of initialization tasks # create the flag file to indicate completion of initialization tasks
touch "$INIT_FLAG" touch "$INIT_FLAG"
fi fi