fix permissions
Deploy / deploy (push) Failing after 3s

This commit is contained in:
2026-05-06 12:23:32 +02:00
parent 6968aefcc6
commit ddcd7b0a5e
3 changed files with 9 additions and 4 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
mkdir -p /app/data mkdir -p /app/data
chown -R www-data:www-data /app/data 2>/dev/null || chmod -R 777 /app/data 2>/dev/null || true chmod -R 777 /app/data
rm -f /app/data/*.lock
exec docker-php-entrypoint "$@" exec docker-php-entrypoint "$@"
+3 -3
View File
@@ -145,7 +145,7 @@ class Router
return ['status' => 'logged_out']; return ['status' => 'logged_out'];
} }
private function createSource(): array private function createSource(): mixed
{ {
$body = json_decode(file_get_contents('php://input'), true); $body = json_decode(file_get_contents('php://input'), true);
$type = LogSourceType::from($body['type'] ?? ''); $type = LogSourceType::from($body['type'] ?? '');
@@ -157,7 +157,7 @@ class Router
); );
} }
private function createRule(): array private function createRule(): mixed
{ {
$body = json_decode(file_get_contents('php://input'), true); $body = json_decode(file_get_contents('php://input'), true);
return $this->repo->createRule( return $this->repo->createRule(
@@ -178,7 +178,7 @@ class Router
return ['status' => 'deleted', 'id' => $id]; return ['status' => 'deleted', 'id' => $id];
} }
private function getAlerts(): array private function getAlerts(): mixed
{ {
$limit = (int) ($_GET['limit'] ?? 100); $limit = (int) ($_GET['limit'] ?? 100);
$offset = (int) ($_GET['offset'] ?? 0); $offset = (int) ($_GET['offset'] ?? 0);
+4
View File
@@ -14,6 +14,10 @@ class Database
} }
@chmod($dir, 0777); @chmod($dir, 0777);
if (file_exists($path)) {
@chmod($path, 0666);
}
$this->pdo = new \PDO("sqlite:$path"); $this->pdo = new \PDO("sqlite:$path");
$this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$this->pdo->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC); $this->pdo->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC);