Skip to content

Commit

Permalink
Merge pull request #25 from stakwork/fix/mqtt-resub
Browse files Browse the repository at this point in the history
Fix/mqtt resub
  • Loading branch information
kevkevinpal committed Jun 26, 2023
2 parents c874ab1 + 2f0f5f9 commit ffc563c
Show file tree
Hide file tree
Showing 167 changed files with 3,239 additions and 1,009 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/cln_proxy_integration_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: CLN Proxy Integration Test
on:
pull_request:
branches:
- master

jobs:
integration-test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
test-name:
[
'boostPayment',
'botCreation',
'chatPayment',
'chatInvoice',
'contacts',
'images',
'latestTest',
'lsats',
'paidMeet',
'paidTribeImages',
'queryRoutes',
'self',
'sphinxPeople',
'streamPayment',
'tribe',
'tribe3Escrow',
'tribe3Messages',
'tribe3Private',
'tribe3Profile',
'tribeEdit',
'tribeImages',
'messageLength',
'transportToken',
'pinnedMsg',
'hmac',
'socketIO',
'tribeMember',
'actionHistory',
'silentTribeBotMsg',
'kickBot',
'invoices',
'boostFail',
'deleteMessages',
'boostFail',
'sphinxAuth',
]
node: [16]
steps:
- name: Enable docker.host.internal for Ubuntu
run: |
pwd && sudo bash -c 'echo "172.17.0.1 host.docker.internal" >> /etc/hosts'
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: relay
- uses: actions/setup-node@v3
with:
node-version: ${{matrix.node}}
- name: Build Relay
working-directory: ./relay
run: |
npm install && npm run build && docker build -t sphinxlightning/sphinx-relay .
- name: Checkout stack
run: |
git clone -b update/swarm-image https://github.com/stakwork/sphinx-stack.git stack
- name: give permissions
working-directory: ./stack
run: |
chmod 777 ./bitcoind;
chmod 777 -R ./relay;
chmod 777 -R ./lnd;
chmod 777 -R ./proxy;
chmod 777 -R ./cln;
- name: Check for NODES.json
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: |
GITACTION_ENV=gitactionenv docker-compose -f ./stack/alts/cln-proxy.yml --project-dir ./stack up -d;
sleep 240;
docker ps
docker logs meme.sphinx
docker logs dave.sphinx
docker wait stack_relaysetup_1
cat stack/relay/NODES.json;
- name: copy file
uses: canastro/copy-file-action@master
with:
source: 'stack/relay/NODES.json'
target: 'relay/src/tests/configs/nodes.json'
- name: Run tests
working-directory: ./relay
run: npx ava src/tests/controllers/${{matrix.test-name}}.test.ts --verbose --serial --timeout=2m
8 changes: 7 additions & 1 deletion .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
'actionHistory',
'silentTribeBotMsg',
'kickBot',
'invoices',
'boostFail',
'deleteMessages',
'boostFail',
'sphinxAuth',
]
node: [16]
steps:
Expand All @@ -61,14 +66,15 @@ jobs:
npm install && npm run build && docker build -t sphinxlightning/sphinx-relay .
- name: Checkout stack
run: |
git clone https://github.com/stakwork/sphinx-stack.git stack
git clone -b update/proxy-tag https://github.com/stakwork/sphinx-stack.git stack
- name: give permissions
working-directory: ./stack
run: |
chmod 777 ./bitcoind;
chmod 777 -R ./relay;
chmod 777 -R ./lnd;
chmod 777 -R ./proxy;
chmod 777 -R ./cln;
- name: Check for NODES.json
uses: nick-fields/retry@v2
with:
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/issue_closed.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/issue_opened.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/lint_format_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
git commit -m 'Lint and format code' || echo -n
git push
npm run build
git add dist
git add dist --force
git commit -m 'Automatic build' || echo -n
git push
bash grpc_gen_types.sh
npm run build
git add src/grpc/types src/grpc/proto.ts dist
git add src/grpc/types src/grpc/proto.ts dist --force
git commit -m 'Update proto files and types' || echo -n
git push
22 changes: 0 additions & 22 deletions .github/workflows/release.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/update.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sphinx.db
binaries/nodeapp-macos
binaries/nodeapp-alpine

dist
dist/public/uploads

dist/config/app.json
Expand Down Expand Up @@ -45,4 +46,4 @@ src/tests/configs/*
src/tests/configs/nodes.json
.idea/
coverage/
testing/stack2
testing/stack2
8 changes: 8 additions & 0 deletions app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,18 @@ async function finishSetup() {
setupDone()
}

//
function setupApp() {
return new Promise(async (resolve) => {
const app = express()

if (config.rate_limit_trust_proxy) {
const rate_limit_trust_proxy = parseInt(config.rate_limit_trust_proxy)
if (rate_limit_trust_proxy > 0) {
app.set('trust proxy', rate_limit_trust_proxy)
}
}

app.use(helmet())
app.use(
express.json({
Expand Down
7 changes: 7 additions & 0 deletions dist/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/app.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ffc563c

Please sign in to comment.