[BREAKGLASS] A server building plugins for BTCPay Server https://plugin-builder.btcpayserver.org
Go to file
r1ckstardev 3836fe6b38 BTCMaps v2: add btcmap import-RPC submit path alongside directory submission
Adds a second downstream lane to /apis/btcmaps/v1/submit that forwards
the merchant payload to teambtcmap/btcmap-api's submit_place RPC
(merged 2026-05-24 in teambtcmap/btcmap-api#91).

Request schema:

- New fields Lat, Lon, Category, ExternalId on BtcMapsSubmitRequest,
  required iff SubmitToBtcMap=true. Validator enforces lat/lon
  ranges, lowercase-identifier category, and 1-200 char external_id.
  Plugin side (rollforsats/BTCPayServerPlugins) composes external_id
  as hostname:storeId so the namespace stays unique per BTCPay
  instance.
- New SubmitToDirectory + SubmitToBtcMap routing flags. The
  directory flag defaults true to preserve existing callers; btcmap
  defaults false so new callers must opt in.
- New Phone field forwarded as OSM Key:phone in extra_fields.

Service layer:

- BtcMapsService.SubmitToBtcMapAsync POSTs a JSON-RPC 2.0 envelope
  ({jsonrpc, method, params, id}) to BTCMAPS:BtcMapImportEndpoint
  (default https://api.btcmap.org/rpc) with method=submit_place,
  origin=btcpayserver, and the merchant payload mapped to the
  documented param shape. Bearer auth from BTCMAPS:BtcMapImportToken.
- Optional fields (website, description, twitter, github, onion,
  phone, country) ride along in extra_fields using OSM tag keys
  (contact:twitter, addr:country, etc.) plus the implicit
  payment:bitcoin=yes marker.
- New BtcMapTokenMissingException parallels the existing
  DirectoryTokenMissingException so the controller can return 503
  with a distinct error code when ops haven't provisioned the
  scoped token yet.

Controller:

- /apis/btcmaps/v1/submit branches on SubmitToDirectory +
  SubmitToBtcMap. At least one must be true (rejected 400 otherwise).
- Each lane has its own exception ladder symmetric to the existing
  directory path: token-missing 503 (directory-not-configured /
  btcmap-not-configured), caller-cancel rethrow, upstream-timeout
  504, generic-failure 502 - error codes namespaced by lane so ops
  can tell them apart.

HttpClient registration:

- New HttpClientNames.BtcMap named client registered with 15s
  per-call timeout and JSON Accept header, matching the
  BtcMapsDirectory budget for bounded worst-case behavior.

Tests:

- 12 new validation tests in BtcMapsServiceTests covering the
  SubmitToBtcMap=true required-field paths (Lat / Lon / Category /
  ExternalId; range checks; lowercase-identifier policy; overlong
  external_id) plus the default-false directory-only-still-works
  baseline. 37/37 BtcMapsServiceTests passing.
2026-05-25 14:45:46 +00:00
.github/workflows chore: add authenticated GitHub client to CI 2026-03-16 02:25:56 -03:00
PluginBuilder BTCMaps v2: add btcmap import-RPC submit path alongside directory submission 2026-05-25 14:45:46 +00:00
PluginBuilder.Tests BTCMaps v2: add btcmap import-RPC submit path alongside directory submission 2026-05-25 14:45:46 +00:00
.coderabbit.yaml chore: add coderabbit config 2025-09-11 17:00:03 -03:00
.dockerignore init 2022-11-08 10:43:22 +09:00
.editorconfig Fixing problem with cshtml files being removed @model string 2026-01-15 23:55:40 -06:00
.gitattributes init 2022-11-08 10:43:22 +09:00
.gitignore init 2022-11-08 10:43:22 +09:00
btcpayserver-plugin-builder.sln Improving playwright GitHub Actions 2025-10-16 09:44:03 -05:00
Cleanup.md Moving PluginNavPages to Component, closer to usage 2025-03-27 23:12:54 -05:00
Dockerfile Bump the builder to dotnet 10.0 2026-03-13 15:32:06 +09:00
README.md Handle local loopback plugin downloads 2026-04-26 12:45:37 -03:00

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 to true, 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 to true, 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}