Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2718eb9
Attempt one at getting grpc to work
mrjvs May 13, 2025
ed67814
feat: Add GRPC server to miiverse-api
mrjvs May 15, 2025
b36dfab
feat: add grpc client on juxt end
mrjvs May 15, 2025
e21b2f5
fix: invalid method strings
mrjvs May 15, 2025
153aedb
fix: Update dockerfiles with new GRPC toolchain
mrjvs May 15, 2025
474ad13
fix: Simplify docker files
mrjvs May 15, 2025
7d87182
fix: small fixes
mrjvs May 15, 2025
641a501
Merge pull request #120 from PretendoNetwork/feat/grpc
binaryoverload May 15, 2025
1970f19
docker: improve service inter-dependencies
ashquarky May 21, 2025
a9acfff
feat(build): Run client-facing JS+CSS through ESBuild pipeline
ashquarky May 21, 2025
12f0ef9
feat(build): Remove pre-minified versions of client-facing JS+CSS
ashquarky May 21, 2025
cb96d34
fix(build): Don't minify identifiers
ashquarky May 22, 2025
4afd67d
feat(lint): Add EJS linting
ashquarky May 22, 2025
247947e
chore(web): Reformat post_template include
ashquarky May 22, 2025
8dfea73
chore(docker): Add R2 to proxy
ashquarky May 23, 2025
caf6d7e
feat(web): Add hamburger to posts
ashquarky May 23, 2025
ee0020f
feat(web): Add reporting to hamburger (mmm)
ashquarky May 23, 2025
23c40a7
feat(web): Add post delete button for moderators
ashquarky May 23, 2025
a27d1c6
fix(web): Highlights are light now
ashquarky May 23, 2025
76ee157
chore(web): Use hasAttribute for boolean condition
ashquarky May 23, 2025
3bf6b2d
chore(web): Clean up promises for deletePost
ashquarky May 23, 2025
735c423
fix(build): Use npm-run-all instead of sh for cross-platform dev'ving
ashquarky May 23, 2025
01147af
fix(web): Don't error on pages that don't have a report modal
ashquarky May 23, 2025
2381c12
feat(web, console): Use IIFE bundle and unvendor PJAX
ashquarky May 23, 2025
0937eab
feat(build): Enable minification and treeshaking
ashquarky May 23, 2025
e9d13d4
Merge pull request #121 from PretendoNetwork/work/reporting
binaryoverload May 23, 2025
4b599df
chore(docker): fix dockerfiles, add root dockerignore and alter gitig…
binaryoverload May 23, 2025
7365b0d
feat(docker): Try to add some 3DS setup stuff
ashquarky May 27, 2025
a3670c9
fix(web): update post perms check to match api server
CaramelKat Jun 9, 2025
7a2e016
Merge pull request #128 from PretendoNetwork/fix-post-perm-check
CaramelKat Jun 9, 2025
a2ba11b
Chore: cleanup posting logic
mrjvs Jun 9, 2025
e96c10a
Chore: Add more security checks
mrjvs Jun 9, 2025
8743dd4
Merge pull request #129 from PretendoNetwork/chore/cleanup-post-logic
mrjvs Jun 11, 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
7 changes: 6 additions & 1 deletion .docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ services:
minio-setup:
image: minio/mc
depends_on:
- minio
minio:
condition: service_healthy
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
Expand All @@ -77,8 +78,11 @@ services:

account:
image: ghcr.io/pretendonetwork/account:sha-99aec60
restart: unless-stopped
ports:
- "8123:8123" # grpc
links:
- mongo
environment:
PN_ACT_CONFIG_REDIS_URL: redis://redis:6379
PN_ACT_CONFIG_HTTP_PORT: 8000
Expand All @@ -96,6 +100,7 @@ services:

friends:
image: ghcr.io/pretendonetwork/friends:sha-5560c1d
restart: unless-stopped
ports:
- "8124:8124" # grpc
environment:
Expand Down
53 changes: 53 additions & 0 deletions .docker/hybrid-account.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from urllib.parse import parse_qsl
from base64 import b64decode, b64encode
from hashlib import sha256
import bcrypt
import json

request = input("NASC request blob:")

parts = parse_qsl(request)

def decode_base64(enc: str):
enc = enc.replace('.', '+').replace('-', '/').replace('*', '=')
return b64decode(enc)
parts = dict(((key, decode_base64(val)) for key, val in parts))

pid = int(parts['userid'].decode('ascii'))
fcdcert_hash = sha256(parts['fcdcert']).digest()

