diff options
author | Kim Alvefur <zash@zash.se> | 2023-07-17 01:38:54 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-07-17 01:38:54 +0200 |
commit | 71ad48095d92dd52a415eef499da32f8c27bb7fe (patch) | |
tree | 0287ae06ee488c1b62e9e3eccbf4a9ae74b8370d /plugins/mod_http_file_share.lua | |
parent | 55768509a3f15b0476289f7a338d02e7233d1926 (diff) | |
download | prosody-71ad48095d92dd52a415eef499da32f8c27bb7fe.tar.gz prosody-71ad48095d92dd52a415eef499da32f8c27bb7fe.zip |
plugins: Use integer config API with interval specification where sensible
Many of these fall into a few categories:
- util.cache size, must be >= 1
- byte or item counts that logically can't be negative
- port numbers that should be in 1..0xffff
Diffstat (limited to 'plugins/mod_http_file_share.lua')
-rw-r--r-- | plugins/mod_http_file_share.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua index 1f9f5b7b..08d6a90e 100644 --- a/plugins/mod_http_file_share.lua +++ b/plugins/mod_http_file_share.lua @@ -36,12 +36,12 @@ local persist_stats = module:open_store("upload_stats", "map"); local secret = module:get_option_string(module.name.."_secret", require"prosody.util.id".long()); local external_base_url = module:get_option_string(module.name .. "_base_url"); -local file_size_limit = module:get_option_number(module.name .. "_size_limit", 10 * 1024 * 1024); -- 10 MB +local file_size_limit = module:get_option_integer(module.name .. "_size_limit", 10 * 1024 * 1024, 0); -- 10 MB local file_types = module:get_option_set(module.name .. "_allowed_file_types", {}); local safe_types = module:get_option_set(module.name .. "_safe_file_types", {"image/*","video/*","audio/*","text/plain"}); local expiry = module:get_option_period(module.name .. "_expires_after", "1w"); -local daily_quota = module:get_option_number(module.name .. "_daily_quota", file_size_limit*10); -- 100 MB / day -local total_storage_limit = module:get_option_number(module.name.."_global_quota", unlimited); +local daily_quota = module:get_option_integer(module.name .. "_daily_quota", file_size_limit*10, 0); -- 100 MB / day +local total_storage_limit = module:get_option_integer(module.name.."_global_quota", unlimited, 0); local create_jwt, verify_jwt = require"prosody.util.jwt".init("HS256", secret, secret, { default_ttl = 600 }); |