[BREAKGLASS] A server building plugins for BTCPay Server
https://plugin-builder.btcpayserver.org
Addresses thgO-O review id 4274558448 (PR #224) items #2 and #3. #2 OperationCanceledException vs HttpClient.Timeout: the prior catch-when filter excluded OCE wholesale to avoid swallowing client disconnects, but HttpClient.Timeout surfaces as TaskCanceledException (inherits from OCE) so an upstream GitHub timeout slipped through and fell out as a 500 instead of the intended 502. Now split into three arms: caller-cancel rethrows (info-log + drop the connection), upstream-timeout returns 504 with discriminant directory-upstream- timeout, anything else still 502 directory-upstream-failed. #3 type/subType case normalization on write: ValidTypes + ValidMerchantSubTypes match OrdinalIgnoreCase at validation, but the write at BuildMerchantEntry preserved the user-submitted casing. A submission of "Merchants" / "Books" would pass validation and land non-canonical in merchants.json. Normalize to ToLowerInvariant on write so the file stays in the lowercase convention. Country is already validated against a case-sensitive Ordinal set so the validator rejects non-uppercase before reaching the writer; no write- path change needed there. |
||
|---|---|---|
| .github/workflows | ||
| PluginBuilder | ||
| PluginBuilder.Tests | ||
| .coderabbit.yaml | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| btcpayserver-plugin-builder.sln | ||
| Cleanup.md | ||
| Dockerfile | ||
| README.md | ||
Introduction
This project hosts a server with a front end which can be used to build BTCPay Server plugins and store the binaries on some storage. You can find our live server on https://plugin-builder.btcpayserver.org/, that is updated through btcpayserver-infra repository.
Prerequisite
It assumes you installed docker on your system.
Configuration
All parameters are configured via environment variables.
PB_POSTGRES: Connection to a postgres database (example:User ID=postgres;Include Error Detail=true;Host=127.0.0.1;Port=61932;Database=btcpayplugin)PB_STORAGE_CONNECTION_STRING: Connection string to azure storage to store build results (example:BlobEndpoint=http://127.0.0.1:32827/satoshi;AccountName=satoshi;AccountKey=Rxb41pUHRe+ibX5XS311tjXpjvu7mVi2xYJvtmq1j2jlUpN+fY/gkzyBMjqwzgj42geXGdYSbPEcu5i5wjSjPw==)PB_CHEAT_MODE: If set totrue, it's considered that the server is running in a development environment and will allow to bypass some security checks (right now only registering admin account).PB_ENABLE_LOCAL_ARTIFACT_DOWNLOAD_PROXY: If set totrue, loopback artifact URLs can be proxied through the API download endpoint for local development.ASPNETCORE_URLS: The url the web server will be listening (example:http://127.0.0.1:8080)PB_DATADIR: Where some persistent data get saved (example:/datadir)
API
Full interactive API documentation is available at /docs on the live server.
The OpenAPI specification is available at /swagger/v1/swagger.json.
Some endpoints require HTTP Basic Auth using your login email and password:
curl --user "email:password" https://plugin-builder.btcpayserver.org/api/v1/plugins/{pluginSlug}/builds/{buildId}