Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Automatic Setting of Permissions in the Data Directory #71

Open
sbaerlocher opened this issue Feb 28, 2024 · 1 comment
Open

Feat: Automatic Setting of Permissions in the Data Directory #71

sbaerlocher opened this issue Feb 28, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@sbaerlocher
Copy link
Contributor

Description

I propose implementing a functionality in dde that automatically checks and sets the permissions in the DATA_DIR or DDE_DATA_DIR before the application starts, using chown based on the environment variables DDE_UID and DDE_GID. This aims to improve user experience and prevent issues with access rights.

Proposed Solution

Implementation of a Bash function to be executed as part of the startup process:

function set_correct_permissions() {
    if [ -d "$DDE_DATA_DIR" ]; then
        echo "Setting correct ownership for the directory $DDE_DATA_DIR to UID: $DDE_UID and GID: $DDE_GID"
        chown -R "$DDE_UID":"$DDE_GID" "$DDE_DATA_DIR"
    else
        echo "Directory $DDE_DATA_DIR does not exist."
    fi
}

Expected Benefit

This adjustment would simplify handling for the user and ensure that permission problems are avoided.

@sbaerlocher sbaerlocher added the enhancement New feature or request label Feb 28, 2024
@sbaerlocher sbaerlocher self-assigned this Feb 28, 2024
@sbaerlocher sbaerlocher changed the title feat: Automatic Setting of Permissions in the Data Directory Feat: Automatic Setting of Permissions in the Data Directory Feb 28, 2024
@rugbymauri
Copy link
Contributor

eventually the sudo is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants