wiki-plugin-linkitylink
v0.0.22
Published
Linkitylink integration plugin for federated wiki
Maintainers
Readme
wiki-plugin-linkitylink
🎉 This is the code for wiki-based federated distribution of software apps.
This plugin demonstrates a complete pattern for distributing and running software applications through Federated Wiki, enabling true peer-to-peer app distribution with automatic updates, version management, and zero-configuration deployment.
Federated Wiki plugin that integrates Linkitylink - a privacy-first link page service.
What This Plugin Does
This plugin integrates Linkitylink with Federated Wiki by:
- Launching a dedicated linkitylink instance for each wiki
- Auto-configuring that instance with the wiki's base URLs
- Proxying requests between wiki and linkitylink
- Managing the lifecycle of the linkitylink service
Each wiki gets its own linkitylink instance, enabling true forking and independent operation.
Wiki-Based Federated Distribution
This plugin implements the Service-Bundling Plugin Pattern, which enables:
- ✅ One-Click Installation - Install apps via plugmatic (fedwiki's plugin manager)
- ✅ Automatic Service Management - Apps spawn and manage themselves
- ✅ Built-In Version Management - Traffic light indicators show update status
- ✅ One-Click Updates - Users can update apps without touching the command line
- ✅ True Forking - Fork a wiki page, get an independent instance of the app
- ✅ Zero Configuration - Works out of the box with sensible defaults
For developers: See CLAUDE.md for the complete Service-Bundling Plugin Pattern documentation. This pattern is reusable for any fedwiki plugin that needs to integrate an external service or application.
Installation
Via Plugmatic (Recommended)
- Open your Federated Wiki
- Add a
plugmaticitem to any page - Add
linkitylinkto the plugin list - Click the status indicator to install
- Done! Linkitylink is now available at
/plugin/linkitylink/
Via npm
1. Install the plugin
# In your wiki's node_modules directory
cd /path/to/wiki/node_modules
git clone https://github.com/planet-nine-app/wiki-plugin-linkitylink.git
cd wiki-plugin-linkitylink
npm install2. Install linkitylink
# Clone linkitylink where the plugin can find it
cd /path/to/planet-nine
git clone https://github.com/planet-nine-app/linkitylink.git
cd linkitylink
npm install3. Use in your wiki
Create a page with a linkitylink item to trigger plugin loading. The plugin will automatically:
- Launch its own linkitylink instance
- Configure it with your wiki's base URLs
- Start proxying requests
{
"type": "linkitylink",
"id": "unique-id",
"text": "My Link Page"
}Routes
All routes are proxied from the wiki to the Linkitylink service:
/plugin/linkitylink/→ Linkitylink homepage/plugin/linkitylink/create→ Create link page/plugin/linkitylink/view/:emojicode→ View link page by emojicode/plugin/linkitylink/t/:alphanumeric→ View link page by alphanumeric ID
Configuration
Environment Variables
Required for multiple wikis on same machine:
# Wiki 1
export LINKITYLINK_PORT=6010
export LINKITYLINK_PATH=/path/to/linkitylink
wiki --port 3000
# Wiki 2 (different terminal)
export LINKITYLINK_PORT=6011
export LINKITYLINK_PATH=/path/to/linkitylink-copy
wiki --port 3001Variables:
LINKITYLINK_PORT- Port for this wiki's linkitylink instance (default: 6010)LINKITYLINK_PATH- Path to linkitylink installation (default:../../linkitylinkrelative to plugin)ENABLE_APP_PURCHASE- Show "Buy in App" button (default: false, set totrueto enable)
Base URLs (owner.json)
The plugin automatically configures linkitylink with base URLs from ~/.wiki/status/owner.json:
{
"fountURL": "http://localhost:3006",
"bdoURL": "http://localhost:3003",
"addieURL": "http://localhost:3005"
}For wiki federation, each wiki's owner.json should point to its own base:
// Wiki A's owner.json
{
"fountURL": "http://base-a.example.com/plugin/allyabase/fount",
"bdoURL": "http://base-a.example.com/plugin/allyabase/bdo",
"addieURL": "http://base-a.example.com/plugin/allyabase/addie"
}
// Wiki B's owner.json
{
"fountURL": "http://base-b.example.com/plugin/allyabase/fount",
"bdoURL": "http://base-b.example.com/plugin/allyabase/bdo",
"addieURL": "http://base-b.example.com/plugin/allyabase/addie"
}How It Works
Plugin Startup Flow
- Plugin loads when wiki page uses linkitylink type
- Reads configuration from
~/.wiki/status/owner.json - Checks for running linkitylink on configured port
- If not running:
- Spawns linkitylink as child process
- Sets environment variables (PORT, FOUNT_BASE_URL, BDO_BASE_URL, ADDIE_BASE_URL)
- Waits for startup (3 seconds)
- If already running:
- Sends configuration update via
POST /config
- Sends configuration update via
- Creates proxy for all
/plugin/linkitylink/*routes
Request Flow
- User visits
http://your-wiki.com/plugin/linkitylink/view/🔗💎... - Plugin strips
/plugin/linkitylinkprefix - Proxies to
http://localhost:{LINKITYLINK_PORT}/view/🔗💎... - Linkitylink fetches data from configured base URLs
- Returns beautiful SVG page to wiki
Architecture Benefits
- Independent Instances - Each wiki runs its own linkitylink
- Isolated Bases - Wiki A connects to Base A, Wiki B connects to Base B
- True Forking - Fork a wiki page, get independent linkitylink data
- Process Management - Plugin manages linkitylink lifecycle
- Automatic Configuration - No manual setup required
Dependencies
http-proxy: ^1.18.1 - For proxying requests to Linkitylink servicenode-fetch: ^2.6.1 - For configuring linkitylink via HTTP
License
MIT
