mirror of
https://github.com/anna-sara/vbytes_lan.git
synced 2025-12-24 05:17:13 +01:00
Compare commits
No commits in common. "19c995ad66667e05728f0898e619153be94a0c6f" and "4d261e8cbcd3d8aa83a5f39d2388403747b8c101" have entirely different histories.
19c995ad66
...
4d261e8cbc
9 changed files with 22 additions and 140 deletions
|
|
@ -7,11 +7,9 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Filament\Models\Contracts\FilamentUser;
|
use Filament\Models\Contracts\FilamentUser;
|
||||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
|
||||||
use Filament\Auth\MultiFactor\Email\Contracts\HasEmailAuthentication;
|
|
||||||
use Filament\Panel;
|
use Filament\Panel;
|
||||||
|
|
||||||
class User extends Authenticatable implements FilamentUser, HasEmailAuthentication, MustVerifyEmail
|
class User extends Authenticatable implements FilamentUser
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||||
use HasFactory, Notifiable;
|
use HasFactory, Notifiable;
|
||||||
|
|
@ -25,7 +23,6 @@ class User extends Authenticatable implements FilamentUser, HasEmailAuthenticati
|
||||||
'name',
|
'name',
|
||||||
'email',
|
'email',
|
||||||
'password',
|
'password',
|
||||||
'has_email_authentication'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -48,7 +45,6 @@ class User extends Authenticatable implements FilamentUser, HasEmailAuthenticati
|
||||||
return [
|
return [
|
||||||
'email_verified_at' => 'datetime',
|
'email_verified_at' => 'datetime',
|
||||||
'password' => 'hashed',
|
'password' => 'hashed',
|
||||||
'has_email_authentication' => 'boolean',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,19 +52,4 @@ class User extends Authenticatable implements FilamentUser, HasEmailAuthenticati
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hasEmailAuthentication(): bool
|
|
||||||
{
|
|
||||||
// This method should return true if the user has enabled email authentication.
|
|
||||||
|
|
||||||
return $this->has_email_authentication;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function toggleEmailAuthentication(bool $condition): void
|
|
||||||
{
|
|
||||||
// This method should save whether or not the user has enabled email authentication.
|
|
||||||
|
|
||||||
$this->has_email_authentication = $condition;
|
|
||||||
$this->save();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
|
||||||
use Illuminate\Routing\Middleware\SubstituteBindings;
|
use Illuminate\Routing\Middleware\SubstituteBindings;
|
||||||
use Illuminate\Session\Middleware\StartSession;
|
use Illuminate\Session\Middleware\StartSession;
|
||||||
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
||||||
use Filament\Auth\MultiFactor\Email\EmailAuthentication;
|
|
||||||
|
|
||||||
class AdminPanelProvider extends PanelProvider
|
class AdminPanelProvider extends PanelProvider
|
||||||
{
|
{
|
||||||
|
|
@ -29,13 +28,11 @@ class AdminPanelProvider extends PanelProvider
|
||||||
->id('admin')
|
->id('admin')
|
||||||
->path('')
|
->path('')
|
||||||
->login()
|
->login()
|
||||||
->profile()
|
->registration()
|
||||||
->multiFactorAuthentication([
|
|
||||||
EmailAuthentication::make(),
|
|
||||||
])
|
|
||||||
->passwordReset()
|
->passwordReset()
|
||||||
->emailVerification()
|
->emailVerification()
|
||||||
->emailChangeVerification()
|
->emailChangeVerification()
|
||||||
|
->profile()
|
||||||
->databaseNotifications()
|
->databaseNotifications()
|
||||||
->colors([
|
->colors([
|
||||||
'primary' => Color::Amber,
|
'primary' => Color::Amber,
|
||||||
|
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
<?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('users', function (Blueprint $table) {
|
|
||||||
$table->boolean('has_email_authentication')->default(false);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::table('users', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('has_email_authentication');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
services:
|
|
||||||
web:
|
|
||||||
image: laravel-www
|
|
||||||
container_name: laravel-www
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: docker/dev/Dockerfile
|
|
||||||
volumes:
|
|
||||||
- .:/var/www/html
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
ports:
|
|
||||||
- "8080:80"
|
|
||||||
environment:
|
|
||||||
CONTAINER_ROLE: app
|
|
||||||
networks:
|
|
||||||
- app
|
|
||||||
db:
|
|
||||||
container_name: laravel-mysql
|
|
||||||
image: "mariadb"
|
|
||||||
ports:
|
|
||||||
- "3306:3306"
|
|
||||||
environment:
|
|
||||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
|
||||||
MYSQL_DATABASE: ${DB_DATABASE}
|
|
||||||
MYSQL_USER: ${DB_USERNAME}
|
|
||||||
MYSQL_PASSWORD: ${DB_PASSWORD}
|
|
||||||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
|
|
||||||
volumes:
|
|
||||||
- "mysql:/var/lib/mysql"
|
|
||||||
networks:
|
|
||||||
- app
|
|
||||||
queue:
|
|
||||||
image: laravel-www
|
|
||||||
container_name: laravel-queue
|
|
||||||
depends_on:
|
|
||||||
- web
|
|
||||||
- db
|
|
||||||
volumes:
|
|
||||||
- ./:/var/www/html
|
|
||||||
networks:
|
|
||||||
- app
|
|
||||||
environment:
|
|
||||||
APP_ENV: ${APP_ENV}
|
|
||||||
CONTAINER_ROLE: queue
|
|
||||||
CACHE_STORE: ${CACHE_STORE}
|
|
||||||
SESSION_DRIVER: ${SESSION_DRIVER}
|
|
||||||
QUEUE_CONNECTION: ${QUEUE_CONNECTION}
|
|
||||||
networks:
|
|
||||||
app:
|
|
||||||
driver: bridge
|
|
||||||
volumes:
|
|
||||||
mysql:
|
|
||||||
driver: local
|
|
||||||
|
|
@ -7,6 +7,8 @@ services:
|
||||||
dockerfile: docker/php/Dockerfile
|
dockerfile: docker/php/Dockerfile
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
volumes:
|
||||||
|
- .:/var/www/html
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "8080:80"
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -25,7 +27,7 @@ services:
|
||||||
MYSQL_PASSWORD: ${DB_PASSWORD}
|
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||||||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
|
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
|
||||||
volumes:
|
volumes:
|
||||||
- "mysql:/var/lib/mysql"
|
- "appdb:/var/lib/mysql"
|
||||||
networks:
|
networks:
|
||||||
- app
|
- app
|
||||||
queue:
|
queue:
|
||||||
|
|
@ -33,9 +35,8 @@ services:
|
||||||
container_name: laravel-queue
|
container_name: laravel-queue
|
||||||
depends_on:
|
depends_on:
|
||||||
- web
|
- web
|
||||||
- db
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/var/www/html
|
- .:/var/www/html
|
||||||
networks:
|
networks:
|
||||||
- app
|
- app
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -48,5 +49,5 @@ networks:
|
||||||
app:
|
app:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
volumes:
|
volumes:
|
||||||
mysql:
|
appdb:
|
||||||
driver: local
|
driver: local
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
FROM php:8.2-apache
|
|
||||||
RUN usermod -u 1000 www-data
|
|
||||||
RUN a2enmod rewrite
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y gnupg2 zlib1g-dev libzip-dev zlib1g-dev libpng-dev libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libxml2-dev libicu-dev
|
|
||||||
RUN docker-php-ext-install zip mysqli pdo pdo_mysql && docker-php-ext-enable mysqli pdo pdo_mysql sodium
|
|
||||||
RUN docker-php-ext-configure gd
|
|
||||||
RUN docker-php-ext-install gd
|
|
||||||
RUN docker-php-ext-configure intl
|
|
||||||
RUN docker-php-ext-install intl
|
|
||||||
|
|
||||||
# Install Composer
|
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
||||||
|
|
||||||
ENV APACHE_DOCUMENT_ROOT /var/www/html/public
|
|
||||||
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
|
|
||||||
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
|
|
||||||
|
|
@ -8,35 +8,37 @@ COPY . /var/www/html
|
||||||
COPY docker/apache/default.conf /etc/apache2/sites-available/000-default.conf
|
COPY docker/apache/default.conf /etc/apache2/sites-available/000-default.conf
|
||||||
COPY docker/scripts/start.sh /usr/local/bin/start
|
COPY docker/scripts/start.sh /usr/local/bin/start
|
||||||
|
|
||||||
|
RUN usermod -u 1000 www-data
|
||||||
|
|
||||||
RUN chown -R www-data:www-data /var/www/html \
|
RUN chown -R www-data:www-data /var/www/html \
|
||||||
&& chmod u+x /usr/local/bin/start \
|
&& chmod u+x /usr/local/bin/start \
|
||||||
&& a2enmod rewrite
|
&& a2enmod rewrite
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y gnupg2 zlib1g-dev libzip-dev zlib1g-dev libicu-dev libpng-dev libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libxml2-dev curl unzip
|
&& apt-get install -y gnupg2 zlib1g-dev libzip-dev zlib1g-dev libicu-dev libpng-dev libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libxml2-dev
|
||||||
RUN docker-php-ext-install zip mysqli pdo pdo_mysql && docker-php-ext-enable mysqli pdo pdo_mysql sodium
|
RUN docker-php-ext-install zip mysqli pdo pdo_mysql && docker-php-ext-enable mysqli pdo pdo_mysql sodium
|
||||||
RUN docker-php-ext-configure gd
|
RUN docker-php-ext-configure gd
|
||||||
RUN docker-php-ext-install gd
|
RUN docker-php-ext-install gd
|
||||||
RUN docker-php-ext-configure intl
|
RUN docker-php-ext-configure intl
|
||||||
RUN docker-php-ext-install intl
|
RUN docker-php-ext-install intl
|
||||||
|
|
||||||
# Install Node.js and build tools
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
nodejs \
|
|
||||||
npm \
|
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
||||||
|
|
||||||
# Add Composer
|
# Add Composer
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
|
||||||
&& composer install --no-interaction --no-progress
|
&& composer install --no-interaction --no-progress
|
||||||
|
|
||||||
|
# Install Node.js and build tools
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
curl \
|
||||||
|
nodejs \
|
||||||
|
npm \
|
||||||
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
# Install Node.js dependencies and build assets
|
# Install Node.js dependencies and build assets
|
||||||
RUN npm install && npm run build
|
RUN npm install && npm run build
|
||||||
|
|
||||||
RUN chown -R www-data:www-data /var/www/html
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
#EXPOSE 80
|
||||||
CMD ["/usr/local/bin/start"]
|
CMD ["/usr/local/bin/start"]
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@ if [ -f "/var/www/html/.env" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#if [ "${RUN_MIGRATIONS:-false}" = "true" ]; then
|
if [ "${RUN_MIGRATIONS:-false}" = "true" ]; then
|
||||||
#php artisan migrate --force
|
php artisan migrate --force
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
if [ "$env" != "local" ]; then
|
if [ "$env" != "local" ]; then
|
||||||
echo "Caching configuration..."
|
echo "Caching configuration..."
|
||||||
|
|
|
||||||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "vbytes_lan",
|
"name": "vbytes_hub",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue