a30eb4d42d77b2effb64e8d9dffa098dec78729c
Gobsidian
A modern, responsive web interface for viewing and editing Obsidian markdown notes, built with Go and TailwindCSS.
Features
- Responsive Design: Works seamlessly on desktop and mobile devices
- Dark Theme: Beautiful dark interface optimized for extended use
- Multiple Image Storage Modes: Flexible image storage options to match Obsidian's behavior
- File Management: Upload, download, edit, and delete files and notes
- Syntax Highlighting: Code blocks with syntax highlighting for multiple languages
- Search Functionality: Quick search through your notes
- Settings Management: Web-based configuration interface
- Markdown Rendering: Full markdown support with Obsidian-style features
Image Storage Modes
- Root Directory: Store images directly in the notes root directory
- Specific Folder: Store all images in a designated folder
- Same as Note: Store images in the same directory as the note
- Subfolder of Note: Store images in a subfolder within the note's directory
Installation
-
Clone the repository:
git clone https://ghb.freebede.com/nahakubuilder/gobsidian.git cd gobsidian -
Install dependencies:
go mod download -
Run the application:
go run cmd/main.go -
Open your browser and navigate to
http://localhost:3000
Configuration
On first run, Gobsidian will create a settings.ini file with default configurations. You can modify these settings through the web interface at /settings or by editing the file directly.
- initial login admin/admin << Make sure you change the password!
Default Configuration
[SERVER]
SECRET_KEY = change-this-secret-key
DEBUG = false
MAX_CONTENT_LENGTH = 16
URL_PREFIX =
HOST = 0.0.0.0
PORT = 3000
[MD_NOTES_APP]
IMAGE_STORAGE_MODE = 1
ALLOWED_IMAGE_EXTENSIONS = jpg, jpeg, png, webp, gif
ALLOWED_FILE_EXTENSIONS = txt, pdf, html, json, yaml, yml, conf, csv, cmd, bat, sh
SHOW_IMAGES_IN_TREE = false
SHOW_IMAGES_IN_FOLDER = true
APP_NAME = Gobsidian
NOTES_DIR = notes
NOTES_DIR_HIDE_SIDEPANE = attached, images
NOTES_DIR_SKIP = secret, private
IMAGE_STORAGE_PATH = images
IMAGE_SUBFOLDER_NAME = attached
SHOW_FILES_IN_TREE = true
SHOW_FILES_IN_FOLDER = true
IMAGES_HIDE = false
[DATABASE]
TYPE = sqlite
PATH = data/gobsidian.db
[AUTH]
REQUIRE_ADMIN_ACTIVATION = true
REQUIRE_EMAIL_CONFIRMATION = false
MFA_ENABLED_BY_DEFAULT = false
LOGIN_AND_EDITS = true
[SECURITY]
PWD_FAILURES_THRESHOLD = 5
MFA_FAILURES_THRESHOLD = 10
FAILURES_WINDOW_MINUTES = 30
AUTO_BAN_DURATION_HOURS = 12
AUTO_BAN_PERMANENT = false
[PROXY]
TRUSTED_PROXIES = 127.0.0.1, ::1
REAL_IP_HEADERS = CF-Connecting-IP, X-Forwarded-For, X-Real-IP
Usage
Viewing Notes
- Navigate through your notes using the sidebar tree structure
- Click on any
.mdfile to view its rendered content - Images and links are automatically processed and displayed
Creating Notes
- Click "New Note" or use Ctrl+N
- Enter a title and content using Markdown syntax
- Save with Ctrl+S or click the Save button
Editing Notes
- Click the "Edit" button on any note
- Use the built-in editor with toolbar for common Markdown formatting
- Auto-save functionality and keyboard shortcuts available
File Management
- Upload files by dragging and dropping or using the upload button
- Download any file by clicking the download icon
- Delete files and folders with confirmation dialogs
Settings
- Access settings via the gear icon in the sidebar
- Configure image storage modes, file extensions, and directories
- Changes take effect immediately or after restart as indicated
Development
Project Structure
gobsidian/
├── cmd/
│ └── main.go # Application entry point
├── internal/
│ ├── config/ # Configuration management
│ ├── handlers/ # HTTP route handlers
│ ├── markdown/ # Markdown rendering
│ ├── models/ # Data models
│ ├── server/ # HTTP server setup
│ └── utils/ # Utility functions
├── web/
│ ├── static/ # CSS, JS, and static assets
│ └── templates/ # HTML templates
├── notes/ # Default notes directory
├── go.mod # Go module definition
└── settings.ini # Configuration file
Building
To build a standalone binary:
# in case you change CSS or add some, recompile tailwind.css
wget https://github.com/tailwindlabs/tailwindcss/releases/download/v4.1.12/tailwindcss-linux-x64
chmod +x tailwindcss-linux-x64
./tailwindcss-linux-x64 -i ./web/static/tailwind.input.css -o ./web/static/tailwind.css --minify
go mod tidy
GOOS=linux GOARCH=amd64 go build -o gobsidian ./cmd
Image storing trying to follow Obsidian settings
Image storing modes:
-
Mode 1 (Root directory):
- Images are stored directly in NOTES_DIR root
- In .md file: just filename like
![[image.png]] - When showing: serve from NOTES_DIR root
-
Mode 2 (Specific folder):
- Images stored in IMAGE_STORAGE_PATH
- In .md file: just filename like
![[image.png]] - When showing: serve from IMAGE_STORAGE_PATH
-
Mode 3 (Same as note):
- Images stored in same directory as the .md file
- In .md file: just filename like
![[image.png]](since it's in same dir) - When showing: serve from note's directory
-
Mode 4 (Subfolder under note):
- Images stored in IMAGE_SUBFOLDER_NAME under note's directory
- In .md file:
![[<IMAGE_SUBFOLDER_NAME>/image.png]] - When showing: serve from note's directory/IMAGE_SUBFOLDER_NAME
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by Obsidian's excellent note-taking capabilities
- Built with Go, Gin, TailwindCSS, and highlight.js
- Thanks to the open source community for the excellent libraries used
Description
Languages
HTML
52.1%
Go
44.4%
JavaScript
2.9%
CSS
0.4%
Makefile
0.2%