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

site owner should be able to get at their own logs #29

Open
dale-c-anderson opened this issue May 15, 2022 · 0 comments
Open

site owner should be able to get at their own logs #29

dale-c-anderson opened this issue May 15, 2022 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@dale-c-anderson
Copy link
Member

dale-c-anderson commented May 15, 2022

  • make sure acl package is present , then, after dirs are created,
/usr/bin/find /var/log/vhosts/<account> -type d -exec /usr/bin/setfacl -md u:<owner>:r  {} \;   # set default for newly created files
/usr/bin/find /var/log/vhosts/<account> -type f -exec /usr/bin/setfacl -m u:<owner>:r {} \;   # give read on current files
/usr/bin/find /var/log/vhosts/<account> -type d -exec /usr/bin/setfacl -m u:<owner>:rx  {} \;   # give read and traverse on current dirs

or in ansible (just eyeballing here, this might need tweaking)

    - name: Make sure setfacl is installed
      package:
        name: acl
        state: present

    - name: Give web account owner access to their own logs (default for new items)
      acl:
        path: /var/log/vhosts/{{ account }}
        entity: "{{ account }}"
        etype: user
        permissions: rx
        default: true
        recursive: true
        state: present

    - name: Give web account owner access to their own logs (existing items)
      acl:
        path: /var/log/vhosts/{{ account }}
        entity: "{{ account }}"
        etype: user
        permissions: rx
        default: false
        recursive: true
        state: present

@dale-c-anderson dale-c-anderson added bug Something isn't working enhancement New feature or request labels May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant