Commit Graph
192 Commits
Author SHA1 Message Date
robert dennis bdf28c1933 node tag includes 2026-10-12 05:18:59 -04:00
robert dennis 4a74b49db0 drop fractal 2026-10-12 05:18:58 -04:00
robert dennis fea87fd8f2 pin api base url 2026-10-12 05:18:57 -04:00
robert dennis 41dc05ec48 admin build rules 2026-10-12 05:18:56 -04:00
robert dennis 56662280a2 openapi fixes 2026-10-12 05:18:55 -04:00
robert dennis 48628b5288 extension error history 2026-10-12 05:18:55 -04:00
robert dennis 1e79399c4b admin backup toggle 2026-10-12 05:18:55 -04:00
robert dennis ab3f169141 docker image validation 2026-10-12 05:18:55 -04:00
robert dennis 17b2091a98 egg import validation 2026-10-12 05:18:55 -04:00
robert dennis e1a9abde2d openapi path params 2026-10-12 05:18:54 -04:00
robert dennis cd5925da87 egg config round trip 2026-10-09 17:34:17 -04:00
Sky Mulleyandrobert dennis 71dd1911a5 Implement native support for hooking into forms with extensions (#7256)
## Problem

Extensions can render content before and after most admin pages, but not
inside the forms on them. The only exception was
`panel.users.detail.form`, and it could only re-render or validate the
user's existing fields. An extension had no way to add a field of its
own, because the Panel's save requests had nowhere to carry the value
and nothing loaded it back.

## Changes

### Slots inside every admin form

The create and edit forms for users, nodes, servers, eggs, locations,
mounts and database hosts each render a slot inside the form, such as
`panel.servers.create.form` and `panel.servers.detail.details.form`. The
slot receives the native `form`, the form's `kind` (`admin.server`), and
`mode` (`'create'` or `'edit'`). Edit slots also receive the saved
`resource`. Contributed `form.AppField` controls share the form's
validation, pending state and submit action.

### Extension-owned fields

An extension registers fields in its provider:

```php
$this->registerFormFields('admin.user', ['plan' => ['required', 'in:free,pro']]);

$this->registerFormFields(
    'admin.node',
    ['region' => ['required', 'string', 'max:32']],
    fn (Node $node): array => ['region' => NodeRegion::for($node)],
    fn (Node $node, array $values) => NodeRegion::store($node, $values['region']),
);
```

The 14 create and update endpoints accept an optional `extensions: {
[extensionId]: { [field]: value } }` body field. Each extension's rules
are applied as `extensions.{id}.{field}`, and only when the request
includes that extension's values. The extension's `save` callback runs
in the same database transaction as the core change, so a failure rolls
both back.

Server creation is the exception. Wings reads the new server while
provisioning it, so extension values are saved after provisioning
succeeds, outside the transaction.

For Node updates when Wings is unreachable. `UpdateNode` saves the node
and then throws `ConfigurationNotPersistedException` as a warning. The
node controller defers that exception until the extension values are
saved, so the node update is no longer rolled back.

`GET /api/admin/extensions/forms/{form}/{id}` returns every extension's
current values. It requires the resource's read permission. Edit pages
fetch it before rendering the form, but only when an extension has
registered fields for that form; the bootstrap payload now lists them
per extension in `forms`.

For users and servers the callbacks are optional, and values are stored
in the extension's scoped settings (`settings()->forUser($user)`,
`forServer($server)`). Values are limited to strings, numbers, booleans,
`null`, or lists of strings and numbers, which keeps the OpenAPI schema
and generated types concrete.

A `load` callback that throws, or returns an invalid value, is recorded
against the extension in the `form` phase. The frontend then hides that
extension's slot contributions on the edit page, so a save cannot
overwrite its stored values with defaults. Fields of a disabled or
failed extension are neither validated, saved nor loaded.

---------

