Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
738dc64
Merge branch 'mempool:master' into circleci-project-setup (#3)
Dargon789 Jul 3, 2025
d12de74
Update jekyll-docker.yml
Dargon789 Jul 3, 2025
a2f1a62
Merge branch 'mempool:master' into main
Dargon789 Jul 3, 2025
b1c6adc
Create jekyll-gh-pages.yml
Dargon789 Jul 3, 2025
2e40175
Potential fix for code scanning alert no. 46: Workflow does not conta…
Dargon789 Jul 3, 2025
0f3a7c6
Delete .github/workflows/jekyll-docker.yml
Dargon789 Jul 3, 2025
44df19b
Merge branch 'main' into master
Dargon789 Jul 3, 2025
04128f2
Delete .github/workflows/jekyll-docker.yml
Dargon789 Jul 4, 2025
59f9611
ops: Add more mempool servers to elements.conf & ops: Bump elements t…
Dargon789 Jul 4, 2025
ffea486
Merge branch 'mempool:master' into master
Dargon789 Jul 4, 2025
712a47d
Create static.yml
Dargon789 Jul 4, 2025
1baf182
Merge pull request #9 from Dargon789/Dargon789-patch-1
Dargon789 Jul 4, 2025
2a0ce49
Create docker-image.yml
Dargon789 Jul 4, 2025
9c4a40e
Potential fix for code scanning alert no. 47: Workflow does not conta…
Dargon789 Jul 4, 2025
b4ca8de
Update jekyll-gh-pages.yml
Dargon789 Jul 4, 2025
22d9908
Create ci_own.yml
Dargon789 Jul 4, 2025
8408113
Potential fix for code scanning alert no. 48: Workflow does not conta…
Dargon789 Jul 4, 2025
1ec4f74
Update ci.yml (#14)
Dargon789 Jul 5, 2025
cf78641
Update docker-image.yml
Dargon789 Jul 5, 2025
4caed32
Update jekyll-gh-pages.yml
Dargon789 Jul 5, 2025
db3ea5c
Delete .github/workflows/docker-image.yml
Dargon789 Jul 5, 2025
c914071
Create SECURITY.md (#15)
Dargon789 Jul 5, 2025
98b3e59
Create nextjs.yml (#16)
Dargon789 Jul 5, 2025
18e681a
Potential fix for code scanning alert no. 25: Server-side request for…
Dargon789 Jul 5, 2025
82483c7
Create rust.yml
Dargon789 Jul 5, 2025
506c369
Potential fix for code scanning alert no. 50: Workflow does not conta…
Dargon789 Jul 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,5 @@ jobs:
- name: Validate JSON syntax
run: |
cat mempool-config.json | jq
working-directory: docker/docker/backend
working-directory: docker/docker/backend

38 changes: 38 additions & 0 deletions .github/workflows/ci_own.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is a basic workflow to help you get started with Actions

name: CI
permissions:
contents: read

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!

# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
20 changes: 0 additions & 20 deletions .github/workflows/jekyll-docker.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
93 changes: 93 additions & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Deploy Next.js site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v5
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: next
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
25 changes: 25 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Rust

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
43 changes: 43 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
21 changes: 21 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
30 changes: 28 additions & 2 deletions backend/src/api/acceleration/acceleration.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,20 @@ class AccelerationRoutes {
}

private async $getAcceleratorAccelerationsHistoryAggregated(req: Request, res: Response): Promise<void> {
const url = `${config.MEMPOOL_SERVICES.API}/${req.originalUrl.replace('/api/v1/services/', '')}`;
const allowedPaths = {
'accelerations': 'accelerations',
'accelerations/history': 'accelerations/history',
'accelerations/stats': 'accelerations/stats',
'estimate': 'estimate',
};
const userPath = req.originalUrl.replace('/api/v1/services/', '');
const safePath = allowedPaths[userPath];
if (!safePath) {
logger.err(`Invalid path requested: ${userPath}`, this.tag);
res.status(400).send({ error: 'Invalid path' });
return;
}
const url = `${config.MEMPOOL_SERVICES.API}/${safePath}`;
try {
const response = await axios.get(url, { responseType: 'stream', timeout: 10000 });
for (const key in response.headers) {
Expand Down Expand Up @@ -67,7 +80,20 @@ class AccelerationRoutes {
}

private async $getAcceleratorEstimate(req: Request, res: Response): Promise<void> {
const url = `${config.MEMPOOL_SERVICES.API}/${req.originalUrl.replace('/api/v1/services/', '')}`;
const allowedPaths = {
'accelerations': 'accelerations',
'accelerations/history': 'accelerations/history',
'accelerations/stats': 'accelerations/stats',
'estimate': 'estimate',
};
const userPath = req.originalUrl.replace('/api/v1/services/', '');
const safePath = allowedPaths[userPath];
if (!safePath) {
logger.err(`Invalid path requested: ${userPath}`, this.tag);
res.status(400).send({ error: 'Invalid path' });
return;
}
const url = `${config.MEMPOOL_SERVICES.API}/${safePath}`;
try {
const response = await axios.post(url, req.body, { responseType: 'stream', timeout: 10000 });
for (const key in response.headers) {
Expand Down
16 changes: 16 additions & 0 deletions production/elements.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ txindex=1
[liquidv1]
validatepegin=1
mainchainrpcport=8332
#addnode=[2401:b140::92:201]:7042
#addnode=[2401:b140::92:202]:7042
#addnode=[2401:b140::92:203]:7042
#addnode=[2401:b140::92:204]:7042
#addnode=[2401:b140:1::92:201]:7042
#addnode=[2401:b140:1::92:202]:7042
#addnode=[2401:b140:1::92:203]:7042
Expand All @@ -35,6 +39,10 @@ mainchainrpcport=8332
#addnode=[2401:b140:4::92:204]:7042
#addnode=[2401:b140:4::92:205]:7042
#addnode=[2401:b140:4::92:206]:7042
#addnode=[2401:b140:5::92:201]:7042
#addnode=[2401:b140:5::92:202]:7042
#addnode=[2401:b140:5::92:203]:7042
#addnode=[2401:b140:5::92:204]:7042

[liquidtestnet]
rpcport=7040
Expand All @@ -58,6 +66,10 @@ signblockscript=51210217e403ddb181872c32a0cd468c710040b2f53d8cac69f18dad07985ee3
evbparams=dynafed:0:::
addnode=liquid-testnet.blockstream.com:18892
addnode=liquidtestnet.com:18891
#addnode=[2401:b140::92:201]:18891
#addnode=[2401:b140::92:202]:18891
#addnode=[2401:b140::92:203]:18891
#addnode=[2401:b140::92:204]:18891
#addnode=[2401:b140:1::92:201]:18891
#addnode=[2401:b140:1::92:202]:18891
#addnode=[2401:b140:1::92:203]:18891
Expand All @@ -82,3 +94,7 @@ addnode=liquidtestnet.com:18891
#addnode=[2401:b140:4::92:204]:18891
#addnode=[2401:b140:4::92:205]:18891
#addnode=[2401:b140:4::92:206]:18891
#addnode=[2401:b140:5::92:201]:18891
#addnode=[2401:b140:5::92:202]:18891
#addnode=[2401:b140:5::92:203]:18891
#addnode=[2401:b140:5::92:204]:18891
2 changes: 1 addition & 1 deletion production/install
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ ELEMENTS_REPO_URL=https://github.com/ElementsProject/elements
ELEMENTS_REPO_NAME=elements
ELEMENTS_REPO_BRANCH=master
#ELEMENTS_LATEST_RELEASE=$(curl -s https://api.github.com/repos/ElementsProject/elements/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
ELEMENTS_LATEST_RELEASE=elements-23.2.7
ELEMENTS_LATEST_RELEASE=elements-23.3.0
echo -n '.'

BITCOIN_ELECTRS_REPO_URL=https://github.com/mempool/electrs
Expand Down