Luc Didry 91e078
# vim:set sw=4 ts=4 sts=4 ft=perl expandtab:
Luc Didry 91e078
{
Luc Didry 91e078
    ####################
Luc Didry 91e078
    # Hypnotoad settings
Luc Didry 91e078
    ####################
Luc Didry 91e078
    # see http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad for a full list of settings
Luc Didry 91e078
    hypnotoad => {
Luc Didry 91e078
        # array of IP addresses and ports you want to listen to
Luc Didry d091ac
        # you can specify a unix socket too, like 'http+unix://%2Ftmp%2Flufi.sock'
Luc Didry 14bc04
        listen => ['http://127.0.0.1:8081'],
Luc Didry 164698
        # if you use Lufi behind a reverse proxy like Nginx, you want to set proxy to 1
Luc Didry abd575
        # if you use Lufi directly, let it commented
Luc Didry abd575
        #proxy  => 1,
Luc Didry a2a578
Luc Didry e7ca84
        # Please read http://mojolicious.org/perldoc/Mojo/Server/Hypnotoad#workers
Luc Didry e7ca84
        # to adjust this to your server
Luc Didry e7ca84
        workers => 30,
Luc Didry e7ca84
        clients => 1,
Luc Didry 91e078
    },
Luc Didry 91e078
Luc Didry 91e078
    # put a way to contact you here and uncomment it
Luc Didry 377a48
    # you can put some HTML in it
Luc Didry 91e078
    # MANDATORY
Luc Didry 377a48
    #contact       => 'Contact page',
Luc Didry 377a48
Luc Didry 377a48
    # put an URL or an email address to receive file reports and uncomment it
Luc Didry 377a48
    # it's for make reporting illegal files easy for users
Luc Didry 377a48
    # MANDATORY
Luc Didry 377a48
    #report => 'report@example.com',
Luc Didry 91e078
Luc Didry 91e078
    # array of random strings used to encrypt cookies
Luc Didry 91e078
    # optional, default is ['fdjsofjoihrei'], PLEASE, CHANGE IT
Luc Didry 91e078
    #secrets        => ['fdjsofjoihrei'],
Luc Didry 91e078
Luc Didry adf0a4
    # choose a theme. See the available themes in `themes` directory
Luc Didry adf0a4
    # optional, default is 'default'
Luc Didry adf0a4
    #theme         => 'default',
Luc Didry adf0a4
Luc Didry 91e078
    # length of the random URL
Luc Didry 91e078
    # optional, default is 8
Luc Didry 91e078
    #length            => 8,
Luc Didry 91e078
Luc Didry 91e078
    # how many URLs will be provisioned in a batch ?
Luc Didry 91e078
    # optional, default is 5
Luc Didry 91e078
    #provis_step       => 5,
Luc Didry 91e078
Luc Didry 91e078
    # max number of URLs to be provisioned
Luc Didry 91e078
    # optional, default is 100
Luc Didry 91e078
    #provisioning      => 100,
Luc Didry 91e078
Luc Didry 91e078
    # length of the modify/delete token
Luc Didry 91e078
    # optional, default is 32
Luc Didry 91e078
    #token_length      => 32,
Luc Didry 91e078
Luc Didry 10a8dd
    # max file size, in octets
Luc Didry 10a8dd
    # you can write it 100*1024*1024
Luc Didry 10a8dd
    # optional, no default
Luc Didry 10a8dd
    #max_file_size     => 104857600,
Luc Didry 10a8dd
Luc Didry 9430bd
    # if you want to have piwik statistics, provide a piwik image tracker
Luc Didry 9430bd
    # only the image tracker is allowed, no javascript
Luc Didry 9430bd
    # optional, no default
Luc Didry 9430bd
    #piwik_img         => 'https://piwik.example.org/piwik.php?idsite=1&rec=1',
Luc Didry 9430bd
Luc Didry d52dd6
    # broadcast_message which will displayed on the index page
Luc Didry 2f3877
    # optional, no default
Luc Didry 2f3877
    #broadcast_message => 'Maintenance',
Luc Didry 2f3877
Luc Didry 91e078
    # default time limit for files
Luc Didry 91e078
    # valid values are 0, 1, 7, 30 and 365
Luc Didry 91e078
    # optional, default is 0 (no limit)
Luc Didry 91e078
    #default_delay     => 0,
Luc Didry 91e078
Luc Didry 91e078
    # 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 91e078
    # a warning message will be displayed on homepage
Luc Didry 91e078
    # optional, default is 0 (no limit)
Luc Didry 91e078
    #max_delay         => 0,
Luc Didry 91e078
Luc Didry 41cb17
    # size thresholds: if you want to define max delays for different sizes of file
Luc Didry 41cb17
    # the keys are size in Bytes, you can't have 10*1000*10000 as key
Luc Didry be8c84
    # if a file is smaller than the smallest configured size, it will have a expiration delay of max_delay (see above)
Luc Didry 41cb17
    # optional, default is using max_delay (see above) for all sizes
Luc Didry 41cb17
    #delay_for_size  => {
Luc Didry 41cb17
    #    10000000   => 90, # between 10MB and 50MB => max is 90 days, less than 10MB => max is max_delay (see above)
Luc Didry 41cb17
    #    50000000   => 60, # between 50MB ans 1GB  => max is 60 days
Luc Didry 41cb17
    #    1000000000 => 2,  # more than 1GB         => max is 2 days
Luc Didry 077b92
    #},
Luc Didry 41cb17
Luc Didry 088fb7
    # URL sub-directory in which you want Lufi to be accessible
Luc Didry 088fb7
    # example: you want to have Lufi under https://example.org/lufi/
Luc Didry 91e078
    # => set prefix to '/lufi' or to '/lufi/', it doesn't matter
Luc Didry 91e078
    # optional, defaut is /
Luc Didry 91e078
    #prefix        => '/',
Luc Didry 91e078
Luc Didry 91e078
    # array of authorized domains for API calls.
Luc Didry 91e078
    # if you want to authorize everyone to use the API: ['*']
Luc Didry 91e078
    # optional, no domains allowed by default
Luc Didry 91e078
    #allowed_domains   => ['http://1.example.com', 'http://2.example.com'],
Luc Didry 91e078
Luc Didry 91e078
    # if set, the shortened URLs will use this domain
Luc Didry 91e078
    # optional
Luc Didry 91e078
    #fixed_domain => 'example.org',
Luc Didry ae8934
Luc Didry ae8934
    # Mail configuration
Luc Didry ae8934
    # See https://metacpan.org/pod/Mojolicious::Plugin::Mail#EXAMPLES
Luc Didry ae8934
    # Optional, default to sendmail method with no arguments
Luc Didry ae8934
    #mail => {
Luc Didry ae8934
    #    # Valid values are 'sendmail' and 'smtp'
Luc Didry ae8934
    #    how => 'smtp',
Luc Didry ae8934
    #    howargs => ['smtp.example.org']
Luc Didry ae8934
    #},
Luc Didry ae8934
Luc Didry ae8934
    # Email sender address
Luc Didry ae8934
    # Optional, default to no-reply@lufi.io
Luc Didry fb140e
    #mail_sender => 'no-reply@lufi.io',
Luc Didry 077b92
Luc Didry d909b8
    # choose what database you want to use
Luc Didry 44507c
    # valid choices are sqlite, postgresql and mysql (all lowercase)
Luc Didry d909b8
    # optional, default is sqlite
Luc Didry d909b8
    #dbtype => 'sqlite',
Luc Didry d909b8
Luc Didry d909b8
    # SQLite ONLY - only used if dbtype is set to sqlite
Luc Didry 077b92
    # define a path to the SQLite database
Luc Didry 077b92
    # you can define it relative to lufi directory or set an absolute path
Luc Didry 18499a
    # remember that it has to be in a directory writable by Lufi user
Luc Didry 077b92
    # optional, default is lufi.db
Luc Didry 077b92
    #db_path           => 'lufi.db',
Luc Didry 40deab
Luc Didry d909b8
    # PostgreSQL ONLY - only used if dbtype is set to postgresql
Luc Didry d909b8
    # these are the credentials to access the PostgreSQL database
Luc Didry d909b8
    # mandatory if you choosed postgresql as dbtype
Luc Didry d909b8
    #pgdb => {
Luc Didry d909b8
    #    database => 'lufi',
Luc Didry d909b8
    #    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 d909b8
    #},
Luc Didry d909b8
Luc Didry f94ae4
    # define a path to the upload directory, where the uploaded files will be stored
Luc Didry f94ae4
    # you can define it relative to lufi directory or set an absolute path
Luc Didry f94ae4
    # remember that it has to be in a directory writable by Lufi user
Luc Didry f94ae4
    # DO NOT CHANGE THIS IF FILES HAVE BEEN ALREADY UPLOADED: THEY WILL NOT BE DOWNLOADABLE ANYMORE
Luc Didry f94ae4
    # optional, default is 'files'
Luc Didry f94ae4
    #upload_dir           => 'files',
Luc Didry f94ae4
Luc Didry ac8d76
    # set `ldap` if you want that only authenticated users can upload files
Luc Didry ac8d76
    # please note that everybody can still download files
Luc Didry ac8d76
    # optional, no default
Luc Didry ac8d76
    #ldap => {
Luc Didry 13e855
    #    uri         => 'ldaps://ldap.example.org',                 # server URI
Luc Didry 13e855
    #    user_tree   => 'ou=users,dc=example,dc=org',               # search base DN
Luc Didry 13e855
    #    bind_dn     => 'uid=ldap_user,ou=users,dc=example,dc=org', # search bind DN
Luc Didry 13e855
    #    bind_pwd    => 'secr3t',                                   # search bind password
Luc Didry 13e855
    #    user_attr   => 'uid',                                      # user attribute (uid, mail, sAMAccountName, etc.)
Luc Didry 13e855
    #    user_filter => '(!(uid=ldap_user))',                       # user filter (to exclude some users, etc.)
Luc Didry 80c7ec
    #    # optional start_tls configuration. See https://metacpan.org/pod/distribution/perl-ldap/lib/Net/LDAP.pod#start_tls
Luc Didry 80c7ec
    #    # don't set or uncomment if you don't want to configure it
Luc Didry 80c7ec
    #    start_tls => {
Luc Didry 80c7ec
    #       verify     => 'optional',
Luc Didry 80c7ec
    #       clientcert => '/etc/ssl/certs/ca-bundle.pem'
Luc Didry 80c7ec
    #    }
Luc Didry ac8d76
    #},
Luc Didry ac8d76
Yann dbdaff
    # set `htpasswd` if you want to use an htpasswd file instead of ldap
Yann dbdaff
    # see 'man htpasswd' to know how to create such file
Yann dbdaff
    #htpasswd => 'lufi.passwd',
Yann dbdaff
Armando Lüscher c3e7a2
    # if you've set ldap above, the session will last `session_duration` seconds before
Luc Didry ac8d76
    # the user needs to reauthenticate
Luc Didry ac8d76
    # optional, default is 3600
Luc Didry ac8d76
    #session_duration => 3600,
Luc Didry ac8d76
Luc Didry 50b1f0
    # allow to add a password on files, asked before allowing to download files
Luc Didry c2e926
    # optional, default is 0
Luc Didry 50b1f0
    #allow_pwd_on_files => 0,
Luc Didry 50b1f0
Luc Didry c2e926
    # force all files to be in "Burn after reading mode"
Luc Didry c2e926
    # optional, default is 0
Luc Didry c2e926
    #force_burn_after_reading => 0,
Luc Didry c2e926
Luc Didry a2a578
    # if set, the files' URLs will always use this domain
Luc Didry 25ab7e
    # optional, no default
Luc Didry a2a578
    #fixed_domain => 'example.org',
Luc Didry a2a578
Luc Didry 25ab7e
    # abuse reasons
Luc Didry 25ab7e
    # set an integer in the abuse field of a file in the database and it will not be downloadable anymore
Luc Didry 25ab7e
    # the reason will be displayed to the downloader, according to the reasons you will configure here.
Luc Didry 25ab7e
    # optional, no default
Luc Didry 25ab7e
    #abuse => {
Luc Didry 25ab7e
    #   0 => 'Copyright infringment',
Luc Didry 25ab7e
    #   1 => 'Illegal content',
Luc Didry 25ab7e
    #},
Luc Didry 25ab7e
Luc Didry 377ba0
    # Content-Security-Policy header that will be sent by Lufi
Luc Didry 377ba0
    # Set to '' to disable CSP header
Luc Didry 377ba0
    # https://content-security-policy.com/ provides a good documentation about CSP.
Luc Didry 377ba0
    # https://report-uri.com/home/generate provides a tool to generate a CSP header.
Luc Didry 616304
    # 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 616304
    #csp => "",
Luc Didry 377ba0
Luc Didry 377ba0
    # X-Frame-Options header that will be sent by Lufi
Luc Didry 377ba0
    # Valid values are: 'DENY', 'SAMEORIGIN', 'ALLOW-FROM https://example.com/'
Luc Didry 377ba0
    # Set to '' to disable X-Frame-Options header
Luc Didry 377ba0
    # See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
Luc Didry 377ba0
    # Please note that this will add a "frame-ancestors" directive to the CSP header (see above) accordingly
Luc Didry 377ba0
    # to the chosen setting (See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors)
Luc Didry 377ba0
    # optional, default is 'DENY'
Luc Didry 377ba0
    #x_frame_options => 'DENY',
Luc Didry 377ba0
Luc Didry 377ba0
    # X-Content-Type-Options that will be sent by Lufi
Luc Didry 377ba0
    # See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
Luc Didry 377ba0
    # Set to '' to disable X-Content-Type-Options header
Luc Didry 377ba0
    # optional, default is 'nosniff'
Luc Didry 377ba0
    #x_content_type_options => 'nosniff',
Luc Didry 377ba0
Luc Didry 377ba0
    # X-XSS-Protection that will be sent by Lufi
Luc Didry 377ba0
    # See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
Luc Didry 377ba0
    # Set to '' to disable X-XSS-Protection header
Luc Didry 377ba0
    # optional, default is '1; mode=block'
Luc Didry 377ba0
    #x_xss_protection => '1; mode=block',
Luc Didry 377ba0
Luc Didry 40deab
    #########################
Luc Didry 40deab
    # Lufi cron jobs settings
Luc Didry 40deab
    #########################
Luc Didry 40deab
Luc Didry 40deab
    # number of days senders' IP addresses are kept in database
Luc Didry 40deab
    # after that delay, they will be deleted from database (used with script/lufi cron cleanbdd)
Luc Didry 40deab
    # optional, default is 365
Luc Didry 40deab
    #keep_ip_during    => 365,
Luc Didry 40deab
Luc Didry 40deab
    # max size of the files directory, in octets
Luc Didry 40deab
    # used by script/lufi cron watch to trigger an action
Luc Didry 40deab
    # optional, no default
Luc Didry 40deab
    #max_total_size    => 10*1024*1024*1024,
Luc Didry 40deab
Luc Didry 40deab
    # default action when files directory is over max_total_size (used with script/lufi cron watch)
Luc Didry 40deab
    # valid values are 'warn', 'stop-upload' and 'delete'
Luc Didry 40deab
    # please, see readme
Luc Didry 40deab
    # optional, default is 'warn'
Luc Didry 40deab
    #policy_when_full  => 'warn',
Luc Didry 40deab
Luc Didry 40deab
    # images which are not viewed since delete_no_longer_viewed_files days will be deleted by the cron cleanfiles task
Luc Didry 40deab
    # if delete_no_longer_viewed_files is not set, the no longer viewed files will NOT be deleted
Luc Didry 40deab
    # optional, no default
Luc Didry ac8d76
    #delete_no_longer_viewed_files => 90,
Luc Didry ae8934
};