Skip to content

Commit f0c550a

Browse files
authored
Add backup download feature (#1587)
1 parent 304be07 commit f0c550a

File tree

8 files changed

+1110
-7
lines changed

8 files changed

+1110
-7
lines changed

Archive.zip

-49.5 MB
Binary file not shown.

agents/monitoring/endpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const initClient = async (network: XmtpEnv = "dev") => {
7070
return client;
7171
};
7272

73-
export async function handler(req: Request) {
73+
export async function handler(req: Request): Promise<Response> {
7474
if (req.method !== "POST") {
7575
return new Response(JSON.stringify({ error: "Method not allowed" }), {
7676
status: 405,

deploy-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"deployedAt": "2025-11-14T15:23:51Z", "version": "0.4.21"}
1+
{ "deployedAt": "2025-11-14T15:23:51Z", "version": "0.4.21" }

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"axios": "^1.8.2",
4747
"datadog-metrics": "^0.12.1",
4848
"dotenv": "^16.5.0",
49+
"express": "^5.1.0",
4950
"node-fetch": "^3.3.0",
5051
"rimraf": "^6.0.1",
5152
"uint8arrays": "^5.1.0",
@@ -59,6 +60,7 @@
5960
"@eslint/js": "^9.19.0",
6061
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
6162
"@types/eslint__js": "^8.42.3",
63+
"@types/express": "^5",
6264
"@types/node": "^20.0.0",
6365
"eslint": "^9.19.0",
6466
"eslint-config-prettier": "^10.0.1",

railway/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Local db backups in railway
2+
3+
This guide walks you through cloning the repository, deploying the download
4+
server to Railway, and accessing the backups listing on port `8080`.
5+
6+
> [!NOTE]
7+
> THis guides assumes you are deploying to Railway in the /app/data folder using this [tutorial](https://docs.xmtp.org/agents/deploy/deploy-agent)
8+
9+
## 1. Clone the project
10+
11+
```bash
12+
git clone --depth=1 https://github.com/xmtp/xmtp-qa-tools.git
13+
cd xmtp-qa-tools
14+
```
15+
16+
## 2. Deploy to Railway
17+
18+
1. Install the Railway CLI and log in:
19+
20+
```bash
21+
npm i -g @railway/cli
22+
railway login
23+
```
24+
25+
2. Create a Railway project:
26+
27+
```bash
28+
railway init
29+
```
30+
31+
3. In the Railway dashboard, open your service settings and set the **Start
32+
Command** to `yarn web`. This ensures Railway runs the web server entrypoint
33+
after each deploy.
34+
35+
4. Deploy the download server:
36+
37+
```bash
38+
railway up
39+
```
40+
41+
## 3. Access the download page
42+
43+
Once the deployment finishes, open the Railway service URL in your browser:
44+
45+
```
46+
https://<your-service>.up.railway.app/
47+
```
48+
49+
You should see the “Download Backup” page with a list of files and their sizes.
50+
Click any **Download** button to retrieve the selected file.
51+
52+
![Screenshot](./screenshot.png)

0 commit comments

Comments
 (0)