Skip to content

Commit

Permalink
Merge pull request #92 from Impa10r/v1.7.2
Browse files Browse the repository at this point in the history
v1.7.2
  • Loading branch information
Impa10r authored Oct 8, 2024
2 parents 580af58 + 40746c4 commit 899055f
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 24 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/manual-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ permissions:

on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true

jobs:
build:
Expand Down Expand Up @@ -32,7 +36,7 @@ jobs:
run: |
docker buildx build \
--platform linux/arm64,linux/amd64 \
--tag ghcr.io/impa10r/peerswap-web:v1.6.6 \
--tag ghcr.io/impa10r/peerswap-web:${{ github.event.inputs.version }} \
--tag ghcr.io/impa10r/peerswap-web:latest \
--output "type=registry" \
.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Versions

## 1.7.2

- Ignore inline comments in peerswap.conf
- Fix Docker building

## 1.7.1

- CLN: Fix compile bug
Expand Down
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ WORKDIR /app

COPY . .

RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /go/bin/psweb cmd/psweb/*.go
RUN git clone https://github.com/ElementsProject/peerswap.git && cd peerswap && git checkout $COMMIT
RUN cd peerswap && make -j$(nproc) lnd-release
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make -j$(nproc) install-lnd && \
git clone https://github.com/ElementsProject/peerswap.git && \
cd peerswap && \
git checkout $COMMIT && \
make -j$(nproc) lnd-release

FROM debian:buster-slim

RUN sed -i 's|$|deb http://deb.debian.org/debian buster main contrib non-free|' /etc/apt/sources.list
RUN apt-get update
RUN sed -i 's|$|deb http://deb.debian.org/debian buster main contrib non-free|' /etc/apt/sources.list && \
apt-get update && apt-get install -y supervisor ca-certificates && \
mkdir -p /var/log/supervisor

RUN apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN apt-get install -y ca-certificates

COPY --from=builder /go/bin/* /bin/

RUN useradd -rm -s /bin/bash -u 1000 -U peerswap
Expand Down
4 changes: 3 additions & 1 deletion cmd/psweb/config/cln.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ func GetPeerswapCLNSetting(section, searchVariable string) string {
}
if parts := strings.Split(line, "="); len(parts) > 1 {
if parts[0] == searchVariable {
// ignore inline comments
value := strings.TrimSpace(strings.Split(parts[1], "#")[0])
// Remove double quotes
return strings.ReplaceAll(strings.TrimSpace(parts[1]), `"`, "")
return strings.ReplaceAll(value, `"`, "")
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/psweb/config/lnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ func getConfSetting(searchVariable, filePath string) string {
for _, line := range lines {
if parts := strings.Split(line, "="); len(parts) > 1 {
if parts[0] == searchVariable {
return strings.TrimSpace(parts[1])
// ignore inline comments
return strings.TrimSpace(strings.Split(parts[1], "#")[0])
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/psweb/main-cln.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ var plugin *glightning.Plugin

// This is called after the plugin starts up successfully
func onInit(plugin *glightning.Plugin, options map[string]glightning.Option, conf *glightning.Config) {
//time.Sleep(20 * time.Second)
// set logging params
_, err := setLogging(filepath.Join(conf.LightningDir, "peerswap", "psweb.log"))
if err != nil {
Expand Down Expand Up @@ -53,7 +52,7 @@ func main() {

if *showHelp {
fmt.Println("A lightweight Web UI plugin for PeerSwap CLN")
fmt.Println("Usage: add 'plugin=/path/to/psweb' to your ~/lightning/config")
fmt.Println("Usage: add 'plugin=/path/to/psweb' to your ~/.lightning/config")
os.Exit(0)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/psweb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (

const (
// App VERSION tag
VERSION = "v1.7.1"
VERSION = "v1.7.2"
// Swap Out reserves are hardcoded here:
// https://github.com/ElementsProject/peerswap/blob/c77a82913d7898d0d3b7c83e4a990abf54bd97e5/peerswaprpc/server.go#L105
SWAP_OUT_CHANNEL_RESERVE = 5000
Expand Down
8 changes: 1 addition & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ module peerswap-web

go 1.21.5

// local
// replace github.com/elementsproject/glightning => ../glightning

// temporary forked
replace github.com/elementsproject/glightning => github.com/impa10r/glightning v0.0.0-20240908125131-efaaf78adc9f

// peerswap uses go-elements v0.4.0 which is not compatible with lnd v0.18
// until they upgrade, I link to a compatible version in my repository
replace github.com/vulpemventures/go-elements => github.com/impa10r/go-elements v0.5.4-0.20240428143053-2c0646844473
Expand All @@ -23,7 +17,7 @@ require (
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/btcsuite/btcd/btcutil/psbt v1.1.8
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/elementsproject/glightning v0.0.0-20240224063423-55240d61b52a
github.com/elementsproject/glightning v0.0.0-20240910115322-5c07410a8494
github.com/elementsproject/peerswap v0.2.98-0.20240802020201-5935fb465630
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
github.com/gorilla/mux v1.8.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/elementsproject/glightning v0.0.0-20240910115322-5c07410a8494 h1:BI49zLZEXWIvWO2E5Z4cP/TQRfJS6BZzamjT0fD8uEo=
github.com/elementsproject/glightning v0.0.0-20240910115322-5c07410a8494/go.mod h1:YAdIeSyx8VEhDCtEaGOJLmWNpPaQ3x4vYSAj9Vrppdo=
github.com/elementsproject/peerswap v0.2.98-0.20240802020201-5935fb465630 h1:ikQ2e5X0Cdw16+YOkBfyfp/QSp7MnfA9xyw7IGlg6z0=
github.com/elementsproject/peerswap v0.2.98-0.20240802020201-5935fb465630/go.mod h1:QrSJ4zWkBJebDE2rdQ6HUoNtcIDTRvcRZB4JWnewnAU=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
Expand Down Expand Up @@ -348,8 +350,6 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/impa10r/glightning v0.0.0-20240908125131-efaaf78adc9f h1:zc4hk6NUFLzWLltACeGyAjChDUGErRy+cqg6oPcDcas=
github.com/impa10r/glightning v0.0.0-20240908125131-efaaf78adc9f/go.mod h1:YAdIeSyx8VEhDCtEaGOJLmWNpPaQ3x4vYSAj9Vrppdo=
github.com/impa10r/go-elements v0.5.4-0.20240428143053-2c0646844473 h1:ZHN0zlcisieLT4imBmU1NwLBN2NgVrfiGgSioIzewEs=
github.com/impa10r/go-elements v0.5.4-0.20240428143053-2c0646844473/go.mod h1:jwWX8Ka2IHv8l/vZeS6FQvZEEFta5yCf5Ra8n4BwoVs=
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
Expand Down

0 comments on commit 899055f

Please sign in to comment.