unverbuggt / mkdocs-encryptcontent-plugin

A MkDocs plugin that encrypt/decrypt markdown content with AES
https://unverbuggt.github.io/mkdocs-encryptcontent-plugin/
MIT License
130 stars 16 forks source link

Entering password doesn't do anything #33

Closed zeldridge closed 2 years ago

zeldridge commented 2 years ago

Hi,

So using the plugin, I have the password set globally and when I enter the password it loads the page with a /? at the end of the URL and refreshes the page. No "invalid password" and no access to the site. It doesn't do anything.

How can I fix this? All I have in the plugin settings is "global_password:"

Thanks

CoinK0in commented 2 years ago

Hey,

I do not reproduce the problem with the following configuration and packages :

python                       3.10.4
mkdocs                       1.3.1
mkdocs-encryptcontent-plugin 2.3.0
mkdocs-material              8.4.2
mkdocs-material-extensions   1.0.3

My mkdocs.yml configuration file looks like this:

site_name: PoC_encryptcontent_plugins
theme:
  name: material
plugins:
  - search: {}
  - encryptcontent:
      global_password: "321"
nav:
  - Home: index.md
  - Tests:
    - Protection: 
      - No Password: "Tests/0-no_password.md"
      - Blank Password: "Tests/1-blank_password.md"
      - With Password: "Tests/2-with_password.md"
      - Diff Password: "Tests/3-diff_password.md"

Each file looks like this :

# index.md
PoC
# 0-no_password.md
PoC
password: 
# 1-blank_password.md
PoC
password: 321
# 2-with_password.md
PoC
password: 654
# 3-diff_password.md
PoC

Could you give me more information about your configuration, such as:


Normally when decrypting a page, the page is not reloaded (Like F5, refreshed), it is only JS which modifies the content of the page without reloading it.

My current assumption is that you'r using a root other than "/" to host your site (like example.com/subdir/index.md) and the site_url variable in your config does not contain this information. When using a subdirectory, the site_url and site_dir variables should be set as follows:

site_url: http://coink0in.github.io/subdir/
site_dir: subdir/

Same problem as described issue#19

zeldridge commented 2 years ago

Your last suggestion with the site_dir and site_url solved my issue! Thank you