-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow to set password-protected notes #1481
base: v4
Are you sure you want to change the base?
Conversation
5a27b0a
to
bdc09c9
Compare
While I think this solution is great in what it does, I wouldn't recommend relying on it to keep anything safe. This is mostly for two reasons:
Having said all that, I do think that your solution has value, as password-encrypted static site can only get about as secure as your solution without external tooling/authentication. I feel like the documentation should reflect that, and I feel like we shouldn't be recommending users to deploy encrypted secret company documentation or medical records in the documentation. |
I just want to quickly chime in. For Quartz itself, I don't see any sort of SOC-2 compliant or adjacent security folks would use for hosting private and internal documentation (though we live in a society). This is still a good POC imo. |
a9e390b
to
18ded6d
Compare
@saberzero1 @aarnphm I updated documentation and put some recommendations from you |
440d910
to
717f2e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh this can also just be kept as reference for ppl who wants to add this to there vault.
Personally I don't really find a wide usage for this.
im happy to include it, we have quite a few reqs for this feature been swamped the last few days but can do a quick review later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep minimal change, I suggest we do locale in separate PR as follow up.
We can add support for Vietnamese and English should be good to start with
9f53862
to
c03e45e
Compare
How about this PR @jackyzha0? Do you want to change anything? |
came here through the search. @jackyzha0, let's get it in please 🙌 |
Came here via searching for this feature. Thanks @dynamotn My use case is: sharing some notes with friends, but I don't want it to be accessible to everyone. I understand that if someone really wants to, they can get through, but that's okay. Won't put anything that sensitive here. Looking forward to this! |
e5af31c
to
f94ffb2
Compare
I'm sorry, that's my fault when I updated new translations. I recovered it |
Hi there, I assumed that this was designed for a String password. So I added So my suggestion is to add some advice regarding what should be put in the Apologies if I missed something here! I think it's a really cool feature. |
Sorry @lachlanjs. That's my bad when encoding password from frontmatter. Thank you for using my PR and testing it |
@rbatra2000 I just noticed the same thing this morning. Doesn't happen on my desktop:) |
I don't know whether disabling this would help? Actually, I tried this, and the issue is not the preview window, it's the search results (I think). Each search result includes a short excerpt from the file underneath the page's title. This is also seen on desktop. Hope this is helpful:) |
Okay @rbatra2000 I think this is what's up
Remove the relevant part of the string (the part that includes I've just deleted the relevant lines out of laziness and wanting to test the theory quickly, but I feel like it would make sense to include a check for whether the password feature is enabled as a part of that ternary operator. @dynamotn I don't fully understand what's going on (I'm no web dev, data science is my thing, so I don't know Javascript/HTML/CSS in the least - which is why I am so grateful for Quartz in the first place @jackyzha0) .
Anyway, I still love the idea of the feature, and I am already happy with it the way it is - for my purposes. I don't personally need Fort Knox, just a tall hedge:). Still, it would be interesting to know how close to Fort Knox you could get with the right setup and this feature. For instance, is it that hard to avoid the issues noted by @saberzero1 above? :
I hope this helps in some way and I am interested to see where it goes:) |
Chiming it to say that just disabling the preview on the clientside is insecure - the plain text of the note is still sent in the content index (which the search uses). You need to encrypt/remove the content that gets added to the content index on generation here |
I guess you would only want to have the content of pages without a password included in the search. For pages with a password, I guess only the heading/tags? If the password is in the frontmatter, then is it also getting added to the index? (L127?) |
That's my exact use case. I won't be storing passwords or sensitive data in quartz but I would love to keep notes that I don't want everyone to be able to see while still being able to share with others. The way I would fix the preview issue is to simply filter out all pages with the password key in the frontmatter during indexing. The page would only be avail by finding it in the tree or a direct URL. |
Thanks for using my PR. I recognized some link features that may be exposed content of protected notes. I will push other commits to fix it soon. |
I'm busy resolving another matter in my life so I'll explain it in another comment. But shortly, if you don't publish your raw vault (notes) to public, and just deploy your Quartz to static sites, your protected note's content will be encrypted. Although like you, I'm not professional TypeScript developer (I'm just a DevOps/Security specialist), I'm confident about the logic of this PR. Immediately, I will fix bug that exposed content on index feature first to resolve for @necauqua and @rbatra2000. After that, I will take a look back all features to avoid any problems in the future. |
b773ac2
to
576fd64
Compare
I pushed fixed commit for @rbatra2000. Please test it and feedback if has any problem. |
This PR resolve #637.
Demo
https://notes.dynamotn.dev/01_Fleeting-Notes/20240505093315 with password

123451
How it works