Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Charon

Charon is a small Bash CLI for buying a MyNymBox VPS and paying its BTCPay invoice. It has no wallet, daemon, database, package manager, or build step.

It can:

  • create a MyNymBox order with a new or existing account;
  • return the native Cashu NUT-18 request and BOLT11 invoice;
  • relay a caller-supplied Cashu v4 token directly to MyNymBox;
  • report payment status.

Charon never stores credentials, cookies, wallet seeds, balances, or tokens. WHMCS cookies exist only in a temporary directory during order.

Requirements

  • Bash 3.2 or newer
  • curl
  • jq

Install

git clone https://github.com/gudnuf/charon.git
install -m 755 charon/bin/charon ~/.local/bin/charon

Order

The tested default is MyNymBox NL KVM VPS 1: WHMCS product 784, quarterly, with the included IPv4 option.

CHARON_PASSWORD='account password' \
  charon order --email 'alias@example.com' --json

For an existing MyNymBox account:

CHARON_PASSWORD='account password' \
  charon order --existing --email 'alias@example.com' --json

A new account may require email verification before Charon can open its BTCPay invoice. The command returns exit code 68 and the created WHMCS invoice URL in that case. After verification, resume that invoice without creating another order:

CHARON_PASSWORD='account password' \
  charon resume WHMCS_INVOICE_ID --email 'alias@example.com' --json

MyNymBox product IDs and configuration fields are provider internals. Override them only after inspecting the current checkout:

charon order --email 'alias@example.com' \
  --pid 784 --billing-cycle quarterly --ipv4-option 42541

Pay

Inspect an invoice. The argument may be its ID or full BTCPay URL:

charon invoice 'https://pay.mynymbox.io/invoice?id=BTCPAY_ID'
charon bolt11 BTCPAY_ID
charon cashu-request BTCPAY_ID

The default payment path reads one cashuB... token from stdin and submits it to MyNymBox's BTCNutServer endpoint:

cashu send 20958 | charon pay BTCPAY_ID --json

Or read it from a file:

charon pay BTCPAY_ID --token-file ecash.token

The invoice's Cashu amount can be a few sats above its Lightning amount because the receiver includes its processing fee. Size the token to amount_sat from charon invoice, not from the BOLT11 amount.

If direct Cashu payment is not desirable, use the returned BOLT11 with any Lightning wallet or Cashu wallet that supports NUT-05 melt. Charon deliberately does not implement melting.

Security

Ecash is bearer money. Prefer stdin so the token does not appear in shell history or process arguments. Charon pins payment submission to https://pay.mynymbox.io; invoice URLs are parsed only for their ID.

The direct endpoint currently accepts single-mint Cashu v4 tokens. A successful HTTP response means the gateway accepted the token for processing. Check the returned invoice status until it is settled.

Test

Tests use local fixtures and never contact MyNymBox:

bash test/test.sh
shellcheck bin/charon test/test.sh test/mock-bin/curl

Exit codes

Code Meaning
0 Success
64 Invalid input
65 Provider or payment rejection
66 Token file unreadable
68 Email verification required
69 Missing dependency or network failure

Scope

Charon automates ordering and settlement. It does not keep a service ledger, manage SSH keys, provision the VPS, renew service, or destroy service. Those can remain ordinary shell scripts around Charon if they become necessary.

License

MIT

About

Stateless Bash CLI for buying a MyNymBox VPS with Cashu or Lightning

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages