305 Commits

Author SHA1 Message Date
MartinOscar
9aaf6b3798
Make redirect & callback public instead of private as required by Laravel 12 (#1081) 2025-03-12 19:32:16 +01:00
Lance Pioch
82409f2fba
Laravel 12.x Shift (#1045)
* Convert route options to fluent methods

Laravel 8 adopts the tuple syntax for controller actions. Since the old options array is incompatible with this syntax, Shift converted them to use modern, fluent methods.

* Slim `lang` files

* Shift core files

* Validate via object directly within Controllers

* Use `Gate` facade for controller authorization

* Dispatch jobs directly

* Remove base controller inheritance

* Default config files

In an effort to make upgrading the constantly changing config files easier, Shift defaulted them and merged your true customizations - where ENV variables may not be used.

* Set new `ENV` variables

* Add new Laravel `composer run dev` script

* Add `storage/app/private` folder

* Bump Composer dependencies

* Convert `$casts` property to method

* Adopt Laravel type hints

* Shift cleanup

* Apply suggestions from code review

Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com>

* Add old key as backup

* Update composer

* Remove extra line

* Update this

---------

Co-authored-by: Shift <shift@laravelshift.com>
Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com>
2025-03-03 14:41:00 -05:00
Boy132
e1308cb04d
Small api docs improvements (#1032)
* update scramble

* cleanup application api endpoints

* cleanup client api endpoints

* fix security schema and make docs homepage nicer

* remove duplicate myclabs/deep-copy

* style(api-docs): use Blade template and Tailwind for styling

* Publish scramble view

* Use localStorage theme instead of config

* Update routes/docs.php

Co-authored-by: Lance Pioch <git@lance.sh>

---------

Co-authored-by: Quinten <67589015+QuintenQVD0@users.noreply.github.com>
Co-authored-by: RMartinOscar <40749467+RMartinOscar@users.noreply.github.com>
Co-authored-by: Lance Pioch <git@lance.sh>
2025-02-26 16:12:19 +01:00
Lance Pioch
635cc6a029
Add PHP 8.4 Support (#858)
* Add php 8.4

* Update ide helper

* Add php 8.4

* Update laravel sanctum

* Update laravel framework

* Hash rounds were increased

* This is always false

* Extend model now

* This does nothing

* Move model validation methods to trait

* Remove base model

* Backup routes were previously referenced by uuids

* Remove commented code

* Upgrade laravel/framework

* Fix migration

* Update ide helper

* Update sanctum

* Add version to composer

* Add this back in, fixed

* Make this protected to be safer
2025-01-30 16:39:00 -05:00
Lance Pioch
ad1a9cd33f
Update phpstan to latest (#804)
* Fix these

* Update phpstan

* Transform these into their identifiers instead

* Fix custom rule

* License is wrong

* Update these

* Pint fixes

* Fix this

* Consolidate these

* Never supported PHP 7

* Better evaluation

* Fixes

* Don’t need ignore

* Replace trait with service

* Subusers are simply the many to many relationship between Servers and Users

* Adjust to remove ignores

* Use new query builder instead!

* wip

* Update composer

* Quick fixes

* Use realtime facade

* Small fixes

* Convert to static to avoid new

* Update to statics

* Don’t modify protected properties directly

* Run pint

* Change to correct method

* Give up and use the facade

* Make sure this route is available

* Filament hasn’t been loaded yet

* This can be readonly

* Typehint

* These are no longer used

* Quick fixes

* Need doc block help

* Always true

* We use caddy with docker

* Pint

* Fix phpstan issues

* Remove unused import

---------

Co-authored-by: MartinOscar <40749467+RMartinOscar@users.noreply.github.com>
2025-01-16 14:53:50 -05:00
Scai
98ebc75965 fix: wrong class used on auth 2025-01-06 20:06:17 +02:00
Scai
8049ef462e refactor: revert oauth routes 2025-01-06 20:01:29 +02:00
Scai
cdd46de274 chore: clean base routes 2025-01-06 15:38:44 +02:00
Scai
ff5812e87b chore: remove old auth 2025-01-06 15:38:04 +02:00
Boy132
8358e410dc
Move installer to correct namespace (#795) 2024-12-08 19:57:00 +01:00
Boy132
b208835ed4
Add Oauth frontend and backend improvements (#718)
* better oauth provider loading

* add auth frontend

* add configs for all default providers

* add more default providers

* add env variables to enable oauth providers

* small refactor to link/ unlink routes

* add oauth tab to (admin) profile

* use redirects instead of exceptions

* add notification if no oauth user is found

* use import in config

* remove whmcs provider

* replace hardcoded links with `route`

* redirect to account page on unlink

* remove unnecessary controller and handle linking/ unlinking in action

* only show oauth tab if at least one oauth provider is enabled
2024-11-30 17:38:38 +01:00
Lance Pioch
6125b07afa
Remove old admin area (#648)
* Remove old admin

* Remove controller test

* Remove unused exceptions

* Remove unused files

* More small tweaks

* Fix doc block

* Remove unused service

* Restore these

* Add back autoDeploy

* Revert "Add back autoDeploy"

This reverts commit 630c1e08acf8056ce8e612f376fcd00c23d90aea.

* Add these back

* Add back exception

* Remove ApiController again

---------

Co-authored-by: RMartinOscar <40749467+RMartinOscar@users.noreply.github.com>
Co-authored-by: Boy132 <mail@boy132.de>
Co-authored-by: notCharles <charles@pelican.dev>
2024-11-13 17:05:48 -05:00
Boy132
3ec90264bd
Update API for roles (#611)
* remove `guard_name` from api and add id to transformer

* disallow update/ delete for root admin role via api

* disallow assigning root admin via api

* add api to remove user roles

* fix assignRoles & removeRoles
2024-10-08 23:46:28 +02:00
Boy132
fc643f57f9
Admin Roles (#502)
* add spatie/permissions

* add policies

* add role resource

* add root admin role handling

* replace some "root_admin" with function

* add model specific permissions

* make permission selection nicer

* fix user creation

* fix tests

* add back subuser checks in server policy

* add custom model for role

* assign new users to role if root_admin is set

* add api for roles

* fix phpstan

* add permissions for settings page

* remove "restore" and "forceDelete" permissions

* add user count to list

* prevent deletion if role has users

* update user list

* fix server policy

* remove old `root_admin` column

* small refactor

* fix tests

* forgot can checks here

* forgot use

* disable editing own roles & disable assigning root admin

* don't allow to rename root admin role

* remove php bombing exception handler

* fix role assignment when creating a user

* fix disableOptionWhen

* fix missing `root_admin` attribute on react frontend

* add permission check for bulk delete

* rename viewAny to viewList

* improve canAccessPanel check

* fix admin not displaying for non-root admins

* make sure non root admins can't edit root admins

* fix import

* fix settings page permission check

* fix server permissions for non-subusers

* fix settings page permission check v2

* small cleanup

* cleanup config file

* move consts from resouce into enum & model

* Update database/migrations/2024_08_01_114538_remove_root_admin_column.php

Co-authored-by: Lance Pioch <lancepioch@gmail.com>

* fix config

* fix phpstan

* fix phpstan 2.0

---------

Co-authored-by: Lance Pioch <lancepioch@gmail.com>
2024-09-21 12:27:41 +02:00
Boy132
496eaaaf83
Web Installer (#504)
* simplify setup command

* add installer page

* add route for installer

* adjust gitignore

* set colors globally

* add "unsaved data changes" alert

* add helper method to check if panel is installed

* make nicer

* redis username isn't required

* bring back db settings command

* store current date in "installed" file

* only redirect if install was successfull

* remove fpm requirement

* change "installed" marker to env variable

* improve requirements step

* add commands to change cache, queue or session drivers respectively

* removed `grouped` for better mobile view
2024-08-03 21:13:17 +02:00
Boy132
a58e159478
Settings page (#486)
* remove old settings stuff

* add basic settings page

* add some settings

* add "test mail" button

* fix mail fields not updating

* fix phpstan

* fix default for "top navigation"

* force toggle buttons to be bool

* force toggle to be bool

* add class to view to allow customization

* add mailgun settings

* add notification settings

* add timeout settings

* organize tabs into sub-functions

* add more settings

* add backup settings

* add sections to mail settings

* add setting for trusted_proxies

* fix unsaved data alert not showing

* fix clear action

* Fix clear action v2

TagsInput expects an array, not a string, fails on saving when using `''`

* Add App favicon

* Remove defaults, collapse misc sections

* Move Save btn, Add API rate limit

* small cleanup

---------

Co-authored-by: notCharles <charles@pelican.dev>
2024-07-29 12:14:24 +02:00
Boy132
7813b6060c
Make oauth nullable & remove middleware from oauth callback (#418)
* make oauth nullable

* fix oauth callback middleware
2024-06-18 22:05:08 +02:00
Boy132
5a3c606627
Add OAuth backend (#386)
* add socialite backend

* fix redirect url

* small cleanup

* fix "oauth" type

* changes from review
2024-06-13 21:06:31 +02:00
Boy132
b1f99ca8a3
Add api for mounts (#160)
* add application api endpoints for mounts

* run pint

* add mounts resource to api key

* add includes to mount transformer

* forgot delete route for mount itself

* add migration for "r_mounts" column

* add mounts to testcase api key
2024-05-19 08:50:15 -07:00
Lance Pioch
91a3bb969e Better scrambling to fix #235 2024-05-16 00:23:29 -04:00
Boy132
6bdd1b3ccb
Add api for server transfers (#153)
* add application api endpoint to start server transfer

* add basics for "cancel transfer" endpoint

* wire up wings cancel

* lint
2024-05-15 07:37:56 -07:00
Boy132
afd9f2eb0e
Add api for database hosts (#159)
* add application api endpoints for database hosts

* run pint

* forgot to lint this one

* Update app/Http/Controllers/Api/Application/DatabaseHosts/DatabaseHostController.php

Co-authored-by: Devonte W <devnote.dev75@gmail.com>

* Update routes/api-application.php

Co-authored-by: Devonte W <devnote.dev75@gmail.com>

* rename all "databaseHost" to "database_host"

---------

Co-authored-by: Devonte W <devnote.dev75@gmail.com>
2024-05-15 07:37:38 -07:00
Lance Pioch
2beb12c04f Swap over routes 2024-05-11 20:50:10 -04:00
Lance Pioch
871e93a38c Add scramble api docs 2024-05-11 17:38:44 -04:00
Lance Pioch
17787fee18 Forbid built in webserver due to unresolvable issues 2024-05-04 13:12:33 -04:00
Lance Pioch
5d2248ab1f Implement container statuses from wings 2024-04-29 14:29:04 -04:00
Lance Pioch
eb5c304f69 Remove these mount usages 2024-03-28 13:29:24 -04:00
Lance Pioch
0d2e63f590 Better route model binding 2024-03-22 21:32:12 -04:00
Lance Pioch
3d740907db This is no longer needed 2024-03-20 03:02:35 -04:00
Lance Pioch
b4532d9d10 Use more fluent methods 2024-03-19 16:47:52 -04:00
Lance Pioch
2aa9be62a1 Use route model binding 2024-03-17 20:57:06 -04:00
Lance Pioch
e4cee4d69d Remove locations 2024-03-14 02:23:30 -04:00
Lance Pioch
a296084d6e Remove nests 2024-03-14 01:27:50 -04:00
Lance Pioch
c83dd86a41 Switch namespace back to App 2024-03-12 22:39:16 -04:00
Matthew Penner
794248d4d7
routes: fix imports 2022-12-01 11:51:26 -07:00
DaneEveritt
1eee55b27c
Add endpoint needed for recieving and processing activity 2022-07-09 17:45:38 -04:00
DaneEveritt
92c1c162af
Code cleanup for facades 2022-06-18 12:07:32 -04:00
DaneEveritt
2f1c8ae91d
Add basic server activity log view 2022-06-12 15:16:48 -04:00
DaneEveritt
986c375052
Improve support for use of i18next; rely on browser caching to keep things simple 2022-06-11 14:04:09 -04:00
DaneEveritt
03a497fb8a
Use a post request to delete SSH keys, some hashes use slashes which cause 404 errors; closes #4100 2022-05-30 17:28:42 -04:00
DaneEveritt
4213775b5c
Fix mounting behavior to work correctly when adding to a server 2022-05-30 11:33:42 -04:00
DaneEveritt
a5521ecb79
Add support for returning transforming activity logs on the front-end 2022-05-29 20:34:48 -04:00
DaneEveritt
287fd60891
Log activity when modifying account details 2022-05-29 18:48:35 -04:00
DaneEveritt
cbecfff6da
Add activity logging for files 2022-05-29 13:56:39 -04:00
DaneEveritt
8605d175d6
Ensure admin endpoints continue to work 2022-05-22 18:56:22 -04:00
DaneEveritt
e313dff674
Massively simplify API binding logic
Changes the API internals to use normal Laravel binding which automatically supports nested-models and can determine their relationships. This removes a lot of confusingly complex internal logic and replaces it with standard Laravel code.

This also removes a deprecated "getModel" method and fully replaces it with a "parameter" method that does stricter type-checking.
2022-05-22 14:10:01 -04:00
DaneEveritt
97280a62a2
Add support for storing SSH keys on user accounts 2022-05-14 17:31:53 -04:00
DaneEveritt
65f27d41a2
Switch to more recent Laravel route definition methods 2022-05-14 15:51:05 -04:00
Dane Everitt
bf9cbe2c6d
Add consistent CSRF token verification to API endpoints; address security concern with non-CSRF protected endpoints 2021-11-16 20:02:18 -08:00
Dane Everitt
45999ba4ee
(security) use POST for logout rather than GET
see https://github.com/pterodactyl/panel/security/advisories/GHSA-m49f-hcxp-6hm6
2021-10-23 13:00:21 -07:00