File tree 8 files changed +10
-4
lines changed
etc/s6-overlay/s6-rc.d/init-ldap-config
8 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 29
29
wheel && \
30
30
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.21/ \
31
31
cryptography \
32
+ legacy-cgi \
32
33
python-ldap=="${LDAP_VERSION}" && \
33
34
printf "Linuxserver.io version: ${VERSION}\n Build-date: ${BUILD_DATE}" > /build_version && \
34
35
echo "**** cleanup ****" && \
Original file line number Diff line number Diff line change 29
29
wheel && \
30
30
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.21/ \
31
31
cryptography \
32
+ legacy-cgi \
32
33
python-ldap=="${LDAP_VERSION}" && \
33
34
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
34
35
echo "**** cleanup ****" && \
Original file line number Diff line number Diff line change @@ -296,6 +296,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
296
296
297
297
# # Versions
298
298
299
+ * ** 25.12.24:** - Add ` legacy-cgi` . Fix fernet key storage.
299
300
* ** 22.12.24:** - Rebase to Alpine 3.21. Add support for read-only and non-root.
300
301
* ** 30.06.24:** - Rebase to Alpine 3.20.
301
302
* ** 23.12.23:** - Rebase to Alpine 3.19.
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ init_diagram: |
74
74
"ldap-auth:latest" <- Base Images
75
75
# changelog
76
76
changelogs :
77
+ - {date: "25.12.24:", desc: "Add `legacy-cgi`. Fix fernet key storage."}
77
78
- {date: "22.12.24:", desc: "Rebase to Alpine 3.21. Add support for read-only and non-root."}
78
79
- {date: "30.06.24:", desc: "Rebase to Alpine 3.20."}
79
80
- {date: "23.12.23:", desc: "Rebase to Alpine 3.19."}
Original file line number Diff line number Diff line change 4
4
from cryptography .fernet import Fernet
5
5
6
6
key = Fernet .generate_key ()
7
- print (key )
7
+ print (key . decode () )
Original file line number Diff line number Diff line change @@ -137,7 +137,8 @@ def do_POST(self):
137
137
138
138
self .send_response (302 )
139
139
140
- cipher_suite = Fernet (os .getenv ("FERNET_KEY" ))
140
+ fernetkey = os .getenv ("FERNET_KEY" ).encode ()
141
+ cipher_suite = Fernet (fernetkey )
141
142
enc = cipher_suite .encrypt (ensure_bytes (user + ':' + passwd ))
142
143
enc = enc .decode ()
143
144
self .send_header ('Set-Cookie' , 'nginxauth=' + enc + '; httponly' )
Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ def do_GET(self):
85
85
ctx[' action' ] = ' decoding credentials'
86
86
87
87
try:
88
- cipher_suite = Fernet(os.getenv(" FERNET_KEY" ))
88
+ fernetkey = os.getenv("FERNET_KEY").encode ()
89
+ cipher_suite = Fernet(fernetkey)
89
90
self.log_message(' Trying to dechipher credentials...' )
90
91
auth_decoded = auth_header[6:].encode ()
91
92
auth_decoded = cipher_suite.decrypt(auth_decoded)
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ if [[ ! -f "/run/.fernetkey" ]]; then
11
11
KEY=$(python3 /app/fernet-key.py)
12
12
echo "generated fernet key"
13
13
else
14
- KEY="b' ${FERNETKEY}' "
14
+ KEY="${FERNETKEY}"
15
15
echo "using FERNETKEY from env variable"
16
16
fi
17
17
echo "${KEY}" > /run/.fernetkey
You can’t perform that action at this time.
0 commit comments