Render.com phoneixd (#280)

* 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
This commit is contained in:
Michael Bumann 2024-07-19 20:21:33 +03:00 committed by GitHub
parent d58f21b389
commit a137474d09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 50 additions and 0 deletions

View file

@ -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())

View file

@ -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