chrissy-dev/protected-github-pages
À propos
Password Protection for Static Pages
Outils de développementProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Historique en cours
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalPassword Protection for Static Pages
A tiny, zero-configuration password gate for static websites.
This project provides a lightweight client-side barrier for static hosting platforms such as GitHub Pages, Amazon S3, Dropbox, or any generic file host. It is designed for temporary or low-risk use cases where you want to hide content from casual access without running a server.
It is intentionally simple, dependency-free, and works as a single HTML file.
What this is good for
This project is useful when you need:
- A quick way to hide a static site behind a password
- No server, no backend, no database
- No build step or tooling
- Something you can upload anywhere and forget about
- A temporary gate for:
- Client previews
- Staging demos
- Internal documentation
- Personal pages you do not want indexed
- Short-lived or ad-hoc sharing
It still gets visits because it solves a very specific problem with almost zero setup.
What this is not
This is not real authentication and should not be treated as security.
It does not protect against:
- Determined attackers
- Brute-force attempts
- Anyone who already knows or guesses the URL
- Directory listing on misconfigured hosts
If you need real access control, use a backend, signed URLs, or platform-level authentication.
How it works
- The password is hashed in the browser using SHA1
- The hash becomes the folder name
- The script attempts to load
{hash}/index.html - If the file exists, the user is redirected
- If it does not exist, access is denied
There is no server-side logic involved.
Setup
- Upload
index.htmlto the root of your static hosting - Open it in a browser and enter your chosen password
- You will see an “incorrect password” message
- Copy the value after the
#in the URL - Create a folder with that exact name
- Put the content you want to protect inside it
Your final structure should look like:
├── index.html
├── background.jpg
└── this-is-a-hash # SHA1 hash of your password
└── index.html # your original index document
That is it.
Demo
Live demo: chrissy-dev.github.io/protected-github-pages/
Demo password: password
Things to consider
- If directory listing is enabled, this can be bypassed
- Anyone with the direct hashed URL can skip the login
- There is no rate limiting or brute-force protection
- This is intentionally minimal and unopinionated
Treat it as a speed bump, not a lock.
Project status
This is an older project that I no longer actively use, but it remains available because:
- It still solves a real, narrow problem
- It has no dependencies or ongoing maintenance burden
- People still find it useful for temporary setups
The scope will remain deliberately small.
Credits
Original concept and early implementation inspired by @matteobrusa
Explorer des projets similaires
Chargement…