News for hackers. Stuff that matters.
Re:Ask HN: Encryption for blog posts on static sites? by Tomte on Monday May 04, 2020 @02:00PM (#23071214)
No, you'd probably need some Javascript.

But why not this: publish the blog post the normal way and configure the web server to only serve it to people with a proper username/password (HTTP Basic Authentication).

All browsers and web servers let you do that.

For Apache, see this example: https://httpd.apache.org/docs/current/howto/htaccess.html#au...

Re:Ask HN: Encryption for blog posts on static sites? by dhruvkar on Monday May 04, 2020 @02:08PM (#23071309)
want it for a static site, no access to the backend. I dont want to run a full blown website, just want access control. possible?
Re:Ask HN: Encryption for blog posts on static sites? by Tomte on Monday May 04, 2020 @02:21PM (#23071448)
Sure, if your web hoster allows .htaccess files (most do). You just put that file next to your HTML files.
Re:Ask HN: Encryption for blog posts on static sites? by dhruvkar on Monday May 04, 2020 @02:34PM (#23071601)
Have you ever hosted something github pages or netlify? Those are the situations I'm talking about, where an htaccess or any server side access control wouldn't work.
Re:Ask HN: Encryption for blog posts on static sites? by Tomte on Monday May 04, 2020 @02:46PM (#23071761)
No, I haven't. But since you did not tell anyone about that requirement, how was I to guess it?
Re:Ask HN: Encryption for blog posts on static sites? by dhruvkar on Monday May 04, 2020 @04:28PM (#23072883)
You're right. I assumed mentioning static site with Hugo or Jekyll was enough.

To clarify, it would be a static site with hosting on something like netlify or github or gitlab pages, where you don't have access to the server.