This is a plugin for Obsidian that allows you to securely share your notes with others via a unique link. Notes are served through a backend API and can include optional features like expiring after being read or requiring a password for access.
- Share notes with a unique link.
- Option to expire notes after being read.
- Password-protect your shared notes.
- Retain the original formatting of your notes, including YAML front matter and Markdown.
- View YAML metadata and Markdown content in a styled HTML page.
- Automatic cleanup of expired notes.
-
Install Python and dependencies:
- Ensure Python 3.8+ is installed.
- Create a virtual environment and install dependencies:
python3 -m venv venv source venv/bin/activate pip install fastapi uvicorn aiosqlite markdown2 pyyaml python-dotenv
-
Set up the SQLite database:
- Create the database file:
touch notes.db
- Initialize the schema:
sqlite3 notes.db < schema.sql
- Create the database file:
-
Set up environment variables:
- Create a
.envfile in the backend directory:API_PASSWORD=your_secure_password DATABASE_URL=notes.db
- Create a
-
Run the server:
uvicorn main:app --host 0.0.0.0 --port 8000
- Clone or download this repository.
git clone https://github.com/your-repo/obi-share.git
- Place the plugin folder in your Obsidian vault under
.obsidian/plugins/obi-share. - Enable the plugin in Obsidian settings.
- Open a note in Obsidian.
- Trigger the plugin via its command (e.g., "Share Note").
- A modal will appear:
- Set a password (optional).
- Choose if the note should expire after being read.
- Copy the generated link from the modal.
Recipients can view the shared note via the generated link. The note will be displayed in a styled HTML format, preserving both metadata and content.
- Update the backend URL in the plugin settings:
- Default:
http://localhost:8000
- Default:
- You can modify the note rendering styles in the backend's HTML template.
Create a new shared note.
- Headers:
Authorization: Bearer <API_PASSWORD>
- Body:
{ "content": "Your note content", "expire_after_read": true, "password": "optional_password" } - Response:
{ "url": "http://<domain>/read/<note_id>" }
Read a shared note.
- Query Parameters:
password(if required)
Clean up expired notes.
- Automatically deletes notes older than 7 days.
- Ensure the backend API is running and accessible from Obsidian.
- YAML parsing errors may occur with complex metadata. Validate your YAML structure if needed.
Contributions are welcome! Feel free to submit pull requests or report issues in the repository.
MIT License. See LICENSE file for details.