Skip to content

A motion design studio on your own machine: Claude makes the video step by step, you approve every stage. Bring your own Claude Code or API key.

Remove Postiz after the Railway security breach

Gerrod Noordsy07da0185bb25
diff --git a/README.md b/README.md
index 37ec701..9c1b06e 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,14 @@
<p align="center"><b>A motion design studio on your own machine.</b><br>
Claude makes the video step by step. You approve every stage.</p>
+> [!WARNING]
+> **Postiz has been removed from Mortiflix.** On October 21, 2026, Railway had a security breach that affects
+> sensitive applications like Postiz, the free, open-source publishing service Mortiflix offered. If you set up
+> Postiz, revoke its API key in Postiz and check the social accounts you connected to it.
+>
+> From now on, Mortiflix publishes through **[Upload-Post](https://upload-post.com)** only. It's the paid service:
+> you make an account with them and pick a plan. See [Publishing](#publishing-optional).
+
<p align="center"><a href="https://youtu.be/53bRoQENmSA"><img src="docs/media/how-to-use-mortiflix.gif" width="720" alt="How to use Mortiflix: tap to watch the video"></a><br>
<b>▶ <a href="https://youtu.be/53bRoQENmSA">Watch: How to use Mortiflix</a></b> (3:07). This video was made with Mortiflix.</p>
@@ -127,7 +135,6 @@ Mortiflix runs on your own accounts: there's nothing to sign up for. `mortiflix
Anthropic API key only for the anthropic-api backend (Claude Code uses your own login)
ElevenLabs API key only for ElevenLabs narration, sound effects and music
Upload-Post API key only for `mortiflix publish` through Upload-Post (optional; sessions never get it)
-Postiz API key only for `mortiflix publish` through your own Postiz (optional; sessions never get it)
Other keys anything a pipeline's tools read from the environment, e.g. GEMINI_API_KEY
```
@@ -198,15 +205,14 @@ Everything goes into the studio folder, never system-wide. Full details: [docs/S
## Publishing (optional)
-Once you approve a final, the video is yours to download. If you'd rather post it straight from the studio, pick a
-service in setup (`mortiflix setup publish`, or Settings › Setup), add its key with `mortiflix keys`:
+Once you approve a final, the video is yours to download. If you'd rather post it straight from the studio, Mortiflix
+publishes through **[Upload-Post](https://upload-post.com)**. It's a hosted service: you make an account there, pick a
+paid plan, and connect your social accounts under a profile. Turn it on in setup (`mortiflix setup publish uploadpost`,
+or Settings › Setup) and add its key with `mortiflix keys set uploadpost`.
-- **[Upload-Post](https://upload-post.com)**: hosted, with paid plans. Connect your accounts there, under a profile.
-- **[Postiz](https://postiz.com)**: free and open source (AGPL-3.0, like Mortiflix), on your own server or this
- computer ([Docker Compose](https://docs.postiz.com/self-host/installation/docker-compose)). Connect your accounts in
- it. You register a developer app with each platform yourself, and TikTok keeps posts private until it has reviewed
- yours. Mortiflix talks to it over its API (`http://localhost:4007/api` for the official Docker image, or
- `https://api.postiz.com` for Postiz Cloud); none of its code is bundled.
+Mortiflix used to offer two publishing services. The free, open-source one, Postiz, was removed after the Railway
+security breach of October 21, 2026 (see the warning at the top). Upload-Post, the paid one, is the one we're staying
+with.
Then:
@@ -219,12 +225,11 @@ mortiflix publish <project> --status # per platform, wi
Only you publish: it's a command you run, never something a session can reach (`mfx` has no way to it), and only a
delivered project's approved final goes out. It shows what goes where and asks before sending (`--yes` skips the
-question in scripts). Running it again never posts the same video twice (`--again` does, on purpose). With Postiz,
-the plan names each connected account it goes to. `--profile` is the Upload-Post profile your accounts are connected
+question in scripts). Running it again never posts the same video twice (`--again` does, on purpose). `--profile` is the Upload-Post profile your accounts are connected
under; it's remembered after the first time.
Publishing was started by [@mutonby](https://github.com/mutonby) ([#3](https://github.com/GTKottman/mortiflix-oss/pull/3)),
-who built the Upload-Post side; Postiz came after, as the free choice.
+who works on Upload-Post and built it.
## Make your own pipeline
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index f827f04..89c3eb9 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -132,15 +132,13 @@ work makes sound. `verifyKey` proves a key with a free, read-only call (`GET /v1
project that lacks a key for its next steps pauses with `NEEDS_YOU` instead of starting a session) all ask it. Other
keys for sessions go to `session.env` through `setSessionKey`; only their names are ever shown.
-The publishing keys (Upload-Post, Postiz) are the studio's, not a session's: `publish.mjs` reads the chosen service's
-key (`keyValue`) when you run `mortiflix publish`. `config.json` › `publish` holds the choice (`service`: `uploadpost`,
-`postiz` or `none`, the Upload-Post `profile`, the Postiz `url`). `publishPlan` takes a delivered project's approved
-video and checks everything; for Postiz, `postizChannels` looks up the connected channels so the plan names them. The
-CLI shows the plan, asks, and `publish` sends it: Upload-Post as one form with an `Idempotency-Key`; Postiz as an upload
-then one `POST /public/v1/posts` with a post per channel (scheduled times converted to UTC). Each post carries a key
+The publishing key (Upload-Post) is the studio's, not a session's: `publish.mjs` reads it (`keyValue`) when you run
+`mortiflix publish`. `config.json` › `publish` holds the choice (`service`: `uploadpost` or `none`, and the Upload-Post
+`profile`). `publishPlan` takes a delivered project's approved video and checks everything. The CLI shows the plan,
+asks, and `publish` sends it to Upload-Post as one form with an `Idempotency-Key`. Each post carries a key
(video, service, platforms, time); the studio refuses one it already sent unless `--again`. It records the post in
`project.json` (`published`) and the log (`PUBLISHED`); `publishStatus` reads it back per platform. Started by @mutonby
-(PR #3, Upload-Post).
+(PR #3, Upload-Post). Postiz was removed on 2026-10-21 after the Railway security breach (see the README).
## Narration (`src/voice/`)
diff --git a/docs/SECURITY.md b/docs/SECURITY.md
index ef500ea..e29b1af 100644
--- a/docs/SECURITY.md
+++ b/docs/SECURITY.md
@@ -69,9 +69,8 @@ key is checked with a free, read-only API call before it's saved.
Sessions don't get it.
- The ElevenLabs key is stored in `secrets.json` too, and given to a session only while ElevenLabs is the narration
engine.
-- The publishing keys (Upload-Post, Postiz) are stored in `secrets.json` too and never given to a session. Only
- `mortiflix publish`, run by you, uses one, and sends it only to the service you picked (for Postiz, the address you
- gave in setup).
+- The publishing key (Upload-Post) is stored in `secrets.json` too and never given to a session. Only
+ `mortiflix publish`, run by you, uses it, and sends it only to Upload-Post.
- Other keys go to `session.env` (mode 600) and are given to every session's environment. The UI shows their names,
never their values. Only add keys that sessions need, and prefer keys with spending limits.
- The runner checks a project's keys before each session: if one is missing, the project pauses and tells you which,
diff --git a/plugin/skills/mortiflix/SKILL.md b/plugin/skills/mortiflix/SKILL.md
index e0f5ec5..04d0f64 100644
--- a/plugin/skills/mortiflix/SKILL.md
+++ b/plugin/skills/mortiflix/SKILL.md
@@ -73,9 +73,9 @@ Say what's already there (`tools`), then ask. Use AskUserQuestion for choices. E
`mortiflix setup install strudel chrome`. Chrome reuses theirs when they have one.
- **Assets**: only if they use a stock site. `mortiflix setup assets <url> …`, then
`mortiflix setup install browser-harness`. They sign in to the site in their own Chrome.
-- **Publishing**: optional. `mortiflix setup publish uploadpost [--profile <name>]` (hosted, paid plans),
- `mortiflix setup publish postiz [--url <their Postiz API address>]` (free, open source, they run it with Docker), or
- `mortiflix setup publish none`. The key is theirs to type: `mortiflix keys set uploadpost` or `mortiflix keys set postiz`.
+- **Publishing**: optional. `mortiflix setup publish uploadpost [--profile <name>]` (hosted, paid plans, an
+ Upload-Post account) or `mortiflix setup publish none`. The key is theirs to type: `mortiflix keys set uploadpost`.
+ Postiz was removed after the Railway security breach of 2026-10-21: never set it up.
- **3D**: only if they want it. `mortiflix setup install blender blender-addons`.
Before each install, say what it is, where it goes and how big it is (`tool_info[id]`). Installs can take minutes, so
diff --git a/src/cli.mjs b/src/cli.mjs
index 17016e3..16fe5c4 100644
--- a/src/cli.mjs
+++ b/src/cli.mjs
@@ -49,8 +49,7 @@ export const HELP = `${C.b('mortiflix')}: a motion design studio on your machine
${C.b('Publishing')}
mortiflix publish <project> [--to tiktok,instagram,youtube] [--profile <name>] [--title "…"] [--description "…"]
[--at 2026-10-20T18:00 [--timezone Europe/Madrid]] [--yes] [--again]
- post a delivered video through Upload-Post or your own
- Postiz, whichever setup picked (asks first)
+ post a delivered video through Upload-Post (asks first)
mortiflix publish <project> --status how it went, per platform, with the links
${C.b('The web studio')}
@@ -77,8 +76,8 @@ export const HELP = `${C.b('mortiflix')}: a motion design studio on your machine
${C.b('Settings')}
mortiflix config [key [value]] show or change settings
- mortiflix keys set <anthropic|elevenlabs|uploadpost|postiz|NAME> set one key (typed hidden, or piped on stdin)
- mortiflix keys remove <anthropic|elevenlabs|uploadpost|postiz|NAME>
+ mortiflix keys set <anthropic|elevenlabs|uploadpost|NAME> set one key (typed hidden, or piped on stdin)
+ mortiflix keys remove <anthropic|elevenlabs|uploadpost|NAME>
mortiflix checks [approve|reject <id>] the error checklist sessions proposed
--studio <dir> works with every command. --json prints what pipelines, list, status, review, keys and
@@ -88,7 +87,7 @@ export const HELP = `${C.b('mortiflix')}: a motion design studio on your machine
mortiflix setup install <${setup.TOOLS.join('|')}>
mortiflix setup music <strudel|none> [--midi|--no-midi]
mortiflix setup assets <url>… | --clear
- mortiflix setup publish <uploadpost|postiz|none> [--url <your Postiz>] [--profile <Upload-Post profile>]`;
+ mortiflix setup publish <uploadpost|none> [--profile <Upload-Post profile>]`;
const LISTS = ['set', 'file', 'note', 'answer'];
@@ -416,13 +415,10 @@ async function publishCmd(root, given, a) {
if (!st.results.length) console.log(C.dim(st.scheduled_for ? ` Scheduled for ${st.scheduled_for}.` : ' Nothing back from the platforms yet.'));
return;
}
- let plan = pub.publishPlan(root, id, { to: opt('to'), profile: opt('profile'), title: opt('title'), description: opt('description'), at: opt('at'), timezone: opt('timezone'), again: Boolean(a.again) });
- // Postiz posts to the channels connected in it: look them up first, so the plan names every account.
- if (plan.service === 'postiz') plan = await pub.postizChannels(root, plan);
+ const plan = pub.publishPlan(root, id, { to: opt('to'), profile: opt('profile'), title: opt('title'), description: opt('description'), at: opt('at'), timezone: opt('timezone'), again: Boolean(a.again) });
console.log(`\n${C.b(plan.project)} ${C.dim(`${(plan.size / 1024 ** 2).toFixed(1)} MB`)}`);
- console.log(` Via ${pub.SERVICES[plan.service].name}${plan.service === 'postiz' ? C.dim(` at ${pub.publishConfig(loadConfig(root)).postiz.url}`) : ''}`);
+ console.log(` Via ${pub.SERVICES[plan.service].name}`);
console.log(` To ${plan.platforms.join(', ')}${plan.from_brief ? C.dim(' (from the brief; --to changes it)') : ''}`);
- if (plan.channels) for (const c of plan.channels) console.log(` ${C.dim(`${c.platform}:`)} ${c.name}`);
if (plan.profile) console.log(` Profile ${plan.profile}`);
console.log(` Title ${plan.title}`);
if (plan.description) console.log(` Text ${plan.description.slice(0, 200)}`);
@@ -431,8 +427,7 @@ async function publishCmd(root, given, a) {
if (!a.yes && !(await confirm(`Post it${plan.at ? ' at that time' : ' now'}?`))) return console.log('Nothing sent.');
const sent = await pub.publish(root, plan);
console.log(`${C.green('✔')} ${plan.at ? 'Scheduled' : 'Sent'}. ${C.b(`mortiflix publish ${id} --status`)} shows how it went.`);
- if (plan.service === 'postiz') console.log(C.dim(` ${sent.posts.length} post${sent.posts.length === 1 ? '' : 's'} · also in your Postiz calendar`));
- else console.log(C.dim(` ${sent.job_id ? `job ${sent.job_id}` : `request ${sent.request_id}`} · also at https://app.upload-post.com`));
+ console.log(C.dim(` ${sent.job_id ? `job ${sent.job_id}` : `request ${sent.request_id}`} · also at https://app.upload-post.com`));
}
// Review in the terminal: what was sent, then answers, notes and a decision.
@@ -855,14 +850,11 @@ async function setupPart(root, id, st) {
}
if (id === 'publish') {
const cur = pub.publishConfig(loadConfig(root));
- console.log(` Now: ${C.b(cur.service === 'none' ? 'not set up' : cur.service === 'postiz' ? `your own Postiz at ${cur.postiz.url}` : `Upload-Post${cur.profile ? ` (profile ${cur.profile})` : ''}`)}`);
+ console.log(` Now: ${C.b(cur.service === 'none' ? 'not set up' : `Upload-Post${cur.profile ? ` (profile ${cur.profile})` : ''}`)}`);
console.log(' 1. Upload-Post: a hosted service with paid plans. You connect your accounts on upload-post.com. Needs its API key.');
- console.log(' 2. Postiz: free and open source (AGPL-3.0). You run it yourself (Docker) and connect your accounts in it.');
- console.log(C.dim(' Install: https://docs.postiz.com/self-host/installation/docker-compose. Each platform needs a developer app you register;'));
- console.log(C.dim(' TikTok keeps posts private until it has reviewed yours.'));
- console.log(' 3. Don\'t publish from the studio: you download finals and post them yourself.');
+ console.log(' 2. Don\'t publish from the studio: you download finals and post them yourself.');
const choice = (await prompterOnce(` Which? ${C.dim(`[Enter keeps ${cur.service}]`)} `)).trim();
- if (choice === '3') { pub.savePublish(root, { service: 'none' }); return console.log(' Publishing off.'); }
+ if (choice === '2') { pub.savePublish(root, { service: 'none' }); return console.log(' Publishing off.'); }
if (choice === '1' || (!choice && cur.service === 'uploadpost')) {
pub.savePublish(root, { service: 'uploadpost' });
await askKey(root, 'uploadpost');
@@ -870,12 +862,6 @@ async function setupPart(root, id, st) {
if (profile) pub.savePublish(root, { profile });
return console.log(` ${C.green('✔')} Publishing through Upload-Post. Post a delivered video with ${C.b('mortiflix publish <project>')}.`);
}
- if (choice === '2' || (!choice && cur.service === 'postiz')) {
- const url = (await prompterOnce(` Your Postiz API address ${C.dim(`(Enter keeps ${cur.postiz.url}; Postiz Cloud is https://api.postiz.com)`)}: `)).trim();
- pub.savePublish(root, { service: 'postiz', url: url || undefined });
- await askKey(root, 'postiz');
- return console.log(` ${C.green('✔')} Publishing through your Postiz. Post a delivered video with ${C.b('mortiflix publish <project>')}.`);
- }
return undefined;
}
if (id === '3d') {
@@ -905,7 +891,7 @@ async function showSetup(root) {
row(st.assets.sites.length ? st['browser-harness'].ok : null, 'Assets', st.assets.sites.length ? `${st.assets.sites.map((x) => x.url).join(', ')} (browser-harness ${st['browser-harness'].ok ? st['browser-harness'].detail : 'missing'})` : 'no sites: sessions make every visual themselves');
const pubCfg = st.publish;
row(pubCfg.service === 'none' ? null : Boolean(pubCfg.key), 'Publishing', pubCfg.service === 'none' ? 'off: you post finals yourself'
- : `${pub.SERVICES[pubCfg.service].name}${pubCfg.service === 'postiz' ? ` at ${pubCfg.postiz.url}` : pubCfg.profile ? `, profile ${pubCfg.profile}` : ''}${pubCfg.key ? '' : ', key missing'}`);
+ : `${pub.SERVICES[pubCfg.service].name}${pubCfg.profile ? `, profile ${pubCfg.profile}` : ''}${pubCfg.key ? '' : ', key missing'}`);
row(st.blender.ok ? st['blender-addons'].ok : null, '3D', st.blender.ok ? `${st.blender.detail}; ${st['blender-addons'].detail}` : 'not set up');
}
@@ -955,8 +941,8 @@ async function setupCmd(root, [part, ...args], a) {
return console.log(now.length ? `${C.green('✔')} Asset sites: ${now.map((x) => x.url).join(', ')}` : 'No asset sites.');
}
if (part === 'publish' && args.length) {
- const c = pub.savePublish(root, { service: args[0], url: typeof a.url === 'string' ? a.url : undefined, profile: typeof a.profile === 'string' ? a.profile : undefined });
- return console.log(c.service === 'none' ? 'Publishing off.' : `${C.green('✔')} Publishing through ${pub.SERVICES[c.service].name}${c.service === 'postiz' ? ` at ${c.postiz.url}` : ''}. Its key: mortiflix keys set ${c.service}`);
+ const c = pub.savePublish(root, { service: args[0], profile: typeof a.profile === 'string' ? a.profile : undefined });
+ return console.log(c.service === 'none' ? 'Publishing off.' : `${C.green('✔')} Publishing through ${pub.SERVICES[c.service].name}. Its key: mortiflix keys set ${c.service}`);
}
if (part === 'status' && a.json) return json(await setupView(root));
if (part === 'status' || !process.stdin.isTTY) return showSetup(root);
diff --git a/src/keys.mjs b/src/keys.mjs
index cceb0d7..9ad4f52 100644
--- a/src/keys.mjs
+++ b/src/keys.mjs
@@ -30,13 +30,6 @@ export const KEYS = {
get: 'app.upload-post.com › API Keys',
for: 'publishing a delivered video to TikTok, Instagram, YouTube and others with `mortiflix publish`, when Upload-Post is your publishing service. Optional: nothing is ever posted on its own.',
},
- postiz: {
- name: 'Postiz API key',
- secret: 'postiz_api_key',
- env: 'POSTIZ_API_KEY',
- get: 'your Postiz › Settings › Developers › Public API',
- for: 'publishing a delivered video with `mortiflix publish`, when your own Postiz is your publishing service. Optional: nothing is ever posted on its own.',
- },
};
// Where a key comes from: saved in this studio, session.env, the environment Mortiflix was started with, or nowhere.
@@ -117,17 +110,6 @@ export async function verifyKey(root, id, value, { fetch = globalThis.fetch } =
if (res.status === 401 || res.status === 403) return { ok: false, detail: 'Upload-Post refused it (check that you copied the whole key)' };
return { ok: null, detail: `couldn't check it (Upload-Post answered ${res.status})` };
}
- if (id === 'postiz') {
- // Your own Postiz, at the address chosen in setup: listing its channels is free and read-only.
- const base = (loadConfig(root).publish?.postiz?.url || 'http://localhost:4007/api').replace(/\/+$/, '');
- const res = await fetch(`${base}/public/v1/integrations`, { headers: { Authorization: key } });
- if (res.ok) {
- const list = [].concat(await res.json().catch(() => [])).filter((c) => c && !c.disabled);
- return { ok: true, detail: list.length ? `${list.length} channel${list.length === 1 ? '' : 's'} connected (${[...new Set(list.map((c) => c.identifier))].join(', ')})` : 'Postiz accepted it, but no channels are connected there yet' };
- }
- if (res.status === 401 || res.status === 403) return { ok: false, detail: 'your Postiz refused it (check that you copied the whole key)' };
- return { ok: null, detail: `couldn't check it (your Postiz at ${base} answered ${res.status})` };
- }
if (id === 'elevenlabs') {
const a = await new ElevenLabs({ key, server: voiceConfig(root).elevenlabs.server, fetch }).account();
const left = Number.isFinite(a.characters_left) ? ` · ${a.characters_left.toLocaleString()} credits left` : '';
diff --git a/src/publish.mjs b/src/publish.mjs
index ef3e583..cd1f753 100644
--- a/src/publish.mjs
+++ b/src/publish.mjs
@@ -1,7 +1,6 @@
// Publishing a delivered video to your social accounts, through the service you picked in setup:
// uploadpost Upload-Post (https://upload-post.com), hosted, paid plans
-// postiz your own Postiz (https://postiz.com), free and open source (AGPL-3.0), self-hosted
-// Started by @mutonby (Upload-Post, PR #3); Postiz added alongside it.
+// Started by @mutonby (Upload-Post, PR #3). Postiz was removed on 2026-10-21 after the Railway breach (README).
//
// Only you publish. It's reachable from the CLI, never from `mfx`, so a session can't post anything; and only a
// delivered project's approved video goes out, never a version still in review. Nothing here runs on its own.
@@ -15,18 +14,10 @@ import { keyValue } from './keys.mjs';
// UPLOAD_POST_API moves it (e.g. to a staging server); the key is sent there.
export const API = () => process.env.UPLOAD_POST_API || 'https://api.upload-post.com';
-// The official Postiz Docker image answers its API here; Postiz Cloud is https://api.postiz.com.
-export const POSTIZ_DEFAULT = 'http://localhost:4007/api';
-
export const SERVICES = {
uploadpost: { name: 'Upload-Post', key: 'uploadpost', platforms: ['tiktok', 'instagram', 'youtube', 'linkedin', 'x', 'facebook', 'threads', 'pinterest', 'bluesky'] },
- // Pinterest is left out: Postiz needs a board for it, which the studio has no way to know.
- postiz: { name: 'Postiz', key: 'postiz', platforms: ['tiktok', 'instagram', 'youtube', 'linkedin', 'x', 'facebook', 'threads', 'bluesky', 'mastodon'] },
};
-// The platforms by every name they're shown under, and which Postiz channel types post to each.
-const POSTIZ_TYPES = { instagram: ['instagram', 'instagram-standalone'], linkedin: ['linkedin', 'linkedin-page'] };
-
// Where the brief said it will run (the social-short intake), as the accounts to post to.
const FROM_BRIEF = { 'TikTok / Reels / Shorts': ['tiktok', 'instagram', 'youtube'], LinkedIn: ['linkedin'], X: ['x'] };
@@ -34,37 +25,28 @@ const FROM_BRIEF = { 'TikTok / Reels / Shorts': ['tiktok', 'instagram', 'youtube
export function publishConfig(config) {
const p = config.publish || {};
- return { service: SERVICES[p.service] ? p.service : 'none', profile: p.profile || null, postiz: { url: p.postiz?.url || POSTIZ_DEFAULT } };
+ // A studio set up for Postiz before it was removed reads as not set up.
+ return { service: SERVICES[p.service] ? p.service : 'none', profile: p.profile || null };
}
-// The service (uploadpost, postiz or none), the Upload-Post profile, and where your Postiz is.
-export function savePublish(root, { service, profile, url } = {}) {
+// The service (uploadpost or none) and the Upload-Post profile.
+export function savePublish(root, { service, profile } = {}) {
const cur = publishConfig(loadConfig(root));
- if (service !== undefined && service !== 'none' && !SERVICES[service]) throw new UserError('publishing: uploadpost, postiz or none');
- let postizUrl = cur.postiz.url;
- if (url !== undefined && url !== null && String(url).trim()) {
- let u;
- try { u = new URL(String(url).trim()); } catch { throw new UserError(`"${url}" isn't a web address (e.g. ${POSTIZ_DEFAULT})`); }
- if (!/^https?:$/.test(u.protocol)) throw new UserError('your Postiz address starts with http:// or https://');
- if (u.username || u.password) throw new UserError('no login in the address: Postiz takes its API key instead');
- postizUrl = u.href.replace(/\/+$/, '');
- }
+ if (service === 'postiz') throw new UserError('Postiz was removed after the Railway breach of 2026-10-21: use Upload-Post (see the README)');
+ if (service !== undefined && service !== 'none' && !SERVICES[service]) throw new UserError('publishing: uploadpost or none');
saveConfig(root, { publish: {
service: service ?? cur.service,
profile: profile !== undefined ? (String(profile || '').trim() || null) : cur.profile,
- postiz: { url: postizUrl },
} });
return publishConfig(loadConfig(root));
}
-const postizBase = (root) => `${publishConfig(loadConfig(root)).postiz.url}/public/v1`;
-
// ---- the plan ----
// Everything a post needs, checked before anything is sent: what you see is what goes out.
export function publishPlan(root, id, { to, profile, title, description, at, timezone, again } = {}) {
const service = publishConfig(loadConfig(root)).service;
- if (service === 'none') throw new UserError('publishing isn\'t set up: pick Upload-Post or your own Postiz with `mortiflix setup publish` (or in Settings › Setup)');
+ if (service === 'none') throw new UserError('publishing isn\'t set up: pick Upload-Post with `mortiflix setup publish` (or in Settings › Setup)');
const svc = SERVICES[service];
const p = loadProject(root, id);
if (p.state !== 'delivered') throw new UserError(`"${p.title}" isn't delivered yet (${p.state}): only an approved final is published`);
@@ -79,12 +61,11 @@ export function publishPlan(root, id, { to, profile, title, description, at, tim
const unknown = platforms.filter((s) => !svc.platforms.includes(s));
if (unknown.length) throw new UserError(`can't publish to ${unknown.join(', ')} through ${svc.name} (one or more of: ${svc.platforms.join(', ')})`);
- // Upload-Post posts under one of your profiles there; Postiz posts to the channels connected in it.
+ // Upload-Post posts under one of your profiles there.
const who = service === 'uploadpost' ? String(profile || publishConfig(loadConfig(root)).profile || '').trim() : null;
if (service === 'uploadpost' && !who) throw new UserError('which Upload-Post profile? Pass --profile with the name your accounts are connected under (it\'s remembered)');
const caption = String(title ?? p.title).trim();
if (!caption) throw new UserError('a post needs a title: pass --title');
- if (service === 'postiz' && platforms.includes('youtube') && caption.length < 2) throw new UserError('YouTube needs a title of at least 2 characters: pass --title');
if (timezone && !at) throw new UserError('--timezone only goes with --at');
if (timezone) { try { new Intl.DateTimeFormat('en', { timeZone: timezone }); } catch { throw new UserError(`--timezone "${timezone}" isn't a time zone (e.g. Europe/Madrid)`); } }
if (at && Number.isNaN(Date.parse(at))) throw new UserError(`--at "${at}" isn't a date and time (e.g. 2026-10-20T18:00)`);
@@ -96,41 +77,6 @@ export function publishPlan(root, id, { to, profile, title, description, at, tim
return { id, service, project: p.title, file, size: st.size, platforms, profile: who, title: caption, description: description ? String(description) : null, at: at || null, timezone: timezone || null, key, from_brief: !to && Boolean(fromBrief) };
}
-// A time without an offset is read in `timezone` (UTC without one), the same way Upload-Post reads it.
-export function utcDate(at, timezone) {
- if (/(Z|[+-]\d\d:?\d\d)$/i.test(at)) return new Date(at).toISOString();
- const asUtc = new Date(`${at}${/T\d\d:\d\d/.test(at) ? '' : 'T00:00'}Z`);
- if (!timezone) return asUtc.toISOString();
- const offset = (t) => {
- const g = Object.fromEntries(new Intl.DateTimeFormat('en-US', { timeZone: timezone, hourCycle: 'h23', year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' })
- .formatToParts(new Date(t)).map((x) => [x.type, x.value]));
- return Date.UTC(g.year, g.month - 1, g.day, g.hour, g.minute, g.second) - t;
- };
- const guess = asUtc.getTime() - offset(asUtc.getTime());
- return new Date(asUtc.getTime() - offset(guess)).toISOString();
-}
-
-// Postiz: the connected channels each platform goes to, so the plan can show them before anything is sent.
-export async function postizChannels(root, plan, { fetch = globalThis.fetch } = {}) {
- const apiKey = needKey(root, 'postiz');
- let res;
- try { res = await fetch(`${postizBase(root)}/integrations`, { headers: { Authorization: apiKey } }); }
- catch (e) { throw new UserError(`couldn't reach your Postiz at ${publishConfig(loadConfig(root)).postiz.url} (${e.message}): is it running?`); }
- if (res.status === 401 || res.status === 403) throw new UserError('your Postiz refused the API key (check it with `mortiflix keys`)');
- if (!res.ok) throw new UserError(`your Postiz couldn't list its channels (${res.status})`);
- const all = [].concat(await res.json().catch(() => [])).filter((c) => c && !c.disabled);
- const channels = [];
- const missing = [];
- for (const platform of plan.platforms) {
- const types = POSTIZ_TYPES[platform] || [platform];
- const found = all.filter((c) => types.includes(c.identifier));
- if (!found.length) missing.push(platform);
- for (const c of found) channels.push({ id: c.id, platform, type: c.identifier, name: c.name || c.profile || c.id });
- }
- if (missing.length) throw new UserError(`no ${missing.join(', ')} channel connected in your Postiz: connect ${missing.length > 1 ? 'them' : 'it'} there, or leave ${missing.length > 1 ? 'them' : 'it'} out with --to`);
- return { ...plan, channels };
-}
-
// ---- sending ----
function needKey(root, id) {
@@ -143,7 +89,7 @@ function needKey(root, id) {
export async function publish(root, plan, { fetch = globalThis.fetch } = {}) {
const p = loadProject(root, plan.id);
if ((p.published || []).some((x) => x.key === plan.key)) throw new UserError('this exact post was already sent (`--status` shows how it went). Add --again to post it once more');
- const sent = plan.service === 'postiz' ? await sendPostiz(root, plan, { fetch }) : await sendUploadPost(root, plan, { fetch });
+ const sent = await sendUploadPost(root, plan, { fetch });
const record = { service: plan.service, key: plan.key, platforms: plan.platforms, profile: plan.profile, scheduled_for: plan.at, timezone: plan.timezone, sent_at: now(), ...sent };
update(root, plan.id, (x) => { x.published = [...(x.published || []), record]; });
event(root, plan.id, { event: 'PUBLISHED', actor: 'you', details: `${plan.platforms.join(', ')} via ${SERVICES[plan.service].name}${plan.at ? ` at ${plan.at}${plan.timezone ? ` ${plan.timezone}` : ''}` : ''}` });
@@ -176,62 +122,14 @@ async function sendUploadPost(root, plan, { fetch }) {
return { request_id: body.request_id || null, job_id: body.job_id || null };
}
-// Postiz: upload the video, then one post per channel in a single request (its rate limit counts requests).
-async function sendPostiz(root, plan, { fetch }) {
- const apiKey = needKey(root, 'postiz');
- const ready = plan.channels ? plan : await postizChannels(root, plan, { fetch });
- const base = postizBase(root);
- const where = publishConfig(loadConfig(root)).postiz.url;
-
- const form = new FormData();
- form.append('file', await openAsBlob(plan.file, { type: 'video/mp4' }), `${plan.id}.mp4`);
- let res;
- try { res = await fetch(`${base}/upload`, { method: 'POST', body: form, headers: { Authorization: apiKey } }); }
- catch (e) { throw new UserError(`couldn't reach your Postiz at ${where} (${e.message}): nothing was posted`); }
- const media = await res.json().catch(() => ({}));
- if (res.status === 401 || res.status === 403) throw new UserError('your Postiz refused the API key (check it with `mortiflix keys`)');
- if (!res.ok || !media.id || !media.path) throw new UserError(`your Postiz didn't take the video (${res.status}): ${media.message || media.error || 'no reason given'}. Nothing was posted`);
-
- const text = [plan.title, plan.description].filter(Boolean).join('\n\n');
- const posts = ready.channels.map((c) => ({
- integration: { id: c.id },
- value: [{ content: c.type === 'youtube' ? plan.description || plan.title : text, image: [{ id: media.id, path: media.path }] }],
- settings: postizSettings(c.type, plan),
- }));
- const body = { type: plan.at ? 'schedule' : 'now', date: plan.at ? utcDate(plan.at, plan.timezone) : new Date().toISOString(), shortLink: false, tags: [], posts };
- try {
- res = await fetch(`${base}/posts`, { method: 'POST', body: JSON.stringify(body), headers: { Authorization: apiKey, 'Content-Type': 'application/json' } });
- } catch (e) {
- // Postiz has no idempotency key: if the request got there, the post exists. Look before sending it again.
- throw new UserError(`lost your Postiz at ${where} while posting (${e.message}). Check its calendar before running this again: it may have gone through`);
- }
- const out = await res.json().catch(() => null);
- if (!res.ok) throw new UserError(`your Postiz didn't take the post (${res.status}): ${out?.message || out?.error || 'no reason given'}`);
- const byId = Object.fromEntries(ready.channels.map((c) => [c.id, c]));
- return {
- date: body.date,
- posts: (Array.isArray(out) ? out : []).map((x) => ({ id: x.postId, channel: x.integration, platform: byId[x.integration]?.platform || null, name: byId[x.integration]?.name || null })),
- };
-}
-
-// What each kind of channel needs besides the text: public, with the platform's own defaults for everything else.
-export function postizSettings(type, plan) {
- switch (type) {
- case 'tiktok': return { __type: 'tiktok', title: plan.title.slice(0, 90), privacy_level: 'PUBLIC_TO_EVERYONE', duet: false, stitch: false, comment: true, autoAddMusic: 'no', brand_content_toggle: false, brand_organic_toggle: false, content_posting_method: 'DIRECT_POST' };
- case 'youtube': return { __type: 'youtube', title: plan.title.slice(0, 100), type: 'public' };
- case 'instagram': case 'instagram-standalone': return { __type: type, post_type: 'post' };
- case 'x': return { __type: 'x', who_can_reply_post: 'everyone' };
- default: return { __type: type };
- }
-}
-
// ---- how it went ----
// How the last post of a project is going, per platform, with the links once they're live.
export async function publishStatus(root, id, { fetch = globalThis.fetch } = {}) {
const last = (loadProject(root, id).published || []).at(-1);
if (!last) throw new UserError('this project hasn\'t been published');
- return (last.service || 'uploadpost') === 'postiz' ? postizStatus(root, last, { fetch }) : uploadPostStatus(root, last, { fetch });
+ if (last.service === 'postiz') throw new UserError('that post went out through Postiz, which was removed after the Railway breach of 2026-10-21: check it in Postiz itself');
+ return uploadPostStatus(root, last, { fetch });
}
async function uploadPostStatus(root, last, { fetch }) {
@@ -249,27 +147,3 @@ async function uploadPostStatus(root, last, { fetch }) {
results: (body.results || []).map((r) => ({ platform: r.platform, state: r.status || (r.success ? 'completed' : 'failed'), url: r.post_url || null, message: r.error_message || r.message || null })),
};
}
-
-const POSTIZ_STATES = { QUEUE: 'queued', PUBLISHED: 'completed', ERROR: 'failed', DRAFT: 'draft' };
-
-async function postizStatus(root, last, { fetch }) {
- const apiKey = needKey(root, 'postiz');
- // Postiz lists posts by date: a window around when it was sent and when it was due.
- const times = [Date.parse(last.sent_at), Date.parse(last.date || last.sent_at)];
- const day = 24 * 3600 * 1000;
- const q = `startDate=${encodeURIComponent(new Date(Math.min(...times) - day).toISOString())}&endDate=${encodeURIComponent(new Date(Math.max(...times) + 2 * day).toISOString())}`;
- let res;
- try { res = await fetch(`${postizBase(root)}/posts?${q}`, { headers: { Authorization: apiKey } }); }
- catch (e) { throw new UserError(`couldn't reach your Postiz (${e.message}): is it running?`); }
- const body = await res.json().catch(() => ({}));
- if (!res.ok) throw new UserError(`your Postiz couldn't say (${res.status}): ${body.message || body.error || 'no reason given'}`);
- const found = Object.fromEntries((body.posts || []).map((x) => [x.id, x]));
- const results = (last.posts || []).map((x) => {
- const post = found[x.id];
- if (!post) return { platform: x.platform, state: 'gone', url: null, message: 'not in your Postiz any more (deleted there?)' };
- return { platform: x.platform || post.integration?.providerIdentifier, state: POSTIZ_STATES[post.state] || String(post.state || 'unknown').toLowerCase(), url: post.releaseURL || null, message: post.error || null };
- });
- const states = new Set(results.map((r) => r.state));
- const status = states.has('queued') ? 'queued' : states.has('failed') || states.has('gone') ? (states.has('completed') ? 'partly done' : 'failed') : results.length ? 'completed' : 'unknown';
- return { ...last, ref: `Postiz, ${results.length} post${results.length === 1 ? '' : 's'}`, status, message: null, results };
-}
diff --git a/src/setup.mjs b/src/setup.mjs
index ffe6a3c..a448190 100644
--- a/src/setup.mjs
+++ b/src/setup.mjs
@@ -70,7 +70,7 @@ export const PARTS = [
id: 'publish',
title: 'Publishing',
why: 'Once you approve a final, `mortiflix publish` can post it to your social accounts: where the brief said, at a time you pick, after it shows you the plan and you say yes. Sessions can never post.',
- needs: 'Optional. Upload-Post (hosted, paid plans, your accounts connected on upload-post.com) or Postiz (free and open source, AGPL-3.0, runs on your own server with Docker, your accounts connected in it). Either one\'s API key. Without one, you download finals and post them yourself.',
+ needs: 'Optional. Upload-Post (hosted, paid plans, your accounts connected on upload-post.com) and its API key. Without one, you download finals and post them yourself.',
},
{
id: '3d',
diff --git a/src/studio.mjs b/src/studio.mjs
index 9b24789..a0868ed 100644
--- a/src/studio.mjs
+++ b/src/studio.mjs
@@ -2,7 +2,7 @@
//
// <studio>/
// config.json settings (backend, model, port...). No secrets.
-// secrets.json your Anthropic, ElevenLabs, Upload-Post and Postiz keys (mode 600), set with `mortiflix keys`. Never served, never logged.
+// secrets.json your Anthropic, ElevenLabs and Upload-Post keys (mode 600), set with `mortiflix keys`. Never served, never logged.
// session.env other keys handed to every session (e.g. GEMINI_API_KEY=...), mode 600, also set with `mortiflix keys`
// checks.json the studio's error checklist (grows from your feedback)
// pipelines/<slug>/ your own pipelines (override the built-in ones with the same slug)
diff --git a/src/web/server.mjs b/src/web/server.mjs
index 7e0b09c..0d4a66a 100644
--- a/src/web/server.mjs
+++ b/src/web/server.mjs
@@ -115,7 +115,7 @@ export async function startServer(root, { port = 4646, host = '127.0.0.1', runne
if (p === '/setup' && method === 'GET') return send(res, 200, await setupInfo(root, installs));
if (p === '/setup/music' && method === 'PUT') { setup.saveMusic(root, await json(req)); return after(await setupInfo(root, installs)); }
if (p === '/setup/assets' && method === 'PUT') { setup.saveAssetSites(root, (await json(req)).sites); return after(await setupInfo(root, installs)); }
- if (p === '/setup/publish' && method === 'PUT') { const b = await json(req); pub.savePublish(root, { service: b.service, url: b.url, profile: b.profile }); return after(await setupInfo(root, installs)); }
+ if (p === '/setup/publish' && method === 'PUT') { const b = await json(req); pub.savePublish(root, { service: b.service, profile: b.profile }); return after(await setupInfo(root, installs)); }
if (p === '/setup/recordings' && method === 'PUT') { setup.browserHarnessRecordings(Boolean((await json(req)).enable)); return after(await setupInfo(root, installs)); }
if (p === '/setup/blender' && method === 'POST') {
if (!loopback) throw new BadRequest('Blender opens on the studio\'s own screen: use mortiflix blender there');
diff --git a/test/publish.test.mjs b/test/publish.test.mjs
index 9bf56f5..dc6cf16 100644
--- a/test/publish.test.mjs
+++ b/test/publish.test.mjs
@@ -6,12 +6,11 @@ import { tempStudio } from './helpers.mjs';
import { loadConfig } from '../src/studio.mjs';
import { createProject, projectPaths, update, loadProject, readEvents } from '../src/projects.mjs';
import * as keys from '../src/keys.mjs';
-import { publishPlan, publish, publishStatus, postizChannels, savePublish, publishConfig, utcDate, POSTIZ_DEFAULT } from '../src/publish.mjs';
+import { publishPlan, publish, publishStatus, savePublish, publishConfig } from '../src/publish.mjs';
import { run } from '../src/cli.mjs';
delete process.env.UPLOAD_POST_API_KEY;
delete process.env.UPLOAD_POST_API;
-delete process.env.POSTIZ_API_KEY;
// A social short that went through every gate: its approved final sits in the record.
function delivered(root, answers = { message: 'Bikes are faster than you think', platform: 'TikTok / Reels / Shorts' }, service = 'uploadpost') {
@@ -136,42 +135,13 @@ test('keys: the Upload-Post key is checked with a free call and never handed to
assert.throws(() => keys.setSessionKey(root, 'UPLOAD_POST_API_KEY', 'x'), /its own place/);
});
-// ---- your own Postiz ----
+// ---- the choice ----
-const CHANNELS = [
- { id: 'ch-tt', name: 'Fast Bikes TT', identifier: 'tiktok', disabled: false },
- { id: 'ch-ig', name: 'fastbikes', identifier: 'instagram-standalone', disabled: false },
- { id: 'ch-yt', name: 'Fast Bikes', identifier: 'youtube', disabled: false },
- { id: 'ch-old', name: 'Old YouTube', identifier: 'youtube', disabled: true },
- { id: 'ch-x', name: '@fastbikes', identifier: 'x', disabled: false },
-];
-
-// A fake Postiz: channels, uploads, posts and the post list.
-function fakePostiz({ channels = CHANNELS, posts = [] } = {}) {
- return fakeApi((url, init) => {
- if (url.endsWith('/integrations')) return init.headers.Authorization === 'pz-secret' ? [200, channels] : [401, { message: 'Unauthorized' }];
- if (url.endsWith('/upload')) return [200, { id: 'media-1', path: 'http://localhost:4007/uploads/final.mp4' }];
- if (url.endsWith('/posts') && init.method === 'POST') return [200, JSON.parse(init.body).posts.map((x, i) => ({ postId: `post-${i + 1}`, integration: x.integration.id }))];
- if (url.includes('/posts?')) return [200, { posts }];
- return [404, {}];
- });
-}
-
-test('postiz: chosen in setup, its address checked, its key separate', async (t) => {
+test('setup: Upload-Post or none; Postiz is gone', async (t) => {
const root = tempStudio(t);
assert.equal(publishConfig(loadConfig(root)).service, 'none');
- assert.equal(publishConfig(loadConfig(root)).postiz.url, POSTIZ_DEFAULT);
- assert.throws(() => savePublish(root, { service: 'myspace' }), /uploadpost, postiz or none/);
- assert.throws(() => savePublish(root, { service: 'postiz', url: 'ftp://box' }), /http:\/\/ or https:\/\//);
- assert.throws(() => savePublish(root, { service: 'postiz', url: 'https://me:[email protected]' }), /no login in the address/);
- assert.equal(savePublish(root, { service: 'postiz', url: 'https://postiz.example/api/' }).postiz.url, 'https://postiz.example/api');
-
- const ok = await keys.verifyKey(root, 'postiz', 'k', { fetch: async (url) => { assert.equal(url, 'https://postiz.example/api/public/v1/integrations'); return new Response(JSON.stringify(CHANNELS)); } });
- assert.equal(ok.ok, true);
- assert.match(ok.detail, /4 channels connected \(tiktok, instagram-standalone, youtube, x\)/);
- assert.equal((await keys.verifyKey(root, 'postiz', 'k', { fetch: async () => new Response('{}', { status: 401 }) })).ok, false);
- assert.deepEqual(keys.keysFor(root, { backend: 'claude-code', steps: [{ work: ['motion', 'audio'] }] }), []);
- assert.throws(() => keys.setSessionKey(root, 'POSTIZ_API_KEY', 'x'), /its own place/);
+ assert.throws(() => savePublish(root, { service: 'myspace' }), /uploadpost or none/);
+ assert.throws(() => savePublish(root, { service: 'postiz' }), /Postiz was removed/);
// Without a terminal, the same choice.
const out = [];
@@ -179,86 +149,11 @@ test('postiz: chosen in setup, its address checked, its key separate', async (t)
console.log = (...a) => out.push(a.join(' '));
try { await run(['--studio', root, 'setup', 'publish', 'uploadpost', '--profile', 'studio']); } finally { console.log = log; }
assert.match(out.join('\n'), /Publishing through Upload-Post/);
- assert.deepEqual(publishConfig(loadConfig(root)), { service: 'uploadpost', profile: 'studio', postiz: { url: 'https://postiz.example/api' } });
-});
-
-test('postiz: names the channels first, uploads the final, posts to each, and never twice by accident', async (t) => {
- const root = tempStudio(t);
- savePublish(root, { service: 'postiz' });
- const id = delivered(root);
- const plan = publishPlan(root, id, { description: 'Link in bio', at: '2026-10-20T18:00', timezone: 'Europe/Madrid' });
- assert.equal(plan.profile, null);
- assert.throws(() => publishPlan(root, id, { to: 'pinterest' }), /can't publish to pinterest through Postiz/);
- await assert.rejects(postizChannels(root, plan, { fetch: fakePostiz().fetch }), /needs your Postiz API key.*mortiflix keys set postiz/);
-
- keys.saveKey(root, 'postiz', 'pz-secret');
- const ready = await postizChannels(root, plan, { fetch: fakePostiz().fetch });
- // The disabled channel is left out; Instagram matches the standalone kind too.
- assert.deepEqual(ready.channels.map((c) => [c.platform, c.id]), [['tiktok', 'ch-tt'], ['instagram', 'ch-ig'], ['youtube', 'ch-yt']]);
- await assert.rejects(postizChannels(root, { ...plan, platforms: ['linkedin'] }, { fetch: fakePostiz().fetch }), /no linkedin channel connected in your Postiz/);
-
- const api = fakePostiz();
- const sent = await publish(root, ready, { fetch: api.fetch });
- const [up, post] = api.calls;
- assert.equal(up.url, 'http://localhost:4007/api/public/v1/upload');
- assert.equal(up.init.headers.Authorization, 'pz-secret');
- assert.equal(up.form.get('file').size, 2048);
- assert.equal(post.url, 'http://localhost:4007/api/public/v1/posts');
- const body = JSON.parse(post.init.body);
- assert.equal(body.type, 'schedule');
- assert.equal(body.date, '2026-10-20T16:00:00.000Z'); // 18:00 in Madrid (summer time)
- assert.deepEqual(body.posts.map((x) => x.settings.__type), ['tiktok', 'instagram-standalone', 'youtube']);
- assert.equal(body.posts[0].settings.content_posting_method, 'DIRECT_POST');
- assert.equal(body.posts[0].settings.privacy_level, 'PUBLIC_TO_EVERYONE');
- assert.deepEqual(body.posts[2].settings, { __type: 'youtube', title: 'Fast bikes', type: 'public' });
- assert.equal(body.posts[0].value[0].content, 'Fast bikes\n\nLink in bio');
- assert.equal(body.posts[2].value[0].content, 'Link in bio');
- assert.deepEqual(body.posts[1].value[0].image, [{ id: 'media-1', path: 'http://localhost:4007/uploads/final.mp4' }]);
-
- assert.deepEqual(sent.posts.map((x) => [x.id, x.platform]), [['post-1', 'tiktok'], ['post-2', 'instagram'], ['post-3', 'youtube']]);
- assert.equal(loadProject(root, id).published[0].service, 'postiz');
- assert.match(readEvents(root, id).at(-1).details, /via Postiz at 2026-10-20T18:00 Europe\/Madrid/);
+ assert.deepEqual(publishConfig(loadConfig(root)), { service: 'uploadpost', profile: 'studio' });
- // Postiz has no idempotency key: the studio refuses the same post again, unless you ask for it.
- await assert.rejects(publish(root, ready, { fetch: api.fetch }), /already sent.*--again/);
- const again = publishPlan(root, id, { description: 'Link in bio', at: '2026-10-20T18:00', timezone: 'Europe/Madrid', again: true });
- assert.notEqual(again.key, plan.key);
- await publish(root, again, { fetch: fakePostiz().fetch });
- assert.equal(loadProject(root, id).published.length, 2);
-});
-
-test('postiz: a refused upload or post records nothing; status reads each post back with its link', async (t) => {
- const root = tempStudio(t);
- savePublish(root, { service: 'postiz' });
+ // A studio set up for Postiz before it was removed reads as not set up, and an old Postiz post isn't looked up.
+ assert.equal(publishConfig({ publish: { service: 'postiz', postiz: { url: 'http://localhost:4007/api' } } }).service, 'none');
const id = delivered(root);
- keys.saveKey(root, 'postiz', 'pz-secret');
- const plan = await postizChannels(root, publishPlan(root, id, { to: 'tiktok,youtube' }), { fetch: fakePostiz().fetch });
- // Fails at one endpoint; the upload before it works.
- const failing = (where, status) => fakeApi((url) => (url.endsWith(where) ? [status, { message: 'Bad video' }] : [200, { id: 'm', path: 'p' }]));
- await assert.rejects(publish(root, plan, { fetch: failing('/upload', 400).fetch }), /didn't take the video \(400\): Bad video\. Nothing was posted/);
- await assert.rejects(publish(root, plan, { fetch: failing('/posts', 400).fetch }), /didn't take the post \(400\): Bad video/);
- await assert.rejects(publish(root, plan, { fetch: async () => { throw new Error('ECONNREFUSED'); } }), /couldn't reach your Postiz at http:\/\/localhost:4007\/api/);
- assert.equal(loadProject(root, id).published, undefined);
-
- await publish(root, plan, { fetch: fakePostiz().fetch });
- const api = fakePostiz({ posts: [
- { id: 'post-1', state: 'PUBLISHED', releaseURL: 'https://www.tiktok.com/@me/video/1', integration: { providerIdentifier: 'tiktok' } },
- { id: 'post-2', state: 'ERROR', error: 'Daily upload limit reached', integration: { providerIdentifier: 'youtube' } },
- { id: 'someone-else', state: 'QUEUE' },
- ] });
- const st = await publishStatus(root, id, { fetch: api.fetch });
- assert.match(api.calls[0].url, /^http:\/\/localhost:4007\/api\/public\/v1\/posts\?startDate=.+&endDate=/);
- assert.equal(st.status, 'partly done');
- assert.deepEqual(st.results, [
- { platform: 'tiktok', state: 'completed', url: 'https://www.tiktok.com/@me/video/1', message: null },
- { platform: 'youtube', state: 'failed', url: null, message: 'Daily upload limit reached' },
- ]);
-});
-
-test('publish: a time without an offset is read in its time zone', () => {
- assert.equal(utcDate('2026-10-20T18:00'), '2026-10-20T18:00:00.000Z');
- assert.equal(utcDate('2026-10-20T18:00', 'Europe/Madrid'), '2026-10-20T16:00:00.000Z');
- assert.equal(utcDate('2026-12-20T18:00', 'Europe/Madrid'), '2026-12-20T17:00:00.000Z');
- assert.equal(utcDate('2026-12-20T18:00', 'America/Chicago'), '2026-12-21T00:00:00.000Z');
- assert.equal(utcDate('2026-10-20T18:00+02:00', 'America/Chicago'), '2026-10-20T16:00:00.000Z');
+ update(root, id, (x) => { x.published = [{ service: 'postiz', posts: [] }]; });
+ await assert.rejects(publishStatus(root, id, { fetch: async () => { throw new Error('no call'); } }), /went out through Postiz/);
});
diff --git a/web/app.js b/web/app.js
index 8b40228..7431e77 100644
--- a/web/app.js
+++ b/web/app.js
@@ -732,7 +732,7 @@ async function setupSection() {
};
// Publishing: which service posts a delivered video (`mortiflix publish`), and what it needs.
- const PUBLISH = { 'Upload-Post': 'uploadpost', 'Postiz (self-hosted)': 'postiz', Off: 'none' };
+ const PUBLISH = { 'Upload-Post': 'uploadpost', Off: 'none' };
const savePublish = async (body, done) => {
try { info = await api('/api/setup/publish', { method: 'PUT', body }); draw(); if (done) toast(done); } catch (e) { toast(e.message, true); }
};
@@ -748,13 +748,6 @@ async function setupSection() {
h('div', { class: 'actions', style: { marginTop: '8px' } },
h('button', { class: 'btn', onclick: () => savePublish({ profile }, 'Profile saved') }, 'Save'), keyNote),
h('p', { class: 'meta' }, 'Connect your accounts on upload-post.com, under a profile. Paid plans.'));
- } else if (pb.service === 'postiz') {
- let url = pb.postiz.url;
- detail = h('div', null,
- h('input', { type: 'text', inputmode: 'url', placeholder: 'http://localhost:4007/api', value: url, oninput: (e) => { url = e.target.value; } }),
- h('div', { class: 'actions', style: { marginTop: '8px' } },
- h('button', { class: 'btn', onclick: () => savePublish({ url }, 'Postiz address saved') }, 'Save'), keyNote),
- h('p', { class: 'meta' }, 'Your Postiz\'s API address: the official Docker image answers at http://localhost:4007/api, Postiz Cloud at https://api.postiz.com. Install it with Docker Compose (docs.postiz.com › Self-host), then connect your accounts in it. Each platform needs a developer app you register there; TikTok keeps posts private until it has reviewed yours.'));
}
return h('div', null,
choiceChips(Object.keys(PUBLISH), label, (v) => savePublish({ service: PUBLISH[v] })),