Skip to content

Commit 9b016df

Browse files
committed
build: #113 Laravel 11 and apache
1 parent afa09d7 commit 9b016df

File tree

185 files changed

+9859
-14426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+9859
-14426
lines changed

.gitattributes

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
* text=auto
2-
*.css linguist-vendored
3-
*.scss linguist-vendored
4-
*.js linguist-vendored
1+
* text=auto eol=lf
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.github export-ignore
510
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

.gitignore

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1+
/.phpunit.cache
12
/node_modules
2-
/public/css/app.css
3+
/public/build
34
/public/hot
4-
/public/js/app.js
55
/public/storage
66
/storage/*.key
7+
/storage/pail
78
/vendor
8-
/.idea
9-
/.vscode
10-
/.vagrant
9+
.env
10+
.env.backup
11+
.env.production
12+
.phpactor.json
13+
.phpunit.result.cache
1114
Homestead.json
1215
Homestead.yaml
13-
clover.xml
16+
auth.json
1417
npm-debug.log
1518
yarn-error.log
16-
.env
17-
.env.testing
18-
.phpstorm.meta.php
19-
.phpunit.result.cache
20-
_ide_helper.php
19+
/.fleet
20+
/.idea
21+
/.vscode
22+
/.zed

.phpstorm.meta.php

+1,750
Large diffs are not rendered by default.

Dockerfile

+41-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,53 @@
1-
FROM laravelfans/laravel:6
1+
FROM php:8.3-apache
22

3-
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
3+
WORKDIR /var/www/laravel
4+
5+
RUN curl -o /usr/local/bin/composer https://getcomposer.org/download/latest-stable/composer.phar \
6+
&& chmod +x /usr/local/bin/composer
7+
8+
# hadolint ignore=DL3008
9+
RUN apt-get update \
10+
&& apt-get install --no-install-recommends -y \
11+
cron \
12+
icu-devtools \
13+
jq \
14+
libfreetype6-dev libicu-dev libjpeg62-turbo-dev libpng-dev libpq-dev \
15+
libsasl2-dev libssl-dev libwebp-dev libxpm-dev libzip-dev libzstd-dev \
16+
unzip \
17+
zlib1g-dev \
18+
&& apt-get clean \
19+
&& apt-get autoclean \
20+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
21+
22+
# hadolint ignore=DL3059
23+
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \
24+
&& pecl install --configureoptions='enable-redis-igbinary="yes" enable-redis-lzf="yes" enable-redis-zstd="yes"' igbinary zstd redis \
25+
&& pecl clear-cache \
26+
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm \
27+
&& docker-php-ext-install gd intl pdo_mysql pdo_pgsql zip \
28+
&& docker-php-ext-enable igbinary opcache redis zstd
29+
30+
COPY composer.json composer.lock ./
31+
RUN composer install --no-autoloader --no-scripts --no-dev
32+
33+
COPY docker/ /
34+
RUN a2enmod rewrite headers \
35+
&& a2ensite laravel \
36+
&& a2dissite 000-default \
37+
&& chmod +x /usr/local/bin/docker-laravel-entrypoint
38+
39+
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash - \
440
&& apt-get install -y \
541
nodejs \
642
&& apt-get clean \
743
&& apt-get autoclean \
844
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
945

10-
COPY docker/etc /etc/
11-
1246
COPY package.json package-lock.json ./
1347
RUN npm install
1448

15-
COPY composer.json composer.lock ./
16-
RUN composer install --no-autoloader --no-scripts --no-dev
17-
1849
COPY . /var/www/laravel
1950
RUN composer install --optimize-autoloader --no-dev \
20-
&& npm run production
51+
&& npm run build
52+
53+
CMD ["docker-laravel-entrypoint"]

app/Console/Kernel.php

-42
This file was deleted.

app/Exceptions/Handler.php

-55
This file was deleted.

app/Http/Controllers/API/GatewayController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Illuminate\Http\Request;
66
use App\Http\Controllers\Controller;
7-
use App\Gateway;
7+
use App\Models\Gateway;
88
use Validator;
99

1010
class GatewayController extends Controller

app/Http/Controllers/API/UserController.php

-66
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Http\Requests\Auth\LoginRequest;
7+
use Illuminate\Http\RedirectResponse;
8+
use Illuminate\Http\Request;
9+
use Illuminate\Support\Facades\Auth;
10+
use Illuminate\View\View;
11+
12+
class AuthenticatedSessionController extends Controller
13+
{
14+
/**
15+
* Display the login view.
16+
*/
17+
public function create(): View
18+
{
19+
return view('auth.login');
20+
}
21+
22+
/**
23+
* Handle an incoming authentication request.
24+
*/
25+
public function store(LoginRequest $request): RedirectResponse
26+
{
27+
$request->authenticate();
28+
29+
$request->session()->regenerate();
30+
if (session('gw_address') && session('gw_port')) {
31+
$token = $request->user()->createToken('wifidog', ['internet:access'])->plainTextToken;
32+
session(['token' => $token]);
33+
$uri = 'http://' . session('gw_address') . ':' . session('gw_port') . '/wifidog/auth?token=' . $token;
34+
return redirect($uri);
35+
}
36+
37+
return redirect()->intended(route('dashboard', absolute: false));
38+
}
39+
40+
/**
41+
* Destroy an authenticated session.
42+
*/
43+
public function destroy(Request $request): RedirectResponse
44+
{
45+
Auth::guard('web')->logout();
46+
47+
$request->session()->invalidate();
48+
49+
$request->session()->regenerateToken();
50+
51+
return redirect('/');
52+
}
53+
}

app/Http/Controllers/Auth/ConfirmPasswordController.php

-39
This file was deleted.

0 commit comments

Comments
 (0)