- Add Docker Compose setup for Wiki.js and PostgreSQL. - Include setup and backup scripts for easy management. - Create command-line scripts to create and edit wiki pages via the GraphQL API. - Add comprehensive README and .gitignore.
Personal Wiki.js Project
This repository contains everything needed to set up, manage, and programmatically interact with a personal Wiki.js instance using Docker and Python scripts.
🚀 Quick Start
-
Set Up Environment: Ensure you have
dockeranddocker-composeinstalled. Thesetup.shscript will check for these. -
Run Setup Script: This script generates a secure database password, creates necessary directories, and starts the wiki.
./setup.sh -
Access Your Wiki: Open your browser and navigate to the URL specified in your
.envfile (e.g.,http://localhost:3000orhttps://wiki.liveaodh.com). Complete the initial setup wizard and create your administrator account.
📁 Project Structure
wikiaodh/
├── docker-compose.yml # Docker services configuration
├── .env # Environment variables (passwords, API key, etc.)
├── setup.sh # Automated setup script
├── backup.sh # Backup script for database and assets
├── README.md # This file
├── requirements.txt # Python dependencies for scripts
├── venv/ # Python virtual environment
└── scripts/
├── create_page.py # CLI tool to create new wiki pages
└── edit_page.py # CLI tool to edit existing wiki pages
🔧 Wiki Management
Docker Commands
- Start the wiki:
docker-compose up -d - Stop the wiki:
docker-compose down - View logs:
docker-compose logs -f - Restart services:
docker-compose restart - Update to latest version:
docker-compose pull && docker-compose up -d
Backup and Restore
- Run a full backup: The
backup.shscript creates a timestamped backup of your database and assets in thebackups/directory../backup.sh
🤖 Command-Line Scripts
These scripts use the Wiki.js GraphQL API to manage content programmatically. They require a Python virtual environment and an API key.
Setup
-
Activate Virtual Environment:
source venv/bin/activate -
Set API Key: Generate an API key in the Wiki.js Administration -> API Access area and add it to your
.envfile:WIKI_API_KEY=your_api_key_here
scripts/create_page.py
Creates a new page in your wiki.
Usage:
python3 scripts/create_page.py --path "my-folder/my-new-page" --title "My New Page" --content-file "path/to/my-content.md"
Arguments:
--path(required): The URL path for the new page.--title(required): The title of the page.--content-file(required): Path to a markdown file with the page content.--tags(optional): A list of tags (e.g.,--tags project guide).
scripts/edit_page.py
Edits an existing page in your wiki.
Usage:
# Update content
python3 scripts/edit_page.py --path "home" --content-file "new_content.md"
# Update title
python3 scripts/edit_page.py --path "home" --title "New Home Page Title"
# Update both
python3 scripts/edit_page.py --path "home" --title "New Title" --content-file "new_content.md"
Arguments:
--path(required): The path of the page to edit.--content-file(optional): Path to a markdown file with the new content.--title(optional): A new title for the page.
Enjoy your powerful, scriptable personal wiki! 📖✨