116 Commits

Author SHA1 Message Date
Lance Pioch
4f5e9a6c30 Merge branch 'main' into issue/68
# Conflicts:
#	app/Filament/Resources/NodeResource/RelationManagers/AllocationsRelationManager.php
#	app/Filament/Resources/ServerResource/Pages/CreateServer.php
#	app/Filament/Resources/ServerResource/Pages/EditServer.php
#	app/Filament/Resources/ServerResource/RelationManagers/AllocationsRelationManager.php
#	app/Filament/Resources/UserResource/Pages/EditProfile.php
#	app/Models/Node.php
#	app/Models/Objects/DeploymentObject.php
#	app/Services/Allocations/AssignmentService.php
#	app/Services/Servers/ServerCreationService.php
#	app/Services/Servers/TransferServerService.php
#	pint.json
2024-10-20 15:14:08 -04:00
Lance Pioch
c7a307af6e Enforce return and parameter types 2024-10-19 21:02:49 -04:00
Lance Pioch
5353d38302 Merge branch 'main' into issue/68
# Conflicts:
#	app/Filament/Resources/NodeResource/Pages/CreateNode.php
#	app/Filament/Resources/NodeResource/RelationManagers/AllocationsRelationManager.php
#	app/Filament/Resources/NodeResource/RelationManagers/NodesRelationManager.php
#	app/Filament/Resources/ServerResource/Pages/CreateServer.php
#	app/Filament/Resources/ServerResource/Pages/EditServer.php
#	app/Filament/Resources/ServerResource/Pages/ListServers.php
#	app/Filament/Resources/ServerResource/RelationManagers/AllocationsRelationManager.php
#	app/Filament/Resources/UserResource/RelationManagers/ServersRelationManager.php
#	app/Transformers/Api/Client/ServerTransformer.php
#	composer.lock
#	config/panel.php
2024-10-18 21:18:48 -04: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
Lance Pioch
0a6b846230 Merge branch 'main' into issue/68
# Conflicts:
#	app/Filament/Resources/ServerResource/Pages/CreateServer.php
#	app/Filament/Resources/ServerResource/Pages/EditServer.php
#	app/Filament/Resources/ServerResource/RelationManagers/AllocationsRelationManager.php
#	app/Services/Allocations/AssignmentService.php
#	database/Seeders/eggs/minecraft/egg-bungeecord.json
#	database/Seeders/eggs/minecraft/egg-forge-minecraft.json
#	database/Seeders/eggs/minecraft/egg-paper.json
#	database/Seeders/eggs/minecraft/egg-sponge-sponge-vanilla.json
#	database/Seeders/eggs/minecraft/egg-vanilla-minecraft.json
#	database/Seeders/eggs/rust/egg-rust.json
#	database/Seeders/eggs/source-engine/egg-counter-strike-global-offensive.json
#	database/Seeders/eggs/source-engine/egg-custom-source-engine-game.json
#	database/Seeders/eggs/source-engine/egg-garrys-mod.json
#	database/Seeders/eggs/source-engine/egg-insurgency.json
#	database/Seeders/eggs/source-engine/egg-team-fortress2.json
#	database/Seeders/eggs/voice-servers/egg-mumble-server.json
#	database/Seeders/eggs/voice-servers/egg-teamspeak3-server.json
2024-09-18 22:21:55 -04:00
Boy132
bb7c0e0e66
Add "Delete files" task (#470)
* started "delete files" task

* add logic to DeleteFilesService

* add frontend

* make nicer

* move description to right place
2024-07-10 09:25:15 +02:00
Lance Pioch
45fcc2a09a Merge branch 'main' into issue/68
# Conflicts:
#	app/Filament/Resources/DatabaseHostResource/Pages/CreateDatabaseHost.php
#	app/Filament/Resources/DatabaseHostResource/Pages/EditDatabaseHost.php
#	app/Filament/Resources/ServerResource/Pages/CreateServer.php
#	app/Filament/Resources/ServerResource/Pages/EditServer.php
#	app/Filament/Resources/ServerResource/Pages/ListServers.php
#	app/Http/Requests/Admin/Node/AllocationFormRequest.php
#	app/Http/Requests/Api/Application/Allocations/StoreAllocationRequest.php
#	app/Models/AuditLog.php
#	app/Models/Server.php
2024-06-26 21:52:05 -04:00
MartinOscar
aa08e774a1
Fix varchar(191) by replacing with 255 #135 (#376)
* Add Nullable

* Edit filament & AppServiceProvider

* Pint

* Patch tests

* Actually patching tests

* Actually patching tests

* Remove length

* Remove defaultStringLength

* Let’s see the differences

---------

Co-authored-by: Lance Pioch <git@lance.sh>
2024-06-16 13:56:18 -04:00
Lance Pioch
36e2fa8e2b Wip 2024-06-13 11:31:58 -04:00
Boy132
703e5480ff add missing fields to StoreScheduleRequest 2024-05-13 18:55:59 +02:00
Lance Pioch
3cea8ca979 Better static analysis 2024-03-17 12:52:22 -04:00
Lance Pioch
c83dd86a41 Switch namespace back to App 2024-03-12 22:39:16 -04:00
Matthew Penner
1d38b4f0e2
Laravel 10 (#4706) 2023-02-23 12:30:16 -07:00
Devonte W
b746c3ead1
fix(api/client): add validation for backup request body (#4704) 2023-02-23 12:23:12 -07:00
Matthew Penner
2b14e46eec
api: fix sequence_id being ignored in server task API
Closes #4434
2023-01-24 15:57:24 -07:00
Boy132
f2095e815e
Allow users to change the server description (#4420) 2022-10-31 10:20:53 -06:00
Matthew Penner
cbcf62086f
Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
2022-10-14 10:59:20 -06:00
DaneEveritt
7224ca81de
Fix bug preventing the creation of API keys with CIDR ranges 2022-06-18 14:21:20 -04:00
DaneEveritt
c14c7b436e
Pass along new fields to Wings instance when endpoint is used; closes #4048 2022-05-28 13:45:23 -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
a9364061c1
Store keys in standard format; query with fingerprint not public key 2022-05-15 16:41:15 -04:00
DaneEveritt
6554164252
Add test coverage for the SSH key endpoints 2022-05-14 18:08:48 -04:00
DaneEveritt
97280a62a2
Add support for storing SSH keys on user accounts 2022-05-14 17:31:53 -04:00
DaneEveritt
c8faf64059
Support naming docker images on eggs; closes #4052
Bumps PTDL_v1 export images to PTDL_v2, updates the Minecraft specific eggs to use named images.
2022-05-07 17:45:22 -04:00
DaneEveritt
c751ce7f44
Allow more values for remote field when creating a database; closes #3842 2022-05-07 14:17:10 -04:00
Dane Everitt
2b3303c46b
Fix changing a user password to not incorrectly handle logging out old sessions; closes #3531 2021-08-15 17:37:12 -07:00
Dane Everitt
5d5e4ca7b1
Add support for locking backups to prevent any accidental deletions 2021-05-03 21:26:09 -07:00
Dane Everitt
663143de0b
Merge branch 'develop' into dane/restore-backups 2021-01-25 19:16:40 -08:00
Dane Everitt
c449ca5155
Use more standardized phpcs 2021-01-23 12:33:34 -08:00
Dane Everitt
87371901c0
Add base logic to support sending a request to restore a backup for a server 2021-01-17 17:51:09 -08:00
Dane Everitt
087c41d5ac
Add endpoint to pull a remote file down 2020-12-24 09:15:03 -08:00
Dane Everitt
5bbb36b3cf
Support updating docker image for a server from the frontend 2020-12-13 11:07:29 -08:00
Matthew Penner
ac8b7fec28
Merge branch 'develop' into matthewpi/server-details-patch-1 2020-12-06 13:30:56 -07:00
Matthew Penner
f9a1bc6c9b Show installing status instead of offline when a server is installing 2020-12-04 09:48:47 -07:00
Matthew Penner
3e1dbbaedd Fix validation rules for ChmodFilesRequest.php, again.. 2020-12-04 09:24:06 -07:00
Matthew Penner
bd0b7127d2 Fix validation rules for ChmodFilesRequest.php 2020-12-04 09:24:06 -07:00
Matthew Penner
8611ebb2d6 Add /api/client/servers/{server}/files/chmod endpoint 2020-12-04 09:24:06 -07:00
Dane Everitt
7ebe04fb91
Don't allow blank passwords on the password change endpoint; closes #2750 2020-11-29 13:28:46 -08:00
Dane Everitt
665a4dd8a4
Merge branch 'develop' into develop 2020-10-31 13:47:12 -07:00
Dane Everitt
e7c64bc60e
Add test coverage for schedule execution 2020-10-14 21:06:27 -07:00
Dane Everitt
c1ee0ac4f8
Add support for executing a scheduled task right now 2020-10-14 20:38:59 -07:00
Caleb
ea778e9345
Merge branch 'develop' into develop 2020-10-13 15:35:38 -04:00
Dane Everitt
8697185900
Fix up database creation and handling code for servers; ref #2447 2020-10-11 11:59:46 -07:00
Dane Everitt
a4d7170fac
Don't allow creation of a database with an identical name for the same server; closes #2447 2020-10-10 18:17:04 -07:00
Dane Everitt
1f7fe093ae
Correctly validate description for API keys to match model expectations; closes #2457 2020-10-10 17:15:30 -07:00
Dane Everitt
d8228f2da8
Allow passing empty values through for variables, covers with test, closes #2433 2020-10-10 16:45:24 -07:00
Caleb
8f8bd0be83 Added Automatic Allocations
Known issues:
- Port range to auto create is hard coded
- React interface is still a WIP.
2020-09-28 11:50:34 -04:00
Dane Everitt
cc6f98c0fd
Replace all instances of 255 as a max length with 191; ref #2421 2020-09-26 16:29:26 -07:00
Dane Everitt
c0fc9125ed
Fix database naming conventions; closes #2404 2020-09-24 19:31:42 -07:00
Dane Everitt
6a4914df3b
Properly validate schedule names; closes #2405 2020-09-24 19:25:34 -07:00