added a help system, replaced the words "tenant" and "Pwa" with better alternatives. corrected and implemented cron jobs. prepared going live on a coolify-powered system.
This commit is contained in:
@@ -19,11 +19,12 @@ class PhotoFactory extends Factory
|
||||
'emotion_id' => Emotion::factory(),
|
||||
'task_id' => null,
|
||||
'guest_name' => $this->faker->name(),
|
||||
'file_path' => 'photos/' . Str::uuid() . '.jpg',
|
||||
'thumbnail_path' => 'photos/thumbnails/' . Str::uuid() . '.jpg',
|
||||
'file_path' => 'photos/'.Str::uuid().'.jpg',
|
||||
'thumbnail_path' => 'photos/thumbnails/'.Str::uuid().'.jpg',
|
||||
'likes_count' => $this->faker->numberBetween(0, 25),
|
||||
'is_featured' => false,
|
||||
'metadata' => ['factory' => true],
|
||||
'ingest_source' => \App\Models\Photo::SOURCE_GUEST_PWA,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -45,4 +46,3 @@ class PhotoFactory extends Factory
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('photobooth_settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedSmallInteger('ftp_port')->default(2121);
|
||||
$table->unsignedInteger('rate_limit_per_minute')->default(20);
|
||||
$table->unsignedTinyInteger('expiry_grace_days')->default(1);
|
||||
$table->boolean('require_ftps')->default(false);
|
||||
$table->json('allowed_ip_ranges')->nullable();
|
||||
$table->string('control_service_base_url')->nullable();
|
||||
$table->string('control_service_token_identifier')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('photobooth_settings');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->boolean('photobooth_enabled')->default(false)->after('settings');
|
||||
$table->string('photobooth_username', 32)->nullable()->after('photobooth_enabled');
|
||||
$table->text('photobooth_password_encrypted')->nullable()->after('photobooth_username');
|
||||
$table->string('photobooth_path')->nullable()->after('photobooth_password_encrypted');
|
||||
$table->timestamp('photobooth_expires_at')->nullable()->after('photobooth_path');
|
||||
$table->string('photobooth_status', 32)->default('inactive')->after('photobooth_expires_at');
|
||||
$table->timestamp('photobooth_last_provisioned_at')->nullable()->after('photobooth_status');
|
||||
$table->timestamp('photobooth_last_deprovisioned_at')->nullable()->after('photobooth_last_provisioned_at');
|
||||
$table->json('photobooth_metadata')->nullable()->after('photobooth_last_deprovisioned_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'photobooth_enabled',
|
||||
'photobooth_username',
|
||||
'photobooth_password_encrypted',
|
||||
'photobooth_path',
|
||||
'photobooth_expires_at',
|
||||
'photobooth_status',
|
||||
'photobooth_last_provisioned_at',
|
||||
'photobooth_last_deprovisioned_at',
|
||||
'photobooth_metadata',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('photos', function (Blueprint $table) {
|
||||
if (! Schema::hasColumn('photos', 'ingest_source')) {
|
||||
$table->string('ingest_source', 32)
|
||||
->default('guest_pwa')
|
||||
->after('guest_name');
|
||||
$table->index('ingest_source');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('photos', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('photos', 'ingest_source')) {
|
||||
$table->dropIndex('photos_ingest_source_index');
|
||||
$table->dropColumn('ingest_source');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('photos', function (Blueprint $table) {
|
||||
if (! Schema::hasColumn('photos', 'filename')) {
|
||||
$table->string('filename')->nullable()->after('guest_name');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'original_name')) {
|
||||
$table->string('original_name')->nullable()->after('filename');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'mime_type')) {
|
||||
$table->string('mime_type', 191)->nullable()->after('original_name');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'size')) {
|
||||
$table->unsignedBigInteger('size')->nullable()->after('mime_type');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'width')) {
|
||||
$table->unsignedInteger('width')->nullable()->after('thumbnail_path');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'height')) {
|
||||
$table->unsignedInteger('height')->nullable()->after('width');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'status')) {
|
||||
$table->string('status', 32)->default('pending')->after('height');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'uploader_id')) {
|
||||
$table->foreignId('uploader_id')
|
||||
->nullable()
|
||||
->after('status')
|
||||
->constrained('users')
|
||||
->nullOnDelete();
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'ip_address')) {
|
||||
$table->string('ip_address', 45)->nullable()->after('uploader_id');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'user_agent')) {
|
||||
$table->text('user_agent')->nullable()->after('ip_address');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('photos', function (Blueprint $table) {
|
||||
foreach (['user_agent', 'ip_address'] as $column) {
|
||||
if (Schema::hasColumn('photos', $column)) {
|
||||
$table->dropColumn($column);
|
||||
}
|
||||
}
|
||||
|
||||
if (Schema::hasColumn('photos', 'uploader_id')) {
|
||||
$table->dropConstrainedForeignId('uploader_id');
|
||||
}
|
||||
|
||||
foreach (['status', 'height', 'width', 'size', 'mime_type', 'original_name', 'filename'] as $column) {
|
||||
if (Schema::hasColumn('photos', $column)) {
|
||||
$table->dropColumn($column);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('coolify_action_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('service_id', 64);
|
||||
$table->string('action', 64);
|
||||
$table->json('payload')->nullable();
|
||||
$table->json('response')->nullable();
|
||||
$table->unsignedSmallInteger('status_code')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('coolify_action_logs');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user