AJustes generales y login

This commit is contained in:
2025-01-13 00:32:13 -03:00
parent e5e040a53b
commit ee19e479f4
18 changed files with 1788 additions and 1127 deletions
+1267 -1086
View File
File diff suppressed because it is too large Load Diff
+29 -23
View File
@@ -3,22 +3,25 @@ FROM php:8.4-fpm
ARG UID=1000
ARG GID=1000
RUN apt update && apt install -y nginx git curl zip unzip supervisor libpq-dev libzip-dev libicu-dev \
&& curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh \
&& bash nodesource_setup.sh \
&& apt install nodejs \
&& pecl install xdebug \
&& docker-php-ext-install pdo_pgsql \
&& docker-php-ext-install zip \
&& docker-php-ext-install bcmath \
&& docker-php-ext-install intl \
&& docker-php-ext-enable xdebug \
&& usermod -u $UID www-data \
&& groupmod -g $GID www-data \
&& apt clean \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/ \
&& apt clean autoclean \
&& apt autoremove --yes
RUN apt update && apt install -y nginx git curl zip unzip supervisor libpq-dev libzip-dev libicu-dev; \
curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh; \
bash nodesource_setup.sh; \
apt install nodejs; \
pecl install xdebug; \
pecl install redis; \
docker-php-ext-install pdo_pgsql; \
docker-php-ext-install zip; \
docker-php-ext-install bcmath; \
docker-php-ext-install intl; \
docker-php-ext-enable xdebug; \
docker-php-ext-enable pcntl; \
docker-php-ext-enable redis; \
usermod -u $UID www-data; \
groupmod -g $GID www-data; \
apt clean; \
rm -rf /var/lib/{apt,dpkg,cache,log}/; \
apt clean autoclean; \
apt autoremove --yes
WORKDIR /var/www/html
@@ -30,14 +33,17 @@ COPY nginx.conf /etc/nginx/sites-enabled/default
COPY supervisord.conf /etc/supervisord.conf
COPY entrypoint.sh /etc/entrypoint.sh
COPY ./ ./
RUN chown -R www-data:www-data /var/www
RUN chown -R www-data:www-data /var/www \
&& composer dump-autoload \
&& npm install \
&& npm run build \
&& npm cache clean --force \
&& rm -rf node_modules\
&& rm -rf /tmp/* /var/tmp/*
USER www-data
RUN composer dump-autoload; \
npm install; \
npm run build; \
npm cache clean --force; \
rm -rf node_modules
USER root
RUN rm -rf /tmp/* /var/tmp/*
EXPOSE 80
ENTRYPOINT [ "sh", "/etc/entrypoint.sh" ]
+1 -1
View File
@@ -11,4 +11,4 @@ down:
docker compose down
shell:
docker compose exec laravel bash
docker compose exec -u www-data laravel bash
+10 -2
View File
@@ -17,7 +17,7 @@ namespace App\Models{
*
* @property string $id
* @property int $valor
* @property string $descripcion
* @property string|null $descripcion
* @property string $turno_id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
@@ -39,7 +39,7 @@ namespace App\Models{
*
*
* @property string $id
* @property string $descripcion
* @property string|null $descripcion
* @property int $valor
* @property \App\Enums\TipoDocumento $tipo_documento
* @property string $turno_id
@@ -76,6 +76,7 @@ namespace App\Models{
* @property string $turno_id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read mixed $total
* @method static \Illuminate\Database\Eloquent\Builder<static>|Efectivo newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Efectivo newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Efectivo query()
@@ -249,10 +250,17 @@ namespace App\Models{
* @property int $fondo
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read mixed $arqueo
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CalculoFondo> $calculosFondo
* @property-read int|null $calculos_fondo_count
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Documento> $documentos
* @property-read int|null $documentos_count
* @property-read \App\Models\Efectivo|null $efectivo
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Egreso> $egresos
* @property-read int|null $egresos_count
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Ingreso> $ingresos
* @property-read int|null $ingresos_count
* @property-read mixed $rendido
* @method static \Illuminate\Database\Eloquent\Builder<static>|Turno newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Turno newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Turno query()
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace App\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Log;
class PruebaJob implements ShouldQueue
{
use Queueable;
public function __construct()
{
}
public function handle(): void
{
Log::info("Prueba de un JOB!");
}
}
+1
View File
@@ -12,6 +12,7 @@ use Illuminate\Validation\ValidationException;
use Livewire\Attributes\Computed;
use Livewire\Component;
use Livewire\WithPagination;
use Log;
use TallStackUi\Traits\Interactions;
class Index extends Component
@@ -0,0 +1,64 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Laravel\Telescope\IncomingEntry;
use Laravel\Telescope\Telescope;
use Laravel\Telescope\TelescopeApplicationServiceProvider;
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
// Telescope::night();
$this->hideSensitiveRequestDetails();
$isLocal = $this->app->environment('local');
Telescope::filter(function (IncomingEntry $entry) use ($isLocal) {
return $isLocal ||
$entry->isReportableException() ||
$entry->isFailedRequest() ||
$entry->isFailedJob() ||
$entry->isScheduledTask() ||
$entry->hasMonitoredTag();
});
}
/**
* Prevent sensitive request details from being logged by Telescope.
*/
protected function hideSensitiveRequestDetails(): void
{
if ($this->app->environment('local')) {
return;
}
Telescope::hideRequestParameters(['_token']);
Telescope::hideRequestHeaders([
'cookie',
'x-csrf-token',
'x-xsrf-token',
]);
}
/**
* Register the Telescope gate.
*
* This gate determines who can access Telescope in non-local environments.
*/
protected function gate(): void
{
Gate::define('viewTelescope', function ($user) {
return in_array($user->email, [
//
]);
});
}
}
+1
View File
@@ -2,4 +2,5 @@
return [
App\Providers\AppServiceProvider::class,
App\Providers\TelescopeServiceProvider::class,
];
+25 -13
View File
@@ -1,33 +1,36 @@
services:
laravel:
image: zenithar:local
build:
context: .
dockerfile: DockerfileFrankenPHP
args:
UID: 1000
GID: 1000
ports:
- "80:80"
restart: on-failure
volumes:
- ./:/app
env_file: .env
entrypoint: php artisan octane:frankenphp --watch --port=80 --workers=1 --max-requests=1
- ./:/var/www/html
scheduler:
image: zenithar:local
build:
context: .
args:
UID: 1000
GID: 1000
volumes:
- .:/var/www/html
env_file: .env
entrypoint: [ "php", "artisan", "schedule:work" ]
user: www-data
entrypoint: [ "php", "artisan", "schedule:work", "-v" ]
worker:
image: zenithar:local
build:
context: .
args:
UID: 1000
GID: 1000
volumes:
- .:/var/www/html
env_file: .env
entrypoint: [ "php", "artisan", "queue:work" ]
user: www-data
entrypoint: [ "php", "artisan", "queue:work", "-v" ]
vite:
image: node:23
@@ -57,6 +60,15 @@ services:
POSTGRES_DB: laravel
POSTGRES_PASSWORD: secret
redis:
image: redis:alpine
restart: unless-stopped
ports:
- "6379:6379"
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
retries: 3
timeout: 5s
volumes:
caddy_data:
postgres_data:
+1
View File
@@ -13,6 +13,7 @@
"laravel-lang/common": "^6.4",
"laravel/framework": "^11.31",
"laravel/octane": "^2.6",
"laravel/telescope": "^5.2",
"laravel/tinker": "^2.9",
"livewire/livewire": "^3.4",
"tallstackui/tallstackui": "^1.37"
Generated
+70 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "665527920379b2afc38414405408a916",
"content-hash": "b3ea0bb5f7c31eb5b191a78ba7b41a07",
"packages": [
{
"name": "archtechx/enums",
@@ -3160,6 +3160,75 @@
},
"time": "2024-12-16T15:26:28+00:00"
},
{
"name": "laravel/telescope",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/laravel/telescope.git",
"reference": "7ee46fbea8e3b01108575c8edf7377abddfe8bb9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/telescope/zipball/7ee46fbea8e3b01108575c8edf7377abddfe8bb9",
"reference": "7ee46fbea8e3b01108575c8edf7377abddfe8bb9",
"shasum": ""
},
"require": {
"ext-json": "*",
"laravel/framework": "^8.37|^9.0|^10.0|^11.0",
"php": "^8.0",
"symfony/console": "^5.3|^6.0|^7.0",
"symfony/var-dumper": "^5.0|^6.0|^7.0"
},
"require-dev": {
"ext-gd": "*",
"guzzlehttp/guzzle": "^6.0|^7.0",
"laravel/octane": "^1.4|^2.0|dev-develop",
"orchestra/testbench": "^6.40|^7.37|^8.17|^9.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.0|^10.5"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Laravel\\Telescope\\TelescopeServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Telescope\\": "src/",
"Laravel\\Telescope\\Database\\Factories\\": "database/factories/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "[email protected]"
},
{
"name": "Mohamed Said",
"email": "[email protected]"
}
],
"description": "An elegant debug assistant for the Laravel framework.",
"keywords": [
"debugging",
"laravel",
"monitoring"
],
"support": {
"issues": "https://github.com/laravel/telescope/issues",
"source": "https://github.com/laravel/telescope/tree/v5.2.6"
},
"time": "2024-11-25T20:34:58+00:00"
},
{
"name": "laravel/tinker",
"version": "v2.10.0",
+205
View File
@@ -0,0 +1,205 @@
<?php
use Laravel\Telescope\Http\Middleware\Authorize;
use Laravel\Telescope\Watchers;
return [
/*
|--------------------------------------------------------------------------
| Telescope Master Switch
|--------------------------------------------------------------------------
|
| This option may be used to disable all Telescope watchers regardless
| of their individual configuration, which simply provides a single
| and convenient way to enable or disable Telescope data storage.
|
*/
'enabled' => env('TELESCOPE_ENABLED', true),
/*
|--------------------------------------------------------------------------
| Telescope Domain
|--------------------------------------------------------------------------
|
| This is the subdomain where Telescope will be accessible from. If the
| setting is null, Telescope will reside under the same domain as the
| application. Otherwise, this value will be used as the subdomain.
|
*/
'domain' => env('TELESCOPE_DOMAIN'),
/*
|--------------------------------------------------------------------------
| Telescope Path
|--------------------------------------------------------------------------
|
| This is the URI path where Telescope will be accessible from. Feel free
| to change this path to anything you like. Note that the URI will not
| affect the paths of its internal API that aren't exposed to users.
|
*/
'path' => env('TELESCOPE_PATH', 'telescope'),
/*
|--------------------------------------------------------------------------
| Telescope Storage Driver
|--------------------------------------------------------------------------
|
| This configuration options determines the storage driver that will
| be used to store Telescope's data. In addition, you may set any
| custom options as needed by the particular driver you choose.
|
*/
'driver' => env('TELESCOPE_DRIVER', 'database'),
'storage' => [
'database' => [
'connection' => env('DB_CONNECTION', 'mysql'),
'chunk' => 1000,
],
],
/*
|--------------------------------------------------------------------------
| Telescope Queue
|--------------------------------------------------------------------------
|
| This configuration options determines the queue connection and queue
| which will be used to process ProcessPendingUpdate jobs. This can
| be changed if you would prefer to use a non-default connection.
|
*/
'queue' => [
'connection' => env('TELESCOPE_QUEUE_CONNECTION', null),
'queue' => env('TELESCOPE_QUEUE', null),
],
/*
|--------------------------------------------------------------------------
| Telescope Route Middleware
|--------------------------------------------------------------------------
|
| These middleware will be assigned to every Telescope route, giving you
| the chance to add your own middleware to this list or change any of
| the existing middleware. Or, you can simply stick with this list.
|
*/
'middleware' => [
'web',
Authorize::class,
],
/*
|--------------------------------------------------------------------------
| Allowed / Ignored Paths & Commands
|--------------------------------------------------------------------------
|
| The following array lists the URI paths and Artisan commands that will
| not be watched by Telescope. In addition to this list, some Laravel
| commands, like migrations and queue commands, are always ignored.
|
*/
'only_paths' => [
// 'api/*'
],
'ignore_paths' => [
'livewire*',
'nova-api*',
'pulse*',
],
'ignore_commands' => [
//
],
/*
|--------------------------------------------------------------------------
| Telescope Watchers
|--------------------------------------------------------------------------
|
| The following array lists the "watchers" that will be registered with
| Telescope. The watchers gather the application's profile data when
| a request or task is executed. Feel free to customize this list.
|
*/
'watchers' => [
Watchers\BatchWatcher::class => env('TELESCOPE_BATCH_WATCHER', true),
Watchers\CacheWatcher::class => [
'enabled' => env('TELESCOPE_CACHE_WATCHER', true),
'hidden' => [],
],
Watchers\ClientRequestWatcher::class => env('TELESCOPE_CLIENT_REQUEST_WATCHER', true),
Watchers\CommandWatcher::class => [
'enabled' => env('TELESCOPE_COMMAND_WATCHER', true),
'ignore' => [],
],
Watchers\DumpWatcher::class => [
'enabled' => env('TELESCOPE_DUMP_WATCHER', true),
'always' => env('TELESCOPE_DUMP_WATCHER_ALWAYS', false),
],
Watchers\EventWatcher::class => [
'enabled' => env('TELESCOPE_EVENT_WATCHER', true),
'ignore' => [],
],
Watchers\ExceptionWatcher::class => env('TELESCOPE_EXCEPTION_WATCHER', true),
Watchers\GateWatcher::class => [
'enabled' => env('TELESCOPE_GATE_WATCHER', true),
'ignore_abilities' => [],
'ignore_packages' => true,
'ignore_paths' => [],
],
Watchers\JobWatcher::class => env('TELESCOPE_JOB_WATCHER', true),
Watchers\LogWatcher::class => [
'enabled' => env('TELESCOPE_LOG_WATCHER', true),
'level' => 'error',
],
Watchers\MailWatcher::class => env('TELESCOPE_MAIL_WATCHER', true),
Watchers\ModelWatcher::class => [
'enabled' => env('TELESCOPE_MODEL_WATCHER', true),
'events' => ['eloquent.*'],
'hydrations' => true,
],
Watchers\NotificationWatcher::class => env('TELESCOPE_NOTIFICATION_WATCHER', true),
Watchers\QueryWatcher::class => [
'enabled' => env('TELESCOPE_QUERY_WATCHER', true),
'ignore_packages' => true,
'ignore_paths' => [],
'slow' => 100,
],
Watchers\RedisWatcher::class => env('TELESCOPE_REDIS_WATCHER', true),
Watchers\RequestWatcher::class => [
'enabled' => env('TELESCOPE_REQUEST_WATCHER', true),
'size_limit' => env('TELESCOPE_RESPONSE_SIZE_LIMIT', 64),
'ignore_http_methods' => [],
'ignore_status_codes' => [],
],
Watchers\ScheduleWatcher::class => env('TELESCOPE_SCHEDULE_WATCHER', true),
Watchers\ViewWatcher::class => env('TELESCOPE_VIEW_WATCHER', true),
],
];
@@ -0,0 +1,70 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Get the migration connection name.
*/
public function getConnection(): ?string
{
return config('telescope.storage.database.connection');
}
/**
* Run the migrations.
*/
public function up(): void
{
$schema = Schema::connection($this->getConnection());
$schema->create('telescope_entries', function (Blueprint $table) {
$table->bigIncrements('sequence');
$table->uuid('uuid');
$table->uuid('batch_id');
$table->string('family_hash')->nullable();
$table->boolean('should_display_on_index')->default(true);
$table->string('type', 20);
$table->longText('content');
$table->dateTime('created_at')->nullable();
$table->unique('uuid');
$table->index('batch_id');
$table->index('family_hash');
$table->index('created_at');
$table->index(['type', 'should_display_on_index']);
});
$schema->create('telescope_entries_tags', function (Blueprint $table) {
$table->uuid('entry_uuid');
$table->string('tag');
$table->primary(['entry_uuid', 'tag']);
$table->index('tag');
$table->foreign('entry_uuid')
->references('uuid')
->on('telescope_entries')
->onDelete('cascade');
});
$schema->create('telescope_monitoring', function (Blueprint $table) {
$table->string('tag')->primary();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
$schema = Schema::connection($this->getConnection());
$schema->dropIfExists('telescope_entries_tags');
$schema->dropIfExists('telescope_entries');
$schema->dropIfExists('telescope_monitoring');
}
};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

+5
View File
@@ -0,0 +1,5 @@
{
"/app.js": "/app.js?id=99f84d421ae083196e0a45c3c310168b",
"/app-dark.css": "/app-dark.css?id=1ea407db56c5163ae29311f1f38eb7b9",
"/app.css": "/app.css?id=de4c978567bfd90b38d186937dee5ccf"
}