Skip to content
Publishing controls

Publishing controls

PULSE drafts a great deal on its own: daily social copy, blog posts, podcast episodes, videos. Whether any of it leaves the building is decided by two layers of switches, and nothing is armed by default.

Every switch, with its default and the order to turn them on, is in one table on Switches and arming order.

The rule

armed(channel) = PULSE_APPLY_ENABLED is exactly "true"
                 AND the channel's own setting is on
  1. PULSE_APPLY_ENABLED is the kill switch. It is off unless it is exactly the lowercase string true. When it is off, no channel can publish, whatever else is set.
  2. Each channel can then be narrowed. A channel with no setting of its own follows the kill switch. A channel setting can only turn a channel off. It can never turn one on when the kill switch is off.

The channels

Channel keyWhat it publishes
blogA Hugo post on your website, through GitHub. See Site pipeline.
podcastPodcast episodes, by adding them to the public RSS feed
audiobookThe weekly long-form book, in the same feed
youtubeReal uploads to a YouTube channel, under the operator’s Google identity
linkedinText posts as the connected member, or as the company page chosen on the LinkedIn card. The daily LinkedIn draft is written whatever this says; see below.
instagramHas its own control, so the channel is governed by the same switch
spotifyHas its own control, under the same rule

Setting a channel

A channel’s own setting comes from the first of these that holds a clear yes or no:

  1. An environment variable, PULSE_PUBLISH_<CHANNEL>, for example PULSE_PUBLISH_YOUTUBE=false. It accepts 1, t, true, y, yes, on and 0, f, false, n, no, off.
  2. A config file, at PULSE_PUBLISH_CONFIG_PATH (default /etc/runink/pulse-publishing.json), or the same JSON inline in PULSE_PUBLISH_CONFIG_JSON when there is no file.
  3. The built-in default, which is on. Combined with a kill switch that is off by default, nothing publishes until someone arms the global.

The config file accepts either shape:

[{"channel": "youtube", "armed": false}]
{"channels": [{"channel": "youtube", "armed": false}]}

A channel missing from the file has no opinion. A file that cannot be read or parsed is ignored and changes nothing in either direction.

Checking what is armed

At startup the server logs one line per channel:

PUBLISHCFG youtube: armed=false (...); channel opinion from ...; console config: ...

A refused publish logs PUBLISHCFG <channel>: DISARMED — did NOT ..., with the layer that decided.

PULSE_APPLY_ENABLED=yes, on, 1, or TRUE does not arm anything. The server warns at startup with PUBLISHCFG-AMBIGUOUS. Write exactly true.

What disarming does to queued posts

The kill switch applies at the moment of publishing, not only when a post is queued. A scheduled post that comes due on a disarmed channel is marked withheld, with the reason. That is final. Re-arming does not replay the backlog; schedule the content again to re-queue it.

Approving content does not bypass the switch either. An approval is consent to the content, and the switch is a statement about the channel.

Who may publish as the deployment

Some channels publish with the user’s own connected account (youtube, instagram, spotify), so a user can only ever post as themselves. Others publish as the deployment:

ChannelWhy it is the deployment’s
linkedinThe user’s own LinkedIn connection (Settings → Integrations); the deployment’s LINKEDIN_ACCESS_TOKEN only for a user with no connection
blogThe operator’s PULSE_SITE_REPO
podcast, audiobookThe one public RSS feed at /podcast/feed.xml

On these channels, being armed is not enough. The content’s owner must also be listed in PULSE_PUBLISHER_USER_IDS, a comma-separated list of PULSE user ids (the users.id column, not emails). Empty means nobody.

  • A dispatch by anyone else is recorded as withheld, with a reason naming the owner gate. It is never reported as posted, and nothing is sent.
  • The daily blog, podcast and audiobook engines skip other users’ campaigns before generating, and log SKIPPED with the same reason.
  • The feed lists only allowlisted owners’ episodes, and only for the channels that are armed. With both podcast and audiobook disarmed, /podcast/feed.xml returns 404.

A <user-id> is the id column of the users table.

The daily LinkedIn draft

Once a day the social engine writes one LinkedIn post per active campaign: a hook line, short paragraphs, three to five hashtags, and a closing link to PULSE_LINKEDIN_CTA_URL (default https://runink.org). The row belongs to the campaign’s owner and waits on Approval with a Copy draft button, so a person pastes it into LinkedIn.

  • The draft is never scheduled. The engine writes no scheduled_posts row for it, and it needs no switch to be written.
  • A draft over LinkedIn’s 3,000-character limit is still kept, and its title says OVER 3000 CHARS, trim before posting.
  • A generation that fails, comes back empty, or is only a refusal is logged and not stored.
  • One draft per campaign per day. A restart does not write a second one.

Approving a LinkedIn draft still offers it to the LinkedIn publisher. It is recorded withheld, and nothing reaches LinkedIn, when the channel is disarmed (PULSE_PUBLISH_LINKEDIN=false or the kill switch off), when no LinkedIn token is configured (neither a connection nor, for a user without one, LINKEDIN_ACCESS_TOKEN), or when the owner is not in PULSE_PUBLISHER_USER_IDS. The content stays approved, ready to copy.

Drafts-only is a setting, not a property of the code. With the kill switch armed, LinkedIn not narrowed, a token configured, and the owner allowlisted, approving a draft posts it. To keep LinkedIn drafts-only while other channels are armed, set PULSE_PUBLISH_LINKEDIN=false.

A campaign that an audit created is a draft until someone activates it, so an audit on its own produces no daily LinkedIn draft.

Outbound calls

The one call path is an AI call (AICallService.PlaceAICall). It needs PULSE_OUTBOUND_CALLS=true and PULSE_AI_CALLS=true, both off by default, PULSE_APPLY_ENABLED=true, a caller whose current role is editor or admin, and the lead’s consent, calling hours, do-not-call and attempt checks. The Asterisk path (CallLead) is retired.

The same switch gates server writes

PULSE_APPLY_ENABLED=true is also what arms the daily blog drafting in the social engine, and what starts the daily site-audit engine. With it off, neither runs and neither costs model time.

It is not enough for the audit-fix modes of ApplyAuditActions (apply, commit, pr), which write to the server’s filesystem and run git with the server’s credentials. Those also need:

VariableDefaultMeaning
PULSE_AUDIT_APPLYoffA narrowing key AND-ed with the kill switch. Unlike the channel keys it defaults off, so arming every channel does not arm server writes. Same yes/no tokens as PULSE_PUBLISH_<CHANNEL>.
PULSE_APPLY_ROOTnoneThe only directory a repo_path may resolve into. Unset refuses every mode, plan included.

and the caller must be an administrator, read from the users table on every call.

Channel-specific safeguards

ChannelAlso needs
blogA GitHub data source with a token, PULSE_SITE_REPO, and the content owner in PULSE_PUBLISHER_USER_IDS.
youtubeYOUTUBE_PRIVACY_STATUS. Unset means private, so an unreviewed upload is never public by accident.
linkedinThe token on the user’s LinkedIn card (sealed in the database), else, for a user with no LinkedIn connection, LINKEDIN_ACCESS_TOKEN and LINKEDIN_AUTHOR_URN (a person or an organization URN). A company page also needs the app’s Community Management API approval. The content owner in PULSE_PUBLISHER_USER_IDS.
podcast, audiobookThe owner in PULSE_PUBLISHER_USER_IDS, PULSE_PUBLIC_BASE_URL, and the episode’s audio must exist. Then submit <PULSE_PUBLIC_BASE_URL>/podcast/feed.xml once to each podcast platform.

Posting to LinkedIn as a company page

The LinkedIn card under Settings → Integrations holds the token PULSE posts with. A user who has a LinkedIn connection always posts with it; a disconnected one posts nothing (the deployment token is not used instead). The deployment’s LINKEDIN_ACCESS_TOKEN is used only for a user with no LinkedIn connection at all. The server log says which token each post used, and the channel’s readiness (ListChannelReadiness: credential_source, author_kind, author_urn) shows it before anything is posted.

Choose who posts on the card lists the company pages the token may post as (LinkedIn roles ADMINISTRATOR or CONTENT_ADMINISTRATOR). Pick one, and approved posts are authored by urn:li:organization:<id>. Leave it on Me to post as the member; PULSE then reads the member id from LinkedIn (/v2/userinfo, which needs the openid and profile scopes).

Owner action first. LinkedIn lets an app list and post as company pages only after it approves the app for the Community Management API. The token then needs w_organization_social (to post) and rw_organization_admin (to list the pages). Until then the list is empty and the card says why. Every other gate still applies: PULSE_APPLY_ENABLED, PULSE_PUBLISH_LINKEDIN, and the owner in PULSE_PUBLISHER_USER_IDS.

With the instance’s LinkedIn app configured (LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET) and LINKEDIN_COMPANY_PAGES=true, Connect company pages on the card signs in with the page scopes instead of a pasted token. See LinkedIn.