Luc Didry e41b08
# vim:set sw=4 ts=4 sts=4 ft=perl expandtab:
Luc Didry e41b08
{
Luc Didry e41b08
    ####################
Luc Didry e41b08
    # Hypnotoad settings
Luc Didry e41b08
    ####################
Luc Didry e41b08
    # see http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad for a full list of settings
Luc Didry e41b08
    hypnotoad => {
Luc Didry e41b08
        # array of IP addresses and ports you want to listen to
Luc Didry 84c04d
        # you can specify a unix socket too, like 'http+unix://%2Ftmp%2Flufi.sock'
Luc Didry e41b08
        listen => ['http://127.0.0.1:8081'],
Luc Didry e41b08
        # if you use Lufi behind a reverse proxy like Nginx, you want to set proxy to 1
Luc Didry e41b08
        # if you use Lufi directly, let it commented
Luc Didry e41b08
        #proxy  => 1,
Luc Didry e41b08
Luc Didry e41b08
        # Please read http://mojolicious.org/perldoc/Mojo/Server/Hypnotoad#workers
Luc Didry e41b08
        # to adjust this to your server
Luc Didry e41b08
        workers => 30,
Luc Didry e41b08
        clients => 1,
Luc Didry e41b08
    },
Luc Didry e41b08
Luc Didry 84c04d
    # Put a way to contact you here and uncomment it
Luc Didry 84c04d
    # You can put some HTML in it
Luc Didry e41b08
    # MANDATORY
Luc Didry e41b08
    contact       => 'Contact page',
Luc Didry e41b08
Luc Didry 84c04d
    # Put an URL or an email address to receive file reports and uncomment it
Luc Didry 84c04d
    # It's for make reporting illegal files easy for users
Luc Didry e41b08
    # MANDATORY
Luc Didry e41b08
    report => 'report@example.com',
Luc Didry e41b08
Luc Didry 84c04d
    # Array of random strings used to encrypt cookies
Luc Didry e41b08
    # optional, default is ['fdjsofjoihrei'], PLEASE, CHANGE IT
Luc Didry e41b08
    #secrets        => ['fdjsofjoihrei'],
Luc Didry e41b08
Luc Didry 8d6f10
    # Name of the instance, displayed next to the logo
Luc Didry 8d6f10
    # optional, default is Lufi
Luc Didry 8d6f10
    #instance_name => 'Lufi',
Luc Didry 8d6f10
Luc Didry 84c04d
    # Choose a theme. See the available themes in `themes` directory
Luc Didry 84c04d
    # Optional, default is 'default'
Luc Didry e41b08
    #theme         => 'default',
Luc Didry e41b08
Luc Didry 84c04d
    # Length of the random URL
Luc Didry e41b08
    # optional, default is 8
Luc Didry e41b08
    #length            => 8,
Luc Didry e41b08
Luc Didry 84c04d
    # How many URLs will be provisioned in a batch ?
Luc Didry e41b08
    # optional, default is 5
Luc Didry e41b08
    #provis_step       => 5,
Luc Didry e41b08
Luc Didry 84c04d
    # Max number of URLs to be provisioned
Luc Didry e41b08
    # optional, default is 100
Luc Didry e41b08
    #provisioning      => 100,
Luc Didry e41b08
Luc Didry 84c04d
    # Length of the modify/delete token
Luc Didry e41b08
    # optional, default is 32
Luc Didry e41b08
    #token_length      => 32,
Luc Didry e41b08
Luc Didry 84c04d
    # Max file size, in octets
Luc Didry 84c04d
    # You can write it 100*1024*1024
Luc Didry e41b08
    # optional, no default
Luc Didry e41b08
    #max_file_size     => 104857600,
Luc Didry e41b08
Luc Didry 84c04d
    # If you want to have piwik statistics, provide a piwik image tracker
Luc Didry 84c04d
    # Only the image tracker is allowed, no javascript
Luc Didry e41b08
    # optional, no default
Luc Didry e41b08
    #piwik_img         => 'https://piwik.example.org/piwik.php?idsite=1&rec=1',
Luc Didry e41b08
Luc Didry 84c04d
    # Broadcast_message which will displayed on the index page
Luc Didry e41b08
    # optional, no default
Luc Didry e41b08
    #broadcast_message => 'Maintenance',
Luc Didry e41b08
Luc Didry 84c04d
    # Default time limit for files
Luc Didry 84c04d
    # Valid values are 0, 1, 7, 30 and 365
Luc Didry e41b08
    # optional, default is 0 (no limit)
Luc Didry e41b08
    #default_delay     => 0,
Luc Didry e41b08
Luc Didry 84c04d
    # Number of days after which the images will be deleted, even if they were uploaded with "no delay" (or value superior to max_delay)
Luc Didry 84c04d
    # A warning message will be displayed on homepage
Luc Didry e41b08
    # optional, default is 0 (no limit)
Luc Didry e41b08
    #max_delay         => 0,
Luc Didry e41b08
Luc Didry 84c04d
    # Size thresholds: if you want to define max delays for different sizes of file
Luc Didry 84c04d
    # The keys are size in Bytes, you can't have 10*1000*10000 as key
Luc Didry 84c04d
    # If a file is smaller than the smallest configured size, it will have a expiration delay of max_delay (see above)
Luc Didry e41b08
    # optional, default is using max_delay (see above) for all sizes
Luc Didry e41b08
    #delay_for_size  => {
Luc Didry e41b08
    #    10000000   => 90, # between 10MB and 50MB => max is 90 days, less than 10MB => max is max_delay (see above)
Luc Didry e41b08
    #    50000000   => 60, # between 50MB ans 1GB  => max is 60 days
Luc Didry e41b08
    #    1000000000 => 2,  # more than 1GB         => max is 2 days
Luc Didry e41b08
    #},
Luc Didry e41b08
Luc Didry e41b08
    # URL sub-directory in which you want Lufi to be accessible
Luc Didry e41b08
    # example: you want to have Lufi under https://example.org/lufi/
Luc Didry e41b08
    # => set prefix to '/lufi' or to '/lufi/', it doesn't matter
Luc Didry e41b08
    # optional, defaut is /
Luc Didry e41b08
    #prefix        => '/',
Luc Didry e41b08
Luc Didry 84c04d
    # Array of authorized domains for API calls.
Luc Didry 84c04d
    # If you want to authorize everyone to use the API: ['*']
Luc Didry e41b08
    # optional, no domains allowed by default
Luc Didry e41b08
    #allowed_domains   => ['http://1.example.com', 'http://2.example.com'],
Luc Didry e41b08
Luc Didry 84c04d
    # Define a path to the upload directory, where the uploaded files will be stored
Luc Didry 84c04d
    # You can define it relative to lufi directory or set an absolute path
Luc Didry 84c04d
    # Remember that it has to be in a directory writable by Lufi user
Luc Didry 84c04d
    # DO NOT CHANGE THIS IF FILES HAVE BEEN ALREADY UPLOADED: THEY WILL NOT BE DOWNLOADABLE ANYMORE
Luc Didry 84c04d
    # optional, default is 'files'
Luc Didry 84c04d
    #upload_dir           => 'files',
Luc Didry 84c04d
Luc Didry 8d6f10
    # You can store files on Swift object storage (https://en.wikipedia.org/wiki/OpenStack#Swift) instead of filesystem
Luc Didry 8d6f10
    # Please read https://metacpan.org/pod/Net::OpenStack::Swift#SYNOPSIS to know how to configure this setting
Luc Didry 8d6f10
    # IMPORTANT: add a `container` key in it, to let Lufi know which container to use. This is not a regular Net::OpenStack::Swift setting, but Lufi need it.
Luc Didry 8d6f10
    # optional, no default
Luc Didry d642eb
    #swift => { auth_url => 'http://swiftstack-picoswiftstack:8080/auth/v1.0', user => 'test:tester', password => 'testing', container => 'lufi', auth_version => '1.0' },
Luc Didry 8d6f10
Luc Didry 84c04d
    # Allow to add a password on files, asked before allowing to download files
Luc Didry 84c04d
    # optional, default is 0
Luc Didry 84c04d
    allow_pwd_on_files => 1,
Luc Didry 84c04d
Luc Didry 84c04d
    # Force all files to be in "Burn after reading mode"
Luc Didry 84c04d
    # optional, default is 0
Luc Didry 84c04d
    #force_burn_after_reading => 0,
Luc Didry 84c04d
Luc Didry 84c04d
    # If set, the files' URLs will always use this domain
Luc Didry 84c04d
    # optional, no default
Luc Didry 84c04d
    #fixed_domain => 'example.org',
Luc Didry 84c04d
Luc Didry 84c04d
    # Abuse reasons
Luc Didry 84c04d
    # Set an integer in the abuse field of a file in the database and it will not be downloadable anymore
Luc Didry 84c04d
    # The reason will be displayed to the downloader, according to the reasons you will configure here.
Luc Didry 84c04d
    # optional, no default
Luc Didry 84c04d
    #abuse => {
Luc Didry 84c04d
    #   0 => 'Copyright infringment',
Luc Didry 84c04d
    #   1 => 'Illegal content',
Luc Didry 84c04d
    #},
Luc Didry 84c04d
    abuse => {
Luc Didry 84c04d
       0 => 'Copyright infringment',
Luc Didry 84c04d
       1 => 'Illegal content',
Luc Didry 84c04d
    },
Luc Didry 84c04d
Luc Didry 84c04d
    ###############
Luc Didry 84c04d
    # Mail settings
Luc Didry 84c04d
    ###############
Luc Didry 84c04d
Luc Didry e41b08
    # Mail configuration
Luc Didry e41b08
    # See https://metacpan.org/pod/Mojolicious::Plugin::Mail#EXAMPLES
Luc Didry 84c04d
    # optional, default to sendmail method with no arguments
Luc Didry e41b08
    #mail => {
Luc Didry e41b08
    #    # Valid values are 'sendmail' and 'smtp'
Luc Didry e41b08
    #    how => 'smtp',
Luc Didry e41b08
    #    howargs => ['smtp.example.org']
Luc Didry e41b08
    #},
Luc Didry e41b08
Luc Didry e41b08
    # Email sender address
Luc Didry 84c04d
    # optional, default to no-reply@lufi.io
Luc Didry e41b08
    #mail_sender => 'no-reply@lufi.io',
Luc Didry e41b08
Luc Didry 84c04d
    #############
Luc Didry 84c04d
    # DB settings
Luc Didry 84c04d
    #############
Luc Didry 84c04d
Luc Didry 84c04d
    # Choose what database you want to use
Luc Didry 84c04d
    # Valid choices are sqlite, postgresql and mysql (all lowercase)
Luc Didry e41b08
    # optional, default is sqlite
Luc Didry e41b08
    #dbtype => 'sqlite',
Luc Didry e41b08
Luc Didry e41b08
    # SQLite ONLY - only used if dbtype is set to sqlite
Luc Didry 84c04d
    # Define a path to the SQLite database
Luc Didry 84c04d
    # You can define it relative to lufi directory or set an absolute path
Luc Didry 84c04d
    # Remember that it has to be in a directory writable by Lufi user
Luc Didry e41b08
    # optional, default is lufi.db
Luc Didry e41b08
    db_path           => 'sqlite.db',
Luc Didry e41b08
Luc Didry e41b08
    # PostgreSQL ONLY - only used if dbtype is set to postgresql
Luc Didry 84c04d
    # These are the credentials to access the PostgreSQL database
Luc Didry e41b08
    # mandatory if you choosed postgresql as dbtype
Luc Didry e41b08
    #pgdb => {
Luc Didry e41b08
    #    database => 'lufi',
Luc Didry e41b08
    #    host     => 'localhost',
Luc Didry 44507c
    #    # optional, default is 5432
Luc Didry 44507c
    #    #port     => 5432,
Luc Didry 44507c
    #    user     => 'DBUSER',
Luc Didry 44507c
    #    pwd      => 'DBPASSWORD',
Luc Didry 44507c
    #    # https://mojolicious.org/perldoc/Mojo/Pg#max_connections
Luc Didry 44507c
    #    # optional, default is 1
Luc Didry 44507c
    #    #max_connections => 1,
Luc Didry 44507c
    #},
Luc Didry 44507c
Luc Didry 44507c
    # MySQL ONLY - only used if dbtype is set to mysql
Luc Didry 84c04d
    # These are the credentials to access the MySQL database
Luc Didry 44507c
    # mandatory if you choosed mysql as dbtype
Luc Didry 44507c
    #mysqldb => {
Luc Didry 44507c
    #    database => 'lufi',
Luc Didry 44507c
    #    host     => 'localhost',
Luc Didry 44507c
    #    # optional, default is 3306
Luc Didry 44507c
    #    #port     => 3306,
Luc Didry 44507c
    #    user     => 'DBUSER',
Luc Didry 44507c
    #    pwd      => 'DBPASSWORD',
Luc Didry 44507c
    #    # https://metacpan.org/pod/Mojo::mysql#max_connections
Luc Didry 44507c
    #    # optional, default is 5 (set to 0 to disable persistent connections)
Luc Didry 44507c
    #    #max_connections => 5,
Luc Didry e41b08
    #},
Luc Didry e41b08
Luc Didry 84c04d
    #############################################
Luc Didry 84c04d
    # LDAP settings (authentication and features)
Luc Didry 84c04d
    #############################################
Luc Didry e41b08
Luc Didry 84c04d
    # Set `ldap` if you want that only authenticated users can upload files
Luc Didry 84c04d
    # Please note that everybody can still download files
Luc Didry e41b08
    # optional, no default
Luc Didry 2c11ea
    #ldap => { uri => 'ldap://rroemhild-test-openldap:10389', user_tree => 'ou=people,dc=planetexpress,dc=com', bind_dn => 'cn=admin,dc=planetexpress,dc=com', bind_pwd => 'GoodNewsEveryone', user_attr => 'uid', user_filter => '' },
Luc Didry e41b08
Luc Didry 84c04d
    # If you've set ldap above, the session will last `session_duration` seconds before
Luc Didry e41b08
    # the user needs to reauthenticate
Luc Didry e41b08
    # optional, default is 3600
Luc Didry e41b08
    #session_duration => 3600,
Luc Didry e41b08
Luc Didry 84c04d
    # If you use `ldap` for authentication, you can map some attributes from LDAP to be able to access them in Lufi
Luc Didry 84c04d
    # Those attributes will be accessible with:
Luc Didry 84c04d
    #   $c->current_user->{lufi_attribute_name} in Lufi backend files (all that is in `lib` directory)
Luc Didry 84c04d
    #   <%= $self->current_user->{lufi_attribute_name} %> in templates files (in `themes` directory)
Luc Didry 84c04d
    #
Luc Didry 84c04d
    # Define the attributes like this: `lufi_attribute_name => 'LDAP_attribute_name'`
Luc Didry 84c04d
    # Note that you can’t use `username` as a Lufi attribute name: this name is reserved and will contain the login of the user
Luc Didry 8d6f10
    # optional, no default
Luc Didry 84c04d
    #ldap_map_attr => {
Luc Didry 84c04d
    #    displayname => 'cn',
Luc Didry 84c04d
    #    mail        => 'mail'
Luc Didry 84c04d
    #},
Luc Didry e41b08
Luc Didry 8d6f10
    # When using LDAP authentication, LDAP users can invite people (by mail) to use Lufi to send them files without
Luc Didry 8d6f10
    # being authenticated.
Luc Didry 8d6f10
    # This is where you configure the behavior of the invitations.
Luc Didry 8d6f10
    # You may need to fetch some attributes from LDAP to use some invitations settings. See `ldap_map_attr` above.
Luc Didry 8d6f10
    # optional, no default
Luc Didry 8d6f10
    #invitations => {
Luc Didry 8d6f10
    #   # The name of the key set in `ldap_map_attr` (above) that corresponds to the mail of the LDAP user
Luc Didry 8d6f10
    #   # optional, default is `mail`
Luc Didry 8d6f10
    #   mail_attr => 'mail',
Luc Didry 8d6f10
    #   # The `From` header of invitation mail can be the mail of the LDAP user
Luc Didry 8d6f10
    #   # Be sure to have a mail system that will correctly send the mail from your users! (DKIM, SPF…)
Luc Didry 8d6f10
    #   # To enable this feature, set it to 1
Luc Didry 8d6f10
    #   # optional, disabled by default
Luc Didry 8d6f10
    #   send_invitation_with_ldap_user_mail => 1,
Luc Didry 8d6f10
    #   # The user is able to set an expiration delay for the invitation.
Luc Didry 8d6f10
    #   # This expiration delay can’t be more than this setting (in days).
Luc Didry 8d6f10
    #   # optional, default is 30 days
Luc Didry 8d6f10
    #   max_invitation_expiration_delay => 30,
Luc Didry 8d6f10
    #   # Once the guest has submitted his files, he has an additional period of time to submit forgotten files.
Luc Didry 8d6f10
    #   # You can set that additional period of time in minutes here.
Luc Didry 8d6f10
    #   # To disable that feature, set it to 0 or less
Luc Didry 8d6f10
    #   # optional, default is 10 minutes
Luc Didry 8d6f10
    #   max_additional_period => 10,
Luc Didry 8d6f10
    #   # Lufi follows privacy-by-design, so, by default, no files URLs (with the decode secret) are stored in database.
Luc Didry 8d6f10
    #   # However, the concern is different for this case. Storing files URLs makes users able to retrieve the guests’ sent files
Luc Didry 8d6f10
    #   # from their `invitations` page.
Luc Didry 8d6f10
    #   # Set to 1 to store guests’ files URLs in database
Luc Didry 8d6f10
    #   # optional, default is 0 (disabled)
Luc Didry 8d6f10
    #   save_files_url_in_db => 0,
Luc Didry 8d6f10
    #   # Users can resend the invitation to their guest. This does not extend the invitation’s expiration delay unless you
Luc Didry 8d6f10
    #   # set this option to 1.
Luc Didry 8d6f10
    #   # optional, default is 0 (disabled)
Luc Didry 8d6f10
    #   extend_invitation_expiration_on_resend => 0,
Luc Didry 8d6f10
    #},
Luc Didry 8d6f10
Luc Didry 84c04d
    #########################
Luc Didry 84c04d
    # Htpasswd authentication
Luc Didry 84c04d
    #########################
Luc Didry e41b08
Luc Didry 84c04d
    # Set `htpasswd` if you want to use an htpasswd file instead of ldap
Luc Didry 84c04d
    # See 'man htpasswd' to know how to create such file
Luc Didry 84c04d
    #htpasswd => 't/lstu.passwd',
Luc Didry e41b08
Luc Didry 84c04d
    #######################
Luc Didry 84c04d
    # HTTP Headers settings
Luc Didry 84c04d
    #######################
Luc Didry e41b08
Luc Didry e41b08
    # Content-Security-Policy header that will be sent by Lufi
Luc Didry e41b08
    # Set to '' to disable CSP header
Luc Didry e41b08
    # https://content-security-policy.com/ provides a good documentation about CSP.
Luc Didry e41b08
    # https://report-uri.com/home/generate provides a tool to generate a CSP header.
Luc Didry 84c04d
    # optional, default is "base-uri 'self'; connect-src 'self' ws://YOUR_HOST; default-src 'none'; font-src 'self'; form-action 'self'; frame-ancestors 'none'; img-src 'self' blob:; media-src blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"
Luc Didry 84c04d
    #csp => "",
Luc Didry e41b08
Luc Didry e41b08
    # X-Frame-Options header that will be sent by Lufi
Luc Didry e41b08
    # Valid values are: 'DENY', 'SAMEORIGIN', 'ALLOW-FROM https://example.com/'
Luc Didry e41b08
    # Set to '' to disable X-Frame-Options header
Luc Didry e41b08
    # See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
Luc Didry e41b08
    # Please note that this will add a "frame-ancestors" directive to the CSP header (see above) accordingly
Luc Didry e41b08
    # to the chosen setting (See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors)
Luc Didry e41b08
    # optional, default is 'DENY'
Luc Didry e41b08
    #x_frame_options => 'DENY',
Luc Didry e41b08
Luc Didry e41b08
    # X-Content-Type-Options that will be sent by Lufi
Luc Didry e41b08
    # See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
Luc Didry e41b08
    # Set to '' to disable X-Content-Type-Options header
Luc Didry e41b08
    # optional, default is 'nosniff'
Luc Didry e41b08
    #x_content_type_options => 'nosniff',
Luc Didry e41b08
Luc Didry e41b08
    # X-XSS-Protection that will be sent by Lufi
Luc Didry e41b08
    # See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
Luc Didry e41b08
    # Set to '' to disable X-XSS-Protection header
Luc Didry e41b08
    # optional, default is '1; mode=block'
Luc Didry e41b08
    #x_xss_protection => '1; mode=block',
Luc Didry e41b08
Luc Didry e41b08
    #########################
Luc Didry e41b08
    # Lufi cron jobs settings
Luc Didry e41b08
    #########################
Luc Didry e41b08
Luc Didry 84c04d
    # Number of days senders' IP addresses are kept in database
Luc Didry 84c04d
    # After that delay, they will be deleted from database (used with script/lufi cron cleanbdd)
Luc Didry e41b08
    # optional, default is 365
Luc Didry e41b08
    #keep_ip_during    => 365,
Luc Didry e41b08
Luc Didry 84c04d
    # Max size of the files directory, in octets
Luc Didry 84c04d
    # Used by script/lufi cron watch to trigger an action
Luc Didry e41b08
    # optional, no default
Luc Didry e41b08
    #max_total_size    => 10*1024*1024*1024,
Luc Didry e41b08
Luc Didry 84c04d
    # Default action when files directory is over max_total_size (used with script/lufi cron watch)
Luc Didry 84c04d
    # Valid values are 'warn', 'stop-upload' and 'delete'
Luc Didry 84c04d
    # Please, see README.md
Luc Didry e41b08
    # optional, default is 'warn'
Luc Didry e41b08
    #policy_when_full  => 'warn',
Luc Didry e41b08
Luc Didry 84c04d
    # Files which are not viewed since delete_no_longer_viewed_files days will be deleted by the cron cleanfiles task
Luc Didry 84c04d
    # If delete_no_longer_viewed_files is not set, the no longer viewed files will NOT be deleted
Luc Didry e41b08
    # optional, no default
Luc Didry e41b08
    #delete_no_longer_viewed_files => 90,
Luc Didry e41b08
};