FileRun

FileRun
Photo by Maksym Kaharlytskyi / Unsplash

So PhotoPrism is pretty darn cool! It looks great and has some advanced features that are fantastic, but it lacks user management for me to really share my photos with others. I came across FileRun for sharing files and a few people mentioned they use it to share photos. Well it looks fairly solid, and it's free for up to five users so I'm going to spin it up and see how it works.

I created a new virtual machine named FILERUN-01 on HV-03 and installed Ubuntu 22.04.

Configure Operating System

Configure SSH Key

Steps performed on desktop via Windows Terminal

  • ssh-keygen -t ed25519
  • Move-Item -Path c:\Users\david\filename* -Destination c:\Users\david\.ssh -Force
  • I open Windows Terminal Settings
  • I open the JSON file and add the following:
            {
                "colorScheme": "Ubuntu-ColorScheme",
                "commandline": "ssh -i \"~/.ssh/filerun-01\" [email protected]",
                "experimental.retroTerminalEffect": false,
                "font": 
                {
                    "face": "Cascadia Code"
                },
                "guid": "{0caa0dad-35be-5f56-a8ff-XXXXXXXXXXXXX}",
                "hidden": false,
                "name": "FILERUN-01",
                "tabTitle": "FILERUN-01"
            },
  • I confirm the GUID is unique and save the file

Configure SSH

Steps performed on FILERUN-01

  • mkdir /home/david/.ssh
  • nano /home/david/.ssh/authorized_keys
  • I paste in the public key and save the file
  • chmod 600 /home/david/.ssh/authorized_keys
  • sudo nano /etc/ssh/sshd_config
    • PermitRootLogin no
    • PubkeyAuthentication yes
    • PubkeyAcceptedKeyTypes ssh-ed25519
    • PasswordAuthentication no
    • AuthorizedKeysFile /home/david/.ssh/authorized_keys
  • I save the file
  • sudo sshd -t
  • sudo systemctl restart ssh

Configure Firewall

Steps performed on FILERUN-01

  • sudo ufw allow 22
  • sudo ufw allow 80
  • sudo ufw allow 443
  • sudo ufw enable

Install FileRun Prerequisites

Steps performed on FILERUN-01

  • sudo apt install wget
  • sudo apt install unzip
  • sudo apt install docker
  • sudo apt install docker-compose

Install FileRun

Steps performed on FILERUN-01

  • mkdir filerun
  • cd filerun/
  • nano docker-compose.yml
version: '2'

services:
  db:
    image: mariadb:10.1
    environment:
      MYSQL_ROOT_PASSWORD: your_mysql_root_password
      MYSQL_USER: your_filerun_username
      MYSQL_PASSWORD: your_filerun_password
      MYSQL_DATABASE: your_filerun_database
    volumes:
      - /filerun/db:/var/lib/mysql

  web:
    image: filerun/filerun
    environment:
      FR_DB_HOST: db
      FR_DB_PORT: 3306
      FR_DB_NAME: your_filerun_database
      FR_DB_USER: your_filerun_username
      FR_DB_PASS: your_filerun_password
      APACHE_RUN_USER: www-data
      APACHE_RUN_USER_ID: 33
      APACHE_RUN_GROUP: www-data
      APACHE_RUN_GROUP_ID: 33
    depends_on:
      - db
    links:
      - db:db
    ports:
      - "80:80"
    volumes:
      - /filerun/html:/var/www/html
      - /filerun/user-files:/user-files
  • mkdir html
  • mkdir user-files
  • mkdir db
  • docker-compose up -d

Access and Configure FileRun

Steps performed on desktop
I bring up my browser and travel to http://filerun.domain.local. It loads and I work my way through the setup wizard. Now I wonder if I can utilize an existing store of photos?
Steps performed on DC-02 via Windows Admin Center

  • I create a new basic service account of _service_filerun

Steps performed on FILERUN-01

  • sudo apt install cifs-utils
  • nano /home/david/.fileruncredentials
username=_service_filerun
password=XXXXXXXXXXXX
domain=domain.local
  • I saved the file .fileruncredentials
  • chmod 400 /home/david/.fileruncredentials
  • mount -t cifs -o rw,vers=3.0,credentials=/home/david/.fileruncredentials //10.10.10.XXX/Data/Pictures/TestFolder /home/david/filerun/user-files/

The mount is working correctly but there is nothing showing up in FileRun. Is there a way to have it rescan for file changes? I do find some commands but they are not working for me. Is it possiblly because I need to start the container after the location was mounted?

  • docker-compose down
  • docker-compose up -d

No that isn't the issue. Oh I know what it is. It's a permission issue because I had run some steps as root. Doh!

  • umount -l /home/david/filerun/user-files/
  • chown david:david /home/david/filerun/user-files
  • exit
  • mount -t cifs -o rw,vers=3.0,credentials=/home/david/.fileruncredentials /10.10.10.XXX/Data/Pictures/TestFolder /home/david/filerun/user-files
    • mount.cifs: permission denied: no match for /home/david/filerun/user-files found in /etc/fstab
  • sudo nano /etc/fstab
    • //10.10.10.XXX/Data/Pictures/TestFolder /home/gooseneck/filerun/user-files/ cifs credentials=/home/david/.fileruncredentials,uid=1000,guid=1000,iocharset=utf8 0 0
  • sudo mount -a

Doesn't work. Ohhh....that's a silly mistake. I've gotta read those mount point locations just a little bit better.

  • rm -R /home/david/filerun/db
  • rm -R /home/david/filerun/html
  • rm -R /home/david/filerun/user-files
  • sudo nano /etc/fstab
    • //10.10.10.XXX/Data/Pictures/TestFolder /filerun/user-files/ cifs credentials=/home/david/.fileruncredentials,uid=1000,gid=1000,iocharset=utf8 0 0
  • mount -a
  • docker-compose down
  • docker-compose up -d

There we go! Now from the info I am finding online the commands to scan in my initial files is:

  • docker exec -it filerun_web_1 php /var/www/html/cron/make_thumbs.php
  • docker exec -it filerun_web_1 php /var/www/html/cron/index_filenames.php/user-files/
  • docker exec -it filerun_web_1 php /var/www/html/cron/metadata_index.php

That did it! I can see my test files inside FileRun. And just in time to call it for today!