30 Commits

Author SHA1 Message Date
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
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
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
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
b4532d9d10 Use more fluent methods 2024-03-19 16:47:52 -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
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
65f27d41a2
Switch to more recent Laravel route definition methods 2022-05-14 15:51:05 -04:00
Dane Everitt
ff21d83e2d
Add endpoint to get all nodes meeting memory & disk requirements for a server; closes #1012 2021-01-10 13:08:43 -08:00
Dane Everitt
fda88940f7
Fix up node autodeployment 2020-04-12 17:20:09 -07:00
Dane Everitt
34ffcdae7a
Remove unnecessary API calls to daemon 2019-12-22 13:45:40 -08:00
Dane Everitt
fb1b2406b5
Add API endpoint to get a server by external ID 2018-02-24 14:09:09 -06:00
Dane Everitt
a9c1946319
Add support for finding a user by external ID. 2018-02-07 21:56:11 -06:00
Dane Everitt
2ec76d283b
Fix bad API behavior 2018-02-04 15:38:38 -06:00
Dane Everitt
c599112021
Finalize server management API 2018-01-30 20:36:59 -06:00
Dane Everitt
5ed164e13e
Implement server creation though the API.
Also implements auto-deployment to specific locations and ports.
2018-01-28 17:14:14 -06:00
Dane Everitt
8afced3410
Add nests & eggs
Cleanup middleware handling and parameters on controllers...
2018-01-27 12:38:56 -06:00
Dane Everitt
de07b3cc7f
Add server database management support to API. 2018-01-25 22:34:53 -06:00
Dane Everitt
2bd691efad
Add database list endpoint, add more resource name magic 2018-01-25 21:26:06 -06:00
Dane Everitt
aca0819bcd
Add server build management to API 2018-01-21 16:02:03 -06:00
Dane Everitt
17f6f3eeb6
Add server details modification endpoint to API. 2018-01-20 16:03:23 -06:00
Dane Everitt
3e327b8b0e
Use more logical route binding to not reveal resources on the API unless authenticated. 2018-01-20 15:33:04 -06:00
Dane Everitt
17544481b5
More server management via the API 2018-01-20 13:48:02 -06:00
Dane Everitt
3724559468
Forgotten changes 2018-01-19 21:48:26 -06:00
Dane Everitt
a497a3d153
Make server listing and single server view API endpoints work 2018-01-19 21:47:06 -06:00
Dane Everitt
0e7f8cedf0
Reorganize API files 2018-01-19 19:58:57 -06:00