Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Commit 8207a55

Browse files
Merge pull request #734 from pubky/dev
v2.0.0
2 parents 6e72010 + 95fd5ee commit 8207a55

File tree

523 files changed

+36388
-16404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

523 files changed

+36388
-16404
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
/.github
3+
.env

.env.example

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
NEXT_PUBLIC_HOMESERVER=pk:z6damwc3jzj1jmtac3kmsiyrgdfxaw8awndaedfnns3obyg9tzxo
2-
NEXT_PUBLIC_PKARR_RELAY=http://localhost:7258
1+
# OPEN VARIABLES
2+
NEXT_PUBLIC_HOMESERVER=ufibwbmed6jeq9k4p583go95wofakh9fwpp4k734trq79pd9u1uy
3+
NEXT_PUBLIC_NEXUS=https://nexus.staging.pubky.app
4+
NEXT_PUBLIC_TESTNET=false
5+
NEXT_PUBLIC_DEFAULT_HTTP_RELAY=https://demo.httprelay.io/link/
36

4-
# NEXT_PUBLIC_HOMESERVER=pk:4unkz8qto4xec6jhw9mie9oepgcurirebdx8axyq3o36fanooxxy
5-
# NEXT_PUBLIC_PKARR_RELAY=https://relay.pkarr.org
7+
# SECRET VARIABLES
8+
BASE_URL_SUPPORT=
9+
SUPPORT_API_ACCESS_TOKEN=
10+
SUPPORT_ACCOUNT_ID=

.eslintrc.json

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
{
22
"root": true,
3-
"ignorePatterns": ["**/*"],
4-
"plugins": ["@nx"],
3+
"ignorePatterns": [
4+
"node_modules",
5+
"dist"
6+
],
7+
"plugins": [
8+
"@nx"
9+
],
510
"overrides": [
611
{
7-
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
12+
"files": [
13+
"*.ts",
14+
"*.tsx",
15+
"*.js",
16+
"*.jsx"
17+
],
818
"rules": {
919
"@nx/enforce-module-boundaries": [
1020
"error",
@@ -14,22 +24,34 @@
1424
"depConstraints": [
1525
{
1626
"sourceTag": "*",
17-
"onlyDependOnLibsWithTags": ["*"]
27+
"onlyDependOnLibsWithTags": [
28+
"*"
29+
]
1830
}
1931
]
2032
}
2133
]
2234
}
2335
},
2436
{
25-
"files": ["*.ts", "*.tsx"],
26-
"extends": ["plugin:@nx/typescript"],
37+
"files": [
38+
"*.ts",
39+
"*.tsx"
40+
],
41+
"extends": [
42+
"plugin:@nx/typescript"
43+
],
2744
"rules": {}
2845
},
2946
{
30-
"files": ["*.js", "*.jsx"],
31-
"extends": ["plugin:@nx/javascript"],
47+
"files": [
48+
"*.js",
49+
"*.jsx"
50+
],
51+
"extends": [
52+
"plugin:@nx/javascript"
53+
],
3254
"rules": {}
3355
}
3456
]
35-
}
57+
}

