fixed failed jobs

This commit is contained in:
Alexander Gabriel 2026-05-27 00:15:55 +02:00
parent 5f62563bac
commit 99c6f5774f
3 changed files with 31 additions and 6 deletions

View File

@ -0,0 +1,19 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class RestrictToSubnet
{
public function handle(Request $request, Closure $next, string $subnet = '192'): Response
{
if (!str_starts_with($request->ip(), $subnet) && !str_starts_with($request->ip(), "127")) {
abort(403);
}
return $next($request);
}
}

View File

@ -1,11 +1,15 @@
#!/bin/sh #!/usr/bin/bash
export LANGUAGE=
source /home/alegab/workspace/comfy_ui/venv/bin/activate source /home/alegab/workspace/comfy_ui/venv/bin/activate
cp "$1" /home/alegab/comfy/ComfyUI/input/fotobox.jpg cp "$1" /home/alegab/comfy/ComfyUI/input/fotobox.jpg
#output=$(comfy-cli run --workflow /home/alegab/comfy/ComfyUI/user/default/workflows/comic2.json) echo "input: $1" >> image_log.txt
output=$(comfy-cli run --workflow /home/alegab/comfy/ComfyUI/user/default/workflows/comic2.json | grep "Outputs" -A 2 | tail -n 1)
output=$(comfy-cli run --workflow /home/alegab/comfy/ComfyUI/user/default/workflows/comic2.json | grep "Outputs" -A 2 | tail -n 2 | head -n 1 | strings)
output=$(tr -dc '[[:print:]]' <<< "$output" | cut -c 5-38,43-)
echo "output: $output" >> image_log.txt
cp $output "$1" cp $output "$1"
# cp storage/app/public/photos/006041bc-1065-4a4f-8f43-16d3be01f4db.jpeg /home/alegab/comfy/ComfyUI/input/fotobox.jpg

View File

@ -3,4 +3,6 @@
use App\Http\Controllers\PhotoController; use App\Http\Controllers\PhotoController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
Route::get('/', [PhotoController::class, 'index'])->name('camera'); Route::get('/', [PhotoController::class, 'index'])
->middleware(\App\Http\Middleware\RestrictToSubnet::class)
->name('camera');