208 lines
9.5 KiB
Markdown
208 lines
9.5 KiB
Markdown
# futureporn
|
|
|
|
https://future.porn
|
|
|
|
|
|
## Software Dependencies
|
|
|
|
* node
|
|
* pnpm
|
|
* ffmpeg
|
|
* [whisper-cli](https://github.com/ggml-org/whisper.cpp)
|
|
* [shaka-packager](https://github.com/shaka-project/shaka-packager/releases)
|
|
|
|
|
|
## Getting started (developers only)
|
|
|
|
Ensure you have all the above software dependencies available on system PATH
|
|
|
|
Install node packages
|
|
|
|
pnpm install
|
|
|
|
Start docker containers
|
|
|
|
docker compose -f ./compose.development.yaml up
|
|
|
|
Start node app in dev mode. Env vars must be available to the app-- We're using dotenvx to load them.
|
|
|
|
dotenvx run -f ../../.env.development.local -- pnpm run dev
|
|
|
|
|
|
## 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, vibeui, closed captions, search
|
|
* supporterTier6 - view, torrent, download, adfree, upload, vibeui, closed captions, search, csv, sql, pytorch
|
|
|
|
## troubleshooting
|
|
|
|
### npm/pnpm/store issues
|
|
|
|
Any problems with node? Delete the following.
|
|
|
|
```shell
|
|
rm -rf ./node_modules
|
|
rm ./package-lock.json
|
|
rm ./pnpm-lock.json
|
|
```
|
|
|
|
then re-install
|
|
|
|
pnpm install
|
|
|
|
|
|
### 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. This usually needs to be done after every time npm installs a new package.
|
|
|
|
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`.
|
|
|
|
|
|
#### edgesOut??
|
|
|
|
```
|
|
npm http fetch GET 200 https://registry.npmjs.org/typescript 32ms (cache hit)
|
|
npm http fetch GET 200 https://registry.npmjs.org/@hapi%2fbourne 67ms (cache revalidated)
|
|
npm http fetch GET 200 https://registry.npmjs.org/@hapi%2fbounce 104ms (cache revalidated)
|
|
npm http fetch GET 200 https://registry.npmjs.org/@hapi%2fboom 142ms (cache revalidated)
|
|
npm http fetch GET 200 https://registry.npmjs.org/@hapi%2fvalidate 225ms (cache revalidated)
|
|
npm http fetch GET 200 https://registry.npmjs.org/@hapi%2ftopo 81ms (cache revalidated)
|
|
npm http fetch GET 200 https://registry.npmjs.org/@types%2fnode 21ms (cache hit)
|
|
npm http fetch GET 200 https://registry.npmjs.org/@humanfs%2ftest 480ms (cache revalidated)
|
|
npm verbose stack TypeError: Cannot read properties of null (reading 'edgesOut')
|
|
npm verbose stack at #loadPeerSet (/home/cj/.nvm/versions/node/v20.19.3/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1286:38)
|
|
npm verbose stack at async #buildDepStep (/home/cj/.nvm/versions/node/v20.19.3/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:901:11)
|
|
npm verbose stack at async Arborist.buildIdealTree (/home/cj/.nvm/versions/node/v20.19.3/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:181:7)
|
|
npm verbose stack at async Promise.all (index 1)
|
|
npm verbose stack at async Arborist.reify (/home/cj/.nvm/versions/node/v20.19.3/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
|
|
npm verbose stack at async Install.exec (/home/cj/.nvm/versions/node/v20.19.3/lib/node_modules/npm/lib/commands/install.js:150:5)
|
|
npm verbose stack at async Npm.exec (/home/cj/.nvm/versions/node/v20.19.3/lib/node_modules/npm/lib/npm.js:207:9)
|
|
npm verbose stack at async module.exports (/home/cj/.nvm/versions/node/v20.19.3/lib/node_modules/npm/lib/cli/entry.js:74:5)
|
|
npm error Cannot read properties of null (reading 'edgesOut')
|
|
npm verbose cwd /home/cj/Documents/futureporn-monorepo/services/our
|
|
npm verbose os Linux 6.14.6-2-MANJARO
|
|
npm verbose node v20.19.3
|
|
npm verbose npm v10.8.2
|
|
npm verbose exit 1
|
|
npm verbose code 1
|
|
```
|
|
|
|
solution: use npm instead of pnpm. (maybe this is monorepo related?)
|
|
|
|
|
|
#### matches??
|
|
|
|
```
|
|
npm http fetch GET 200 https://registry.npmjs.org/babel-jest 196ms (cache miss)
|
|
npm http fetch GET 200 https://registry.npmjs.org/typedoc 229ms (cache miss)
|
|
npm http fetch GET 200 https://registry.npmjs.org/wait-on 83ms (cache miss)
|
|
npm verbose stack TypeError: Cannot read properties of null (reading 'matches')
|
|
npm verbose stack at Link.matches (/home/cj/.nvm/versions/node/v20.19.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1160:41)
|
|
npm verbose stack at Link.canDedupe (/home/cj/.nvm/versions/node/v20.19.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1104:15)
|
|
npm verbose stack at PlaceDep.pruneDedupable (/home/cj/.nvm/versions/node/v20.19.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:426:14)
|
|
npm verbose stack at new PlaceDep (/home/cj/.nvm/versions/node/v20.19.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:278:14)
|
|
npm verbose stack at new PlaceDep (/home/cj/.nvm/versions/node/v20.19.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:314:26)
|
|
npm verbose stack at #buildDepStep (/home/cj/.nvm/versions/node/v20.19.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:931:18)
|
|
npm verbose stack at async Arborist.buildIdealTree (/home/cj/.nvm/versions/node/v20.19.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:182:7)
|
|
npm verbose stack at async Promise.all (index 1)
|
|
npm verbose stack at async Arborist.reify (/home/cj/.nvm/versions/node/v20.19.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
|
|
npm verbose stack at async Install.exec (/home/cj/.nvm/versions/node/v20.19.1/lib/node_modules/npm/lib/commands/install.js:149:5)
|
|
npm error Cannot read properties of null (reading 'matches')
|
|
npm verbose cwd /home/cj/Documents/futureporn-monorepo/services/our
|
|
npm verbose os Linux 6.14.6-2-MANJARO
|
|
npm verbose node v20.19.1
|
|
npm verbose npm v11.4.2
|
|
npm verbose exit 1
|
|
npm verbose code 1
|
|
npm error A complete log of this run can be found in: /home/cj/.npm/_logs/2025-07-14T12_49_09_670Z-debug-0.log
|
|
```
|
|
|
|
## Development
|
|
|
|
### Apply migrations
|
|
|
|
dotenvx run -f ../../.env.development.local -- npx prisma migrate dev --name "rename_asrvtt"
|
|
|
|
## 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
|