Compare commits

..

No commits in common. "19c995ad66667e05728f0898e619153be94a0c6f" and "4d261e8cbcd3d8aa83a5f39d2388403747b8c101" have entirely different histories.

9 changed files with 22 additions and 140 deletions

View file

@ -7,11 +7,9 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Filament\Models\Contracts\FilamentUser;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Filament\Auth\MultiFactor\Email\Contracts\HasEmailAuthentication;
use Filament\Panel;
class User extends Authenticatable implements FilamentUser, HasEmailAuthentication, MustVerifyEmail
class User extends Authenticatable implements FilamentUser
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable;
@ -25,7 +23,6 @@ class User extends Authenticatable implements FilamentUser, HasEmailAuthenticati
'name',
'email',
'password',
'has_email_authentication'
];
/**
@ -48,7 +45,6 @@ class User extends Authenticatable implements FilamentUser, HasEmailAuthenticati
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'has_email_authentication' => 'boolean',
];
}
@ -56,19 +52,4 @@ class User extends Authenticatable implements FilamentUser, HasEmailAuthenticati
{
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();
}
}

View file

@ -18,7 +18,6 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use Filament\Auth\MultiFactor\Email\EmailAuthentication;
class AdminPanelProvider extends PanelProvider
{
@ -29,13 +28,11 @@ class AdminPanelProvider extends PanelProvider
->id('admin')
->path('')
->login()
->profile()
->multiFactorAuthentication([
EmailAuthentication::make(),
])
->registration()
->passwordReset()
->emailVerification()
->emailChangeVerification()
->profile()
->databaseNotifications()
->colors([
'primary' => Color::Amber,

View file

@ -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');
});
}
};

View file

@ -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

View file

@ -7,6 +7,8 @@ services:
dockerfile: docker/php/Dockerfile
depends_on:
- db
volumes:
- .:/var/www/html
ports:
- "8080:80"
environment:
@ -25,7 +27,7 @@ services:
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- "mysql:/var/lib/mysql"
- "appdb:/var/lib/mysql"
networks:
- app
queue:
@ -33,9 +35,8 @@ services:
container_name: laravel-queue
depends_on:
- web
- db
volumes:
- ./:/var/www/html
- .:/var/www/html
networks:
- app
environment:
@ -48,5 +49,5 @@ networks:
app:
driver: bridge
volumes:
mysql:
appdb:
driver: local

View file

@ -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

View file

@ -8,35 +8,37 @@ COPY . /var/www/html
COPY docker/apache/default.conf /etc/apache2/sites-available/000-default.conf
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 \
&& chmod u+x /usr/local/bin/start \
&& a2enmod rewrite
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-configure gd
RUN docker-php-ext-install gd
RUN docker-php-ext-configure 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
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& 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
RUN npm install && npm run build
RUN chown -R www-data:www-data /var/www/html
WORKDIR /var/www/html
#EXPOSE 80
CMD ["/usr/local/bin/start"]

View file

@ -19,9 +19,9 @@ if [ -f "/var/www/html/.env" ]; then
fi
fi
#if [ "${RUN_MIGRATIONS:-false}" = "true" ]; then
#php artisan migrate --force
#fi
if [ "${RUN_MIGRATIONS:-false}" = "true" ]; then
php artisan migrate --force
fi
if [ "$env" != "local" ]; then
echo "Caching configuration..."

2
package-lock.json generated
View file

@ -1,5 +1,5 @@
{
"name": "vbytes_lan",
"name": "vbytes_hub",
"lockfileVersion": 3,
"requires": true,
"packages": {