Skip to content

Commit

Permalink
Render.com phoneixd (#280)
Browse files Browse the repository at this point in the history
* chore: default protocol for phoenixd

some environments can only provide the host and port for internal services (e.g. render.com)
in those cases we default to http

* feat: add render.com config for phoneixd deployment

This allows one click deploys to render.com with a phoenixd backend

* Update render.yaml
  • Loading branch information
bumi authored Jul 19, 2024
1 parent d58f21b commit a137474
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lnclient/phoenixd/phoenixd.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ type PhoenixService struct {

func NewPhoenixService(address string, authorization string) (result lnclient.LNClient, err error) {
authorizationBase64 := b64.StdEncoding.EncodeToString([]byte(":" + authorization))
// some environments (e.g. in a cloud environment like render.com) can only get the address and the port but not the protocol
// in those cases we default to http for local requests
if !strings.HasPrefix(address, "http") {
address = "http://" + address
}
phoenixService := &PhoenixService{Address: address, Authorization: authorizationBase64}

info, err := phoenixService.GetInfo(context.Background())
Expand Down
45 changes: 45 additions & 0 deletions scripts/linux-x86_64/phoenixd/render.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
services:
- type: web
runtime: image
name: albyhub
image:
url: ghcr.io/getalby/hub:latest
numInstances: 1
region: frankfurt # Default: oregon
plan: starter
disk:
name: data
mountPath: /data
sizeGB: 2
autoDeploy: false
envVars:
- key: WORK_DIR
value: /data/albyhub
- key: LOG_EVENTS
value: true
- key: LN_BACKEND_TYPE
value: PHOENIX
- key: PHOENIXD_AUTHORIZATION
value: dcf0cf3501c04f97890e3bb3204f94f60d6b99d270cc8c40dfd390cced2f3c11
- key: PHOENIXD_ADDRESS
fromService:
name: phoenixd
type: pserv
property: hostport
- type: pserv
runtime: image
name: phoenixd
image:
url: ghcr.io/sethforprivacy/phoenixd:latest
numInstances: 1
region: frankfurt # Default: oregon
plan: starter
disk:
name: data
mountPath: /data
sizeGB: 2
autoDeploy: false
dockerCommand: /phoenix/bin/phoenixd --agree-to-terms-of-service --http-bind-ip 0.0.0.0 --http-password=dcf0cf3501c04f97890e3bb3204f94f60d6b99d270cc8c40dfd390cced2f3c11
envVars:
- key: PHOENIX_DATADIR
value: /data/phoenixd

0 comments on commit a137474

Please sign in to comment.