Files
Infra-Management/database/migrations/2024_01_01_000008_create_identity_table.php
I-Fun c649f055d8 feat: initialize Infra Manager with React, Tailwind CSS, and Inertia.js
- Added main application entry point (app.jsx) and bootstrap file for React setup.
- Created Wiki index page (Index.jsx) for documentation and file management.
- Implemented utility functions for formatting and status handling in utils.js.
- Set up Blade template (app.blade.php) for Inertia.js integration.
- Defined API routes for metrics and terminal access in api.php.
- Established console commands for scheduled tasks in console.php.
- Created web routes for various application features including authentication, hypervisors, containers, cloud accounts, security, backups, and wiki management in web.php.
- Developed setup scripts for Windows (setup.ps1) and Linux (setup.sh) environments.
- Configured Tailwind CSS for styling with custom themes and animations in tailwind.config.js.
- Set up Vite for asset bundling and development server in vite.config.js.
2026-04-07 20:29:32 +07:00

73 lines
2.9 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('password_entries', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
$table->string('title');
$table->string('category')->nullable();
$table->string('url')->nullable();
$table->string('username')->nullable();
$table->text('password'); // encrypted
$table->text('notes')->nullable(); // encrypted
$table->json('custom_fields')->nullable(); // encrypted
$table->json('tags')->nullable();
$table->boolean('is_shared')->default(false);
$table->json('shared_with')->nullable(); // user IDs
$table->timestamp('expires_at')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
$table->softDeletes();
});
Schema::create('certificates', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('domain');
$table->json('san')->nullable(); // Subject Alternative Names
$table->text('certificate'); // encrypted
$table->text('private_key'); // encrypted
$table->text('chain')->nullable(); // encrypted
$table->string('issuer')->nullable();
$table->string('type'); // self-signed, lets-encrypt, custom
$table->boolean('auto_renew')->default(false);
$table->timestamp('issued_at')->nullable();
$table->timestamp('expires_at');
$table->json('tags')->nullable();
$table->string('status'); // valid, expiring, expired, revoked
$table->foreignId('created_by')->constrained('users');
$table->timestamps();
$table->softDeletes();
});
Schema::create('ssh_keys', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
$table->string('name');
$table->string('fingerprint')->unique();
$table->text('public_key');
$table->text('private_key')->nullable(); // encrypted
$table->string('algorithm')->default('rsa');
$table->integer('key_size')->default(4096);
$table->boolean('has_passphrase')->default(false);
$table->json('tags')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
public function down(): void
{
Schema::dropIfExists('ssh_keys');
Schema::dropIfExists('certificates');
Schema::dropIfExists('password_entries');
}
};