Skip to content

feat: Switched db user from admin to $USER, modularized the code, and re-wo…#3

Open
cnbennett3 wants to merge 1 commit into
masterfrom
asvs-remediation
Open

feat: Switched db user from admin to $USER, modularized the code, and re-wo…#3
cnbennett3 wants to merge 1 commit into
masterfrom
asvs-remediation

Conversation

@cnbennett3
Copy link
Copy Markdown

@cnbennett3 cnbennett3 commented May 28, 2026

feat: Switched db user from admin to $USER, modularized the code, and re-worked to reuse a valid existing db if one exists.

…rked to reuse a valid existing db if one exists.
@cnbennett3 cnbennett3 requested a review from frostyfan109 May 28, 2026 14:48
@cnbennett3 cnbennett3 changed the title Switched db user from admin to $USER, modularized the code, and re-wo… feat: Switched db user from admin to $USER, modularized the code, and re-wo… May 28, 2026
Comment thread docker/debian/init.sh
Comment on lines +48 to +52
# Verify that "before_delete hook" is set to expected value
if ! grep -Fq "$EXPECTED_HOOK" /tmp/filebrowser-config.json; then
echo "[init.sh::validate_db]: Invalid database: before_delete hook set to invalid value."
return 1
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If trash-cli is disabled, I don't think the hook is ever set so this will erroneously throw

Comment thread docker/debian/init.sh

# Add bootstrap $USER as bootstrap db user. Default perms used (ie everything except admin and password lock)
echo "[init.sh::rebuild_db]: Adding database bootstrap user [$USER]"
if ! /filebrowser -d "$DB_PATH" -c "$CONFIG_PATH" users add "$USER" create_random_password; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this going to pass in the literal create_random_password instead of a function call?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch. I accidentally nuked it when I was cleaning up the code to commit. It's back.

Copy link
Copy Markdown

@frostyfan109 frostyfan109 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple things to clarify before approving

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants