simple static web site - ala blog with some categories protected by password

hi

I would like to use fly to run a simple static web site - blog like where some categories would be protected by password - on fly. Using adoc or anything similar. Web site content stored in github displayed by fly. Is that possible?

Thank you
Radek

1 Like

Hi,
You could do something like using the jekyll Docker image to build the static web page, and then expose the site using the http_service section in your fly.toml

1 Like

it doesn’t look like there is simple way to protect separate pages by password in jekyll

It looks like there are jekyll plugins you can use for authentication, such as jekyll-auth. Would that work for what you need?

not really. I already checked that. I do not want to force users to have a Google account…

let’s say I have site web.com

  • web.com/welcome - anyone can access
  • web.com/page1 - only those with secret password “password1” can a access such page
  • web.com/page2 - only those with secret password “password123” can a access such page

You can use Caddy!
A config would look something like:

http://localhost:8080 {
    root * /path/to/your/site
    file_server

    basicauth /page1/* {
        User <password hash>
    }

    basicauth /page2/* {
        User <password hash>
    }
}

(note: localhost 8080 is used if you want fly to handle the certificates, it is also possible to have Caddy handle them but that is a bit more setup)

Further reading:
https://hub.docker.com/_/caddy#:~:text=Building%20your%20own%20Caddy-based%20image

3 Likes

From How To to Questions / Help

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.