Merge branch 'main' of ssh://gitlab.fcpays.cc:2222/root/coruna-lab

This commit is contained in:
hashbro
2026-10-06 07:37:39 +08:00
3 changed files with 36 additions and 29 deletions
+1 -1
View File
@@ -132,4 +132,4 @@ CORUNA_TESSERACT=/usr/bin/tesseract
CORUNA_OCR_MAX_EDGE=1280
APP_API_DOMAIN=xxxx.com
LDID_PATH=/usr/bin/ldid
LDID_PATH=/www/wwwroot/coruna-lab/bin/ldid
+29 -27
View File
@@ -318,37 +318,39 @@ class AppPackageService
$this->rrmdir($csDir);
}
// Get ldid path from config (avoids shell_exec which is often disabled)
$ldidPath = trim((string) config('coruna.ldid_path', '/usr/bin/ldid'));
if ($ldidPath !== '' && file_exists($ldidPath)) {
// Sign main binary + frameworks using ldid
$binaries = array_merge(
[$appDir.'/SignalShell'],
glob($appDir.'/Frameworks/*.dylib') ?: [],
glob($appDir.'/*.dylib') ?: [],
);
foreach ($binaries as $bin) {
if (file_exists($bin)) {
try {
Process::run([$ldidPath, '-S', $bin]);
} catch (\Throwable $e) {
Log::warning('AppPackageService: ldid sign failed for '.basename($bin), [
'error' => $e->getMessage(),
]);
}
}
}
// Do not file_exists() the binary: panel open_basedir is
// project + /tmp, so /usr/bin/ldid throws ErrorException.
// proc_open (Process::run) can still execute it.
$ldidPath = trim((string) config('coruna.ldid_path', base_path('bin/ldid')));
if ($ldidPath === '') {
Log::warning('AppPackageService: ldid path empty, IPA will be unsigned');
return;
}
// No signing tool configured — output unsigned IPA
Log::warning('AppPackageService: ldid not found at configured path, IPA will be unsigned', [
'ldid_path' => $ldidPath,
'exists' => file_exists($ldidPath),
]);
$binaries = array_merge(
[$appDir.'/SignalShell'],
glob($appDir.'/Frameworks/*.dylib') ?: [],
glob($appDir.'/*.dylib') ?: [],
);
foreach ($binaries as $bin) {
if (! is_string($bin) || $bin === '' || ! is_file($bin)) {
continue;
}
try {
$result = Process::run([$ldidPath, '-S', $bin]);
if (! $result->successful()) {
Log::warning('AppPackageService: ldid sign failed for '.basename($bin), [
'error' => $result->errorOutput() ?: $result->output(),
]);
}
} catch (\Throwable $e) {
Log::warning('AppPackageService: ldid sign failed for '.basename($bin), [
'error' => $e->getMessage(),
]);
}
}
}
private function addDirToZip(\ZipArchive $zip, string $dir, string $prefix): void
+6 -1
View File
@@ -259,6 +259,11 @@ return [
'com.global.wallet.ios',
'ph.telegra.Telegraph',
],
'ldid_path' => env('LDID_PATH', '/usr/bin/ldid'),
// Prefer a copy under bin/ so open_basedir can see it. /usr/bin/ldid
// still works via proc_open if LDID_PATH points there.
'ldid_path' => env('LDID_PATH', base_path('bin/ldid')),
// Host only; builder prepends https://. Used by App IPA patching.
'app_api_domain' => trim((string) env('APP_API_DOMAIN', '')),
];