Skip to content

About

Sell FeatherPanel game servers, VDS and web hosting from Paymenter: create, suspend, upgrade and terminate automatically!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

FeatherPanel extension for Paymenter

Requires FeatherPanel v1.5.6 or newer.

Sells FeatherPanel products from Paymenter v1.x:

Product type What gets created in FeatherPanel
game Game server (node/location, realm, spell, allocations, limits, environment variables)
vds VDS / VM instance on a VM node (Proxmox template, memory, CPUs/cores, disk)
web Web hosting WebSpace (web node, webplate, hosting package or custom limits, domain)

Lifecycle: create, suspend, unsuspend, terminate, upgrade/downgrade, test connection. Client area: "Open in FeatherPanel" single sign-on button, live Status and Address (IP:port / VM IP / domain).

Requirements

  • Paymenter v1.x (tested with v1.5.9, PHP 8.3+).
  • FeatherPanel v1.5.6 or newer. Older panels don't have the external-ID lookups for VDS and WebSpaces, or the stored VDS sizes after an upgrade. Game servers also work on v1.5.x.
  • A FeatherPanel admin API key (Admin → API Keys → Create). Treat it like a root password: it can do anything in the panel. Store it only in Paymenter.

Install

  1. Copy extensions/Servers/FeatherPanel/ from this repo into your Paymenter root, so you get extensions/Servers/FeatherPanel/FeatherPanel.php.
  2. Run composer dump-autoload (or php artisan optimize:clear).
  3. Go to Admin → Extensions → Servers → New → FeatherPanel, then fill in the settings:
    • Panel URL: for example https://panel.example.com.
    • API key: stored encrypted.
    • External ID prefix: default paymenter-. FeatherPanel resources get the external id <prefix><service id>. Use a different prefix for each Paymenter install that shares a panel.
    • SSO link lifetime: in minutes.
  4. Click Test connection. This checks the URL and the key (it reads users and locations).

Product settings

Create a product, pick the FeatherPanel server, then choose a Product type. The rest of the form changes with the type, and the selects are loaded live from the panel.

Game server

  • location_ids: a node is picked automatically among non-maintenance nodes in these locations that have enough free allocations. You can pin one with node_id.
  • realm_id, spell_id, docker_image, startup: empty means the spell defaults.
  • memory (MB), swap, disk (MB), cpu (%), io, threads.
  • databases, backups, additional_allocations.
  • environment: a JSON object such as {"MINECRAFT_VERSION":"1.21.4"}. Spell defaults fill anything left out.
  • skip_scripts, oom_killer.

VDS

  • vm_node_id, template_id.
  • memory (MB), cpus (sockets), cores, disk (GB).
  • Optional: storage, bridge, pve_node.
  • backup_limit.
  • ci_user: the cloud-init user. The password is generated and shown to the client.
  • create_wait: how many seconds to wait for the clone.

Web hosting

  • web_node_id, webplate_id.
  • hosting_package_id: when set, the package limits win.
  • Otherwise these limits are used: disk (MB), cpu_limit, memory_limit, bandwidth_limit_gb, database_limit, mailbox_limit.
  • ssl.

Checkout fields

  • web asks the customer for a domain.
  • vds asks for an optional hostname.

Config options / upgrades

  • Any product setting can be overridden by a Paymenter config option with the same key, for example memory, disk or cores.
  • A game spell variable can be overridden by a config option keyed by its env variable, for example MINECRAFT_VERSION.
  • Upgrading or downgrading to another product (or changing config options) PATCHes the panel resource:
    • game: limits plus extra allocations;
    • VDS: memory, CPUs and cores, and the disk only grows;
    • web: limits.

How it behaves

  • Panel user: looked up by the client's exact e-mail. If there is none, a user is created with the client's name and a random password. The client then signs in through the SSO button.
  • Idempotent: every create first looks up <prefix><service id>. A retried or duplicated job reuses the existing resource instead of creating a second one. A VDS that is still cloning is detected (CREATION_IN_PROGRESS) and is not created twice.
  • Suspend: sent with reason "Payment overdue" (FeatherPanel requires a reason). Unsuspend lifts it.
  • Terminate: deletes the resource. If the resource is already gone, terminate succeeds. A VDS that is still being created makes terminate fail so Paymenter retries it.
  • VDS creation: the VDS is created asynchronously. The extension waits up to create_wait seconds and then returns the IP and the cloud-init credentials. If it takes longer, the service is still created and the details appear once the panel finishes.

Tests

  • tests/Feature/FeatherPanel/ holds the unit tests. They mock HTTP with Http::fake, so no panel is needed.
  • tests/E2E/ holds the full lifecycle test against a real FeatherPanel.

See TESTING.md for how to run both.

License

MIT

About

Sell FeatherPanel game servers, VDS and web hosting from Paymenter: create, suspend, upgrade and terminate automatically!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages