Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to Password Protect the Entire Page #599

Open
p0fi opened this issue Aug 9, 2023 · 7 comments
Open

Option to Password Protect the Entire Page #599

p0fi opened this issue Aug 9, 2023 · 7 comments
Assignees

Comments

@p0fi
Copy link

p0fi commented Aug 9, 2023

馃摉 Description

Currently it's possible with Retype to password protect single pages or folders by setting the visibility property to protected.

It would be useful option to protect the entire page with a password so that viewers without a password can't even see the navigation.

馃攷 Details

Ideally this setting could be controlled via a CLI parameter like the actual password (RETYPE_PASSWORD) or the secret (RETYPE_SECRET) or an environment variable.

Maybe something like RETYPE_PAGE_PROTECTED=true

It could also be part of the project configuration in retype.yml for example

input: .
output: .retype
url: example.com # Add your website address here
branding:
  title: Project Name
  label: Docs
links:
  - text: Getting Started
    link: https://retype.com/guides/getting-started/
footer:
  copyright: "© Copyright . All rights reserved."
visibility: protected
@p0fi p0fi changed the title Add the Option to Password Protect the Entire Page Option to Password Protect the Entire Page Aug 9, 2023
@geoffreymcgill
Copy link
Contributor

I might be missing something here and you might need to provide additional details or description of your requirements.

How about setting visibility: private on the page?

@geoffreymcgill geoffreymcgill self-assigned this Aug 9, 2023
@p0fi
Copy link
Author

p0fi commented Aug 9, 2023

This approach has the following problems:

  1. The inclusion of the visibility: private setting is required for all pages, although it is not a significant concern.
  2. The page will not appear in the left navigation. Doing this to all pages would result in an empty navigation bar.
  3. When operating the page in development mode while editing, it is required to include the password argument (RETYPE_PASSWORD=xxxxx or --password flag) when executing the CLI command (retype start). This requirement prevents the local execution of the command for editing purposes unless a password has been set. Therefore I am required to frequently input the password while working on the page. Ideally, I would prefer the ability to work on it locally without requiring a password, and subsequently deploy it on GitHub Pages with password protection. The management of this can be effectively achieved through the utilization of an environment variable or build flag within the Github action responsible for the construction and deployment of the page.

@geoffreymcgill
Copy link
Contributor

  1. Setting the visibility on each of the pages or folders is currently required. We do have a plan to implement a defaults project config that will allow for setting the default page config values. There is no time line for the release of defaults, but it is a priority.
  2. Setting layout: central on the Page is one option to hide the left tree navigation.
  3. There should be a way to get the RETYPE_PASSWORD Environment variable working during retype start when running locally. I will try.

Hope this helps.

@geoffreymcgill
Copy link
Contributor

It seems like you might be looking for more of a site-wide password protection option? If you are using Cloudflare, I believe they have an option or plugin to password protect an entire website or maybe even just a portion of website.

@p0fi
Copy link
Author

p0fi commented Aug 9, 2023

  1. Setting layout: central on the Page is one option to hide the left tree navigation.

I would like to clarify that I would want the navigation to be accessible to users who possess the password, while excluding access to it for users who do not possess the password. Basically having a password set for the entire project not only single pages.

  1. There should be a way to get the RETYPE_PASSWORD Environment variable working during retype start when running locally.

The functionality functions properly when the environmental variable is set. However, in the absence of this variable, attempting to initiate the retype start command results in the occurrence of the following error.

ERROR: [folder/page.md] No "password" project-level option is configured for private pages.

The outcome is a 404 page exclusively due to the password protection implemented on every page within the project.

@p0fi
Copy link
Author

p0fi commented Jan 29, 2024

It seems like you might be looking for more of a site-wide password protection option?

Yes 馃槵 But im not using Cloudflare or anything similar. It would be cool if Retype had this feature. Would maybe also somehow solve #679 as I currently need to set every page to protected which basically disables search.

@p0fi
Copy link
Author

p0fi commented Apr 8, 2024

Any news on this topic? 馃槆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants