WikiSmith/macseem/wikismith
Live WikiSign in

Public AI Wiki Sharing

Overview

The Public AI Wiki Sharing feature allows wiki owners to share AI-generated content publicly through unique links and optional website embeds. This feature addresses the need for a straightforward publishing model, enabling users to distribute documentation without requiring viewer authentication.

User-facing behavior

  • Wiki Owners:

    • Can publish wikis and generate shareable links for public access.
    • Have the ability to unpublish or rotate share links to revoke access.
    • Can enable or disable embedding of wiki content on external websites.
  • Viewers:

    • Can access shared wikis via public links without signing in.
    • Can navigate through pages of the shared wiki seamlessly.
    • Can view embedded wiki content that is consistent with the original.

Architecture and data flow

The architecture revolves around a centralized dashboard that manages wiki visibility and sharing settings. The flow includes:

  • Visibility Control: Wiki owners set their wikis to public or private from the dashboard.
  • Share Link Generation: When a wiki is made public, an unguessable token is generated for the share link.
  • Content Retrieval: Public wikis can be accessed via the generated link, which points to the latest version of the wiki content.
  • Embedding: If enabled, the system provides an embed-ready route for public wiki pages, allowing them to be integrated into external sites.

Key implementation details

  • Visibility and Access Controls:
    • Wikis are private by default, and owners can toggle visibility.
    • Public wikis are accessible without authentication, while private or revoked links return a 404 status to enhance security.
{
  "defaultVisibility": "private",
  "publicAccess": true,
  "responseOnRevokedLink": 404
}
  • Share Link Model:
    • Public sharing utilizes a high-entropy token (UUID) to ensure security.
    • Share links remain stable across wiki updates and support deep linking for navigation.
const generateShareLink = (wikiId: string): string => {
  const token = generateUUID();
  return `https://wiki.example.com/${wikiId}/share/${token}`;
};
  • Embedded Wiki Delivery:
    • The system provides an embed-ready route that renders pages in read-only mode, hiding owner controls.
    • Owners can independently enable or disable embedding without affecting the public visibility setting.
<iframe src="https://wiki.example.com/embed/{wikiId}" width="600" height="400"></iframe>
  • Dashboard User Experience:
    • The dashboard includes a dedicated "Sharing" control surface for each wiki, allowing easy management of visibility and sharing settings.
    • The UI provides clear indicators of the current status and options for link management.
# Example command to rotate share token
curl -X POST https://api.example.com/wikis/{wikiId}/rotate-token

Key files

  • features/public-ai-wiki-sharing-prd.md - Contains detailed requirements and user stories for the Public AI Wiki Sharing feature, outlining goals and functional specifications features/public-ai-wiki-sharing-prd.md:1-28.
  • src/dashboard/SharingControl.ts - Implements the sharing control UI, allowing wiki owners to manage visibility and sharing settings.
  • src/api/ShareLinkController.ts - Handles the generation and management of share links, including token rotation and access control.
  • src/embed/EmbedRoute.ts - Manages the embedding of wiki content, ensuring it is rendered correctly and securely on external sites.