Skip to content

CIFS Share Setup and Automatic Metadata Scanning

Ryan edited this page May 28, 2025 · 2 revisions

📂 CIFS Share Setup and Automatic Metadata Scanning

This guide explains how to mount a CIFS (SMB) share and enable automatic metadata scanning in FileRise.


1. Mount the CIFS Share on the Host

Mount the network share locally on the host machine before starting the Docker container:

sudo mkdir -p /mnt/cifs_share
sudo mount -t cifs //your-server/share /mnt/cifs_share \
  -o username=youruser,password=yourpass,uid=33,gid=33

Make sure the uid and gid match the www-data user inside your FileRise container. See the next section.


2. Determine UID/GID for www-data

Run the following inside your running FileRise container to check the UID and GID of www-data:

docker exec -it <container_name> id www-data

Example output:

uid=33(www-data) gid=33(www-data) groups=33(www-data)

Use the reported uid and gid when mounting your CIFS share on the host.

On some systems (like Unraid), you may need to use:

-o uid=99,gid=33

Adjust as needed depending on how your host and container map user permissions.


3. Configure docker-compose.yml

Update your Docker Compose configuration to bind the mounted directory and enable scanning:

services:
  filerise:
    image: your-filerise-image
    volumes:
      - /mnt/cifs_share:/var/www/uploads
    environment:
      - SCAN_ON_START=true

4. What Happens on Container Start

If SCAN_ON_START=true is set:

  • FileRise runs the scripts/scan_uploads.php script
  • It scans /var/www/uploads
  • For any new files or folders, metadata is generated in /var/www/metadata
  • Metadata includes:
    • path, type, size
    • "user": "Imported"
    • "uploadDate": current timestamp

🧠 Notes

  • It’s fully CLI-triggered and safe to run repeatedly
  • You can re-run the scanner manually with:
docker exec -it <container_name> php /var/www/scripts/scan_uploads.php

Clone this wiki locally