fixed failed jobs
This commit is contained in:
parent
5f62563bac
commit
99c6f5774f
19
app/Http/Middleware/RestrictToSubnet.php
Normal file
19
app/Http/Middleware/RestrictToSubnet.php
Normal 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);
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,15 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/bash
|
||||
export LANGUAGE=
|
||||
|
||||
source /home/alegab/workspace/comfy_ui/venv/bin/activate
|
||||
|
||||
cp "$1" /home/alegab/comfy/ComfyUI/input/fotobox.jpg
|
||||
|
||||
#output=$(comfy-cli run --workflow /home/alegab/comfy/ComfyUI/user/default/workflows/comic2.json)
|
||||
output=$(comfy-cli run --workflow /home/alegab/comfy/ComfyUI/user/default/workflows/comic2.json | grep "Outputs" -A 2 | tail -n 1)
|
||||
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 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 storage/app/public/photos/006041bc-1065-4a4f-8f43-16d3be01f4db.jpeg /home/alegab/comfy/ComfyUI/input/fotobox.jpg
|
||||
@ -3,4 +3,6 @@
|
||||
use App\Http\Controllers\PhotoController;
|
||||
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');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user