noplanman.lufi
Ansible Role for Lufi (Let's Upload That File)
:rocket: Development has moved to git.feneas.org.
(The GitHub repository is just a mirror, so please fork on Feneas if you want to contribute. No registration is required; just log in with your GitHub account.)
This role helps you install and set up Lufi on Debian/Ubuntu servers. Learn more about Lufi, created by Luc Didry.
This role will automatically install a service that starts when the server boots. It will also detect which service manager is being used.
Requirements
Using this role will not install Nginx or Apache as a reverse proxy; you need to set those up separately! You can check the example configurations for guidance.
Role Variables
Set the user and group to run Lufi. It's best to use the web server's user/group.
lufi_user: www-data
lufi_group: www-data
Decide if Lufi should be kept updated. (default: no)
lufi_keep_updated: no
There are some required and many optional variables. See all available settings in defaults/main.yml
.
# Required!
lufi_working_dir: "/var/www/example.com"
lufi_listen: "http://127.0.0.1:8080" # Can also be an array for multiple addresses.
lufi_contact: "[email protected]"
lufi_secrets: ["array", "of", "random", "secrets"]
# Optional
lufi_theme: "default"
lufi_proxy: no
lufi_workers: 30
lufi_clients: 1
lufi_url_length: 8
lufi_provis_step: 5
lufi_provisioning: 100
lufi_token_length: 32
lufi_max_file_size: 104857600
lufi_piwik_img: ""
lufi_broadcast_message: ""
lufi_default_delay: 0
lufi_max_delay: 0
lufi_delay_for_size:
10000000: 90 # For files between 10MB and 50MB => max is 90 days
50000000: 60 # For files between 50MB and 1GB => max is 60 days
1000000000: 2 # For files larger than 1GB => max is 2 days
lufi_prefix: "/"
lufi_allowed_domains: []
lufi_fixed_domain: ""
lufi_mail:
how: "smtp"
howargs: ["smtp.example.org"]
lufi_mail_sender: "[email protected]"
lufi_db_type: "sqlite"
lufi_db_path: "lufi.db"
lufi_pgdb:
database: "lufi"
host: "localhost"
user: "DBUSER"
pwd: "DBPASSWORD"
lufi_upload_dir: "files"
lufi_ldap:
uri: "ldaps://ldap.example.org"
user_tree: "ou=users,dc=example,dc=org"
bind_dn: ",ou=users,dc=example,dc=org"
bind_user: "uid=ldap_user"
bind_pwd: "secr3t"
user_filter: "!(uid=ldap_user)"
lufi_htpasswd: "lufi.passwd"
lufi_session_duration: 3600
lufi_allow_pwd_on_files: no
lufi_keep_ip_during: 365
lufi_max_total_size: 10*1024*1024*1024
lufi_policy_when_full: "warn"
lufi_delete_no_longer_viewed_files: 90
Role Tags
Each part of the setup has a specific tag.
lufi:install
lufi:site
lufi:service
Dependencies
None.
Example Playbook
# playbook.yml
---
- hosts: servers
become: yes
vars_files:
- vars/main.yml
roles:
- { role: noplanman.lufi }
# vars/main.yml
---
lufi_working_dir: "/var/www/lufi.example.com"
lufi_listen: "http://127.0.0.1:8080"
lufi_contact: "[email protected]"
lufi_secrets: ["xud7ooJu","aiNg7duG","ih7kom8Z","Ocaish3I","Ooja7chi","Eet4weil","Ethee4Go","xahJ0ohy"]
lufi_broadcast_message: "Welcome to Lufi. Upload your files!"
Tests
Docker is used to test the role with different operating systems.
Check the tests
folder for more information.
License
MIT
Install and run Lufi on a Debian-like system.
ansible-galaxy install noplanman.lufi