diff --git a/changelog.txt b/changelog.txt index 1301cfb..b1b28c7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,6 @@ vrel 0.1.5: - - Doubled the default maximum lifetime (3 months -> 6 months). + - Reduced max paste size (15MB -> 10MB). + - Doubled the default max lifetime (3 months -> 6 months). - Added an optional configuration file. - Added syntax setting per-paste. - Sender IP storing should work with proxies. diff --git a/config.default.lua b/config.default.lua index 6e3f316..581fdb5 100644 --- a/config.default.lua +++ b/config.default.lua @@ -16,7 +16,7 @@ return { -- Default lifetime of a paste in the web interface defaultLifetime = 86400, -- 1 day -- Maximal size of a request/paste - requestMaxDataSize = 15728640, -- 15MB + requestMaxDataSize = 10485760, -- 10MB -- Pygments style name pygmentsStyle = "monokai", -- Extra CSS applied to syntax-highlighted blocks (with and without Pygments) @@ -25,6 +25,8 @@ return { timeout = 1, -- 1 second -- Debug mode debug = false, - -- Time interval to remove expired webserver cache entries (seconds) + -- Cached pages lifetime + cacheDuration = 3600, -- 1 hour + -- Time interval to remove expired cache entries (seconds) cacheCleanInterval = 3600 -- 1 hour } diff --git a/vrel.lua b/vrel.lua index 5087452..2e800f8 100644 --- a/vrel.lua +++ b/vrel.lua @@ -4,7 +4,7 @@ math.randomseed(os.time()) local hasConfigFile, config = pcall(dofile, "config.lua") if not hasConfigFile then config = {} end -- Basic HTTP server -- -local httpd, requestMaxDataSize = nil, config.requestMaxDataSize or 15728640 -- max post/paste data size (bytes) (15MB) +local httpd, requestMaxDataSize = nil, config.requestMaxDataSize or 10485760 -- max post/paste data size (bytes) (10MB) httpd = { log = function(str, ...) print("["..os.date().."] "..str:format(...)) end, -- log a message (str:format(...)) peername = function(client) return ("%s:%s"):format(client:getpeername()) end, -- returns a nice display name for the client (address:port) @@ -221,7 +221,7 @@ end httpd.start(config.address or "*", config.port or 8155, { -- Pages ["/([^/]*)"] = function(request, name) if forbiddenName[name] then return end - if #name == 0 then return { cache = 3600, "200 OK", {["Content-Type"] = "text/html"}, [[