Docker container to continuously sync Obsidian markdown notes from a GitHub repository and publish it for the webs.
Official Perlite demo here.
# clone this repository
git clone https://github.com/l4rm4nd/Obsidian-Mkdocs-Gitsync
cd Obsidian-Mkdocs-Gitsync
# adjust `docker-compose.yml` to your needs:
# 1. add your to be synced GitHub repo at env variable `GIT_SYNC_REPO`
# 2. add your GitHub username at env variable `GIT_SYNC_USERNAME` - only if your repo is private
# 3. add GitHub access token at env variable `GIT_SYNC_PASSWORD` - only if your repo is private
# 4. add your GitHub repo name at env variable `HIDE_FOLDERS`
# fix permissions; may have to be run a second time after starting the container
sudo chmod -R 777 repository/
sudo chown -R 1000:1000 repository/
# start the container
docker compose up -d
Then browse http://127.0.0.1:8888 to inspect your markdown notes. May combine with a reverse proxy such as Traefik and publish securely to the interwebs. Enjoy!
If you want to change the default notes path/name Demo
, you also have to adjust the volume mappings for the perlite service too. So if your to be synced GitHub repo is called Obsidian_Notes
, adjust the compose file's service Perlite as follows:
services:
perlite:
image: sec77/perlite:latest
container_name: perlite
restart: unless-stopped
environment:
- NOTES_PATH=Obsidian_Notes # <-- adjusted with custom repo name
- HIDE_FOLDERS=docs,private,trash
- LINE_BREAKS=true
volumes:
- ./repository/root:/var/www/perlite/Obsidian_Notes:ro # <-- adjusted with custom repo name
If you want to adjust the website's title, please adjust the index.php
file that is bind mounted into the Perlite container. The following line is relevant:
12 $title = 'Obsidian-Gitsync-Perlite';
To correctly display images and links you have to adjust your Obsidian settings slightly.
In detail, you have to enable relative path links. Please follow the instructions here.
Many thanks to the original devs:
- ❤️ secure-77 for Perlite
- ❤️ kubernetes for git-sync