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

Set correct nextcloud permissions for local storage access #1087

Closed
33Fraise33 opened this issue Apr 23, 2020 · 3 comments
Closed

Set correct nextcloud permissions for local storage access #1087

33Fraise33 opened this issue Apr 23, 2020 · 3 comments

Comments

@33Fraise33
Copy link

33Fraise33 commented Apr 23, 2020

I'm running Nextcloud in Docker through Ansible:

- name: setup nextcloud docker container
  docker_container:
    name: nextcloud
    image: nextcloud:latest
    networks:
      - name: fraise_network
        ipv4_address: "{{ docker_network.nextcloud }}"
    purge_networks: yes
    volumes:
      - "/data/nextcloud/www:/var/www/html"
      - "/data:/data"
    user: 33:1003
    env:
      NEXTCLOUD_ADMIN_USER: gianni
      NEXTCLOUD_ADMIN_PASSWORD: "{{ nextcloud_admin_password }}"
      NEXTCLOUD_TRUSTED_DOMAINS: "domain"
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud
      MYSQL_PASSWORD: "{{ db_nextcloud_password }}"
      MYSQL_HOST: "{{ docker_network.nextcloud_db }}"
    restart: yes
    restart_policy: always
    state: started
    pull: true

I would like to be able to write into my /data directory through the external storage access app.

A group was created on the Docker host with the name 'data' where I added in the http user (33 uid on arch) and changed the folder permissions of all folders to 775 and owner: root:data.

When adding the external storage I see "You don't have permission to upload or create files here".
After giving a certain folder temporary 777 permissios I see that nextcloud still writes as http:http.

Is it possible to change this when running in docker?

@flower1024
Copy link

i use this dockerfile since a few months

FROM nextcloud:fpm-alpine

ARG UID
ARG GID

RUN apk --no-cache add shadow &&
rm -rf /var/cache/apk/* &&
OUID=$(id -u www-data) &&
OGID=$(id -g www-data) &&
usermod -u $UID www-data &&
groupmod -g $GID www-data &&
find / -group $OGID -exec chgrp -h www-data {} ; &&
find / -user $OUID -exec chown -h www-data {} ;

@Oberfeldwedler
Copy link

Oberfeldwedler commented Nov 22, 2020

This is what i am running.
@Flow86 Unfortunately yours didn't work for me, so heres my Dockerfile:

FROM nextcloud:20-fpm-alpine

ARG UID=1003
ARG GID=1003

RUN apk --no-cache add shadow && \
rm -rf /var/cache/apk/* && \
OUID=$(id -u www-data) && \
OGID=$(id -g www-data) && \
usermod -u $UID www-data && \
groupmod -g $GID www-data ;

RUN OGID=$(id -g www-data) && \
find / -group $OGID -exec chgrp -h www-data {} \;

RUN OUID=$(id -u www-data) && \
find / -user $OUID -exec chown -h www-data {} \;

J0WI added a commit to J0WI/docker-nextcloud that referenced this issue Sep 1, 2022
J0WI added a commit to J0WI/docker-nextcloud that referenced this issue Sep 1, 2022
J0WI added a commit that referenced this issue Sep 6, 2022
@J0WI
Copy link
Contributor

J0WI commented Sep 6, 2022

closing due #1812

@J0WI J0WI closed this as completed Sep 6, 2022
ananace pushed a commit to ananace/docker-nextcloud that referenced this issue May 10, 2024
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

No branches or pull requests

4 participants