Skip to content

Docker container to continuously sync Obsidian markdown notes from GitHub and publish it for the webs

Notifications You must be signed in to change notification settings

Geronimoes/Obsidian-Gitsync

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Obsidian-Gitsync-Perlite

Docker container to continuously sync Obsidian markdown notes from a GitHub repository and publish it for the webs.

Official Perlite demo here.

image

Usage

# 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!

Customization

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';

Links & Images

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.

Acknowledgement

Many thanks to the original devs:

About

Docker container to continuously sync Obsidian markdown notes from GitHub and publish it for the webs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%