waschinski / photo-stream

Self-hosted, super simple photo stream
https://github.com/waschinski/photo-stream
MIT License
448 stars 68 forks source link

Feature request: Authentication #52

Closed ElFishi closed 1 year ago

ElFishi commented 1 year ago

Is there a way the resulting site could require authentication before the stream is shown? Thx.

oliverhihn commented 1 year ago

You cloud put it behind an nginx reverse proxy and use the basic auth functionality of nginx. That would be an easiest way to accomplish that.

dumblob commented 1 year ago

Related: https://github.com/waschinski/photo-stream/issues/29#issuecomment-1281129954

ElFishi commented 1 year ago

Thanks for responding. I was actually hoping to use some authentification when hosting a static site on render.

oliverhihn commented 1 year ago

Then you could maybe use https://github.com/oauth2-proxy/oauth2-proxy

ElFishi commented 1 year ago

Thanks for pointing me this way. It turns out render has a page on OAuth. And it also has a page on PageCrypt which is quite OK for my purpose.

waschinski commented 1 year ago

Thanks @oliverhihn for chiming in here and helping out, it's much appreciated.

Also, PageCrypt looks interesting and like something that would be nice to have included in Photo Stream out of the box while keeping it rather simple.

ElFishi commented 1 year ago

I pretty much followed their example. On render I use the Build Command bundle exec jekyll build && yarn && yarn run build and the package.json goes

{
  "scripts": {
    "build": "pagecrypt _site/index.html _site/index.htm $PASSWORD && rm _site/index.html"
  },
  "engines": {
    "node": ">=16 <19"
  },
  "devDependencies": {
    "pagecrypt": "^5.4.0"
  }
}

Mind the version restriction on node, b/c node v19 throws an error.