Co-authored-by: robert dennis <31261583+robertdrakedennis@users.noreply.github.com>
2026-10-09 01:26:45 -04:00
robert dennis 135b298560 alpha cleanup 2026-10-08 19:17:30 -04:00
robert dennis e217e42360 complexity cleanup 2026-10-08 18:49:15 -04:00
robert dennis cceaa535b8 lint cleanup 2026-10-08 16:54:59 -04:00
Sky Mulley 173f2da8c3 fix issue where chmod would be refused by wings due to it not being string typed 2026-10-08 09:43:07 +01:00
Sky Mulley dd81db5d4d implement ability to set icon for extensions 2026-10-07 10:46:54 +01:00
robert dennis 7db75f2e4a install handling cleanup 2026-10-06 20:11:59 -04:00
Sky Mulley 76b49b1be1 improve reset password security 2026-10-06 13:13:39 +01:00
Sky Mulley c848794e13 hide recaptcha inputted secret key from settings 2026-10-06 12:57:00 +01:00
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00
Dane Everitt a81c3b4d52 Add support for stripe-style identifiers on existing models with UUIDs (#5548)
This is a partial implementation to begin moving towards stripe-style
identifiers for resources in the system. Any models with an existing
`uuid` column can easily be updated to return an identifier in the
format of `prfx_xyz` where `prfx` is a four character prefix, and `xyz`
is the UUID, encoded using base-32.

These are quite easy to use within the API layer because we just need to
do one quick transformation to extract the UUID for those models. This
PR implements that logic for servers in the `SubstituteClientBindings`
logic.

A future PR will need to come through and handle identifiers for models
that _don't_ currently use UUIDs for reference that we want to expose to
clients. In those cases it is easier to just generate base-32 encoded
UUID7s that get stored in the database and indexed. They follow the same
base approach, but you don't need to do any transformations in the code
(other than stripping the prefix, unless we decide to store the prefix).

There is also now a `PTERODACTYL_USE_SERVER_IDENTIFIERS` environment
variable, that when set to true, updates the front-end and API response
to use this new identifier in place of the `uuidShort` value.
2026-02-14 11:21:57 -08:00
Matthew Penner 8be2b892c3 fix!: use POST instead of DELETE when disabling 2FA
Signed-off-by: Matthew Penner <me@matthewp.io>
2024-10-24 11:27:42 -06:00
Daniel Barton 2ffe019675 ui(server): support for decompressing .7z files (#5016) 2024-05-04 17:16:00 -06:00
Matthew Penner 8abf2d8106 ui(server): fix defaultValue not being used with VariableBox select 2023-10-20 19:30:25 -06:00
Devonte W aea5c474db fix(resources/api): allow svg xml format (#4705) 2023-02-23 12:19:58 -07:00
Matthew Penner fbdac5b63f ui(server): fix reinstall_failed conflict state 2023-01-17 15:21:31 -07:00
Boy132 032e4f2e31 Apply node maintenance mode to servers (#4421) 2022-11-06 16:02:30 -07:00
Boy132 f2095e815e Allow users to change the server description (#4420) 2022-10-31 10:20:53 -06:00
DaneEveritt e040fd1ebd Fix display of database rows when password is not available
closes #4381
2022-09-17 11:50:40 -07:00
DaneEveritt d6c30092ec Utilize a unique ID for activity logs to improve rendering perf 2022-07-10 14:53:29 -04:00
DaneEveritt 26d7d7e0e0 Fix SWR key logic 2022-07-04 18:22:58 -04:00
DaneEveritt d6b6ac6dab Key activity log cache to the server instance, not the user instance. 2022-07-04 18:13:15 -04:00
DaneEveritt 2d836156d2 Update totp disable modal; require password for enable operation 2022-07-03 14:27:37 -04:00
DaneEveritt 4aa163b76f Hide IP addresses from activity logs not generated by the user themselves 2022-06-27 20:52:27 -04:00
DaneEveritt bd278b2688 Fix install warning display and make it reactive 2022-06-27 20:36:24 -04:00
DaneEveritt 80ae600fe1 Correctly update dependencies for release 2022-06-26 17:31:47 -04:00
DaneEveritt dc84af9937 Apply new eslint rules; default to prettier for styling 2022-06-26 15:13:52 -04:00
DaneEveritt 8bd518048e Fix excessive re-rendering due to route changesd 2022-06-20 13:19:40 -04:00
DaneEveritt d47a05881b Show when an event was triggered via the API directly 2022-06-18 12:52:26 -04:00
DaneEveritt 68a654f9e8 Selectively show the additional metadata if it isn't in the display string at all 2022-06-12 15:30:49 -04:00
DaneEveritt 2f1c8ae91d Add basic server activity log view 2022-06-12 15:16:48 -04:00
DaneEveritt 06427f8d13 Don't make two API calls for activity log data 2022-06-11 14:52:33 -04:00
DaneEveritt 0bfba306bf Add filtering support for activity logs 2022-06-05 19:23:25 -04:00
DaneEveritt c6e8b893c8 Add basic activity log view 2022-06-05 18:35:53 -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 a5521ecb79 Add support for returning transforming activity logs on the front-end 2022-05-29 20:34:48 -04:00
DaneEveritt dca53611ff Ensure we don't cause a mess with the auth providers 2022-05-22 18:16:47 -04:00
DaneEveritt 4d3362b24f Perform a bit of code cleanup 2022-05-22 17:23:48 -04:00
DaneEveritt be88e4e893 Ignore migrations, pass credentials 2022-05-22 17:01:39 -04:00