fp/services/our/README.md
CJ_Clippy 330e38db75
Some checks failed
ci / build (push) Failing after 1s
ci / Tests & Checks (push) Failing after 1s
add uploader to vtuber creation
2025-06-17 05:40:24 -08:00

100 lines
4.2 KiB
Markdown

# futureporn
## projekt requirements
* [x] NO BUNDLER (esbuild/vite/webpack/parcel/swc/etc.). IF YOU REACH FOR A BUNDLER, YOU'RE OVERCOMPLICATING IT!
* [x] NO JWT. IF YOU REACH FOR JWT, YOU'RE OVERCOMPLICATING IT!
* [x] Uploads backend
* [x] Uploads frontend
* [x] backend task processor
* [x] Vods
* [x] HLS
* [ ] Deploy
* [ ] Write
* [ ] Publish
* [ ] Streams
* [x] VTubers
* [ ] Tags
* [ ] Toys
* [ ] Monetized affiliate links
## Tiers & Privs
* user - view, torrent, download
* supporterTier1 - view, torrent, download, adfree, upload
* supporterTier6 - view, torrent, download, adfree, upload, csv, sql
## troubleshooting
### keyv
We use tsup to convert ESM to CJS for graphile-worker.
We're staying on version ^4 because that's the one that supports CJS. https://github.com/jaredwray/keyv/issues/1224
### sharp
sharp is often a pain in the ass to install.
```
[dev:serve] /home/cj/Documents/futureporn-monorepo/services/our/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp/lib/sharp.js:37
[dev:serve] throw new Error(help.join('\n'));
[dev:serve] ^
[dev:serve]
[dev:serve] Error:
[dev:serve] Something went wrong installing the "sharp" module
[dev:serve]
[dev:serve] Cannot find module '../build/Release/sharp-linux-x64.node'
[dev:serve] Require stack:
[dev:serve] - /home/cj/Documents/futureporn-monorepo/services/our/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp/lib/sharp.js
[dev:serve] - /home/cj/Documents/futureporn-monorepo/services/our/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp/lib/constructor.js
[dev:serve] - /home/cj/Documents/futureporn-monorepo/services/our/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp/lib/index.js
[dev:serve]
[dev:serve] Possible solutions:
[dev:serve] - Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
[dev:serve] - Install for the current linux-x64 runtime: "npm install --platform=linux --arch=x64 sharp"
[dev:serve] - Consult the installation documentation: https://sharp.pixelplumbing.com/install
[dev:serve] at Object.<anonymous> (/home/cj/Documents/futureporn-monorepo/services/our/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp/lib/sharp.js:37:9)
[dev:serve] at Module._compile (node:internal/modules/cjs/loader:1469:14)
[dev:serve] at Object.transformer (/home/cj/Documents/node_modules/.pnpm/tsx@4.15.7/node_modules/tsx/dist/register-BujtrvNV.cjs:2:1265)
[dev:serve] at Module.load (node:internal/modules/cjs/loader:1288:32)
[dev:serve] at Module._load (node:internal/modules/cjs/loader:1104:12)
[dev:serve] at Module.require (node:internal/modules/cjs/loader:1311:19)
[dev:serve] at require (node:internal/modules/helpers:179:18)
[dev:serve] at Object.<anonymous> (/home/cj/Documents/futureporn-monorepo/services/our/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp/lib/constructor.js:11:1)
[dev:serve] at Module._compile (node:internal/modules/cjs/loader:1469:14)
[dev:serve] at Object.transformer (/home/cj/Documents/node_modules/.pnpm/tsx@4.15.7/node_modules/tsx/dist/register-BujtrvNV.cjs:2:1265)
[dev:serve]
```
If you have trouble installing sharp, try ignoring the system's installed libvips.
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --ignore-scripts=false --foreground-scripts --verbose --platform=linux --arch=x64 sharp
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --ignore-scripts=false --foreground-scripts --verbose sharp
Actually, better advice is to probably **remove libvips from the system**. This way, a compatible libvips is always pulled during `npm install`.
Annoyingly, it might be necessary to re-install sharp after every new npm package, even if said package is unrelated to sharp.
## Deployments
### Apply migrations
cd /opt/futureporn/services/our
npx @dotenvx/dotenvx run -f /usr/local/etc/futureporn/our/env -- npx prisma migrate deploy
### pgweb
https://github.com/sosedoff/pgweb/wiki/SSH-Gateway
ssh -i ~/.ssh/futureporn2025 -Ng -L 5000:localhost:5432 root@45.63.66.171
pgweb --url postgres://future_porn:REDACTED@localhost:5000/future_porn
### pgadmin
dotenvx run -f ./.env.production -- docker run -p 5050:80 --rm --init -it -e PGADMIN_DEFAULT_EMAIL -e PGADMIN_DEFAULT_PASSWORD -e PGADMIN_DISABLE_POSTFIX=1 dpage/pgadmin4