mriedmann / humhub-docker

Alpine-based PHP-FPM and NGINX HumHub docker-container
MIT License
96 stars 79 forks source link

Permissions - Profile Image #264

Closed r1z1 closed 11 months ago

r1z1 commented 2 years ago

Hi,

I have this error during the prerequisites step from a fresh docker install (using portainer.io):

Permissions - Profile Image (Hint: Make /var/www/localhost/htdocs/uploads/profile_image writable for the Webserver/PHP!)

My docker-compose

version: '3.1'
services:
  humhub:
    image: mriedmann/humhub:stable
    links:
      - "db:db"
    ports:
      - "8080:80"
    volumes:
      - "config:/var/www/localhost/htdocs/protected/config"
      - "uploads:/var/www/localhost/htdocs/uploads"
      - "modules:/var/www/localhost/htdocs/protected/modules"
    environment:
      HUMHUB_DB_USER: humhub
      HUMHUB_DB_PASSWORD: humhub
  db:
    image: mariadb:10.2
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: humhub
      MYSQL_USER: humhub
      MYSQL_PASSWORD: humhub

If it helps: image

Thx

zarevskaya commented 2 years ago

Hi,

You must create the folder called profile_image in uploads.

r1z1 commented 2 years ago

Hi,

The folder exists and seems to have the correct permissions

drwxrwxr-x 3 systemd-network systemd-journal 4096 Apr 25 05:02 profile_image`

zarevskaya commented 2 years ago

Hi,

The folder exists and seems to have the correct permissions

drwxrwxr-x 3 systemd-network systemd-journal 4096 Apr 25 05:02 profile_image`

Okay, change the image by; mriedmann/humhub:1.9

I remember this trick ^^

mriedmann commented 2 years ago

It depends a bit on your system. What distribution are you on? Is it possible that SELinux or AppArmor is blocking the requests? Also, please have a look inside the container (docker exec -it <containername> sh) and run id to get the current user-id. If it is not 0 (=root) or whatever id systemd-network or systemd-journal has on your system it is unable to write to the directory.

Things you can try:

Hope we can get this working for you ;)

r1z1 commented 2 years ago

I changed the image by mriedmann/humhub:1.9 but still the same issue.

The user inside the docker is root:

/ # id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)

Server: Containers: 17 Running: 17 Paused: 0 Stopped: 0 Images: 20 Server Version: 20.10.15 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: cgroupfs Cgroup Version: 1 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc Default Runtime: runc Init Binary: docker-init containerd version: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16 runc version: v1.1.1-0-g52de29d init version: de40ad0 Security Options: apparmor seccomp Profile: default Kernel Version: 5.13.0-40-generic Operating System: Ubuntu 20.04.4 LTS OSType: linux Architecture: x86_64 Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false



The error in only for this folder the other are fine, weird
![image](https://user-images.githubusercontent.com/4463593/167165308-f636d231-01b3-4ccc-bc88-cd67bd5ad414.png)
mriedmann commented 2 years ago

Ok very weird, no idea sorry ... I will try to replicate this on my side ... but could take some time.

francoisauclair911 commented 1 year ago

Having the same issue running humbub 1.11.4

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

ghost commented 1 year ago

issues still an ongoing issue and went stale do to inactivity which should of never happened

mriedmann commented 1 year ago

Sorry reopening then

ghost commented 1 year ago

i would like to state i got a stable version of it running for docker and will update the compose files here im currently working on a 3rd party app store repo for the OS known as https://casaos.io which utilizes Docker and Docker-Compose to run files check out more @ https://cloudrack.ca (this is a domain which links cname to my github.io pages https://thunderm16.github.io/Cloudrack-CasaOS-App-Repo/)

I will post the humhub configs needed to run in time sorry seems i lost the files and need to re-run it as this was a app i was planning on adding to my 3rd party app repo and just haven't gotten back to it yet.


PS dont let this close if you can

ghost commented 1 year ago

stable works for sure but heres what i have for a casaos yaml im sure it be simple to configure as its still a docker-compose.yaml

show some love by joining our discord link found @ https://cloudrack.ca For the readme on the docker-compose.yaml please see https://github.com/ThunderM16/Cloudrack-CasaOS-App-Repo/blob/main/Apps/Humhub/README.md

name: humhub
services:
  db:
    cpu_shares: 90
    command: []
    container_name: db
    deploy:
      resources:
        limits:
          memory: 15981M
    environment:
      - MYSQL_DATABASE=humhub
      - MYSQL_PASSWORD=humhub
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_USER=humhub
    image: mariadb:10.2
    labels:
      icon: https://products.containerize.com/social-network-platforms/humhub/menu_image.png
    ports:
      - target: 3306
        published: "3306"
        protocol: tcp
    restart: unless-stopped
    volumes:
      - type: bind
        source: /DATA/AppData/festive_john/var/lib/mysql
        target: /var/lib/mysql
    volumes: []
    devices: []
    cap_add: []
    network_mode: bridge
    privileged: false
  humhub:
    cpu_shares: 90
    command: []
    container_name: humhub
    depends_on:
      db:
        condition: service_started
        restart: true
        required: true
    deploy:
      resources:
        limits:
          memory: 15981M
    environment:
      - HUMHUB_DB_HOST=db:3306
      - HUMHUB_DB_PASSWORD=humhub
      - HUMHUB_DB_USER=humhub
    image: mriedmann/humhub:stable
    labels:
      icon: https://products.containerize.com/social-network-platforms/humhub/menu_image.png
    links:
      - db:db
    ports:
      - target: 80
        published: "8081"
        protocol: tcp
    restart: unless-stopped
    volumes:
      - type: bind
        source: /DATA/AppData/var/www/localhost/htdocs/protected/config
        target: /var/www/localhost/htdocs/protected/config
      - type: bind
        source: /DATA/AppData/var/www/localhost/htdocs/uploads
        target: /var/www/localhost/htdocs/uploads
      - type: bind
        source: /DATA/AppData/var/www/localhost/htdocs/protected/modules
        target: /var/www/localhost/htdocs/protected/modules
      - type: bind
        source: /DATA/AppData/var/www/localhost/htdocs/uploads/profile_image
        target: /var/www/localhost/htdocs/uploads/profile_image
    devices: []
    cap_add: []
    network_mode: bridge
    privileged: false
x-casaos:
  author: self
  category: self
  hostname: 10.0.0.202
  icon: https://products.containerize.com/social-network-platforms/humhub/menu_image.png
  index: /
  port_map: "8081"
  scheme: http
  store_app_id: festive_john
  title:
    custom: HumHub
ghost commented 1 year ago

will admit tho im having issues in regards to adjusting the PHP settings any suggestions would be highly appreciated.

ArchBlood commented 1 year ago

will admit tho im having issues in regards to adjusting the PHP settings any suggestions would be highly appreciated.

I've currently not had much time on my hands to be much help, could you provide information on what PHP setup you're using?

ghost commented 1 year ago

id have to whip a container up again and go all PHP rogue here lol give me some time

cloudrack-ca commented 1 year ago

still here went ghost will update over next hour or so. got working tho.

cloudrack-ca commented 1 year ago

please check my yaml if you don't mind https://github.com/cloudrack-ca/Cloudrack-CasaOS-App-Repo/tree/main/Apps/Humhub

but should be able to see the below steps here for the current container regarding PHP issue

/ # apk add nano
(1/1) Installing nano (5.9-r0)
Executing busybox-1.34.1-r5.trigger
OK: 254 MiB in 137 packages
/ # php --ini
Configuration File (php.ini) Path: /etc/php7
Loaded Configuration File:         /etc/php7/php.ini
Scan for additional .ini files in: /etc/php7/conf.d
Additional .ini files parsed:      /etc/php7/conf.d/00_ctype.ini,
/etc/php7/conf.d/00_curl.ini,
/etc/php7/conf.d/00_dom.ini,
/etc/php7/conf.d/00_fileinfo.ini,
/etc/php7/conf.d/00_gd.ini,
/etc/php7/conf.d/00_iconv.ini,
/etc/php7/conf.d/00_intl.ini,
/etc/php7/conf.d/00_json.ini,
/etc/php7/conf.d/00_ldap.ini,
/etc/php7/conf.d/00_mbstring.ini,
/etc/php7/conf.d/00_openssl.ini,
/etc/php7/conf.d/00_pdo.ini,
/etc/php7/conf.d/00_session.ini,
/etc/php7/conf.d/00_simplexml.ini,
/etc/php7/conf.d/00_sqlite3.ini,
/etc/php7/conf.d/00_xml.ini,
/etc/php7/conf.d/00_xmlwriter.ini,
/etc/php7/conf.d/00_zip.ini,
/etc/php7/conf.d/01_exif.ini,
/etc/php7/conf.d/01_mysqlnd.ini,
/etc/php7/conf.d/01_phar.ini,
/etc/php7/conf.d/01_xmlreader.ini,
/etc/php7/conf.d/02_pdo_mysql.ini,
/etc/php7/conf.d/99-custom.ini,
/etc/php7/conf.d/apcu.ini,
/etc/php7/conf.d/imagick.ini

/ # nano /etc/php7/php.ini

inside the container /etc/php7/php.ini here its an issues found inside the PHP

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
ArchBlood commented 1 year ago

If you're using the latest beta then you should use PHP 8+

I'm also seeing multiple MySQL installed;

https://stackoverflow.com/questions/41812651/what-is-the-difference-between-mysqlnd-pdo-and-pdo-mysql-extensions-in-php

cloudrack-ca commented 1 year ago

If you're using the latest beta then you should use PHP 8+

I'm also seeing multiple MySQL installed;

https://stackoverflow.com/questions/41812651/what-is-the-difference-between-mysqlnd-pdo-and-pdo-mysql-extensions-in-php

not talking about me are you cause ..... my docker-compose.yaml has 1 db.. @ArchBlood

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 11 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

joel72265 commented 10 months ago

mkdir /uploads/profile_image docker exec humhub_humhub_1 chmod 755 /var/www/localhost/htdocs/uploads/profile_image docker exec humhub_humhub_1 chown -R nginx:nginx /var/www/localhost/htdocs/uploads/profile_image