Skip to content

feat: add support for self-hosted Confluence (Server / Data Center) - #1

Open
wodCZ wants to merge 2 commits into
mainfrom
feat/self-hosted-support
Open

feat: add support for self-hosted Confluence (Server / Data Center)#1
wodCZ wants to merge 2 commits into
mainfrom
feat/self-hosted-support

Conversation

@wodCZ

@wodCZ wodCZ commented Jul 24, 2026

Copy link
Copy Markdown
Member

The tool previously assumed Atlassian Cloud (the /wiki context path, email + API-token Basic auth, and accountId-based user references). Add a deployment-aware layer so self-hosted Server / Data Center instances work too.

  • Auto-detect deployment from the URL host (*.atlassian.net = Cloud, else self-hosted); override with a new --type cloud|server flag.
  • Self-hosted authenticates with a Personal Access Token via Bearer auth; email is now required only for Cloud.
  • Deployment-aware REST API base path (Cloud /wiki/rest/api vs server /rest/api), including support for a context path (e.g. /confluence).
  • Resolve users by userKey (?key=) in addition to accountId (?accountId=), and read ri:userkey / ri:username content references alongside ri:account-id.
  • Parse self-hosted URL forms: /pages/viewpage.action?pageId=, /spaces/SPACE/pages/ID, and pretty /display/SPACE/Title (page ID resolved from space + title via the API).
  • Build attachment/image download links and frontmatter page URLs from the instance context path instead of a hardcoded /wiki.

Add unit tests for URL parsing/detection and client auth/paths; update README.

The tool previously assumed Atlassian Cloud (the /wiki context path,
email + API-token Basic auth, and accountId-based user references). Add a
deployment-aware layer so self-hosted Server / Data Center instances work too.

- Auto-detect deployment from the URL host (*.atlassian.net = Cloud, else
  self-hosted); override with a new --type cloud|server flag.
- Self-hosted authenticates with a Personal Access Token via Bearer auth;
  email is now required only for Cloud.
- Deployment-aware REST API base path (Cloud /wiki/rest/api vs server
  /rest/api), including support for a context path (e.g. /confluence).
- Resolve users by userKey (?key=) in addition to accountId (?accountId=),
  and read ri:userkey / ri:username content references alongside ri:account-id.
- Parse self-hosted URL forms: /pages/viewpage.action?pageId=,
  /spaces/SPACE/pages/ID, and pretty /display/SPACE/Title (page ID resolved
  from space + title via the API).
- Build attachment/image download links and frontmatter page URLs from the
  instance context path instead of a hardcoded /wiki.

Add unit tests for URL parsing/detection and client auth/paths; update README.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nversion

Fixes found while mirroring a large self-hosted space to Markdown:

- ac:link to ri:page/ri:attachment was silently dropped (only ri:user was
  handled), losing every cross-page reference in tables and body text.
  Now renders a markdown link with a best-effort display URL.
- Classic emoticons without an emoji-fallback glyph (tick, minus, information,
  ...) leaked as raw :name: tokens; now mapped to Unicode symbols.
- view-file/viewpdf/... macros embedding attachments were left as
  "Unsupported macro" comments; attachments are now downloaded alongside
  images.
- jira macro renders its issue key instead of being dropped.
- contentbylabel macro (dynamic, not present in page storage) is resolved
  via a new Client.SearchByCQL and materialized into a link list.
- children/pagetree macros are materialized into a linked list instead of
  a bare comment, wrapped in markers so empty-stub detection still works.
- markdown macro body (already Markdown, CDATA-wrapped) is now emitted
  verbatim instead of left unsupported.
- Page validation no longer rejects legitimately empty container pages.
- A single missing/oversized attachment now warns and is skipped instead
  of failing the whole page conversion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant