Skip to content

Commit

Permalink
Remove all values from optional defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
noplanman committed Jan 17, 2017
1 parent c8017d5 commit 4a6a34d
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 24 deletions.
48 changes: 24 additions & 24 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ lutim_keep_updated: no
# lutim_secrets: ["array", "of", "random", "secrets"]

# Optional
lutim_theme: "default"
lutim_proxy: no
lutim_url_length: 8
lutim_crypto_key_length: 8
lutim_provis_step: 5
lutim_provisioning: 100
lutim_anti_flood_delay: 5
lutim_tweet_card_via: "@framasky"
lutim_max_file_size: 10485760
lutim_piwik_img: ""
lutim_hosted_by: ""
lutim_broadcast_message: ""
lutim_allowed_domains: []
lutim_default_delay: 0
lutim_max_delay: 0
lutim_always_encrypt: no
lutim_token_length: 24
lutim_prefix: "/"
lutim_db_path: "lutim.db"
lutim_thumbnail_size: 100
lutim_stats_day_num: 365
lutim_keep_ip_during: 365
lutim_max_total_size: 10*1024*1024*1024
lutim_policy_when_full: "warn"
lutim_delete_no_longer_viewed_files: 90
#lutim_theme: "default"
#lutim_proxy: no
#lutim_url_length: 8
#lutim_crypto_key_length: 8
#lutim_provis_step: 5
#lutim_provisioning: 100
#lutim_anti_flood_delay: 5
#lutim_tweet_card_via: "@framasky"
#lutim_max_file_size: 10485760
#lutim_piwik_img: ""
#lutim_hosted_by: ""
#lutim_broadcast_message: ""
#lutim_allowed_domains: []
#lutim_default_delay: 0
#lutim_max_delay: 0
#lutim_always_encrypt: no
#lutim_token_length: 24
#lutim_prefix: "/"
#lutim_thumbnail_size: 100
#lutim_stats_day_num: 365
#lutim_keep_ip_during: 365
#lutim_max_total_size: 10*1024*1024*1024
#lutim_policy_when_full: "warn"
#lutim_delete_no_longer_viewed_files: 90
48 changes: 48 additions & 0 deletions templates/lutim.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
# if you use Lutim behind a reverse proxy like Nginx, you want to set proxy to 1
# if you use Lutim directly, let it commented
#proxy => 1,
{% if lutim_proxy is defined %}
proxy => {{ lutim_proxy | ternary(1,0) }},
{% endif %}
},

################
Expand All @@ -32,57 +34,77 @@
# choose a theme. See the available themes in `themes` directory
# optional, default is 'default'
#theme => 'default',
{% if lutim_theme is defined %}
theme => '{{ lutim_theme }}',
{% endif %}

# length of the images random URL
# optional, default is 8
#length => 8,
{% if lutim_url_length is defined %}
length => {{ lutim_url_length }},
{% endif %}

# length of the encryption key
# optional, default is 8
#crypto_key_length => 8,
{% if lutim_crypto_key_length is defined %}
crypto_key_length => {{ lutim_crypto_key_length }},
{% endif %}

# how many URLs will be provisioned in a batch ?
# optional, default is 5
#provis_step => 5,
{% if lutim_provis_step is defined %}
provis_step => {{ lutim_provis_step }},
{% endif %}

# max number of URLs to be provisioned
# optional, default is 100
#provisioning => 100,
{% if lutim_provisioning is defined %}
provisioning => {{ lutim_provisioning }},
{% endif %}

# anti-flood protection delay, in seconds
# users won't be able to ask Lutim to download images more than one per anti_flood_delay seconds
# optional, default is 5
#anti_flood_delay => 5,
{% if lutim_anti_flood_delay is defined %}
anti_flood_delay => {{ lutim_anti_flood_delay }},
{% endif %}

# twitter account which will appear on twitter cards
# see https://dev.twitter.com/docs/cards/validation/validator to register your Lutim instance on twitter
# optional, default is @framasky
#tweet_card_via => '@framasky',
{% if lutim_tweet_card_via is defined %}
tweet_card_via => '{{ lutim_tweet_card_via }}',
{% endif %}

# max image size, in octets
# you can write it 10*1024*1024
# optional, default is 10485760
#max_file_size => 10485760,
{% if lutim_max_file_size is defined %}
max_file_size => {{ lutim_max_file_size }},
{% endif %}

# if you want to have piwik statistics, provide a piwik image tracker
# only the image tracker is allowed, no javascript
# optional, no default
#piwik_img => 'https://piwik.example.org/piwik.php?idsite=1&rec=1',
{% if lutim_piwik_img is defined %}
piwik_img => '{{ lutim_piwik_img }}',
{% endif %}

# if you want to include something in the right of the screen, put it here
# here's an exemple to put the logo of your hoster
# optional, no default
#hosted_by => 'My super hoster <img src="http://hoster.example.com" alt="Hoster logo">',
{% if lutim_hosted_by is defined %}
hosted_by => '{{ lutim_hosted_by }}',
{% endif %}

# DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED
# Lutim now checks if the X-Forwarded-Proto header is present and equal to https.
Expand All @@ -93,42 +115,56 @@
# broadcast_message which will displayed on all pages of Lutim (but no in json response)
# optional, no default
#broadcast_message => 'Maintenance',
{% if lutim_broadcast_message is defined %}
broadcast_message => '{{ lutim_broadcast_message }}',
{% endif %}

# array of authorized domains for API calls.
# if you want to authorize everyone to use the API: ['*']
# optional, no domains allowed by default
#allowed_domains => ['http://1.example.com', 'http://2.example.com'],
{% if lutim_allowed_domains is defined %}
allowed_domains => {{ lutim_allowed_domains | to_json }},
{% endif %}

# default time limit for files
# valid values are 0, 1, 7, 30 and 365
# optional, default is 0 (no limit)
#default_delay => 0,
{% if lutim_default_delay is defined %}
default_delay => {{ lutim_default_delay }},
{% endif %}

# number of days after which the images will be deleted, even if they were uploaded with "no delay" (or value superior to max_delay)
# a warning message will be displayed on homepage
# optional, default is 0 (no limit)
#max_delay => 0,
{% if lutim_max_delay is defined %}
max_delay => {{ lutim_max_delay }},
{% endif %}

# if set to 1, all the images will be encrypted and the encryption option will no be displayed
# optional, default is 0
#always_encrypt => 0,
{% if lutim_always_encrypt is defined %}
always_encrypt => {{ lutim_always_encrypt | ternary(1,0) }},
{% endif %}

# length of the image's delete token
# optional, default is 24
#token_length => 24,
{% if lutim_token_length is defined %}
token_length => {{ lutim_token_length }},
{% endif %}

# URL sub-directory in which you want Lutim to be accessible
# example: you want to have Lutim under https://example.org/lutim/
# => set prefix to '/lutim' or to '/lutim/', it doesn't matter
# optional, defaut is /
#prefix => '/',
{% if lutim_prefix is defined %}
prefix => '{{ lutim_prefix }}',
{% endif %}

# define a path to the SQLite database
# you can define it relative to lutim directory or set an absolute path
Expand All @@ -144,7 +180,9 @@
# this works only if you have ImageMagick
# optional, default is 100 (pixels)
#thumbnail_size => 100,
{% if lutim_thumbnail_size is defined %}
thumbnail_size => {{ lutim_thumbnail_size }},
{% endif %}

##########################
# Lutim cron jobs settings
Expand All @@ -153,30 +191,40 @@
# number of days shown in /stats page (used with script/lutim cron stats)
# optional, default is 365
#stats_day_num => 365,
{% if lutim_stats_day_num is defined %}
stats_day_num => {{ lutim_stats_day_num }},
{% endif %}

# number of days senders' IP addresses are kept in database
# after that delay, they will be deleted from database (used with script/lutim cron cleanbdd)
# optional, default is 365
#keep_ip_during => 365,
{% if lutim_keep_ip_during is defined %}
keep_ip_during => {{ lutim_keep_ip_during }},
{% endif %}

# max size of the files directory, in octets
# used by script/lutim cron watch to trigger an action
# optional, no default
#max_total_size => 10*1024*1024*1024,
{% if lutim_max_total_size is defined %}
max_total_size => {{ lutim_max_total_size }},
{% endif %}

# default action when files directory is over max_total_size (used with script/lutim cron watch)
# valid values are 'warn', 'stop-upload' and 'delete'
# please, see readme
# optional, default is 'warn'
#policy_when_full => 'warn',
{% if lutim_policy_when_full is defined %}
policy_when_full => '{{ lutim_policy_when_full }}',
{% endif %}

# images which are not viewed since delete_no_longer_viewed_files days will be deleted by the cron cleanfiles task
# if delete_no_longer_viewed_files is not set, the no longer viewed files will NOT be deleted
# optional, no default
#delete_no_longer_viewed_files => 90
{% if lutim_delete_no_longer_viewed_files is defined %}
delete_no_longer_viewed_files => {{ lutim_delete_no_longer_viewed_files }},
{% endif %}
};

0 comments on commit 4a6a34d

Please sign in to comment.