Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uffd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container 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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thies
uffd
Commits
126f1659
Commit
126f1659
authored
3 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Auto-generate SECRET_KEY in Debian package, minor improvement of uffd-admin
parent
e34b87db
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
debian/contrib/uffd-admin
+4
-4
4 additions, 4 deletions
debian/contrib/uffd-admin
debian/postinst
+7
-0
7 additions, 0 deletions
debian/postinst
debian/uffd.cfg
+1
-0
1 addition, 0 deletions
debian/uffd.cfg
with
12 additions
and
4 deletions
debian/contrib/uffd-admin
+
4
−
4
View file @
126f1659
#!/bin/
bash -x
#!/bin/
sh
set
-e
set
-e
u
export
FLASK_APP
=
/usr/share/uffd/uffd
export
CONFIG_FILENAME
=
/etc/uffd/uffd.cfg
if
[
"
$(
whoami
)
"
=
"uffd"
]
;
then
flask
"
$@
"
elif
command
-v
sudo
&
> /dev/null
;
then
elif
command
-v
sudo
>
/dev/null
2>&1
;
then
exec sudo
--preserve-env
=
FLASK_APP,CONFIG_FILENAME
-u
uffd flask
"
$@
"
elif
command
-v
runuser
&
> /dev/null
;
then
elif
command
-v
runuser
>
/dev/null
2>&1
;
then
exec
runuser
--preserve-environment
-u
uffd
--
flask
"
$@
"
else
echo
"Could not not become 'uffd' user, exiting"
...
...
This diff is collapsed.
Click to expand it.
debian/postinst
+
7
−
0
View file @
126f1659
...
...
@@ -10,6 +10,13 @@ case "$1" in
chown
-R
uffd:uffd /var/lib/uffd
chmod
0770 /var/lib/uffd
python3
<<
EOF
import secrets
cfg = open('/etc/uffd/uffd.cfg', 'r').read()
cfg = cfg.replace('
\n
#SECRET=autogenerated by postinst script
\n
',
'
\n
SECRET="'+secrets.token_hex(128)+'"
\n
', 1)
open('/etc/uffd/uffd.cfg', 'w').write(cfg)
EOF
chown
root:uffd /etc/uffd/uffd.cfg
chmod
0640 /etc/uffd/uffd.cfg
...
...
This diff is collapsed.
Click to expand it.
debian/uffd.cfg
+
1
−
0
View file @
126f1659
FLASK_ENV
=
"production"
SQLALCHEMY_DATABASE_URI
=
"sqlite:////var/lib/uffd/db.sqlite"
#SECRET=autogenerated by postinst script
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment