Skip to content

Commit 8e42305

Browse files
committed
Merge branch 'ListIndexOutOfRange-master' into master PR#27
Include feature to load secret for environnement variable.
2 parents 3895760 + 08e3167 commit 8e42305

File tree

4 files changed

+157
-59
lines changed

4 files changed

+157
-59
lines changed

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Byte-compiled / optimized / DLL files
2+
**/__pycache__/
3+
**/.ipynb_checkpoints/
4+
*.py[cod]
5+
*.pyc
6+
*.pyo
7+
*.so
8+
9+
# Mkdocs
10+
build/
11+
site/
12+
13+
# pip package
14+
dist/
15+
*.egg-info/
16+
17+
# Vscode
18+
.vscode/
19+
.vscode/*
20+
!.vscode/settings.json
21+
!.vscode/tasks.json
22+
!.vscode/launch.json
23+
!.vscode/extensions.json
24+
*.code-workspace
25+
26+
# Pipenv
27+
Pipfile
28+
Pipfile.lock
29+
30+
# Data not intended for deployment
31+
**.m
32+
**.pt
33+
**/logs
34+
# **notebooks**
35+
36+
# Test & Backups
37+
*test*.py
38+
**test**

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The content is encrypted with AES-256 in Python using PyCryptodome, and decrypte
2424
* [Installation](#installation)
2525
* [Usage](#usage)
2626
* [Global password protection](#global-password-protection)
27+
* [Github secret](#github-secret)
2728
* [Customization](#extra-vars-customization)
2829
* [Features](#features)
2930
* [HighlightJS support](#highlightjs-support) *(default)*
@@ -68,6 +69,7 @@ plugins:
6869

6970
Add an meta tag `password: secret_password` in your markdown files to protect them.
7071

72+
7173
### Global password protection
7274

7375
Add `global_password: your_password` in plugin configuration variable, to protect by default your articles with this password
@@ -82,6 +84,23 @@ If a password is defined in an article, it will **ALWAYS** overwrite the global
8284

8385
> **NOTE** Keep in mind that if the `password:` tag exists without value in an article, it will **not be protected** !
8486

87+
88+
### Github secret
89+
90+
Instead of specifying a password in the mkdocs.yml file, you can use a Github secret coupled to a CI/CD pipeline. This process is in two steps:
91+
92+
1. First, you need to make an environment variable containing your password accessible at runtime (through any CI/CD pipeline).
93+
94+
95+
4. Finally, in the mkdocs.yml file, instead of specifying a global password, simply set the `use_secret` field to the name of your environment variable, e.g. in the case where my secret is stored in the $PASSWORD` variable:
96+
97+
```yaml
98+
plugins:
99+
- encryptcontent:
100+
use_secret: 'PASSWORD'
101+
```
102+
103+
85104
### Extra vars customization
86105

87106
Optionally you can use some extra variables in plugin configuration to customize default messages.

0 commit comments

Comments
 (0)