Skip to content

Commit

Permalink
Merge branch 'feat/wails-v2' into task-multi-pay
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Jan 25, 2024
2 parents 560b226 + 7cf88fd commit 4b8f608
Show file tree
Hide file tree
Showing 150 changed files with 6,826 additions and 5,309 deletions.
6 changes: 6 additions & 0 deletions .do/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: nwc
services:
- name: web
github:
repo: getAlby/nostr-wallet-connect
branch: server-self-host
20 changes: 20 additions & 0 deletions .do/deploy.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
spec:
name: nwc
services:
- name: web
git:
branch: server-self-host
repo_clone_url: https://github.com/getAlby/nostr-wallet-connect.git
envs:
- key: RELAY
value: "RELAY=wss://relay.getalby.com/v1"
scope: RUN_TIME
- key: LN_BACKEND_TYPE
value: BREEZ
scope: RUN_TIME
- key: COOKIE_SECRET
scope: RUN_TIME
- key: GREENLIGHT_INVITE_CODE
scope: RUN_TIME
- key: BREEZ_MNEMONIC
scope: RUN_TIME
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
frontend/node_modules
frontend/dist
8 changes: 1 addition & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,4 @@ PORT=8080
#LN_BACKEND_TYPE=LND
#LND_CERT_FILE=/home/YOUR_USERNAME/.polar/networks/1/volumes/lnd/alice/tls.cert
#LND_ADDRESS=127.0.0.1:10001
#LND_MACAROON_FILE=/home/YOUR_USERNAME/.polar/networks/1/volumes/lnd/alice/data/chain/bitcoin/regtest/admin.macaroon

# Alby Wallet API Client
#LN_BACKEND_TYPE=ALBY
#ALBY_CLIENT_SECRET=
#ALBY_CLIENT_ID=
#OAUTH_REDIRECT_URL=http://localhost:8080/alby/callback
#LND_MACAROON_FILE=/home/YOUR_USERNAME/.polar/networks/1/volumes/lnd/alice/data/chain/bitcoin/regtest/admin.macaroon
40 changes: 20 additions & 20 deletions .github/workflows/multiplatform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ jobs:
IMAGENAME: ${{ github.event.repository.name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out code
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: go test
- name: Docker build
uses: mr-smithers-excellent/docker-build-push@v6
id: build
with:
image: ${{ env.IMAGENAME }}
registry: ${{ env.REGISTRY }}
multiPlatform: true
platform: linux/amd64,linux/arm64,linux/386
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
name: Check out code
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: mkdir frontend/dist && touch frontend/dist/tmp && go test
- name: Docker build
uses: mr-smithers-excellent/docker-build-push@v6
id: build
with:
image: ${{ env.IMAGENAME }}
registry: ${{ env.REGISTRY }}
multiPlatform: true
platform: linux/amd64,linux/arm64
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
104 changes: 52 additions & 52 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,55 @@ jobs:
IMAGENAME: ${{ github.event.repository.name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out code
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: go test
- name: Docker build
uses: mr-smithers-excellent/docker-build-push@v6
id: build
with:
image: ${{ env.IMAGENAME }}
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout deployment repo
uses: actions/checkout@v2
with:
repository: getalby/alby-deployment
path: infrastructure
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# Always update dev environment
- name: Update dev environment
if: ${{ github.ref == 'refs/heads/main' }}
uses: fjogeleit/yaml-update-action@v0.7.0
with:
valueFile: 'alby-simnet-deployment/values/nwc.yaml'
propertyPath: 'nwc.image.tag'
value: ${{ steps.build.outputs.tags }}
repository: getalby/alby-deployment
branch: main
createPR: false
message: 'CD: Update nwc tag to ${{ steps.build.outputs.tags }}'
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
workDir: infrastructure
# Only update prod environment if this action was triggered by a new tag
- name: Update production environment
if: startsWith(github.ref, 'refs/tags')
uses: fjogeleit/yaml-update-action@v0.7.0
with:
valueFile: 'alby-mainnet-deployment/values.yaml'
propertyPath: 'nwc.image.tag'
value: ${{ steps.build.outputs.tags }}
repository: getalby/alby-deployment
branch: main
createPR: false
message: 'CD: Update nwc tag to ${{ steps.build.outputs.tags }}'
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
workDir: infrastructure
- uses: actions/checkout@v2
name: Check out code
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: mkdir frontend/dist && touch frontend/dist/tmp && go test
- name: Docker build
uses: mr-smithers-excellent/docker-build-push@v6
id: build
with:
image: ${{ env.IMAGENAME }}
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout deployment repo
uses: actions/checkout@v2
with:
repository: getalby/alby-deployment
path: infrastructure
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# Always update dev environment
- name: Update dev environment
if: ${{ github.ref == 'refs/heads/main' }}
uses: fjogeleit/yaml-update-action@v0.7.0
with:
valueFile: "alby-simnet-deployment/values/nwc.yaml"
propertyPath: "nwc.image.tag"
value: ${{ steps.build.outputs.tags }}
repository: getalby/alby-deployment
branch: main
createPR: false
message: "CD: Update nwc tag to ${{ steps.build.outputs.tags }}"
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
workDir: infrastructure
# Only update prod environment if this action was triggered by a new tag
- name: Update production environment
if: startsWith(github.ref, 'refs/tags')
uses: fjogeleit/yaml-update-action@v0.7.0
with:
valueFile: "alby-mainnet-deployment/values.yaml"
propertyPath: "nwc.image.tag"
value: ${{ steps.build.outputs.tags }}
repository: getalby/alby-deployment
branch: main
createPR: false
message: "CD: Update nwc tag to ${{ steps.build.outputs.tags }}"
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
workDir: infrastructure
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
.DS_Store
.env
.env.local
*.db
*.macaroon
node_modules
nostr-wallet-connect
nwc.db
.breez
.data

frontend/dist
frontend/node_modules
frontend/wailsjs
package.json.md5

build

*.log

# generated by platform-specific files
frontend/src/utils/request.ts
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"editor.defaultFormatter": "golang.go"
}
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[go]": {
"editor.defaultFormatter": "golang.go"
},
"editor.formatOnSave": true,
"go.buildTags": "http,wails"
}
26 changes: 21 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
FROM golang:1.20-alpine as builder
FROM node:18-alpine as frontend
WORKDIR /build
COPY frontend ./frontend
RUN cd frontend && yarn install && yarn build

FROM golang:latest as builder

RUN apt-get update && \
apt-get install -y gcc

ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GOARCH=amd64

# Move to working directory /build
WORKDIR /build
Expand All @@ -11,15 +23,19 @@ RUN go mod download
# Copy the code into the container
COPY . .

# Build the application
RUN go build -o main
# Copy frontend dist files into the container
COPY --from=frontend /build/frontend/dist ./frontend/dist

RUN go build -o main .

# Start a new, final image to reduce size.
FROM alpine as final

# FROM gcr.io/distroless/static-debian11

# USER small-user:small-user

# Copy the binaries and entrypoint from the builder image.
COPY --from=builder /build/main /bin/
COPY --from=builder /build/public /public/
COPY --from=builder /build/views /views/

ENTRYPOINT [ "/bin/main" ]
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bin/main
Loading

0 comments on commit 4b8f608

Please sign in to comment.