print("OK.")
password = input(f"NEX Password for {pid}:")
fc = input("FC (XXXX-XXXX-XXXX):")
pnidpid = int(input("PNID PID:"))
pnidpassword = input("PNID password:")

def nintendo_password(password: str, pid: int):
buf = pid.to_bytes(4, 'little')
buf += b'\x02\x65\x43\x46'
buf += password.encode('ascii')
return sha256(buf).digest().hex()

print(json.dumps({
'device_type': '3ds',
'access_level': 0,
'server_access_level': "prod",
'pid': pid,
'password': password,
'friend_code': fc,
}))

print(json.dumps({
'model': "ctr",
'serial': parts['csnum'].decode('ascii'),
'access_level': 0,
'server_access_level': 'prod',
'certificate_hash': b64encode(fcdcert_hash).decode('ascii'),
'fcdcert_hash': b64encode(fcdcert_hash).decode('ascii'),
'device_attributes': [],
}))

pwhash = nintendo_password(pnidpassword, pnidpid)
bpwsalt = bcrypt.gensalt(10)
bpwhash = bcrypt.hashpw(pwhash.encode('ascii'), bpwsalt)
print(f"{pnidpid}: {bpwhash.decode('ascii')}")
24 changes: 24 additions & 0 deletions .docker/hyrbid-accounts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
For 3DS testing, "hybrid accounts" are often needed. This is where the same account information is accepted on both
prod and local servers. If you see 002-0102 on the proxy, this is likely the issue.

You need:
- Any NASC request blob (copy this from mitmproxy). Starts with "gameid="...
- Your NEX password (https://9net.org/~stary/get_3ds_pid_password.3dsx)
- Your 3DS friend code (you can click past the ban message to see this)
- The PID for your linked PNID (https://pnidlt.gab.net.eu.org/)
- The password for your linked PNID

First, register a PNID with the same username as your linked PNID. The password will be overwritten later.
```shell
# REGISTER
https_proxy=http://localhost:8888 curl -k -v -X POST -H "Content-Type: application/json" --data '{"email":"ash@heyquark.com", "username":"PN_quarky", "mii_name":"Luca", "password":"letm3in", "password_confirm":"letm3in"}' https://api.pretendo.cc/v1/register/
```

Then, run `hybrid-account.py` and provide the information it asks for. It will give:
- A `nexaccounts` record (JSON, `device_type`, `access_level`...)
- A `devices` record (JSON, `model`, `serial`...)
- The PNID PID and hashed password

Your best bet is to insert these into the database using MongoDB Compass. Connect to `localhost` then in `account/nexaccounts`, Add Data->Insert Document, paste the output from the script. Same for `account/devices`.

Locate your newly-registered PNID in `account/pnids` and overwrite the `pid` and `password` fields with the values provided by the script.
1 change: 1 addition & 0 deletions .docker/mitmproxy-local.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

s3_domains = [
"cdn.pretendo.cc",
"r2-cdn.pretendo.cc"
]

def request(flow: http.HTTPFlow):
Expand Down
5 changes: 2 additions & 3 deletions apps/juxtaposition-ui/.dockerignore → .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.git
node_modules
.git
config.json
certs
src/logs
logs/
6 changes: 4 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ jobs:
id: build-and-push
uses: docker/build-push-action@v6
with:
context: ./apps/${{ matrix.repo }}/
context: ./
file: ${{ matrix.repo }}.Dockerfile
platforms: linux/amd64
push: ${{ env.SHOULD_PUSH_IMAGE }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down Expand Up @@ -108,7 +109,8 @@ jobs:
id: build-and-push
uses: docker/build-push-action@v6
with:
context: ./apps/${{ matrix.repo }}/
context: ./
file: ${{ matrix.repo }}.Dockerfile
platforms: linux/arm64
push: ${{ env.SHOULD_PUSH_IMAGE }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:

- name: Install dependencies
run: npm ci
working-directory: ./apps/${{ matrix.repo }}

- name: Lint
run: npm run lint
Expand Down
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
node_modules
node_modules/
.env
certs
logs
dist
logs/
dist/
newman
config.json
uploads
uploads/
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"html.format.unformatted": "%,%_,%=,%-,%#,%%,-%,_%,a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,math,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,slot,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr",
"emmet.includeLanguages": {
"ejs": "html",
},
"javascript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.importModuleSpecifier": "non-relative",
}
48 changes: 0 additions & 48 deletions apps/juxtaposition-ui/Dockerfile

This file was deleted.

9 changes: 9 additions & 0 deletions apps/juxtaposition-ui/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"watch": [
"src/"
],
"ext": "js,ts,ejs,json,css",
"env": {
"NODE_ENV": "development"
}
}
Loading