.github/dependabot.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
open-pull-requests-limit: 10
8+
ignore:
9+
# Ignore Nx core packages
10+
# Must migrate manually periodically running `npx nx migrate latest`
11+
- dependency-name: "nx"
12+
- dependency-name: "@nx/*"
13+
# # Ignore TypeScript and related tools
14+
# - dependency-name: "typescript"
15+
# - dependency-name: "tslib"
16+
# - dependency-name: "ts-node"
17+
# - dependency-name: "ts-jest"
18+
# - dependency-name: "@typescript-eslint/*"
19+
# - dependency-name: "@types/node"
20+
# - dependency-name: "@types/react"
21+
# - dependency-name: "@types/react-dom"
22+
# # Ignore Build and Transpilation Tools
23+
# - dependency-name: "@swc/*"
24+
# - dependency-name: "@swc-node/*"
25+
# - dependency-name: "babel-jest"
26+
# - dependency-name: "postcss"
27+
# - dependency-name: "autoprefixer"
28+
# # Ignore Testing Frameworks
29+
# - dependency-name: "jest"
30+
# - dependency-name: "jest-*"
31+
# - dependency-name: "jest-environment-*"
32+
# - dependency-name: "@testing-library/*"
33+
# # Ignore Linting Tools
34+
# - dependency-name: "eslint"
35+
# - dependency-name: "eslint-config-*"
36+
# - dependency-name: "eslint-plugin-*"
37+
# - dependency-name: "prettier"
38+
# - dependency-name: "eslint-config-next"
39+
# - dependency-name: "@nx/eslint"
40+
# - dependency-name: "@nx/eslint-plugin"
41+
# # Ignore Framework and Core Libraries
42+
# - dependency-name: "react"
43+
# - dependency-name: "react-dom"
44+
# - dependency-name: "next"
45+
# - dependency-name: "nextjs-toploader"
46+
# - dependency-name: "tailwindcss"
47+
# - dependency-name: "tailwind-merge"
48+
# # Optionally ignore Cypress if you prefer manual updates
49+
# - dependency-name: "cypress"
50+
# - dependency-name: "eslint-plugin-cypress"
51+
# reviewers:
52+
# - "your-github-username"
53+
# assignees:
54+
# - "your-github-username"

.github/workflows/build.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build Prod
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- dev
8+
pull_request:
9+
branches:
10+
- master
11+
- dev
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: '22'
25+
cache: 'npm'
26+
27+
- name: Create .env
28+
env:
29+
BASE_URL_SUPPORT: ${{ secrets.BASE_URL_SUPPORT }}
30+
SUPPORT_API_ACCESS_TOKEN: ${{ secrets.SUPPORT_API_ACCESS_TOKEN }}
31+
SUPPORT_ACCOUNT_ID: ${{ secrets.SUPPORT_ACCOUNT_ID }}
32+
run: |
33+
echo "NEXT_PUBLIC_HOMESERVER=ufibwbmed6jeq9k4p583go95wofakh9fwpp4k734trq79pd9u1uy" >> .env
34+
echo "NEXT_PUBLIC_NEXUS=https://nexus.staging.pubky.app" >> .env
35+
echo "NEXT_PUBLIC_TESTNET=false" >> .env
36+
echo "BASE_URL_SUPPORT=$BASE_URL_SUPPORT" >> .env
37+
echo "SUPPORT_API_ACCESS_TOKEN=$SUPPORT_API_ACCESS_TOKEN" >> .env
38+
echo "SUPPORT_ACCOUNT_ID=$SUPPORT_ACCOUNT_ID" >> .env
39+
40+
- name: Install dependencies
41+
run: npm install --omit=dev
42+
43+
- name: Build prod
44+
env:
45+
BASE_URL_SUPPORT: ${{ secrets.BASE_URL_SUPPORT }}
46+
SUPPORT_API_ACCESS_TOKEN: ${{ secrets.SUPPORT_API_ACCESS_TOKEN }}
47+
SUPPORT_ACCOUNT_ID: ${{ secrets.SUPPORT_ACCOUNT_ID }}
48+
run: npm run build

.github/workflows/e2e-test.yml

Lines changed: 76 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,102 @@ name: e2e-test
22

33
on:
44
workflow_dispatch:
5-
pull_request:
5+
push:
6+
branches:
7+
- dev
8+
- master
9+
10+
concurrency:
11+
group: "e2e-test"
12+
cancel-in-progress: true
613

714
jobs:
815
test:
916
runs-on: ubuntu-latest
1017
strategy:
1118
matrix:
12-
browser: [chrome, firefox]
19+
browser: [firefox] # [chrome, firefox]
1320

1421
steps:
1522
- name: Checkout this repository
1623
uses: actions/checkout@v4
1724
with:
1825
path: pubky-app
1926

