Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uffd-nginxauth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
uffd
uffd-nginxauth
Merge requests
!5
Fix SECRET_KEY autogeneration in Debian package
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Fix SECRET_KEY autogeneration in Debian package
debian-secret-generation-fix
into
master
Overview
0
Commits
1
Pipelines
5
Changes
2
Merged
Fix SECRET_KEY autogeneration in Debian package
Julian
requested to merge
debian-secret-generation-fix
into
master
Mar 23, 2022
Overview
0
Commits
1
Pipelines
5
Changes
2
0
0
Merge request reports
Viewing commit
a0e1da29
Show latest version
2 files
+
16
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
a0e1da29
Fix SECRET_KEY autogeneration in Debian package
· a0e1da29
Julian
authored
Mar 23, 2022
debian/postinst
+
12
−
0
View file @ a0e1da29
Edit in single-file editor
Open in Web IDE
Show full file
@@ -13,6 +13,18 @@ case "$1" in
@@ -13,6 +13,18 @@ case "$1" in
chown
root:uffd-nginxauth /etc/uffd-nginxauth/uffd-nginxauth.cfg
chown
root:uffd-nginxauth /etc/uffd-nginxauth/uffd-nginxauth.cfg
chmod
0640 /etc/uffd-nginxauth/uffd-nginxauth.cfg
chmod
0640 /etc/uffd-nginxauth/uffd-nginxauth.cfg
python3
<<
EOF
import secrets
cfg = open('/etc/uffd-nginxauth/uffd-nginxauth.cfg', 'r').read()
cfg = cfg.replace('
\n
#SECRET_KEY=autogenerated by postinst script
\n
',
'
\n
SECRET_KEY="'+secrets.token_hex(128)+'"
\n
', 1)
# Prior to v0.2.1 the default config used the wrong name for SECRET_KEY
if '
\n
SECRET_KEY=' not in cfg:
cfg = cfg.replace('
\n
#SECRET=autogenerated by postinst script
\n
',
'
\n
SECRET_KEY="'+secrets.token_hex(128)+'"
\n
', 1)
open('/etc/uffd-nginxauth/uffd-nginxauth.cfg', 'w').write(cfg)
EOF
invoke-rc.d uwsgi restart uffd-nginxauth
invoke-rc.d uwsgi restart uffd-nginxauth
;;
;;
Loading