unverbuggt / mkdocs-encryptcontent-plugin

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

Can't make Environment Variables work #69

Closed Momolem closed 6 months ago

Momolem commented 6 months ago

Hey,

maybe I am just to incompetent but I cant make Environment Variables work and need some guidance:

My mkdocs section:

    - encryptcontent:
      title_prefix: '🔐'
      password_inventory:
          secret: 
            user: !ENV VAULT
      summary: 'Private page'
      placeholder: 'Password'
      decryption_failure_message: 'Invalid password'
      encryption_info_message: "You don't have access to this page."
      search_index: 'encrypted'
      password_button: True

echo $VAULT displays "test"

But I still get the error: ERROR - Empty password found for level 'secret' and user 'user'!

Can someone tell me what I am doing wrong :/

unverbuggt commented 6 months ago

You'll need to set the environment variable like this in linux: export VAULT=test or like this in windows: set VAULT=test. And then call mkdocs serve within the same terminal session.

Further Information is here: https://www.mkdocs.org/user-guide/configuration/#environment-variables

If you continue to have problems, test first if the problem relates to this plugin or your setup with this minimal example:

site_name: !ENV VAULT
Momolem commented 6 months ago

I feel stupid :) Thank you very much :) forgot the export keyword