Strip Songs2VID to a payment-free self-hosted OSS core.
Remove Stripe/billing/pricing/marketing, simplify schema and entitlements for unlimited self-host use, and keep auth, encode, and YouTube upload. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
935abfb22e
commit
925aadae75
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build multi-arch production image and optionally push to Docker Hub.
|
||||
# Usage:
|
||||
# ./scripts/release-cloud.sh # build locally (current arch)
|
||||
# ./scripts/release-cloud.sh --push # build+push linux/amd64,linux/arm64
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
cd "$ROOT"
|
||||
|
||||
IMAGE="${DOCKER_IMAGE:-atakanozban/songs2vid}"
|
||||
TAG="${DOCKER_TAG:-latest}"
|
||||
FULL="${IMAGE}:${TAG}"
|
||||
|
||||
echo "==> Prisma generate"
|
||||
npx prisma generate
|
||||
|
||||
echo "==> Typecheck / lint (optional soft)"
|
||||
npm run lint || true
|
||||
|
||||
echo "==> Watermark unit checks"
|
||||
npx tsx scripts/watermark.test.ts
|
||||
|
||||
if [[ "${1:-}" == "--push" ]]; then
|
||||
echo "==> Multi-arch build+push ${FULL} (amd64,arm64)"
|
||||
docker buildx create --name s2yt-builder --use 2>/dev/null || docker buildx use s2yt-builder
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
-t "$FULL" \
|
||||
--push \
|
||||
.
|
||||
echo "Pushed ${FULL}. Deploy on songs2vid.com host with deploy/songs2vid/docker-compose.yml"
|
||||
else
|
||||
echo "==> Local docker build ${FULL}"
|
||||
docker build -t "$FULL" .
|
||||
echo "Built ${FULL}. Re-run with --push for Hub multi-arch."
|
||||
fi
|
||||
+14
-44
@@ -1,53 +1,23 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { Plan } from "@prisma/client";
|
||||
import {
|
||||
resolveBurnedSongTitle,
|
||||
resolveYouTubeTitle,
|
||||
validateYouTubeTitle,
|
||||
} from "../lib/titles";
|
||||
|
||||
function testYouTubeTitleResolution() {
|
||||
assert.equal(
|
||||
resolveYouTubeTitle({ title: "My Video", songTitle: "Song", artist: "Artist" }, Plan.FREE),
|
||||
"My Video",
|
||||
);
|
||||
assert.equal(
|
||||
resolveYouTubeTitle({ title: "My Video", songTitle: "Song", artist: "Artist" }),
|
||||
"My Video",
|
||||
);
|
||||
assert.equal(
|
||||
resolveYouTubeTitle({ title: "", songTitle: "Song", artist: "Artist" }),
|
||||
"Artist - Song",
|
||||
);
|
||||
assert.equal(resolveYouTubeTitle({ title: "", songTitle: "Song" }), "Song");
|
||||
assert.equal(resolveBurnedSongTitle({ songTitle: "Track" }), "Track");
|
||||
assert.equal(resolveBurnedSongTitle({ title: "YouTube only" }, "Fallback"), "Fallback");
|
||||
assert.equal(validateYouTubeTitle({ title: "Ok" }), null);
|
||||
assert.ok(validateYouTubeTitle({ title: "" }));
|
||||
assert.equal(validateYouTubeTitle({ title: "", songTitle: "S", artist: "A" }), null);
|
||||
|
||||
assert.equal(
|
||||
resolveYouTubeTitle({ title: "", songTitle: "Song", artist: "Artist" }, Plan.FREE),
|
||||
"",
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
resolveYouTubeTitle({ title: "", songTitle: "Song", artist: "Artist" }, Plan.PREMIUM),
|
||||
"Artist - Song",
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
resolveYouTubeTitle({ title: "Custom", songTitle: "Song", artist: "Artist" }, Plan.PREMIUM),
|
||||
"Custom",
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
resolveYouTubeTitle({ title: "", songTitle: "Song", artist: "" }, Plan.PREMIUM),
|
||||
"Song",
|
||||
);
|
||||
}
|
||||
|
||||
function testBurnedSongTitle() {
|
||||
assert.equal(resolveBurnedSongTitle({ songTitle: "Track" }), "Track");
|
||||
assert.equal(resolveBurnedSongTitle({ title: "YouTube only" }, "Fallback"), "Fallback");
|
||||
}
|
||||
|
||||
function testValidation() {
|
||||
assert.equal(validateYouTubeTitle({ title: "Ok" }, Plan.FREE), null);
|
||||
assert.ok(validateYouTubeTitle({ title: "" }, Plan.FREE));
|
||||
assert.equal(
|
||||
validateYouTubeTitle({ title: "", songTitle: "S", artist: "A" }, Plan.PREMIUM),
|
||||
null,
|
||||
);
|
||||
}
|
||||
|
||||
testYouTubeTitleResolution();
|
||||
testBurnedSongTitle();
|
||||
testValidation();
|
||||
console.log("titles.test.ts: ok");
|
||||
|
||||
Reference in New Issue
Block a user