locksidian: obsidian password protection

You know how every notes app — Notion, Evernote, you name it — has some form of in-app password protection? Obsidian doesn’t.Not that surprising, really. It just works with plain .md files and acts like a very smart text editor. But still — there had to be a way.So, after a bit of research (and compromising my dreams of full-on encryption), I settled on a more achievable first step: a simple password prompt on vault entry. Not bulletproof security, of course — anyone can open the files outside Obsidian — but something to stop casual intruders and prying eyes.To a beginner coder like me, though, this felt like climbing Everest.How It StartedArmed with ChatGPT and the Obsidian docs, I began.First, I followed the sample plugin tutorial and got the plugin skeleton compiled and running. The main code is in TypeScript (a language developed by Microsoft that compiles down to JavaScript), and to my surprise, it was actually understandable.I explored GitHub (mainly main.tv's plugins) to see how others structured their code, and that helped me grasp the core patterns.Then I did the classic productivity hack: edited the manifest.json file to show my plugin’s name and metadata. You know, just to feel like I’d accomplished something before diving into the hard stuff.Building the Password PromptUsing the Obsidian docs, the sample plugin, and some shameless GPT prompting, I scraped together a working base:C-liketsCopyEditimport { App, Modal, Notice, Plugin, PluginSettingTab, Setting } from 'obsidian';

export default class PasswordPromptPlugin extends Plugin {
// ...
}Next came the modal — the actual password prompt. I created a PasswordPromptModal class, read up on how classes work in TypeScript, and built a simple window with a hardcoded password.C-liketsCopyEditclass PasswordPromptModal extends Modal {
// ...
onOpen() { /* render UI */ }
onClose() { /* handle closure */ }
}It worked — except for two issues:I had to manually click the Submit button every time (ugh).You could just press the little ‘x’ and bypass the password. Big problem.So, I called in GPT again. It helped fix the entry issue, but not the "unclosable modal" one. Eventually, I dug deeper and solved it myself:C-liketsCopyEditonClose() {
if (this.preventClose) {
modal.open().then(checkPassword);
} else {
let { contentEl } = this;
contentEl.empty();
}
}Now, if you try to close the modal, it just opens again. Like an annoying but well-meaning gatekeeper.Settings, Defaults, and One Final BugWith the core working, I built a settings tab using the sample plugin as a template. This lets users toggle password protection and set their password:C-liketsCopyEditclass PasswordPromptSettingsTab extends PluginSettingTab {
// ...
display() {
// UI code
}
}One last hiccup: now that the password comes from settings, there was no default password on install. Meaning... you couldn’t even get into the vault after enabling the plugin.Fixed with:C-liketsCopyEditinterface PasswordPromptSettings {
enablePassword: boolean;
password: string;
}

const DEFAULT_SETTINGS: PasswordPromptSettings = {
enablePassword: true,
password: 'password123',
};A bit embarrassing. But it works!Introducing: Locksidian 🔒Here’s what the plugin does:🔐 Password Protection:
Prompts you for a password when opening your vault in Obsidian. Not hacker-proof, but good enough to keep out nosey siblings or classmates 😅.⚙️ Easy Setup:
Clean settings UI built into Obsidian, where you can enable/disable the prompt and set your own password.🛠️ Flexible by Design:
Choose your own password and toggle the feature whenever you want. Designed for minimal friction and maximum usefulness.Get the PluginYou can grab the plugin directly from the GitHub repo here: [LINK]
Or, if you’re patient, you can wait for it to (hopefully) be accepted into the official Community Plugins list. I’ve submitted a pull request!Final ThoughtsCreating Locksidian was equal parts chaotic and exhilarating. Honestly? If you're even thinking about building a plugin — do it. If a beginner like me can cobble something together, you absolutely can too.Stay tuned. I’ve got more features (and philosophical ramblings) coming your way soon. Chronicle is just getting started.

You know how every notes app — Notion, Evernote, you name it — has some form of in-app password protection? Obsidian doesn’t.

Not that surprising, really. It just works with plain .md files and acts like a glorified text editor. But still — there had to be a way.

So, after a bit of research (and compromising my dreams of full-on encryption), I settled on a more achievable first step: a simple password prompt on vault entry. Not bulletproof security, of course — anyone can open the files outside Obsidian — but something to stop casual intruders and prying eyes.

To a beginner coder like me, though, this felt like climbing Everest.

How It Started

Armed with ChatGPT and the Obsidian docs, I began.

First, I followed the sample plugin tutorial and got the plugin skeleton compiled and running. The main code is in TypeScript (a language developed by Microsoft that compiles down to JavaScript), and to my surprise, it was actually understandable.

I explored GitHub (mainly main.tv's plugins) to see how others structured their code, and that helped me grasp the core patterns.

Then I did the classic productivity hack: edited the manifest.json file to show my plugin’s name and metadata. You know, just to feel like I’d accomplished something before diving into the hard stuff.

Building the Password Prompt

Using the Obsidian docs, the sample plugin, and some shameless GPT prompting, I scraped together a working base:

tsCopyEditimport { App, Modal, Notice, Plugin, PluginSettingTab, Setting } from 'obsidian';

export default class PasswordPromptPlugin extends Plugin {
// ...
}

Next came the modal — the actual password prompt. I created a PasswordPromptModal class, read up on how classes work in TypeScript, and built a simple window with a hardcoded password.

tsCopyEditclass PasswordPromptModal extends Modal {
// ...
onOpen() { /* render UI */ }
onClose() { /* handle closure */ }
}

It worked — except for two issues:

  1. I had to manually click the Submit button every time (ugh).
  2. You could just press the little ‘x’ and bypass the password. Big problem.

So, I called in GPT again. It helped fix the entry issue, but not the "unclosable modal" one. Eventually, I dug deeper and solved it myself:

tsCopyEditonClose() {
if (this.preventClose) {
modal.open().then(checkPassword);
} else {
let { contentEl } = this;
contentEl.empty();
}
}

Now, if you try to close the modal, it just opens again. Like an annoying but well-meaning gatekeeper.

Settings, Defaults, and One Final Bug

With the core working, I built a settings tab using the sample plugin as a template. This lets users toggle password protection and set their password:

tsCopyEditclass PasswordPromptSettingsTab extends PluginSettingTab {
// ...
display() {
// UI code
}
}

One last hiccup: now that the password comes from settings, there was no default password on install. Meaning... you couldn’t even get into the vault after enabling the plugin.

Fixed with:

tsCopyEditinterface PasswordPromptSettings {
enablePassword: boolean;
password: string;
}

const DEFAULT_SETTINGS: PasswordPromptSettings = {
enablePassword: true,
password: 'password123',
};

A bit embarrassing. But it works!

Introducing: Locksidian 🔒

Here’s what the plugin does:

  • 🔐 Password Protection:
    Prompts you for a password when opening your vault in Obsidian. Not hacker-proof, but good enough to keep out nosey siblings or classmates 😅.
  • ⚙️ Easy Setup:
    Clean settings UI built into Obsidian, where you can enable/disable the prompt and set your own password.
  • 🛠️ Flexible by Design:
    Choose your own password and toggle the feature whenever you want. Designed for minimal friction and maximum usefulness.

Get the Plugin

You can grab the plugin directly from the GitHub repo here: [LINK]
Or, if you’re patient, you can wait for it to (hopefully) be accepted into the official Community Plugins list. I’ve submitted a pull request!

Final Thoughts

Creating Locksidian was equal parts chaotic and exhilarating. Honestly? If you're even thinking about building a plugin — do it. If a beginner like me can cobble something together, you absolutely can too.

Stay tuned. I’ve got more features (and philosophical ramblings) coming your way soon. Chronicle is just getting started.