20-
- name: Checkout skunk-works
27+
- name: Checkout pubky-docker
2128
uses: actions/checkout@v4
2229
with:
23-
repository: pubky/skunk-works
24-
path: skunk-works
25-
ssh-key: ${{ secrets.DEPLOY_KEY }}
30+
repository: pubky/pubky-docker
31+
ref: catch-21/update
32+
path: pubky-docker
33+
submodules: true
34+
token: ${{ secrets.READ_REPOS }}
35+
# cannot use ssh-key (deploy key) for private submodules due to the
36+
# limitation where only a single key can be used per repo checkout
37+
# see https://github.com/actions/checkout/issues/183
2638

27-
- name: Run skunk-works
28-
working-directory: skunk-works
39+
- name: Modify pubky-docker docker-compose.yml
40+
working-directory: pubky-docker/development
2941
run: |
30-
npm install
31-
npm run link
32-
cp ./.env.example ./services/backend/.env
33-
npm run backend &
42+
YQ_BINARY=yq_linux_amd64
43+
YQ_VERSION=v4.44.3
44+
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY}.tar.gz -O - | tar xz && sudo mv ${YQ_BINARY} /usr/bin/yq
45+
yq -i 'del(.services.pkarr)' docker-compose.yml
46+
yq -i 'del(.services.client)' docker-compose.yml
47+
yq -i 'del(.services.homeserver.depends_on)' docker-compose.yml
48+
49+
- name: Modify homeserver.config.toml
50+
working-directory: pubky-docker/development
51+
run: sed -i 's/secret_key = "0123000000000000000000000000000000000000000000000000000000000000"/secret_key = "${{ secrets.HOMESERVER_SECRET_KEY }}"/' homeserver.config.toml
52+
53+
# reduce neo4j memory to prevent
54+
# ERROR Invalid memory configuration - exceeds physical memory. Check the configured values for server.memory.pagecache.size and server.memory.heap.max_size
55+
- name: Modify neo4j.env
56+
working-directory: pubky-docker/development
57+
run: |
58+
sed -i 's/NEO4J_server_memory_pagecache_size=2G/NEO4J_server_memory_pagecache_size=1G/' neo4j.env
59+
sed -i 's/NEO4J_server_memory_heap_initial__size=4G/NEO4J_server_memory_heap_initial__size=1G/' neo4j.env
60+
sed -i 's/NEO4J_server_memory_heap_max__size=8G/NEO4J_server_memory_heap_max__size=2G/' neo4j.env
61+
62+
- name: Build and run pubky-docker
63+
working-directory: pubky-docker/development
64+
run: docker compose up -d
65+
66+
- name: Wait for pubky-docker to start
67+
run: |
68+
PORT=8080
69+
MAX_WAIT=300 # Maximum wait time in seconds (5 minutes)
70+
WAIT_INTERVAL=5 # Interval between checks in seconds
71+
ELAPSED=0
72+
73+
while ! curl -s http://localhost:$PORT; do
74+
if [ $ELAPSED -ge $MAX_WAIT ]; then
75+
echo "Service did not start within 5 minutes."
76+
exit 1
77+
fi
78+
echo "Waiting for service on port $PORT to be ready... ($ELAPSED seconds elapsed)"
79+
sleep $WAIT_INTERVAL
80+
ELAPSED=$((ELAPSED + WAIT_INTERVAL))
81+
done
82+
83+
echo "Service is ready."
3484
3585
- name: Build pubky-app frontend
3686
working-directory: pubky-app
3787
run: |
38-
cp ./.env.example ./.env
88+
echo "NEXT_PUBLIC_HOMESERVER=${{ secrets.HOMESERVER_PUBKY }}
89+
NEXT_PUBLIC_NEXUS=http://localhost:8080
90+
NEXT_PUBLIC_TESTNET=false
91+
NEXT_PUBLIC_DEFAULT_HTTP_RELAY=https://demo.httprelay.io/link/
92+
BASE_URL_SUPPORT=${{ secrets.BASE_URL_SUPPORT }}
93+
SUPPORT_API_ACCESS_TOKEN=${{ secrets.SUPPORT_API_ACCESS_TOKEN }}
94+
SUPPORT_ACCOUNT_ID=1" > .env
3995
npm install
40-
npm link @pubky/sdk
4196
4297
- name: Run e2e tests (${{ matrix.browser }})
4398
uses: cypress-io/github-action@v6
99+
env:
100+
DEBUG: '@cypress/github-action'
44101
with:
45102
working-directory: pubky-app/apps/web-e2e
46103
config-file: cypress.config.ts
@@ -51,6 +108,7 @@ jobs:
51108
install: false
52109
start: npm run start:prod
53110
wait-on: 'http://localhost:4200'
111+
wait-on-timeout: 180
54112

