Set up Filegator according to my needs
Updated copyright notice
Added molecule test
Added template for default users


browse  log 



You can also use your local clone with git send-email.


Filegator is a web-based file manager, this is an ansible role to set up that app and it is based on debian 11 and nginx.

See the filegator documentation for more info https://docs.filegator.io/

Note that this one https://filegator.io/faq/ refers to old versions of filegator.

One limitation of the app is that you can't allow userB to access folder or file of userA, in order to share files with other users they need to have the same homedir or enable the guest account.

See https://github.com/filegator/filegator/issues/59

#Filegator Variables

You do need to quote like this "''" variables that are going to end up in the filegator php config.

I recommend creating a vars/main.yml encrypted with vault that contains the required variables.

#Required variables

The passwords corresponds to a hash of a password(bcrypt). You can generate one with php, get php -> php -a -> echo password_hash('', PASSWORD_DEFAULT);

The guest account is necessary even if you don't use it, the app simply crash if you omit it from the config, it is disabled if there is no permissions.

filegator_admin_password: <your-password>
csrf_key: "'<csrf_key>'"
      username: admin
      name: Admin
      role: admin
      homedir: "/"
      permissions: "read|write|upload|download|batchdownload|zip"
      password: "{{ filegator_admin_password }}"
      username: "guest"
      name: "Guest"
      role: "guest"
      homedir: "/"
      permissions: ""
      password: ""

#Other variables

php_version: 7.4

# PHP upload parameters
upload_max_size: 2000
upload_chunk_size: 5

# Filegator parameters
dark_theme: true

# When the file on the disk has the same name than the one getting
# download append a digit to the one that is being downloaded.
overwrite_on_upload: false
# Set nginx and php accordingly
upload_simultaneous: 3
timezone: "'UTC'"
logo: "'https://filegator.io/filegator_logo.svg'"
language: "'english'"
default_archive_name: "'archive.zip'"
date_format: '"YY/MM/DD hh:mm:ss"'
guest_redirection: "''"
# how many simultaneous getdirs to spawn when searching
search_simultaneous: 5

# See https://docs.filegator.io/configuration/tmpfs.html

# I've looked in the source code and they use a mt_random
# and if the gc_probability_perc is greater than the mt_random number then
# the files older than gc_older_than days get cleaned up

# So set up a high gc_proc_perc and gc_older than set to 1 if you want tmp files
# to get cleaned up frequently.
gc_older_than: 2
gc_probability_perc: 60

# Show a file terminated by the following extensions in a window and edit them
editable: ['.txt', '.css', '.js', '.ts', '.html', '.php', '.json', '.md', '.py']
# Show the files directly in the browser
download_inline: ['pdf']
# See https://docs.filegator.io/configuration/basic.html
filter_entries: []
# See https://scotthelme.co.uk/tough-cookies/
cookie_samesite: "'Strict'"

#Example Playbook

- hosts: servers
    - { role: filegator, filegator_admin_password: my_password }


molecule test