Compare commits
18 Commits
b8ba17b33f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b4d3d435e | |||
| 564f816fb9 | |||
| 3709e378c3 | |||
| 4a45dae593 | |||
| 2b0448d517 | |||
| 3bb6af73c3 | |||
| 57cf153560 | |||
| e45fd4b148 | |||
|
d479369770
|
|||
|
af739e3c88
|
|||
| 273ed65a8d | |||
| ccfd5b996b | |||
| e5ef197ed6 | |||
| c0be2e294a | |||
| 823a284fbc | |||
| 67e601d0c4 | |||
| 7e4ebd91ad | |||
| 4dc5dee2b9 |
14
README.md
14
README.md
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
## hstream Website
|
## hstream Website
|
||||||
|
|
||||||
### Install
|
### Install (Ubuntu)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install PHP
|
# Install PHP
|
||||||
sudo add-apt-repository ppa:ondrej/php
|
sudo add-apt-repository ppa:ondrej/php
|
||||||
apt update && apt upgrade
|
apt update && apt upgrade
|
||||||
apt install php8.3 php8.3-xml php8.3-mysql php8.3-gd php8.3-zip php8.3-curl php8.3-mbstring
|
apt install php8.4 php8.4-xml php8.4-mysql php8.4-gd php8.4-zip php8.4-curl php8.4-mbstring
|
||||||
|
|
||||||
# Install NodeJS
|
# Install NodeJS
|
||||||
curl -sL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh
|
curl -sL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh
|
||||||
@@ -22,7 +22,7 @@ mv composer.phar composer
|
|||||||
|
|
||||||
# Install NGINX (skip for local dev)
|
# Install NGINX (skip for local dev)
|
||||||
apt install nginx
|
apt install nginx
|
||||||
apt install php8.3-fpm
|
apt install php8.4-fpm
|
||||||
|
|
||||||
# Install MariaDB
|
# Install MariaDB
|
||||||
apt install mariadb-server
|
apt install mariadb-server
|
||||||
@@ -54,7 +54,7 @@ nano /etc/supervisor/conf.d/laravel-queue.conf :
|
|||||||
|
|
||||||
[program:laravel-queue]
|
[program:laravel-queue]
|
||||||
process_name=%(program_name)s_%(process_num)02d
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
command=php /var/www/hstream/artisan queue:work --queue=default --sleep=3 --tries=3 --max-time=3600
|
command=php84 /var/www/hstream/artisan queue:work --queue=default --sleep=3 --tries=3 --max-time=3600
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
stopasgroup=true
|
stopasgroup=true
|
||||||
@@ -83,9 +83,9 @@ zip -r hstream_2023_11_30.zip hstream/
|
|||||||
|
|
||||||
### Update
|
### Update
|
||||||
```bash
|
```bash
|
||||||
php artisan down
|
php84 artisan down
|
||||||
git pull
|
git pull
|
||||||
npm run build
|
npm run build
|
||||||
php artisan view:clear && php artisan optimize:clear && php artisan cache:clear && service php8.4-fpm restart
|
php84 artisan view:clear && php84 artisan optimize:clear && php84 artisan cache:clear && service php8.4-fpm restart
|
||||||
php artisan up
|
php84 artisan up
|
||||||
```
|
```
|
||||||
|
|||||||
11
app/Enums/UserRole.php
Normal file
11
app/Enums/UserRole.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
enum UserRole: string
|
||||||
|
{
|
||||||
|
case ADMINISTRATOR = 'admin';
|
||||||
|
case MODERATOR = 'moderator';
|
||||||
|
case SUPPORTER = 'supporter';
|
||||||
|
case BANNED = 'banned';
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Admin;
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Enums\UserRole;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -31,11 +32,11 @@ class UserController extends Controller
|
|||||||
|
|
||||||
switch ($validated['action']) {
|
switch ($validated['action']) {
|
||||||
case 'ban':
|
case 'ban':
|
||||||
$user->update(['is_banned' => 1]);
|
$user->addRole(UserRole::BANNED);
|
||||||
alert()->success('Banned', 'User has been banned.');
|
alert()->success('Banned', 'User has been banned.');
|
||||||
break;
|
break;
|
||||||
case 'unban':
|
case 'unban':
|
||||||
$user->update(['is_banned' => 0]);
|
$user->removeRole(UserRole::BANNED);
|
||||||
alert()->success('Unbanned', 'User has been unbanned.');
|
alert()->success('Unbanned', 'User has been unbanned.');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use App\Models\Episode;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use GrantHolle\Altcha\Rules\ValidAltcha;
|
||||||
|
|
||||||
class DownloadApiController extends Controller
|
class DownloadApiController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -16,11 +18,12 @@ class DownloadApiController extends Controller
|
|||||||
public function getDownload(Request $request)
|
public function getDownload(Request $request)
|
||||||
{
|
{
|
||||||
$validated = $request->validate([
|
$validated = $request->validate([
|
||||||
'episode_id' => 'required',
|
'episode_id' => ['required'],
|
||||||
'captcha' => 'required|captcha'
|
'captcha' => ['required', new ValidAltcha],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$episode = Episode::where('id', $request->input('episode_id'))->firstOrFail();
|
$episode = Episode::where('id', $request->input('episode_id'))
|
||||||
|
->firstOrFail();
|
||||||
|
|
||||||
// Increase download count, as we assume the user
|
// Increase download count, as we assume the user
|
||||||
// downloads after submitting the captcha
|
// downloads after submitting the captcha
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Auth;
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Enums\UserRole;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
@@ -88,10 +89,7 @@ class DiscordAuthController extends Controller
|
|||||||
|
|
||||||
// User is not in the guild
|
// User is not in the guild
|
||||||
if ($response->status() === 404) {
|
if ($response->status() === 404) {
|
||||||
$user->update([
|
$user->removeRole(UserRole::SUPPORTER);
|
||||||
'is_patreon' => false,
|
|
||||||
]);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,22 +108,15 @@ class DiscordAuthController extends Controller
|
|||||||
$discordRoles = $response->json('roles', []);
|
$discordRoles = $response->json('roles', []);
|
||||||
$patreonRoles = config('discord.patreon_roles', []);
|
$patreonRoles = config('discord.patreon_roles', []);
|
||||||
|
|
||||||
$isPatreon = false;
|
// If intersect of array is empty, then the user doesn't have the role
|
||||||
foreach($patreonRoles as $patreonRole)
|
$hasSupporterRole = !empty(array_intersect($discordRoles, $patreonRoles));
|
||||||
{
|
|
||||||
if (in_array($patreonRole, $discordRoles, true)) {
|
if (!$hasSupporterRole) {
|
||||||
$isPatreon = true;
|
// Remove role if not found
|
||||||
break;
|
$user->removeRole(UserRole::SUPPORTER);
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only update if something actually changed
|
$user->addRole(UserRole::SUPPORTER);
|
||||||
$isPatreonOld = (bool) $user->is_patreon;
|
|
||||||
if ($isPatreonOld !== $isPatreon) {
|
|
||||||
$user->update([
|
|
||||||
'is_patreon' => $isPatreon,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ use Illuminate\Support\Facades\Auth;
|
|||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Validation\Rules;
|
use Illuminate\Validation\Rules;
|
||||||
|
|
||||||
|
use GrantHolle\Altcha\Rules\ValidAltcha;
|
||||||
|
|
||||||
class RegisteredUserController extends Controller
|
class RegisteredUserController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -24,6 +26,7 @@ class RegisteredUserController extends Controller
|
|||||||
'name' => ['required', 'string', 'max:255'],
|
'name' => ['required', 'string', 'max:255'],
|
||||||
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:'.User::class],
|
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:'.User::class],
|
||||||
'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
||||||
|
'altcha' => ['required', new ValidAltcha],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$user = User::create([
|
$user = User::create([
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ namespace App\Http\Controllers;
|
|||||||
use App\Models\Contact;
|
use App\Models\Contact;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use GrantHolle\Altcha\Rules\ValidAltcha;
|
||||||
|
|
||||||
class ContactController extends Controller
|
class ContactController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -25,7 +27,7 @@ class ContactController extends Controller
|
|||||||
'email' => 'required|max:50',
|
'email' => 'required|max:50',
|
||||||
'message' => 'required|max:1000',
|
'message' => 'required|max:1000',
|
||||||
'subject' => 'required|max:50',
|
'subject' => 'required|max:50',
|
||||||
'captcha' => 'required|captcha',
|
'altcha' => ['required', new ValidAltcha],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$contact = new Contact();
|
$contact = new Contact();
|
||||||
@@ -37,9 +39,4 @@ class ContactController extends Controller
|
|||||||
|
|
||||||
return back()->with('status', 'contact-submitted');
|
return back()->with('status', 'contact-submitted');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reloadCaptcha(): \Illuminate\Http\JsonResponse
|
|
||||||
{
|
|
||||||
return response()->json(['captcha'=> captcha_img()]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,11 +111,13 @@ class HomeController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function updateLanguage(Request $request): \Illuminate\Http\RedirectResponse
|
public function updateLanguage(Request $request): \Illuminate\Http\RedirectResponse
|
||||||
{
|
{
|
||||||
if(! in_array($request->language, config('lang-detector.languages'))) {
|
abort_unless(in_array($request->language, config('app.supported_locales'), true), 404);
|
||||||
return redirect()->back();
|
|
||||||
}
|
|
||||||
|
|
||||||
Cookie::queue(Cookie::forever('locale', $request->language));
|
session(['locale' => $request->language]);
|
||||||
|
|
||||||
|
if (Auth::check()) {
|
||||||
|
Auth::user()->update(['locale' => $request->language]);
|
||||||
|
}
|
||||||
|
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|||||||
57
app/Http/Controllers/MatrixController.php
Normal file
57
app/Http/Controllers/MatrixController.php
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Requests\MatrixRegisterRequest;
|
||||||
|
use App\Services\MatrixRegistrationService;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class MatrixController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display the user page.
|
||||||
|
*/
|
||||||
|
public function index(Request $request): \Illuminate\View\View
|
||||||
|
{
|
||||||
|
$rooms = [
|
||||||
|
['name' => '🏠 General', 'description' => 'Our main chat.', 'alias' => 'https://matrix.to/#/#general:hstream.moe'],
|
||||||
|
['name' => '📡 Releases', 'description' => 'Were we @everyone for new releases.', 'alias' => 'https://matrix.to/#/#releases:hstream.moe'],
|
||||||
|
['name' => '👗 NSFW 2D', 'description' => 'Channel for R18 2D Media.', 'alias' => 'https://matrix.to/#/#nsfw:hstream.moe'],
|
||||||
|
['name' => '👗 NSFW IRL', 'description' => 'Channel for R18 IRL Media.', 'alias' => 'https://matrix.to/#/#nsfw-irl:hstream.moe']
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('matrix.index', [
|
||||||
|
'user' => $request->user(),
|
||||||
|
'rooms' => $rooms,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create matrix user
|
||||||
|
*/
|
||||||
|
public function store(
|
||||||
|
MatrixRegisterRequest $request,
|
||||||
|
MatrixRegistrationService $matrixService
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
$result = $matrixService->registerUser(
|
||||||
|
$request->username,
|
||||||
|
$request->password
|
||||||
|
);
|
||||||
|
|
||||||
|
$user = $request->user();
|
||||||
|
$user->matrix_id = $result['user_id'];
|
||||||
|
$user->save();
|
||||||
|
|
||||||
|
return redirect()
|
||||||
|
->back()
|
||||||
|
->with('success', 'Matrix user created successfully.');
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return back()
|
||||||
|
->withErrors([
|
||||||
|
'username' => $e->getMessage()
|
||||||
|
])
|
||||||
|
->withInput();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,6 +37,7 @@ class Kernel extends HttpKernel
|
|||||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
\App\Http\Middleware\IsBanned::class,
|
\App\Http\Middleware\IsBanned::class,
|
||||||
|
\App\Http\Middleware\SetLocale::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
'api' => [
|
'api' => [
|
||||||
@@ -58,6 +59,7 @@ class Kernel extends HttpKernel
|
|||||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||||
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
|
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||||
'auth.admin' => \App\Http\Middleware\IsAdmin::class,
|
'auth.admin' => \App\Http\Middleware\IsAdmin::class,
|
||||||
|
'auth.moderator' => \App\Http\Middleware\IsModerator::class,
|
||||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||||
|
|||||||
@@ -1,28 +1,14 @@
|
|||||||
<?php namespace app\Http\Middleware;
|
<?php namespace app\Http\Middleware;
|
||||||
|
|
||||||
|
use App\Enums\UserRole;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class IsAdmin {
|
class IsAdmin {
|
||||||
|
|
||||||
/**
|
|
||||||
* The Guard implementation.
|
|
||||||
*
|
|
||||||
* @var Guard
|
|
||||||
*/
|
|
||||||
protected $auth;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new filter instance.
|
|
||||||
*
|
|
||||||
* @param Guard $auth
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct(Guard $auth)
|
|
||||||
{
|
|
||||||
$this->auth = $auth;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
@@ -30,15 +16,14 @@ class IsAdmin {
|
|||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle(Request $request, Closure $next): Response
|
||||||
{
|
{
|
||||||
if( ! $this->auth->user()->is_admin)
|
if(Auth::check() && Auth::user()->hasRole(UserRole::ADMINISTRATOR))
|
||||||
{
|
{
|
||||||
session()->flash('error_msg','This resource is restricted to Administrators!');
|
return $next($request);
|
||||||
return redirect()->route('home.index');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
session()->flash('error_msg','This resource is restricted to Administrators!');
|
||||||
|
return redirect()->route('home.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
<?php namespace app\Http\Middleware;
|
<?php namespace app\Http\Middleware;
|
||||||
|
|
||||||
|
use App\Enums\UserRole;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class IsBanned {
|
class IsBanned {
|
||||||
|
|
||||||
@@ -13,9 +16,9 @@ class IsBanned {
|
|||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle(Request $request, Closure $next): Response
|
||||||
{
|
{
|
||||||
if(auth()->check() && auth()->user()->is_banned == 1)
|
if(Auth::check() && Auth::user()->hasRole(UserRole::BANNED))
|
||||||
{
|
{
|
||||||
Auth::logout();
|
Auth::logout();
|
||||||
$request->session()->invalidate();
|
$request->session()->invalidate();
|
||||||
|
|||||||
29
app/Http/Middleware/IsModerator.php
Normal file
29
app/Http/Middleware/IsModerator.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use App\Enums\UserRole;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
|
class IsModerator
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*
|
||||||
|
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||||
|
*/
|
||||||
|
public function handle(Request $request, Closure $next): Response
|
||||||
|
{
|
||||||
|
if (Auth::check() && Auth::user()->hasRole(UserRole::MODERATOR))
|
||||||
|
{
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
|
||||||
|
session()->flash('error_msg','This resource is restricted to Administrators!');
|
||||||
|
return redirect()->route('home.index');
|
||||||
|
}
|
||||||
|
}
|
||||||
41
app/Http/Middleware/SetLocale.php
Normal file
41
app/Http/Middleware/SetLocale.php
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
|
class SetLocale
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*
|
||||||
|
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||||
|
*/
|
||||||
|
public function handle(Request $request, Closure $next): Response
|
||||||
|
{
|
||||||
|
// 1. Logged-in user preference
|
||||||
|
if (Auth::check() && Auth::user()->locale) {
|
||||||
|
App::setLocale(Auth::user()->locale);
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Session (guest or user override)
|
||||||
|
if (session()->has('locale') && in_array($request->language, config('app.supported_locales'), true)) {
|
||||||
|
App::setLocale(session('locale'));
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Browser language
|
||||||
|
$locale = $request->getPreferredLanguage(config('app.supported_locales'));
|
||||||
|
|
||||||
|
if ($locale) {
|
||||||
|
App::setLocale($locale);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,8 @@ use Illuminate\Support\Facades\RateLimiter;
|
|||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
|
|
||||||
|
use GrantHolle\Altcha\Rules\ValidAltcha;
|
||||||
|
|
||||||
class LoginRequest extends FormRequest
|
class LoginRequest extends FormRequest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -29,6 +31,7 @@ class LoginRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'email' => ['required', 'string', 'email'],
|
'email' => ['required', 'string', 'email'],
|
||||||
'password' => ['required', 'string'],
|
'password' => ['required', 'string'],
|
||||||
|
'altcha' => ['required', new ValidAltcha],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
49
app/Http/Requests/MatrixRegisterRequest.php
Normal file
49
app/Http/Requests/MatrixRegisterRequest.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class MatrixRegisterRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*/
|
||||||
|
public function authorize(): bool
|
||||||
|
{
|
||||||
|
$isOldEnough = $this->user()->created_at->lt(now()->subMonth());
|
||||||
|
$noAccount = !$this->user()->matrix_id;
|
||||||
|
return $isOldEnough && $noAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'username' => [
|
||||||
|
'required',
|
||||||
|
'string',
|
||||||
|
'min:3',
|
||||||
|
'max:32',
|
||||||
|
'regex:/^[a-z0-9._=-]+$/', // Valid Matrix localpart
|
||||||
|
],
|
||||||
|
'password' => [
|
||||||
|
'required',
|
||||||
|
'string',
|
||||||
|
'min:8',
|
||||||
|
'confirmed',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function messages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'username.regex' => 'Username may only contain lowercase letters, numbers and . _ = -',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Livewire;
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use App\Enums\UserRole;
|
||||||
use App\Models\Comment;
|
use App\Models\Comment;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ class AdminUserSearch extends Component
|
|||||||
public $search = '';
|
public $search = '';
|
||||||
|
|
||||||
#[Url(history: true)]
|
#[Url(history: true)]
|
||||||
public $filtered = ['true'];
|
public $discordId = '';
|
||||||
|
|
||||||
#[Url(history: true)]
|
#[Url(history: true)]
|
||||||
public $patreon = [];
|
public $patreon = [];
|
||||||
@@ -38,10 +39,10 @@ class AdminUserSearch extends Component
|
|||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
$users = User::when($this->filtered !== [], fn ($query) => $query->where('id', '>=', 10000))
|
$users = User::when($this->patreon !== [], fn ($query) => $query->whereJsonContains('roles', UserRole::SUPPORTER->value))
|
||||||
->when($this->patreon !== [], fn ($query) => $query->where('is_patreon', 1))
|
->when($this->banned !== [], fn ($query) => $query->whereJsonContains('roles', UserRole::BANNED->value))
|
||||||
->when($this->banned !== [], fn ($query) => $query->where('is_banned', 1))
|
|
||||||
->when($this->search !== '', fn ($query) => $query->where('name', 'like', '%'.$this->search.'%'))
|
->when($this->search !== '', fn ($query) => $query->where('name', 'like', '%'.$this->search.'%'))
|
||||||
|
->when($this->discordId !== '', fn ($query) => $query->where('discord_id', '=', $this->discordId))
|
||||||
->paginate(20);
|
->paginate(20);
|
||||||
|
|
||||||
return view('livewire.admin-user-search', [
|
return view('livewire.admin-user-search', [
|
||||||
|
|||||||
@@ -21,6 +21,15 @@ class DownloadButton extends Component
|
|||||||
|
|
||||||
public $background = 'bg-rose-600';
|
public $background = 'bg-rose-600';
|
||||||
|
|
||||||
|
public $fileExtension = 'HEVC';
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
if (str_contains($this->downloadUrl, 'AV1')) {
|
||||||
|
$this->fileExtension = 'AV1';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function clicked($downloadId)
|
public function clicked($downloadId)
|
||||||
{
|
{
|
||||||
$download = Downloads::find($downloadId);
|
$download = Downloads::find($downloadId);
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ class DownloadsSearch extends Component
|
|||||||
$types[] = 'FHD';
|
$types[] = 'FHD';
|
||||||
} elseif ($label === 'FHD 48fps') {
|
} elseif ($label === 'FHD 48fps') {
|
||||||
$types[] = 'FHDi';
|
$types[] = 'FHDi';
|
||||||
} elseif ($label === 'UHD' && auth()->user()->is_patreon) {
|
} elseif ($label === 'UHD' && auth()->user()->hasRole(\App\Enums\UserRole::SUPPORTER)) {
|
||||||
$types[] = 'UHD';
|
$types[] = 'UHD';
|
||||||
} elseif ($label === 'UHD 48fps' && auth()->user()->is_patreon) {
|
} elseif ($label === 'UHD 48fps' && auth()->user()->hasRole(\App\Enums\UserRole::SUPPORTER)) {
|
||||||
$types[] = 'UHDi';
|
$types[] = 'UHDi';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ class DownloadsSearch extends Component
|
|||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
if (!auth()->user()->is_patreon) {
|
if (!auth()->user()->hasRole(\App\Enums\UserRole::SUPPORTER)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
//use Illuminate\Contracts\Auth\MustVerifyEmail;
|
//use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||||
|
|
||||||
|
use App\Enums\UserRole;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
@@ -25,8 +27,6 @@ class User extends Authenticatable
|
|||||||
'email',
|
'email',
|
||||||
'password',
|
'password',
|
||||||
'locale',
|
'locale',
|
||||||
'is_patreon',
|
|
||||||
'is_banned',
|
|
||||||
// Discord
|
// Discord
|
||||||
'discord_id',
|
'discord_id',
|
||||||
'discord_avatar',
|
'discord_avatar',
|
||||||
@@ -55,7 +55,7 @@ class User extends Authenticatable
|
|||||||
'name' => 'string',
|
'name' => 'string',
|
||||||
'email' => 'string',
|
'email' => 'string',
|
||||||
'locale' => 'string',
|
'locale' => 'string',
|
||||||
'roles' => 'json',
|
'roles' => 'array',
|
||||||
'tag_blacklist' => 'array',
|
'tag_blacklist' => 'array',
|
||||||
// Discord
|
// Discord
|
||||||
'discord_id' => 'integer',
|
'discord_id' => 'integer',
|
||||||
@@ -120,4 +120,44 @@ class User extends Authenticatable
|
|||||||
|
|
||||||
return asset('images/default-avatar.webp');
|
return asset('images/default-avatar.webp');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if user has a specific role
|
||||||
|
*/
|
||||||
|
public function hasRole(UserRole $role): bool
|
||||||
|
{
|
||||||
|
return in_array($role->value, $this->roles ?? [], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Role to User
|
||||||
|
*/
|
||||||
|
public function addRole(UserRole $role): void
|
||||||
|
{
|
||||||
|
if ($this->hasRole($role)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get all current roles
|
||||||
|
$roles = $this->roles ?? [];
|
||||||
|
|
||||||
|
// Add new role
|
||||||
|
$roles[] = $role->value;
|
||||||
|
|
||||||
|
$this->roles = $roles;
|
||||||
|
$this->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove Role from User
|
||||||
|
*/
|
||||||
|
public function removeRole(UserRole $role): void
|
||||||
|
{
|
||||||
|
if (!$this->hasRole($role)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->roles = array_diff($this->roles, [$role->value]);
|
||||||
|
$this->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ class EpisodeService
|
|||||||
Request $request,
|
Request $request,
|
||||||
Hentai $hentai,
|
Hentai $hentai,
|
||||||
int $episodeNumber,
|
int $episodeNumber,
|
||||||
Studios $studio = null,
|
?Studios $studio = null,
|
||||||
Episode $referenceEpisode = null
|
?Episode $referenceEpisode = null
|
||||||
): Episode
|
): Episode
|
||||||
{
|
{
|
||||||
$episode = new Episode();
|
$episode = new Episode();
|
||||||
|
|||||||
49
app/Services/MatrixRegistrationService.php
Normal file
49
app/Services/MatrixRegistrationService.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
||||||
|
class MatrixRegistrationService
|
||||||
|
{
|
||||||
|
public function registerUser(string $username, string $password)
|
||||||
|
{
|
||||||
|
$server = config('services.matrix.server');
|
||||||
|
$secret = config('services.matrix.shared_secret');
|
||||||
|
|
||||||
|
// Get nonce from Synapse
|
||||||
|
$nonceResponse = Http::get("$server/_synapse/admin/v1/register");
|
||||||
|
|
||||||
|
if (!$nonceResponse->ok()) {
|
||||||
|
throw new \Exception("Could not fetch nonce from Matrix.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$nonce = $nonceResponse->json()['nonce'];
|
||||||
|
|
||||||
|
// Generate MAC
|
||||||
|
$mac = hash_hmac(
|
||||||
|
'sha1',
|
||||||
|
$nonce . "\0" .
|
||||||
|
$username . "\0" .
|
||||||
|
$password . "\0" .
|
||||||
|
"notadmin",
|
||||||
|
$secret
|
||||||
|
);
|
||||||
|
|
||||||
|
// Send registration request
|
||||||
|
$response = Http::post("$server/_synapse/admin/v1/register", [
|
||||||
|
'nonce' => $nonce,
|
||||||
|
'username' => $username,
|
||||||
|
'password' => $password,
|
||||||
|
'admin' => false,
|
||||||
|
'mac' => $mac,
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($response->failed()) {
|
||||||
|
$error = $response->json()['error'] ?? $response->body();
|
||||||
|
throw new \Exception($error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $response->json();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "laravel/laravel",
|
"name": "w33b/hstream",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"description": "The skeleton application for the Laravel framework.",
|
"description": "The website of hstream.moe",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"laravel",
|
"laravel",
|
||||||
"framework"
|
"framework"
|
||||||
@@ -9,45 +9,38 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.2",
|
"php": "^8.2",
|
||||||
|
"grantholle/laravel-altcha": "^2.1",
|
||||||
"guzzlehttp/guzzle": "^7.8.1",
|
"guzzlehttp/guzzle": "^7.8.1",
|
||||||
"hisorange/browser-detect": "^5.0",
|
"hisorange/browser-detect": "^5.0",
|
||||||
"http-interop/http-factory-guzzle": "^1.2",
|
"http-interop/http-factory-guzzle": "^1.2",
|
||||||
"intervention/image": "^3.9",
|
"intervention/image": "^3.11",
|
||||||
"intervention/image-laravel": "^1.3",
|
"intervention/image-laravel": "^1.5",
|
||||||
"laravel/framework": "^11.0",
|
"laravel/framework": "^12.0",
|
||||||
"laravel/sanctum": "^4.0",
|
"laravel/sanctum": "^4.2",
|
||||||
"laravel/scout": "^10.20",
|
"laravel/scout": "^10.20",
|
||||||
"laravel/socialite": "^5.24",
|
"laravel/socialite": "^5.24",
|
||||||
"laravel/tinker": "^2.10",
|
"laravel/tinker": "^2.10",
|
||||||
"livewire/livewire": "^3.6.4",
|
"livewire/livewire": "^3.7.0",
|
||||||
"maize-tech/laravel-markable": "^2.3.0",
|
"maize-tech/laravel-markable": "^2.3.0",
|
||||||
"meilisearch/meilisearch-php": "^1.16",
|
"meilisearch/meilisearch-php": "^1.16",
|
||||||
"mews/captcha": "3.4.4",
|
|
||||||
"predis/predis": "^2.2",
|
"predis/predis": "^2.2",
|
||||||
"realrashid/sweet-alert": "^7.2",
|
"realrashid/sweet-alert": "^7.2",
|
||||||
"rtconner/laravel-tagging": "^4.1",
|
"rtconner/laravel-tagging": "^5.0",
|
||||||
"socialiteproviders/discord": "^4.2",
|
"socialiteproviders/discord": "^4.2",
|
||||||
"spatie/laravel-discord-alerts": "^1.5",
|
"spatie/laravel-discord-alerts": "^1.8",
|
||||||
"spatie/laravel-sitemap": "^7.3",
|
"spatie/laravel-sitemap": "^7.3"
|
||||||
"vluzrmos/language-detector": "^2.3"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"barryvdh/laravel-debugbar": "^3.14.7",
|
"barryvdh/laravel-debugbar": "^3.16",
|
||||||
"fakerphp/faker": "^1.24.0",
|
"fakerphp/faker": "^1.24.0",
|
||||||
"laravel/breeze": "^2.3",
|
"laravel/breeze": "^2.3",
|
||||||
"laravel/pint": "^1.18",
|
"laravel/pint": "^1.18",
|
||||||
"laravel/sail": "^1.38",
|
|
||||||
"mockery/mockery": "^1.4.4",
|
"mockery/mockery": "^1.4.4",
|
||||||
"nunomaduro/collision": "^8.1",
|
"nunomaduro/collision": "^8.1",
|
||||||
"phpunit/phpunit": "^11.4",
|
"phpunit/phpunit": "^11.4",
|
||||||
"spatie/laravel-ignition": "^2.0"
|
"spatie/laravel-ignition": "^2.0"
|
||||||
},
|
},
|
||||||
"repositories": [
|
"repositories": [],
|
||||||
{
|
|
||||||
"type": "vcs",
|
|
||||||
"url": "https://github.com/renatokira/comments.git"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"exclude-from-classmap": [],
|
"exclude-from-classmap": [],
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
2031
composer.lock
generated
2031
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -111,6 +111,18 @@ return [
|
|||||||
|
|
||||||
'faker_locale' => 'en_US',
|
'faker_locale' => 'en_US',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Supported Locales
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is used to display the supported locales by this app, it also is
|
||||||
|
| used to verify session data and requests in the SetLocale Middleware
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'supported_locales' => ['en', 'de', 'fr'],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Encryption Key
|
| Encryption Key
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'characters' => ['2', '3', '4', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'M', 'N', 'P', 'Q', 'R', 'T', 'U', 'X', 'Y', 'Z'],
|
|
||||||
'default' => [
|
|
||||||
'length' => 5,
|
|
||||||
'width' => 120,
|
|
||||||
'height' => 36,
|
|
||||||
'quality' => 90,
|
|
||||||
'math' => false,
|
|
||||||
'expire' => 60,
|
|
||||||
'encrypt' => false,
|
|
||||||
],
|
|
||||||
'math' => [
|
|
||||||
'length' => 9,
|
|
||||||
'width' => 120,
|
|
||||||
'height' => 36,
|
|
||||||
'quality' => 90,
|
|
||||||
'math' => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
'flat' => [
|
|
||||||
'length' => 6,
|
|
||||||
'width' => 160,
|
|
||||||
'height' => 46,
|
|
||||||
'quality' => 90,
|
|
||||||
'lines' => 6,
|
|
||||||
'bgImage' => false,
|
|
||||||
'bgColor' => '#ecf2f4',
|
|
||||||
'fontColors' => ['#2c3e50', '#c0392b', '#16a085', '#c0392b', '#8e44ad', '#303f9f', '#f57c00', '#795548'],
|
|
||||||
'contrast' => -5,
|
|
||||||
],
|
|
||||||
'mini' => [
|
|
||||||
'length' => 3,
|
|
||||||
'width' => 60,
|
|
||||||
'height' => 32,
|
|
||||||
],
|
|
||||||
'inverse' => [
|
|
||||||
'length' => 5,
|
|
||||||
'width' => 120,
|
|
||||||
'height' => 36,
|
|
||||||
'quality' => 90,
|
|
||||||
'sensitive' => true,
|
|
||||||
'angle' => 12,
|
|
||||||
'sharpen' => 10,
|
|
||||||
'blur' => 2,
|
|
||||||
'invert' => true,
|
|
||||||
'contrast' => -5,
|
|
||||||
]
|
|
||||||
];
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
/*
|
|
||||||
* Indicates whenever should autodetect and apply the language of the request.
|
|
||||||
*/
|
|
||||||
'autodetect' => env('LANG_DETECTOR_AUTODETECT', true),
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default driver to use to detect the request language.
|
|
||||||
*
|
|
||||||
* Available: browser, subdomain, uri.
|
|
||||||
*/
|
|
||||||
'driver' => env('LANG_DETECTOR_DRIVER', 'browser'),
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Used on subdomain and uri drivers. That indicates which segment should be used
|
|
||||||
* to verify the language.
|
|
||||||
*/
|
|
||||||
'segment' => env('LANG_DETECTOR_SEGMENT', 0),
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Languages available on the application.
|
|
||||||
*
|
|
||||||
* You could use parse_langs_to_array to use the string syntax
|
|
||||||
* or just use the array of languages with its aliases.
|
|
||||||
*/
|
|
||||||
'languages' => parse_langs_to_array(
|
|
||||||
env('LANG_DETECTOR_LANGUAGES', ['en', 'de', 'fr'])
|
|
||||||
),
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Indicates if should store detected locale on cookies
|
|
||||||
*/
|
|
||||||
'cookie' => (bool) env('LANG_DETECTOR_COOKIE', true),
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Indicates if should encrypt cookie
|
|
||||||
*/
|
|
||||||
'cookie_encrypt' => (bool) env('LANG_DETECTOR_COOKIE_ENCRYPT', false),
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Cookie name
|
|
||||||
*/
|
|
||||||
'cookie_name' => env('LANG_DETECTOR_COOKIE', 'locale'),
|
|
||||||
];
|
|
||||||
@@ -47,5 +47,11 @@ return [
|
|||||||
'avatar_default_extension' => env('DISCORD_EXTENSION_DEFAULT', 'webp'), // only pick from jpg, png, webp
|
'avatar_default_extension' => env('DISCORD_EXTENSION_DEFAULT', 'webp'), // only pick from jpg, png, webp
|
||||||
],
|
],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Matrix Registration
|
||||||
|
*/
|
||||||
|
'matrix' => [
|
||||||
|
'server' => env('MATRIX_SERVER'),
|
||||||
|
'shared_secret' => env('MATRIX_SHARED_SECRET'),
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?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->string('locale', 10)
|
||||||
|
->nullable()
|
||||||
|
->after('discord_avatar');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('locale');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
// Migrate supporters
|
||||||
|
DB::table('users')->where('is_patreon', 1)->update([
|
||||||
|
'roles' => DB::raw("JSON_ARRAY('supporter')")
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Migrate banned
|
||||||
|
DB::table('users')->where('is_banned', 1)->update([
|
||||||
|
'roles' => DB::raw("JSON_ARRAY('banned')")
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Migrate admins
|
||||||
|
DB::table('users')->where('is_admin', 1)->update([
|
||||||
|
'roles' => DB::raw("JSON_ARRAY('admin')")
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Drop columns
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('is_admin');
|
||||||
|
$table->dropColumn('is_patreon');
|
||||||
|
$table->dropColumn('is_banned');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
DB::table('users')->update(['roles' => null]);
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->boolean('is_admin')->default(0);
|
||||||
|
$table->boolean('is_patreon')->default(0);
|
||||||
|
$table->boolean('is_banned')->default(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?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->string('matrix_id')
|
||||||
|
->nullable()
|
||||||
|
->after('discord_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('matrix_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
services:
|
|
||||||
laravel.test:
|
|
||||||
build:
|
|
||||||
context: './vendor/laravel/sail/runtimes/8.3'
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
args:
|
|
||||||
WWWGROUP: '${WWWGROUP}'
|
|
||||||
MYSQL_CLIENT: mariadb-client
|
|
||||||
image: 'sail-8.3/app'
|
|
||||||
extra_hosts:
|
|
||||||
- 'host.docker.internal:host-gateway'
|
|
||||||
ports:
|
|
||||||
- '${APP_PORT:-80}:80'
|
|
||||||
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
|
|
||||||
environment:
|
|
||||||
WWWUSER: '${WWWUSER}'
|
|
||||||
LARAVEL_SAIL: 1
|
|
||||||
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
|
|
||||||
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
|
|
||||||
IGNITION_LOCAL_SITES_PATH: '${PWD}'
|
|
||||||
volumes:
|
|
||||||
- '.:/var/www/html'
|
|
||||||
networks:
|
|
||||||
- sail
|
|
||||||
depends_on:
|
|
||||||
- mariadb
|
|
||||||
- redis
|
|
||||||
mariadb:
|
|
||||||
image: 'mariadb:11'
|
|
||||||
ports:
|
|
||||||
- '${FORWARD_DB_PORT:-3306}:3306'
|
|
||||||
environment:
|
|
||||||
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
|
|
||||||
MYSQL_ROOT_HOST: '%'
|
|
||||||
MYSQL_DATABASE: '${DB_DATABASE}'
|
|
||||||
MYSQL_USER: '${DB_USERNAME}'
|
|
||||||
MYSQL_PASSWORD: '${DB_PASSWORD}'
|
|
||||||
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
|
||||||
volumes:
|
|
||||||
- 'sail-mariadb:/var/lib/mysql'
|
|
||||||
- './vendor/laravel/sail/database/mariadb/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
|
|
||||||
networks:
|
|
||||||
- sail
|
|
||||||
healthcheck:
|
|
||||||
test:
|
|
||||||
- CMD
|
|
||||||
- healthcheck.sh
|
|
||||||
- '--connect'
|
|
||||||
- '--innodb_initialized'
|
|
||||||
retries: 3
|
|
||||||
timeout: 5s
|
|
||||||
redis:
|
|
||||||
image: 'redis:alpine'
|
|
||||||
ports:
|
|
||||||
- '${FORWARD_REDIS_PORT:-6379}:6379'
|
|
||||||
volumes:
|
|
||||||
- 'sail-redis:/data'
|
|
||||||
networks:
|
|
||||||
- sail
|
|
||||||
healthcheck:
|
|
||||||
test:
|
|
||||||
- CMD
|
|
||||||
- redis-cli
|
|
||||||
- ping
|
|
||||||
retries: 3
|
|
||||||
timeout: 5s
|
|
||||||
networks:
|
|
||||||
sail:
|
|
||||||
driver: bridge
|
|
||||||
volumes:
|
|
||||||
sail-mariadb:
|
|
||||||
driver: local
|
|
||||||
sail-redis:
|
|
||||||
driver: local
|
|
||||||
1318
package-lock.json
generated
1318
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@
|
|||||||
"@fortawesome/fontawesome-free": "^6.5.1",
|
"@fortawesome/fontawesome-free": "^6.5.1",
|
||||||
"@jellyfin/libass-wasm": "^4.1.1",
|
"@jellyfin/libass-wasm": "^4.1.1",
|
||||||
"@yaireo/tagify": "^4.21.2",
|
"@yaireo/tagify": "^4.21.2",
|
||||||
|
"altcha": "^2.3.0",
|
||||||
"chart.js": "^4.5.0",
|
"chart.js": "^4.5.0",
|
||||||
"dashjs": "^5.0.0",
|
"dashjs": "^5.0.0",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
|
|||||||
@@ -122,4 +122,33 @@ input:checked~.dot {
|
|||||||
font-display: swap;
|
font-display: swap;
|
||||||
src: url(https://fonts.bunny.net/figtree/files/figtree-latin-ext-600-normal.woff2) format('woff2'), url(https://fonts.bunny.net/figtree/files/figtree-latin-ext-600-normal.woff) format('woff');
|
src: url(https://fonts.bunny.net/figtree/files/figtree-latin-ext-600-normal.woff2) format('woff2'), url(https://fonts.bunny.net/figtree/files/figtree-latin-ext-600-normal.woff) format('woff');
|
||||||
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Captcha */
|
||||||
|
:root {
|
||||||
|
--altcha-border-width: 1px;
|
||||||
|
--altcha-border-radius: 0.375rem;
|
||||||
|
--altcha-color-base: #333;
|
||||||
|
--altcha-color-border: #a0a0a0;
|
||||||
|
--altcha-color-text: #fff;
|
||||||
|
--altcha-color-border-focus: currentColor;
|
||||||
|
--altcha-color-error-text: #f23939;
|
||||||
|
--altcha-color-footer-bg: #141414;
|
||||||
|
--altcha-max-width: 260px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.altcha-footer {
|
||||||
|
border-bottom-left-radius: 0.375rem;
|
||||||
|
border-bottom-right-radius: 0.375rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"] {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-color: #a0a0a0;
|
||||||
|
color: rgb(225,29,72);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"]:checked {
|
||||||
|
background-color: rgb(225,29,72);
|
||||||
|
box-shadow: 0 0 0 0px #fff, 0 0 0 calc(2px + 0px) rgba(246, 59, 118, 0.5), 0 0 #0000;
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,9 @@ import {
|
|||||||
initTE,
|
initTE,
|
||||||
} from "tw-elements";
|
} from "tw-elements";
|
||||||
|
|
||||||
|
// Captcha
|
||||||
|
import 'altcha';
|
||||||
|
|
||||||
// import Alpine from 'alpinejs';
|
// import Alpine from 'alpinejs';
|
||||||
|
|
||||||
// window.Alpine = Alpine;
|
// window.Alpine = Alpine;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div class="mb-4 rounded-lg bg-success-400 px-6 py-5 text-base text-success-800 mt-5" role="alert">
|
<div class="mb-4 rounded-lg bg-success-400 px-6 py-5 text-base text-success-800 mt-5" role="alert">
|
||||||
{{ $alert->text }}
|
{{ $alert->text }}
|
||||||
@auth
|
@auth
|
||||||
@if(Auth::user()->is_admin)
|
@if(Auth::user()->hasRole(\App\Enums\UserRole::ADMINISTRATOR))
|
||||||
<form method="POST" action="{{ route('admin.alert.delete', $alert->id) }}" class="float-right hover:text-success-900">
|
<form method="POST" action="{{ route('admin.alert.delete', $alert->id) }}" class="float-right hover:text-success-900">
|
||||||
@csrf
|
@csrf
|
||||||
@method('delete')
|
@method('delete')
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<div class="mb-4 rounded-lg bg-danger-400 px-6 py-5 text-base text-danger-800 mt-5" role="alert">
|
<div class="mb-4 rounded-lg bg-danger-400 px-6 py-5 text-base text-danger-800 mt-5" role="alert">
|
||||||
{{ $alert->text }}
|
{{ $alert->text }}
|
||||||
@auth
|
@auth
|
||||||
@if(Auth::user()->is_admin)
|
@if(Auth::user()->hasRole(\App\Enums\UserRole::ADMINISTRATOR))
|
||||||
<form method="POST" action="{{ route('admin.alert.delete', $alert->id) }}" class="float-right hover:text-danger-900">
|
<form method="POST" action="{{ route('admin.alert.delete', $alert->id) }}" class="float-right hover:text-danger-900">
|
||||||
@csrf
|
@csrf
|
||||||
@method('delete')
|
@method('delete')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
@auth
|
@auth
|
||||||
@if(Auth::user()->is_admin)
|
@if(Auth::user()->hasRole(\App\Enums\UserRole::ADMINISTRATOR))
|
||||||
<div class="relative p-5 bg-white dark:bg-neutral-700/40 rounded-lg overflow-hidden z-10">
|
<div class="relative p-5 bg-white dark:bg-neutral-700/40 rounded-lg overflow-hidden z-10">
|
||||||
<div class="float-left">
|
<div class="float-left">
|
||||||
<a data-te-toggle="modal" data-te-target="#modalUploadEpisode" class="text-xl text-gray-800 dark:text-gray-200 leading-tight cursor-pointer whitespace-nowrap">
|
<a data-te-toggle="modal" data-te-target="#modalUploadEpisode" class="text-xl text-gray-800 dark:text-gray-200 leading-tight cursor-pointer whitespace-nowrap">
|
||||||
|
|||||||
@@ -69,6 +69,11 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="block">
|
||||||
|
<altcha-widget id="captcha" floating challengeurl="/altcha-challenge"></altcha-widget>
|
||||||
|
<x-input-error :messages="$errors->get('altcha')" class="mt-2" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center justify-end mt-4">
|
<div class="flex items-center justify-end mt-4">
|
||||||
@if (Route::has('password.request'))
|
@if (Route::has('password.request'))
|
||||||
<a class="underline text-sm text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-rose-500 dark:focus:ring-offset-neutral-800" href="{{ route('password.request') }}">
|
<a class="underline text-sm text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-rose-500 dark:focus:ring-offset-neutral-800" href="{{ route('password.request') }}">
|
||||||
@@ -127,6 +132,11 @@
|
|||||||
<x-input-error :messages="$errors->get('password_confirmation')" class="mt-2" />
|
<x-input-error :messages="$errors->get('password_confirmation')" class="mt-2" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="block">
|
||||||
|
<altcha-widget id="captcha" floating challengeurl="/altcha-challenge"></altcha-widget>
|
||||||
|
<x-input-error :messages="$errors->get('altcha')" class="mt-2" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center justify-end mt-4">
|
<div class="flex items-center justify-end mt-4">
|
||||||
<x-primary-button class="ms-4">
|
<x-primary-button class="ms-4">
|
||||||
{{ __('Register') }}
|
{{ __('Register') }}
|
||||||
|
|||||||
@@ -33,19 +33,7 @@
|
|||||||
<x-input-error class="mt-2" :messages="$errors->get('message')" />
|
<x-input-error class="mt-2" :messages="$errors->get('message')" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<altcha-widget id="captcha" floating challengeurl="/altcha-challenge"></altcha-widget>
|
||||||
<x-input-label for="message" :value="__('Captcha')" />
|
|
||||||
<div class="flex pt-2">
|
|
||||||
<div id="captchaImg">
|
|
||||||
{!! captcha_img() !!}
|
|
||||||
</div>
|
|
||||||
<button type="button" class="inline-flex items-center ml-2 px-2 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-500 rounded-md font-semibold text-xs text-gray-700 dark:text-gray-300 uppercase tracking-widest shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800 disabled:opacity-25 transition ease-in-out duration-150" id="reloadcaptcha">
|
|
||||||
<i class="fa-solid fa-rotate-right"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<x-text-input id="captcha" class="block " type="text" name="captcha" required />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<x-primary-button>{{ __('Submit') }}</x-primary-button>
|
<x-primary-button>{{ __('Submit') }}</x-primary-button>
|
||||||
@@ -65,18 +53,4 @@
|
|||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script>
|
|
||||||
function reloadCaptcha() {
|
|
||||||
window.axios.get('/reload-captcha').then(function(response) {
|
|
||||||
if (response.status == 200) {
|
|
||||||
document.querySelector("#captchaImg").innerHTML = response.data.captcha;
|
|
||||||
}
|
|
||||||
}).catch(function(error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
document.querySelector("#reloadcaptcha").addEventListener("click", reloadCaptcha);
|
|
||||||
</script>
|
|
||||||
</section>
|
</section>
|
||||||
@@ -49,6 +49,22 @@
|
|||||||
<i class="fa-brands fa-discord"></i> {{ __('nav.our-discord-server') }}
|
<i class="fa-brands fa-discord"></i> {{ __('nav.our-discord-server') }}
|
||||||
</x-dropdown-link>
|
</x-dropdown-link>
|
||||||
|
|
||||||
|
<x-dropdown-link :href="route('join.matrix')">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="icon icon-tabler icons-tabler-outline icon-tabler-brand-matrix pr-1">
|
||||||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||||
|
<path d="M4 3h-1v18h1" />
|
||||||
|
<path d="M20 21h1v-18h-1" />
|
||||||
|
<path d="M7 9v6" />
|
||||||
|
<path d="M12 15v-3.5a2.5 2.5 0 1 0 -5 0v.5" />
|
||||||
|
<path d="M17 15v-3.5a2.5 2.5 0 1 0 -5 0v.5" />
|
||||||
|
</svg>
|
||||||
|
Join our Matrix
|
||||||
|
</div>
|
||||||
|
</x-dropdown-link>
|
||||||
|
|
||||||
<x-dropdown-link>
|
<x-dropdown-link>
|
||||||
<div class="grid grid-cols-2">
|
<div class="grid grid-cols-2">
|
||||||
<p class="cursor-default">{{ __('nav.theme') }}</p>
|
<p class="cursor-default">{{ __('nav.theme') }}</p>
|
||||||
@@ -163,7 +179,7 @@
|
|||||||
<i class="fa-solid fa-gear"></i> {{ __('nav.settings') }}
|
<i class="fa-solid fa-gear"></i> {{ __('nav.settings') }}
|
||||||
</x-dropdown-link>
|
</x-dropdown-link>
|
||||||
|
|
||||||
@if (Auth::user()->is_admin)
|
@if (Auth::user()->hasRole(\App\Enums\UserRole::ADMINISTRATOR))
|
||||||
<x-dropdown-link href="{{ route('admin.upload.index') }}">
|
<x-dropdown-link href="{{ route('admin.upload.index') }}">
|
||||||
<i class="fa-solid fa-user-tie"></i> Admin
|
<i class="fa-solid fa-user-tie"></i> Admin
|
||||||
</x-dropdown-link>
|
</x-dropdown-link>
|
||||||
|
|||||||
@@ -6,12 +6,16 @@
|
|||||||
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-pink-700 dark:text-neutral-200 ">
|
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-pink-700 dark:text-neutral-200 ">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" class="px-6 py-3">
|
<th scope="col" class="px-6 py-3">
|
||||||
Discord-ID
|
ID
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-6 py-3">
|
||||||
|
Discord ID
|
||||||
<input
|
<input
|
||||||
class="w-4 h-4 ml-2 text-rose-600 bg-gray-100 border-gray-300 rounded focus:ring-rose-500 dark:focus:ring-rose-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
|
wire:model.live.debounce.600ms="discordId"
|
||||||
type="checkbox"
|
type="search"
|
||||||
wire:model.live="filtered"
|
id="discord-search"
|
||||||
value="true"
|
class="ml-2 w-32 h-7 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-rose-800 focus:border-rose-900 dark:bg-neutral-900 dark:border-neutral-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-rose-800 dark:focus:border-rose-900"
|
||||||
|
placeholder="Search..."
|
||||||
>
|
>
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" class="px-6 py-3">
|
<th scope="col" class="px-6 py-3">
|
||||||
@@ -59,14 +63,17 @@
|
|||||||
<th scope="row" class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
|
<th scope="row" class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
|
||||||
{{ $user->id }}
|
{{ $user->id }}
|
||||||
</th>
|
</th>
|
||||||
|
<td class="px-6 py-4">
|
||||||
|
{{ $user->discord_id ?? 'n/a' }}
|
||||||
|
</td>
|
||||||
<td class="px-6 py-4">
|
<td class="px-6 py-4">
|
||||||
{{ $user->name }}
|
{{ $user->name }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4">
|
<td class="px-6 py-4">
|
||||||
{{ $user->is_patreon ? 'Yes' : 'No' }}
|
{{ $user->hasRole(\App\Enums\UserRole::SUPPORTER) ? 'Yes' : 'No' }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4">
|
<td class="px-6 py-4">
|
||||||
{{ $user->is_banned ? 'Yes' : 'No' }}
|
{{ $user->hasRole(\App\Enums\UserRole::BANNED) ? 'Yes' : 'No' }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4">
|
<td class="px-6 py-4">
|
||||||
{{ $user->created_at->format('Y-m-d') }}
|
{{ $user->created_at->format('Y-m-d') }}
|
||||||
@@ -78,9 +85,9 @@
|
|||||||
<form method="POST" action="{{ route('admin.user.update') }}">
|
<form method="POST" action="{{ route('admin.user.update') }}">
|
||||||
@csrf
|
@csrf
|
||||||
<input type="hidden" value="{{ $user->id }}" name="id">
|
<input type="hidden" value="{{ $user->id }}" name="id">
|
||||||
<input type="hidden" value="{{ $user->is_banned ? 'unban' : 'ban' }}" name="action">
|
<input type="hidden" value="{{ $user->hasRole(\App\Enums\UserRole::BANNED) ? 'unban' : 'ban' }}" name="action">
|
||||||
<button type="submit" class="inline-block w-full rounded bg-rose-600 pl-[4px] pr-[4px] p-[1px] text-xs font-medium uppercase leading-normal text-white transition duration-150 ease-in-out hover:bg-rose-700 focus:bg-rose-600">
|
<button type="submit" class="inline-block w-full rounded bg-rose-600 pl-[4px] pr-[4px] p-[1px] text-xs font-medium uppercase leading-normal text-white transition duration-150 ease-in-out hover:bg-rose-700 focus:bg-rose-600">
|
||||||
{{ $user->is_banned ? 'Unban' : 'Ban' }}
|
{{ $user->hasRole(\App\Enums\UserRole::BANNED) ? 'Unban' : 'Ban' }}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<button wire:click="deleteUserComments('{{ $user->id }}')" class="inline-block w-full rounded bg-red-600 pl-[4px] pr-[4px] p-[1px] text-xs font-medium uppercase leading-normal text-white transition duration-150 ease-in-out hover:bg-rose-700 focus:bg-rose-600">
|
<button wire:click="deleteUserComments('{{ $user->id }}')" class="inline-block w-full rounded bg-red-600 pl-[4px] pr-[4px] p-[1px] text-xs font-medium uppercase leading-normal text-white transition duration-150 ease-in-out hover:bg-rose-700 focus:bg-rose-600">
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
<div class="flex-grow">
|
<div class="flex-grow">
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<p class="font-medium text-gray-900 dark:text-gray-100">{{ $comment->user->name }}</p>
|
<p class="font-medium text-gray-900 dark:text-gray-100">{{ $comment->user->name }}</p>
|
||||||
@if($comment->user->is_admin)
|
@if($comment->user->hasRole(\App\Enums\UserRole::ADMINISTRATOR))
|
||||||
<a data-te-toggle="tooltip" title="Admin"><i class="fa-solid fa-crown text-yellow-600"></i></a>
|
<a data-te-toggle="tooltip" title="Admin"><i class="fa-solid fa-crown text-yellow-600"></i></a>
|
||||||
@endif
|
@endif
|
||||||
@if($comment->user->is_patreon)
|
@if($comment->user->hasRole(\App\Enums\UserRole::SUPPORTER))
|
||||||
<a data-te-toggle="tooltip" title="Badge of appreciation for the horny people supporting us! :3"><i class="fa-solid fa-hand-holding-heart text-rose-600"></i></a>
|
<a data-te-toggle="tooltip" title="Badge of appreciation for the horny people supporting us! :3"><i class="fa-solid fa-hand-holding-heart text-rose-600"></i></a>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
@else
|
@else
|
||||||
<p class="text-lg">Episode {{ $episodeNumber }}</p>
|
<p class="text-lg">Episode {{ $episodeNumber }}</p>
|
||||||
@endif
|
@endif
|
||||||
<p class="text-xs">HEVC MKV {{ $fileSize ?? '' }}</p>
|
<p class="text-xs">{{ $fileExtension }} MKV {{ $fileSize ?? '' }}</p>
|
||||||
<p class="text-xs" id="count-{{ $downloadId }}">Downloaded {{ $downloadCount }} times</p>
|
<p class="text-xs" id="count-{{ $downloadId }}">Downloaded {{ $downloadCount }} times</p>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -235,6 +235,11 @@
|
|||||||
'/' .
|
'/' .
|
||||||
$expire;
|
$expire;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$fileExtension = "HEVC";
|
||||||
|
if (str_contains($download->url, 'AV1')) {
|
||||||
|
$fileExtension = "AV1";
|
||||||
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<a href="{{ $downloadURL }}" wire:click="clicked({{ $download->id }})"
|
<a href="{{ $downloadURL }}" wire:click="clicked({{ $download->id }})"
|
||||||
download>
|
download>
|
||||||
@@ -249,7 +254,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col text-center w-full">
|
<div class="flex flex-col text-center w-full">
|
||||||
<p class="text-xs">HEVC MKV</p>
|
<p class="text-xs">{{ $fileExtension }} MKV</p>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
<a href="{{ $dldomains[array_rand($dldomains)] }}/{{ $hdl->getDownloadByType('FHD')->url }}">
|
<a href="{{ $dldomains[array_rand($dldomains)] }}/{{ $hdl->getDownloadByType('FHD')->url }}">
|
||||||
|
@php
|
||||||
|
$fileExtension = "HEVC";
|
||||||
|
if (str_contains($hdl->getDownloadByType('FHD')->url, 'AV1')) {
|
||||||
|
$fileExtension = "AV1";
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
<button class="group rounded-md shadow bg-rose-600 text-white cursor-pointer flex justify-between items-center overflow-hidden transition-all hover:glow m-1 w-[150px]">
|
<button class="group rounded-md shadow bg-rose-600 text-white cursor-pointer flex justify-between items-center overflow-hidden transition-all hover:glow m-1 w-[150px]">
|
||||||
<div class="relative w-12 h-12 bg-white bg-opacity-20 text-white flex justify-center items-center transition-all"><svg id="arrow" class="w-4 h-4 transition-all group-hover:-translate-y-1" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
<div class="relative w-12 h-12 bg-white bg-opacity-20 text-white flex justify-center items-center transition-all"><svg id="arrow" class="w-4 h-4 transition-all group-hover:-translate-y-1" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
|
||||||
@@ -7,7 +13,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="w-32 text-center">
|
<div class="w-32 text-center">
|
||||||
<p class="px-5 text-sm row-span-2">Episode {{ $hdl->episode }}</p>
|
<p class="px-5 text-sm row-span-2">Episode {{ $hdl->episode }}</p>
|
||||||
<p class="px-5 text-xs">HEVC MKV</p>
|
<p class="px-5 text-xs">{{ $fileExtension }} MKV</p>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
169
resources/views/matrix/index.blade.php
Normal file
169
resources/views/matrix/index.blade.php
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<div class="min-h-screen">
|
||||||
|
<div class="max-w-5xl mx-auto py-16 px-6">
|
||||||
|
|
||||||
|
<!-- Header -->
|
||||||
|
<div class="text-center mb-8">
|
||||||
|
<h1 class="text-4xl font-bold text-gray-900 dark:text-white mb-4">
|
||||||
|
We're Moving to Matrix 🚀
|
||||||
|
</h1>
|
||||||
|
<p class="text-lg text-gray-600 dark:text-neutral-200 max-w-3xl mx-auto">
|
||||||
|
Due to recent changes with Discord, we are transitioning our community to
|
||||||
|
<span class="font-semibold text-indigo-600">Matrix</span> —
|
||||||
|
an open, decentralized communication network.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Why Matrix -->
|
||||||
|
<div class="bg-white dark:bg-neutral-800 rounded-2xl shadow-sm p-8 mb-8">
|
||||||
|
<h2 class="text-2xl dark:text-white font-semibold mb-4">What is Matrix?</h2>
|
||||||
|
|
||||||
|
<p class="text-gray-700 dark:text-neutral-300 mb-4">
|
||||||
|
Matrix is an open-source messaging system. Unlike Discord, it is
|
||||||
|
<strong>decentralized</strong>. That means no single company controls it.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul class="list-disc pl-6 text-gray-700 dark:text-neutral-300 space-y-2">
|
||||||
|
<li>You can choose which server (called a “homeserver”) you register on.</li>
|
||||||
|
<li>All servers communicate with each other (this is called federation).</li>
|
||||||
|
<li>You are <strong>not required</strong> to use our server to join our rooms.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="mt-6 p-4 bg-pink-50 dark:bg-pink-950 border border-pink-100 dark:border-pink-700 rounded-lg">
|
||||||
|
<p class="text-pink-500 text-sm">
|
||||||
|
Example: You can register at a different server like matrix.org and still join our rooms.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Our Server -->
|
||||||
|
<div class="bg-white dark:bg-neutral-800 rounded-2xl shadow-sm p-8 mb-8">
|
||||||
|
<h2 class="text-2xl dark:text-white font-semibold mb-4">Our Matrix Server</h2>
|
||||||
|
|
||||||
|
<p class="text-gray-700 dark:text-neutral-300 mb-4">
|
||||||
|
We provide our own Matrix homeserver for community members.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul class="list-disc pl-6 text-gray-700 dark:text-neutral-300 space-y-2 mb-6">
|
||||||
|
<li>Available to users registered for more than 1 month</li>
|
||||||
|
<li>Fully federated with the entire Matrix network</li>
|
||||||
|
<li>No obligation to use it - it’s optional</li>
|
||||||
|
<li>Anonymized IP addresses to protect your privacy</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
@auth
|
||||||
|
@if(auth()->user()->created_at->lt(now()->subMonth()))
|
||||||
|
@if(auth()->user()->matrix_id)
|
||||||
|
<div class="bg-green-50 dark:bg-green-950 dark:border-green-700 border border-green-200 p-6 rounded-xl">
|
||||||
|
<h3 class="font-semibold text-green-800 dark:text-green-300 mb-2">
|
||||||
|
✅ You are registered!
|
||||||
|
</h3>
|
||||||
|
<p class="text-green-700 dark:text-green-400 mb-4">
|
||||||
|
Your Matrix account has been created successfully.
|
||||||
|
</p>
|
||||||
|
<p class="text-green-700 dark:text-green-400 mb-4">
|
||||||
|
Make sure to store your password, as we don't have a password reset function!
|
||||||
|
</p>
|
||||||
|
<p class="text-green-700 dark:text-green-400 mb-4">
|
||||||
|
You can now log in using any Matrix client of your choice.
|
||||||
|
</p>
|
||||||
|
<p class="text-green-700 dark:text-green-400 mb-4">
|
||||||
|
For the best experience, we recommend:
|
||||||
|
</p>
|
||||||
|
<ul class="list-disc text-green-700 dark:text-green-400 pl-6 space-y-2 mb-6">
|
||||||
|
<li>Downloading the official <strong><a href="https://element.io/download" target="_blank" class="underline">Element</a></strong> app for desktop or mobile</li>
|
||||||
|
<li>Or using our web client via <strong><a href="https://element.hstream.moe/" target="_blank" class="underline">Element Web</a></strong></li>
|
||||||
|
</ul>
|
||||||
|
<p class="text-green-700 dark:text-green-400 mb-4">
|
||||||
|
Simply sign in with your new username (<code>{{ $user->matrix_id }}</code>) and password to get started.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div class="bg-green-50 dark:bg-green-950 dark:border-green-700 border border-green-200 p-6 rounded-xl">
|
||||||
|
<h3 class="font-semibold text-green-800 dark:text-green-300 mb-2">
|
||||||
|
🎉 You are eligible!
|
||||||
|
</h3>
|
||||||
|
<p class="text-green-700 dark:text-green-400 mb-2">
|
||||||
|
Your account is older than one month. You can create your account now.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="p-4 bg-red-100 dark:bg-red-950 border border-red-100 dark:border-red-700 rounded-lg mb-4">
|
||||||
|
<p class="text-red-500 text-sm font-bold">
|
||||||
|
Important: Save your password! We don't have a password reset function yet!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@include('matrix.register')
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@else
|
||||||
|
<div class="bg-yellow-50 dark:bg-yellow-900 border border-yellow-200 dark:border-yellow-700 p-6 rounded-xl">
|
||||||
|
<h3 class="font-semibold text-yellow-800 dark:text-yellow-300 mb-2">
|
||||||
|
⏳ Not Yet Eligible
|
||||||
|
</h3>
|
||||||
|
<p class="text-yellow-700 dark:text-yellow-400">
|
||||||
|
Your account must be at least one month old to register
|
||||||
|
on our Matrix server.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@else
|
||||||
|
<div class="bg-gray-100 dark:bg-neutral-700 p-6 rounded-xl text-center">
|
||||||
|
<p class="text-gray-700 dark:text-gray-100">
|
||||||
|
Please log in to check if you're eligible for our Matrix server.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
@endauth
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Our Space -->
|
||||||
|
<div class="bg-white dark:bg-neutral-800 rounded-2xl shadow-sm p-8 mb-8">
|
||||||
|
<h2 class="text-2xl dark:text-white font-semibold mb-4">Our Matrix Space</h2>
|
||||||
|
|
||||||
|
<p class="text-gray-700 dark:text-neutral-300 mb-4">
|
||||||
|
All of our rooms are organized inside our main Matrix Space:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="bg-gray-100 dark:bg-neutral-700 dark:text-neutral-300 p-4 rounded-lg font-mono text-sm break-all">
|
||||||
|
<a href="https://matrix.to/#/#hstream:hstream.moe" target="_blank">https://matrix.to/#/#hstream:hstream.moe</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Room List -->
|
||||||
|
<div class="bg-white dark:bg-neutral-800 rounded-2xl shadow-sm p-8 mb-8">
|
||||||
|
<h2 class="text-2xl dark:text-white font-semibold mb-6">Our Matrix Rooms</h2>
|
||||||
|
|
||||||
|
<div class="grid md:grid-cols-2 gap-6">
|
||||||
|
@foreach($rooms as $room)
|
||||||
|
<div class="border dark:border-neutral-900 rounded-xl p-6 hover:shadow-md dark:bg-neutral-800 hover:dark:bg-neutral-900/60 transition">
|
||||||
|
<h3 class="font-semibold dark:text-neutral-100 text-lg mb-2">
|
||||||
|
{{ $room['name'] }}
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<p class="text-gray-600 dark:text-neutral-300 text-sm mb-4">
|
||||||
|
{{ $room['description'] }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="bg-gray-100 dark:bg-neutral-700 dark:text-neutral-300 p-3 rounded text-xs font-mono break-all">
|
||||||
|
<a href="{{ $room['alias'] }}" target="_blank">{{ $room['alias'] }}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Guide -->
|
||||||
|
<div class="bg-white dark:bg-neutral-800 rounded-2xl shadow-sm p-8">
|
||||||
|
<h2 class="text-2xl dark:text-white font-semibold mb-4">Matrix Guide</h2>
|
||||||
|
|
||||||
|
<p class="text-gray-700 dark:text-neutral-300 mb-4">
|
||||||
|
Matrix and Element can be overwhelming for new users, so here is a guide from Element:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul class="list-disc pl-6 text-gray-700 dark:text-neutral-300 space-y-2 mb-6">
|
||||||
|
<li>Element Guide: <a class="font-bold text-green-800 dark:text-green-300 underline" referrerPolicy="no-referrer" href="https://static.element.io/pdfs/element-user-guide.pdf" target="_blank">element-user-guide.pdf</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-app-layout>
|
||||||
31
resources/views/matrix/register.blade.php
Normal file
31
resources/views/matrix/register.blade.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<form method="POST" action="{{ route('join.matrix.create') }}">
|
||||||
|
@csrf
|
||||||
|
<div>
|
||||||
|
<x-input-label for="username" :value="__('Username')" />
|
||||||
|
<x-text-input id="username" class="block mt-1 w-full" type="text" name="username" :value="old('username')" required autofocus autocomplete="username" />
|
||||||
|
<x-input-error :messages="$errors->get('username')" class="mt-2" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4">
|
||||||
|
<x-input-label for="password" :value="__('Password')" />
|
||||||
|
<x-text-input id="password" class="block mt-1 w-full"
|
||||||
|
type="password"
|
||||||
|
name="password"
|
||||||
|
required/>
|
||||||
|
<x-input-error :messages="$errors->get('password')" class="mt-2" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4">
|
||||||
|
<x-input-label for="password_confirmation" :value="__('Confirm Password')" />
|
||||||
|
<x-text-input id="password_confirmation" class="block mt-1 w-full"
|
||||||
|
type="password"
|
||||||
|
name="password_confirmation"
|
||||||
|
required />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center justify-end mt-4">
|
||||||
|
<x-primary-button class="ms-4">
|
||||||
|
{{ __('Create Matrix Account') }}
|
||||||
|
</x-primary-button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
@@ -52,7 +52,19 @@
|
|||||||
<br>
|
<br>
|
||||||
@php $download = $episode->getDownloadByType('UHD'); @endphp
|
@php $download = $episode->getDownloadByType('UHD'); @endphp
|
||||||
@isset($download)
|
@isset($download)
|
||||||
@if (!Auth::user()->is_patreon)
|
@if (Auth::user()->hasRole(\App\Enums\UserRole::SUPPORTER) || Auth::user()->hasRole(\App\Enums\UserRole::ADMINISTRATOR))
|
||||||
|
<p class="font-bold text-gray-800 dark:text-gray-200">
|
||||||
|
<i class="fa-solid fa-lock-open pr-[4px] text-green-400"></i> 4k
|
||||||
|
</p>
|
||||||
|
|
||||||
|
@php $dlpdomains = config('hstream.download_domain_4k'); @endphp
|
||||||
|
|
||||||
|
<div class="flex flex-wrap justify-around">
|
||||||
|
@foreach ($dlList as $hdl)
|
||||||
|
@include('modals.partials.download-button-patreon')
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
@if (config('hstream.free_downloads'))
|
@if (config('hstream.free_downloads'))
|
||||||
<p class="font-bold text-gray-800 dark:text-gray-200">
|
<p class="font-bold text-gray-800 dark:text-gray-200">
|
||||||
<i class="fa-solid fa-lock-open pr-[4px] text-yellow-600"></i> 4k
|
<i class="fa-solid fa-lock-open pr-[4px] text-yellow-600"></i> 4k
|
||||||
@@ -67,18 +79,6 @@
|
|||||||
on our Discord server, you have to logout and login again.
|
on our Discord server, you have to logout and login again.
|
||||||
</p>
|
</p>
|
||||||
@endif
|
@endif
|
||||||
@else
|
|
||||||
<p class="font-bold text-gray-800 dark:text-gray-200">
|
|
||||||
<i class="fa-solid fa-lock-open pr-[4px] text-green-400"></i> 4k
|
|
||||||
</p>
|
|
||||||
|
|
||||||
@php $dlpdomains = config('hstream.download_domain_4k'); @endphp
|
|
||||||
|
|
||||||
<div class="flex flex-wrap justify-around">
|
|
||||||
@foreach ($dlList as $hdl)
|
|
||||||
@include('modals.partials.download-button-patreon')
|
|
||||||
@endforeach
|
|
||||||
</div>
|
|
||||||
@endif
|
@endif
|
||||||
@else
|
@else
|
||||||
<p class="text-gray-800 dark:text-gray-200 font-bold">
|
<p class="text-gray-800 dark:text-gray-200 font-bold">
|
||||||
@@ -91,7 +91,19 @@
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
@if ($episode->interpolated_uhd)
|
@if ($episode->interpolated_uhd)
|
||||||
@if (!Auth::user()->is_patreon)
|
@if (Auth::user()->hasRole(\App\Enums\UserRole::SUPPORTER) || Auth::user()->hasRole(\App\Enums\UserRole::ADMINISTRATOR) )
|
||||||
|
<p class="font-bold text-gray-800 dark:text-gray-200">
|
||||||
|
<i class="fa-solid fa-lock-open pr-[4px] text-green-400"></i> 4k 48fps
|
||||||
|
</p>
|
||||||
|
|
||||||
|
@php $dlpdomains = config('hstream.download_domain_4k'); @endphp
|
||||||
|
|
||||||
|
<div class="flex flex-wrap justify-around">
|
||||||
|
@foreach ($dlList as $hdl)
|
||||||
|
@include('modals.partials.download-button-patreon-interpolated')
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
@if (config('hstream.free_downloads'))
|
@if (config('hstream.free_downloads'))
|
||||||
<p class="font-bold text-gray-800 dark:text-gray-200">
|
<p class="font-bold text-gray-800 dark:text-gray-200">
|
||||||
<i class="fa-solid fa-lock-open pr-[4px] text-yellow-600"></i> 4k 48fps
|
<i class="fa-solid fa-lock-open pr-[4px] text-yellow-600"></i> 4k 48fps
|
||||||
@@ -106,18 +118,6 @@
|
|||||||
on our Discord server, you have to logout and login again.
|
on our Discord server, you have to logout and login again.
|
||||||
</p>
|
</p>
|
||||||
@endif
|
@endif
|
||||||
@else
|
|
||||||
<p class="font-bold text-gray-800 dark:text-gray-200">
|
|
||||||
<i class="fa-solid fa-lock-open pr-[4px] text-green-400"></i> 4k 48fps
|
|
||||||
</p>
|
|
||||||
|
|
||||||
@php $dlpdomains = config('hstream.download_domain_4k'); @endphp
|
|
||||||
|
|
||||||
<div class="flex flex-wrap justify-around">
|
|
||||||
@foreach ($dlList as $hdl)
|
|
||||||
@include('modals.partials.download-button-patreon-interpolated')
|
|
||||||
@endforeach
|
|
||||||
</div>
|
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|||||||
@@ -8,18 +8,7 @@
|
|||||||
<p id="message" class="text-red-600">
|
<p id="message" class="text-red-600">
|
||||||
</p>
|
</p>
|
||||||
<div class="flex pt-2">
|
<div class="flex pt-2">
|
||||||
<div id="captchaImg">
|
<altcha-widget id="altcha" challengeurl="/altcha-challenge"></altcha-widget>
|
||||||
{!! captcha_img() !!}
|
|
||||||
</div>
|
|
||||||
<button type="button" class="inline-flex items-center ml-2 px-2 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-500 rounded-md font-semibold text-xs text-gray-700 dark:text-gray-300 uppercase tracking-widest shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800 disabled:opacity-25 transition ease-in-out duration-150" id="reloadcaptcha" >
|
|
||||||
<i class="fa-solid fa-rotate-right"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="flex pt-2 mt-1">
|
|
||||||
<x-text-input id="captcha_text" class="block " type="text" name="captcha_text"/>
|
|
||||||
<button type="button" class="inline-flex items-center ml-2 px-2 -pt-1 bg-rose-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-rose-700 active:bg-rose-900 focus:outline-none focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800 transition ease-in-out duration-150" id="submitcaptcha" >
|
|
||||||
Submit
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<p class="text-gray-800 dark:text-gray-200 text-sm">
|
<p class="text-gray-800 dark:text-gray-200 text-sm">
|
||||||
@@ -39,9 +28,15 @@
|
|||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
@php
|
||||||
|
$fileExtension = "HEVC";
|
||||||
|
if (str_contains($episode->getDownloadByType('FHD')->url, 'AV1')) {
|
||||||
|
$fileExtension = "AV1";
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
<div class="flex flex-col text-center w-full">
|
<div class="flex flex-col text-center w-full">
|
||||||
<p class="text-xl">Episode {{ $episode->episode }}</p>
|
<p class="text-xl">Episode {{ $episode->episode }}</p>
|
||||||
<p class="text-xs">HEVC MKV {{ $episode->getDownloadByType('FHD')->getFileSize() ?? '' }}</p>
|
<p class="text-xs">{{ $fileExtension }} MKV {{ $episode->getDownloadByType('FHD')->getFileSize() ?? '' }}</p>
|
||||||
<p class="text-xs" id="downloadCount">Downloaded {{ $episode->getDownloadByType('FHD')->count }} times</p>
|
<p class="text-xs" id="downloadCount">Downloaded {{ $episode->getDownloadByType('FHD')->count }} times</p>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
@@ -51,21 +46,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
var downloadCounter = 0;
|
var downloadCounter = 0;
|
||||||
function reloadCaptcha() {
|
|
||||||
window.axios.get('/reload-captcha').then(function (response) {
|
|
||||||
if (response.status == 200) {
|
|
||||||
document.querySelector("#captchaImg").innerHTML = response.data.captcha;
|
|
||||||
}
|
|
||||||
}).catch(function (error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function submitCaptcha() {
|
function submitCaptcha(captchaToken) {
|
||||||
document.querySelector("#message").innerHTML = '';
|
document.querySelector("#message").innerHTML = '';
|
||||||
window.axios.post('/get-download', {
|
window.axios.post('/get-download', {
|
||||||
captcha: document.getElementById('captcha_text').value,
|
episode_id: document.getElementById('e_id').value,
|
||||||
episode_id: document.getElementById('e_id').value
|
captcha: captchaToken,
|
||||||
}).then(function (response) {
|
}).then(function (response) {
|
||||||
document.querySelector("#captcharequired").style.display = "none";
|
document.querySelector("#captcharequired").style.display = "none";
|
||||||
document.querySelector("#captchsolved").style.display = "block";
|
document.querySelector("#captchsolved").style.display = "block";
|
||||||
@@ -89,6 +75,16 @@
|
|||||||
|
|
||||||
document.querySelector("#downloadEpisode").addEventListener("click", increaseDownloadCounter);
|
document.querySelector("#downloadEpisode").addEventListener("click", increaseDownloadCounter);
|
||||||
|
|
||||||
document.querySelector("#reloadcaptcha").addEventListener("click", reloadCaptcha);
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
document.querySelector("#submitcaptcha").addEventListener("click", submitCaptcha);
|
const altcha = document.querySelector("#altcha");
|
||||||
|
|
||||||
|
altcha.addEventListener("statechange", (ev) => {
|
||||||
|
if (ev.detail.state === "verified") {
|
||||||
|
submitCaptcha(ev.detail.payload);
|
||||||
|
|
||||||
|
// Remove captcha from DOM
|
||||||
|
altcha.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
<div class="flex-grow">
|
<div class="flex-grow">
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<p class="font-medium text-gray-900 dark:text-gray-100">{{ $comment->user->name }}</p>
|
<p class="font-medium text-gray-900 dark:text-gray-100">{{ $comment->user->name }}</p>
|
||||||
@if($comment->user->is_admin)
|
@if($comment->user->hasRole(\App\Enums\UserRole::ADMINISTRATOR))
|
||||||
<a data-te-toggle="tooltip" title="Admin"><i class="fa-solid fa-crown text-yellow-600"></i></a>
|
<a data-te-toggle="tooltip" title="Admin"><i class="fa-solid fa-crown text-yellow-600"></i></a>
|
||||||
@endif
|
@endif
|
||||||
@if($comment->user->is_patreon)
|
@if($comment->user->hasRole(\App\Enums\UserRole::SUPPORTER))
|
||||||
<a data-te-toggle="tooltip" title="Badge of appreciation for the horny people supporting us! :3"><i class="fa-solid fa-hand-holding-heart text-rose-600"></i></a>
|
<a data-te-toggle="tooltip" title="Badge of appreciation for the horny people supporting us! :3"><i class="fa-solid fa-hand-holding-heart text-rose-600"></i></a>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
@include('modals.share')
|
@include('modals.share')
|
||||||
|
|
||||||
@auth
|
@auth
|
||||||
@if(Auth::user()->is_admin)
|
@if(Auth::user()->hasRole(\App\Enums\UserRole::ADMINISTRATOR))
|
||||||
@include('admin.modals.upload-episode')
|
@include('admin.modals.upload-episode')
|
||||||
@include('admin.modals.add-subtitles')
|
@include('admin.modals.add-subtitles')
|
||||||
@include('admin.modals.edit-episode')
|
@include('admin.modals.edit-episode')
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="flex flex-col py-5 pl-24">
|
<div class="flex flex-col py-5 pl-24">
|
||||||
<strong class="text-slate-900 text-xl font-bold dark:text-slate-200">
|
<strong class="text-slate-900 text-xl font-bold dark:text-slate-200">
|
||||||
{{ $user->name }}
|
{{ $user->name }}
|
||||||
@if ($user->is_patreon)
|
@if ($user->hasRole(\App\Enums\UserRole::SUPPORTER))
|
||||||
<a data-te-toggle="tooltip" title="Badge of appreciation for the horny people supporting us! :3"><i
|
<a data-te-toggle="tooltip" title="Badge of appreciation for the horny people supporting us! :3"><i
|
||||||
class="fa-solid fa-hand-holding-heart text-rose-600 animate-pulse"></i></a>
|
class="fa-solid fa-hand-holding-heart text-rose-600 animate-pulse"></i></a>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
62
routes/admin.php
Normal file
62
routes/admin.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\Admin\AlertController;
|
||||||
|
use App\Http\Controllers\Admin\ContactController;
|
||||||
|
use App\Http\Controllers\Admin\CommentsController;
|
||||||
|
use App\Http\Controllers\Admin\EpisodeController;
|
||||||
|
use App\Http\Controllers\Admin\ReleaseController;
|
||||||
|
use App\Http\Controllers\Admin\UserController;
|
||||||
|
use App\Http\Controllers\Admin\SubtitleController;
|
||||||
|
use App\Http\Controllers\Admin\SiteBackgroundController;
|
||||||
|
use App\Http\Controllers\Api\AdminApiController;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|---------------------------------------------------------------------------------
|
||||||
|
| Admin Routes
|
||||||
|
|---------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
Route::group(['middleware' => ['auth', 'auth.admin']], function () {
|
||||||
|
// Site alerts
|
||||||
|
Route::get('/admin/alert', [AlertController::class, 'index'])->name('admin.alert.index');
|
||||||
|
Route::post('/admin/alert', [AlertController::class, 'store'])->name('admin.alert.create');
|
||||||
|
Route::delete('/admin/alert/{alert_id}', [AlertController::class, 'delete'])->name('admin.alert.delete');
|
||||||
|
|
||||||
|
// Users
|
||||||
|
Route::get('/admin/users', [UserController::class, 'index'])->name('admin.user.index');
|
||||||
|
Route::post('/admin/users', [UserController::class, 'update'])->name('admin.user.update');
|
||||||
|
|
||||||
|
// Comments
|
||||||
|
Route::get('/admin/comments', [CommentsController::class, 'index'])->name('admin.comments.index');
|
||||||
|
|
||||||
|
// Contact page overview
|
||||||
|
Route::get('/admin/contact', [ContactController::class, 'index'])->name('admin.contact.index');
|
||||||
|
Route::delete('/admin/contact/{contact_id}', [ContactController::class, 'delete'])->name('admin.contact.delete');
|
||||||
|
|
||||||
|
// Site background settings
|
||||||
|
Route::get('/admin/background', [SiteBackgroundController::class, 'index'])->name('admin.background.index');
|
||||||
|
Route::post('/admin/background', [SiteBackgroundController::class, 'create'])->name('admin.background.create');
|
||||||
|
Route::put('/admin/background', [SiteBackgroundController::class, 'update'])->name('admin.background.update');
|
||||||
|
Route::delete('/admin/background', [SiteBackgroundController::class, 'delete'])->name('admin.background.delete');
|
||||||
|
|
||||||
|
// Release
|
||||||
|
Route::get('/admin/release', [ReleaseController::class, 'index'])->name('admin.upload.index');
|
||||||
|
Route::post('/admin/release/upload', [ReleaseController::class, 'store'])->name('admin.upload');
|
||||||
|
|
||||||
|
// Episode
|
||||||
|
Route::post('/admin/episode/upload', [EpisodeController::class, 'store'])->name('admin.upload.episode');
|
||||||
|
Route::post('/admin/episode/edit', [EpisodeController::class, 'update'])->name('admin.edit');
|
||||||
|
|
||||||
|
// Get Tags used for Upload Form
|
||||||
|
Route::get('/admin/tags', [AdminApiController::class, 'getTags'])->name('admin.tags');
|
||||||
|
Route::get('/admin/studios', [AdminApiController::class, 'getStudios'])->name('admin.studios');
|
||||||
|
|
||||||
|
// Get Tags for editing Episode
|
||||||
|
Route::get('/admin/tags/{episode_id}', [AdminApiController::class, 'getEpisodeTags'])->name('admin.tags.episode');
|
||||||
|
Route::get('/admin/studio/{episode_id}', [AdminApiController::class, 'getEpisodeStudio'])->name('admin.studio.episode');
|
||||||
|
|
||||||
|
// Subtitles
|
||||||
|
Route::get('/admin/subtitles/{episode_id}', [AdminApiController::class, 'getSubtitles'])->name('admin.subtitles');
|
||||||
|
Route::post('/admin/add-new-subtitle', [SubtitleController::class, 'store'])->name('admin.add.new.subtitle');
|
||||||
|
Route::post('/admin/update-subtitles', [SubtitleController::class, 'update'])->name('admin.update.subtitles');
|
||||||
|
});
|
||||||
52
routes/user.php
Normal file
52
routes/user.php
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\HomeController;
|
||||||
|
use App\Http\Controllers\ProfileController;
|
||||||
|
use App\Http\Controllers\PlaylistController;
|
||||||
|
use App\Http\Controllers\Api\UserApiController;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|---------------------------------------------------------------------------------
|
||||||
|
| User Routes
|
||||||
|
|---------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Matrix
|
||||||
|
Route::get('/join-matrix', [App\Http\Controllers\MatrixController::class, 'index'])->name('join.matrix');
|
||||||
|
|
||||||
|
Route::middleware('auth')->group(function () {
|
||||||
|
// Matrix
|
||||||
|
Route::post('/join-matrix', [App\Http\Controllers\MatrixController::class, 'store'])->name('join.matrix.create');
|
||||||
|
|
||||||
|
Route::get('/user/profile', [ProfileController::class, 'index'])->name('profile.show');
|
||||||
|
Route::get('/user/comments', [ProfileController::class, 'comments'])->name('profile.comments');
|
||||||
|
Route::get('/user/likes', [ProfileController::class, 'likes'])->name('profile.likes');
|
||||||
|
Route::get('/user/watched', [ProfileController::class, 'watched'])->name('user.watched');
|
||||||
|
|
||||||
|
// Notifications
|
||||||
|
Route::get('/user/notifications', [App\Http\Controllers\NotificationController::class, 'index'])->name('profile.notifications');
|
||||||
|
Route::delete('/user/notifications', [App\Http\Controllers\NotificationController::class, 'delete'])->name('profile.notifications.delete');
|
||||||
|
|
||||||
|
// User Profile Actions
|
||||||
|
Route::get('/user/settings', [ProfileController::class, 'settings'])->name('profile.settings');
|
||||||
|
Route::patch('/user/settings', [ProfileController::class, 'update'])->name('profile.update');
|
||||||
|
Route::delete('/user/delete', [ProfileController::class, 'destroy'])->name('profile.delete');
|
||||||
|
Route::post('/user/settings', [ProfileController::class, 'saveSettings'])->name('profile.settings.save');
|
||||||
|
Route::get('/user/blacklist', [UserApiController::class, 'getBlacklist'])->name('profile.blacklist');
|
||||||
|
Route::post('/user/blacklist', [ProfileController::class, 'saveBlacklist'])->name('profile.blacklist.save');
|
||||||
|
|
||||||
|
// Playlist Routes for User Page
|
||||||
|
Route::get('/user/playlists', [PlaylistController::class, 'playlists'])->name('profile.playlists');
|
||||||
|
Route::get('/user/playlist/{playlist_id}', [PlaylistController::class, 'showPlaylist'])->name('profile.playlist.show');
|
||||||
|
Route::post('/create-playlist', [PlaylistController::class, 'createPlaylist'])->name('profile.playlists.create');
|
||||||
|
Route::delete('/user/playlist/{playlist_id}', [PlaylistController::class, 'deletePlaylist'])->name('profile.playlist.delete');
|
||||||
|
Route::post('/user/playlist-episode', [PlaylistController::class, 'deleteEpisodeFromPlaylist'])->name('playlist.delete.episode');
|
||||||
|
|
||||||
|
// Playlist Routes for Modals on Stream Page
|
||||||
|
Route::post('/hentai/add-to-playlist', [PlaylistController::class, 'addPlaylistApi'])->name('hentai.playlists.add');
|
||||||
|
Route::post('/hentai/create-playlist', [PlaylistController::class, 'createPlaylistApi'])->name('hentai.playlists.create');
|
||||||
|
|
||||||
|
// Download Page
|
||||||
|
Route::get('/download-search', [HomeController::class, 'downloadSearch'])->name('download.search');
|
||||||
|
});
|
||||||
@@ -3,14 +3,12 @@
|
|||||||
use App\Http\Controllers\ContactController;
|
use App\Http\Controllers\ContactController;
|
||||||
use App\Http\Controllers\HomeController;
|
use App\Http\Controllers\HomeController;
|
||||||
use App\Http\Controllers\PlaylistController;
|
use App\Http\Controllers\PlaylistController;
|
||||||
use App\Http\Controllers\ProfileController;
|
|
||||||
use App\Http\Controllers\StreamController;
|
use App\Http\Controllers\StreamController;
|
||||||
use App\Http\Controllers\UserController;
|
|
||||||
use App\Http\Controllers\Api\AdminApiController;
|
|
||||||
use App\Http\Controllers\Api\DownloadApiController;
|
use App\Http\Controllers\Api\DownloadApiController;
|
||||||
use App\Http\Controllers\Api\HentaiApiController;
|
use App\Http\Controllers\Api\HentaiApiController;
|
||||||
use App\Http\Controllers\Api\StreamApiController;
|
use App\Http\Controllers\Api\StreamApiController;
|
||||||
use App\Http\Controllers\Api\UserApiController;
|
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -40,100 +38,15 @@ Route::post('/search', [HomeController::class, 'searchRedirect'])->name('hentai.
|
|||||||
Route::get('/contact', [ContactController::class, 'index'])->name('contact.index');
|
Route::get('/contact', [ContactController::class, 'index'])->name('contact.index');
|
||||||
Route::post('/contact', [ContactController::class, 'store'])->name('contact.store');
|
Route::post('/contact', [ContactController::class, 'store'])->name('contact.store');
|
||||||
|
|
||||||
// Public Playlistts
|
// Public Playlists
|
||||||
Route::get('/playlists', [PlaylistController::class, 'index'])->name('playlist.index');
|
Route::get('/playlists', [PlaylistController::class, 'index'])->name('playlist.index');
|
||||||
Route::get('/playlist/{playlist_id}', [PlaylistController::class, 'show'])->name('playlist.show');
|
Route::get('/playlist/{playlist_id}', [PlaylistController::class, 'show'])->name('playlist.show');
|
||||||
|
|
||||||
// Captcha Reload
|
|
||||||
Route::get('/reload-captcha', [ContactController::class, 'reloadCaptcha']);
|
|
||||||
|
|
||||||
// Download
|
// Download
|
||||||
Route::post('/get-download', [DownloadApiController::class, 'getDownload']);
|
Route::post('/get-download', [DownloadApiController::class, 'getDownload']);
|
||||||
|
|
||||||
Route::post('/update-language', [HomeController::class, 'updateLanguage'])->name('update.language');
|
Route::post('/update-language', [HomeController::class, 'updateLanguage'])->name('update.language');
|
||||||
|
|
||||||
// User Routes
|
require __DIR__.'/user.php';
|
||||||
Route::middleware('auth')->group(function () {
|
require __DIR__.'/admin.php';
|
||||||
Route::get('/user/profile', [ProfileController::class, 'index'])->name('profile.show');
|
|
||||||
Route::get('/user/comments', [ProfileController::class, 'comments'])->name('profile.comments');
|
|
||||||
Route::get('/user/likes', [ProfileController::class, 'likes'])->name('profile.likes');
|
|
||||||
Route::get('/user/watched', [ProfileController::class, 'watched'])->name('user.watched');
|
|
||||||
|
|
||||||
// Notifications
|
|
||||||
Route::get('/user/notifications', [App\Http\Controllers\NotificationController::class, 'index'])->name('profile.notifications');
|
|
||||||
Route::delete('/user/notifications', [App\Http\Controllers\NotificationController::class, 'delete'])->name('profile.notifications.delete');
|
|
||||||
|
|
||||||
// User Profile Actions
|
|
||||||
Route::get('/user/settings', [ProfileController::class, 'settings'])->name('profile.settings');
|
|
||||||
Route::patch('/user/settings', [ProfileController::class, 'update'])->name('profile.update');
|
|
||||||
Route::delete('/user/delete', [ProfileController::class, 'destroy'])->name('profile.delete');
|
|
||||||
Route::post('/user/settings', [ProfileController::class, 'saveSettings'])->name('profile.settings.save');
|
|
||||||
Route::get('/user/blacklist', [UserApiController::class, 'getBlacklist'])->name('profile.blacklist');
|
|
||||||
Route::post('/user/blacklist', [ProfileController::class, 'saveBlacklist'])->name('profile.blacklist.save');
|
|
||||||
|
|
||||||
// Playlist Routes for User Page
|
|
||||||
Route::get('/user/playlists', [PlaylistController::class, 'playlists'])->name('profile.playlists');
|
|
||||||
Route::get('/user/playlist/{playlist_id}', [PlaylistController::class, 'showPlaylist'])->name('profile.playlist.show');
|
|
||||||
Route::post('/create-playlist', [PlaylistController::class, 'createPlaylist'])->name('profile.playlists.create');
|
|
||||||
Route::delete('/user/playlist/{playlist_id}', [PlaylistController::class, 'deletePlaylist'])->name('profile.playlist.delete');
|
|
||||||
Route::post('/user/playlist-episode', [PlaylistController::class, 'deleteEpisodeFromPlaylist'])->name('playlist.delete.episode');
|
|
||||||
|
|
||||||
// Playlist Routes for Modals on Stream Page
|
|
||||||
Route::post('/hentai/add-to-playlist', [PlaylistController::class, 'addPlaylistApi'])->name('hentai.playlists.add');
|
|
||||||
Route::post('/hentai/create-playlist', [PlaylistController::class, 'createPlaylistApi'])->name('hentai.playlists.create');
|
|
||||||
|
|
||||||
// Download Page
|
|
||||||
Route::get('/download-search', [HomeController::class, 'downloadSearch'])->name('download.search');
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
|
||||||
|---------------------------------------------------------------------------------
|
|
||||||
| Admin Pages
|
|
||||||
|---------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
Route::group(['middleware' => ['auth', 'auth.admin']], function () {
|
|
||||||
// Site alerts
|
|
||||||
Route::get('/admin/alert', [App\Http\Controllers\Admin\AlertController::class, 'index'])->name('admin.alert.index');
|
|
||||||
Route::post('/admin/alert', [App\Http\Controllers\Admin\AlertController::class, 'store'])->name('admin.alert.create');
|
|
||||||
Route::delete('/admin/alert/{alert_id}', [App\Http\Controllers\Admin\AlertController::class, 'delete'])->name('admin.alert.delete');
|
|
||||||
|
|
||||||
// Users
|
|
||||||
Route::get('/admin/users', [App\Http\Controllers\Admin\UserController::class, 'index'])->name('admin.user.index');
|
|
||||||
Route::post('/admin/users', [App\Http\Controllers\Admin\UserController::class, 'update'])->name('admin.user.update');
|
|
||||||
|
|
||||||
// Comments
|
|
||||||
Route::get('/admin/comments', [App\Http\Controllers\Admin\CommentsController::class, 'index'])->name('admin.comments.index');
|
|
||||||
|
|
||||||
// Contact page overview
|
|
||||||
Route::get('/admin/contact', [App\Http\Controllers\Admin\ContactController::class, 'index'])->name('admin.contact.index');
|
|
||||||
Route::delete('/admin/contact/{contact_id}', [App\Http\Controllers\Admin\ContactController::class, 'delete'])->name('admin.contact.delete');
|
|
||||||
|
|
||||||
// Site background settings
|
|
||||||
Route::get('/admin/background', [App\Http\Controllers\Admin\SiteBackgroundController::class, 'index'])->name('admin.background.index');
|
|
||||||
Route::post('/admin/background', [App\Http\Controllers\Admin\SiteBackgroundController::class, 'create'])->name('admin.background.create');
|
|
||||||
Route::put('/admin/background', [App\Http\Controllers\Admin\SiteBackgroundController::class, 'update'])->name('admin.background.update');
|
|
||||||
Route::delete('/admin/background', [App\Http\Controllers\Admin\SiteBackgroundController::class, 'delete'])->name('admin.background.delete');
|
|
||||||
|
|
||||||
// Release
|
|
||||||
Route::get('/admin/release', [App\Http\Controllers\Admin\ReleaseController::class, 'index'])->name('admin.upload.index');
|
|
||||||
Route::post('/admin/release/upload', [App\Http\Controllers\Admin\ReleaseController::class, 'store'])->name('admin.upload');
|
|
||||||
|
|
||||||
// Episode
|
|
||||||
Route::post('/admin/episode/upload', [App\Http\Controllers\Admin\EpisodeController::class, 'store'])->name('admin.upload.episode');
|
|
||||||
Route::post('/admin/episode/edit', [App\Http\Controllers\Admin\EpisodeController::class, 'update'])->name('admin.edit');
|
|
||||||
|
|
||||||
// Get Tags used for Upload Form
|
|
||||||
Route::get('/admin/tags', [AdminApiController::class, 'getTags'])->name('admin.tags');
|
|
||||||
Route::get('/admin/studios', [AdminApiController::class, 'getStudios'])->name('admin.studios');
|
|
||||||
|
|
||||||
// Get Tags for editing Episode
|
|
||||||
Route::get('/admin/tags/{episode_id}', [AdminApiController::class, 'getEpisodeTags'])->name('admin.tags.episode');
|
|
||||||
Route::get('/admin/studio/{episode_id}', [AdminApiController::class, 'getEpisodeStudio'])->name('admin.studio.episode');
|
|
||||||
|
|
||||||
// Subtitles
|
|
||||||
Route::get('/admin/subtitles/{episode_id}', [AdminApiController::class, 'getSubtitles'])->name('admin.subtitles');
|
|
||||||
Route::post('/admin/add-new-subtitle', [App\Http\Controllers\Admin\SubtitleController::class, 'store'])->name('admin.add.new.subtitle');
|
|
||||||
Route::post('/admin/update-subtitles', [App\Http\Controllers\Admin\SubtitleController::class, 'update'])->name('admin.update.subtitles');
|
|
||||||
});
|
|
||||||
|
|
||||||
require __DIR__.'/auth.php';
|
require __DIR__.'/auth.php';
|
||||||
|
|||||||
Reference in New Issue
Block a user