This template repository makes it easy to create a password protected page that is hosted on Github pages. This can be useful for information or events that should not be available to everyone, e.g. for your birthday, wedding or a corporate event.
To check the demo use the password test
.
Disclaimer: Please be aware, that I (or the dependencies) might have missed something, so do not assume this to be bullet proof. Do not share bank information or similar this way.
use this template
button{GITHUB-ACCOUNT-NAME}.github.io/{REPOSITORY-NAME}
)DECRYPTION_PASSPHRASE
and set the value
to your desired password (note that the CI pipeline will fail on the first attempt due to the missing password)main
branch in order to activate hosting with Github PagesTo customize the website:
You can customize the login page
- name: Encrypt index
run: >
staticrypt index.html -p ${{ secrets.DECRYPTION_PASSPHRASE }} --short
--template "password_template.html"
--template-title "Login"
--template-instructions "This is a test website, use the password 'test' to enter."
--template-button "Open Page"
--template-color-primary "#113e9f"
--template-color-secondary "#e4e4e4"
Edit the main.html
which will be shown to visitors after encryption (the encrypted version, that is hosted is index.html
)
By default encryption of assets is enabled, since the workflow encrypt_with_assets.yml
is active.
Note, this only replaces all directly linked images, CSS and JavaScript file in the HTML document with an in-place base64 representation.
Thus, your relative links in files will probably not work anymore, since their location changed.
If you do not want to encrypt assets
exclude
s of the _config.yml
,encrypt_with_assets.yml
to encrypt_with_assets._yml
, and encrypt_without_assets._yml
to encrypt_with_assets.yml
If you don't want to have any of your data (even) in a private repository you can also convert it locally and only upload the index.html
afterwards.
To do this, follow these steps:
docker build -t ppw .
docker run -it --rm --name ppw -e PASSWORD=test --mount type=bind,source=${PWD},target=/code ppw
main.html
git update-index --skip-worktree main.html
Optionally the same is needed for your assets.