55113
- name: Upload ${{ matrix.browser }} screenshots
56114
if: ${{ always() }}
@@ -65,3 +123,7 @@ jobs:
65123
with:
66124
name: videos-${{ matrix.browser }}
67125
path: pubky-app/dist/cypress/apps/web-e2e/videos
126+
127+
- name: Dump docker logs on failure
128+
if: failure()
129+
uses: jwalton/gh-docker-logs@v2

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ testem.log
3939
.DS_Store
4040
Thumbs.db
4141

42-
.nx/cache
42+
.nx
4343

4444
# Next.js
4545
.next

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Alternatively we could use node:22.9.0-alpine3.20
2+
FROM node:22.9.0-slim
3+
4+
# Set working directory
5+
WORKDIR /usr/src/app
6+
7+
# Declare build arguments
8+
ARG NEXT_PUBLIC_HOMESERVER
9+
ARG NEXT_PUBLIC_NEXUS
10+
ARG NEXT_PUBLIC_TESTNET
11+
12+
# Copy pubky-app
13+
COPY . .
14+
15+
# Install dependencies
16+
RUN npm install --omit=dev
17+
18+
# Remove devDependencies to reduce image size
19+
RUN npm prune --production
20+
21+
# Build
22+
RUN npm run build
23+
24+
# The command to run the pubky web server
25+
CMD ["npm", "run", "serve:prod"]

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,18 @@ Create a `.env` file at the root of the project and include the following enviro
2323
### :test_tube: Testnet Configuration
2424

2525
```
26-
NEXT_PUBLIC_HOMESERVER=pk:z6damwc3jzj1jmtac3kmsiyrgdfxaw8awndaedfnns3obyg9tzxo
27-
NEXT_PUBLIC_PKARR_RELAY=http://localhost:7258
26+
NEXT_PUBLIC_HOMESERVER=z6damwc3jzj1jmtac3kmsiyrgdfxaw8awndaedfnns3obyg9tzxo
27+
NEXT_PUBLIC_NEXUS=http://localhost:8080
28+
NEXT_PUBLIC_DEFAULT_HTTP_RELAY=https://demo.httprelay.io/link/
29+
NEXT_PUBLIC_TESTNET=true
2830
```
2931

3032
### :earth_americas: Mainnet Configuration
3133

3234
```
33-
NEXT_PUBLIC_HOMESERVER=pk:4unkz8qto4xec6jhw9mie9oepgcurirebdx8axyq3o36fanooxxy
34-
NEXT_PUBLIC_PKARR_RELAY=https://relay.pkarr.org
35+
NEXT_PUBLIC_HOMESERVER=ufibwbmed6jeq9k4p583go95wofakh9fwpp4k734trq79pd9u1uy
36+
NEXT_PUBLIC_NEXUS=https://nexus.staging.pubky.app
37+
NEXT_PUBLIC_DEFAULT_HTTP_RELAY=https://demo.httprelay.io/link/
3538
```
3639

3740
## :running: Running Scripts

0 commit comments

Comments
 (0)