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 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 e41b08
    # put a way to contact you here and uncomment it
Luc Didry e41b08
    # you can put some HTML in it
Luc Didry e41b08
    # MANDATORY
Luc Didry e41b08
    contact       => 'Contact page',
Luc Didry e41b08
Luc Didry e41b08
    # put an URL or an email address to receive file reports and uncomment it
Luc Didry e41b08
    # 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 e41b08
    # 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 e41b08
    # choose a theme. See the available themes in `themes` directory
Luc Didry e41b08
    # optional, default is 'default'
Luc Didry e41b08
    #theme         => 'default',
Luc Didry e41b08
Luc Didry e41b08
    # length of the random URL
Luc Didry e41b08
    # optional, default is 8
Luc Didry e41b08
    #length            => 8,
Luc Didry e41b08
Luc Didry e41b08
    # 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 e41b08
    # max number of URLs to be provisioned
Luc Didry e41b08
    # optional, default is 100
Luc Didry e41b08
    #provisioning      => 100,
Luc Didry e41b08
Luc Didry e41b08
    # length of the modify/delete token
Luc Didry e41b08
    # optional, default is 32
Luc Didry e41b08
    #token_length      => 32,
Luc Didry e41b08
Luc Didry e41b08
    # max file size, in octets
Luc Didry e41b08
    # 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 e41b08
    # if you want to have piwik statistics, provide a piwik image tracker
Luc Didry e41b08
    # 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 e41b08
    # 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 e41b08
    # default time limit for files
Luc Didry e41b08
    # 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 e41b08
    # 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 e41b08
    # 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 e41b08
    # size thresholds: if you want to define max delays for different sizes of file
Luc Didry e41b08
    # the keys are size in Bytes, you can't have 10*1000*10000 as key
Luc Didry e41b08
    # 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 e41b08
    # array of authorized domains for API calls.
Luc Didry e41b08
    # 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 e41b08
    # if set, the shortened URLs will use this domain
Luc Didry e41b08
    # optional
Luc Didry e41b08
    #fixed_domain => 'example.org',
Luc Didry e41b08
Luc Didry e41b08
    # Mail configuration
Luc Didry e41b08
    # See https://metacpan.org/pod/Mojolicious::Plugin::Mail#EXAMPLES
Luc Didry e41b08
    # 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 e41b08
    # Optional, default to no-reply@lufi.io
Luc Didry e41b08
    #mail_sender => 'no-reply@lufi.io',
Luc Didry e41b08
Luc Didry e41b08
    # choose what database you want to use
Luc Didry 44507c
    # 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 e41b08
    # define a path to the SQLite database
Luc Didry e41b08
    # you can define it relative to lufi directory or set an absolute path
Luc Didry e41b08
    # 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 e41b08
    # 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 44507c
    # 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 e41b08
    # define a path to the upload directory, where the uploaded files will be stored
Luc Didry e41b08
    # you can define it relative to lufi directory or set an absolute path
Luc Didry e41b08
    # remember that it has to be in a directory writable by Lufi user
Luc Didry e41b08
    # DO NOT CHANGE THIS IF FILES HAVE BEEN ALREADY UPLOADED: THEY WILL NOT BE DOWNLOADABLE ANYMORE
Luc Didry e41b08
    # optional, default is 'files'
Luc Didry e41b08
    #upload_dir           => 'files',
Luc Didry e41b08
Luc Didry e41b08
    # set `ldap` if you want that only authenticated users can upload files
Luc Didry e41b08
    # please note that everybody can still download files
Luc Didry e41b08
    # optional, no default
Luc Didry e41b08
    #ldap => { uri => 'ldap://rroemhild-test-openldap', 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 e41b08
    # set `htpasswd` if you want to use an htpasswd file instead of ldap
Luc Didry e41b08
    # see 'man htpasswd' to know how to create such file
Luc Didry e41b08
    #htpasswd => 't/lstu.passwd',
Luc Didry e41b08
Luc Didry e41b08
    # 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 e41b08
    # allow to add a password on files, asked before allowing to download files
Luc Didry e41b08
    # optional, default is 0
Luc Didry e41b08
    allow_pwd_on_files => 1,
Luc Didry e41b08
Luc Didry e41b08
    # force all files to be in "Burn after reading mode"
Luc Didry e41b08
    # optional, default is 0
Luc Didry e41b08
    #force_burn_after_reading => 0,
Luc Didry e41b08
Luc Didry e41b08
    # if set, the files' URLs will always use this domain
Luc Didry e41b08
    # optional, no default
Luc Didry e41b08
    #fixed_domain => 'example.org',
Luc Didry e41b08
Luc Didry e41b08
    # abuse reasons
Luc Didry e41b08
    # set an integer in the abuse field of a file in the database and it will not be downloadable anymore
Luc Didry e41b08
    # the reason will be displayed to the downloader, according to the reasons you will configure here.
Luc Didry e41b08
    # optional, no default
Luc Didry e41b08
    abuse => {
Luc Didry e41b08
       0 => 'Copyright infringment',
Luc Didry e41b08
       1 => 'Illegal content',
Luc Didry e41b08
    },
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 e41b08
    # optional, default is "base-uri 'self'; connect-src 'self'; 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 e41b08
    # the default value is good for `default` and `milligram` themes
Luc Didry e41b08
    #csp => "base-uri 'self'; connect-src 'self'; 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 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 e41b08
    # number of days senders' IP addresses are kept in database
Luc Didry e41b08
    # 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 e41b08
    # max size of the files directory, in octets
Luc Didry e41b08
    # 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 e41b08
    # default action when files directory is over max_total_size (used with script/lufi cron watch)
Luc Didry e41b08
    # valid values are 'warn', 'stop-upload' and 'delete'
Luc Didry e41b08
    # please, see readme
Luc Didry e41b08
    # optional, default is 'warn'
Luc Didry e41b08
    #policy_when_full  => 'warn',
Luc Didry e41b08
Luc Didry e41b08
    # images which are not viewed since delete_no_longer_viewed_files days will be deleted by the cron cleanfiles task
Luc Didry e41b08
    # 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
};