-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample_settings.lua
42 lines (41 loc) · 1.34 KB
/
example_settings.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
-- Settings
url = "http://mydomain.mytld:8081/"
redis = "127.0.0.1:6379"
expiresecs = 604800
maxpastesize = 64 * 1024 -- 64KiB
theme = "blackbox"
mainpage = doctype()(
tag"head"(
tag"title" "CPaste Server"
),
tag"body"(
tag"h1" "CPaste",
"CPaste is a micro paste service using Carbon and Redis.", tag"br",
tag"a"[{href="http://github.com/vifino/cpaste"}]("Get it here."), tag"br",
tag"h1" "Example Usage:",
tag"blockquote"[{cite="http://github.com/vifino/cpaste"}](
tag"h2" "CLI:",
"$ cat myfile.txt | curl -F 'f=<-' "..url, tag"br",
url.."rpPxsp6d", tag"br",
"$ curl "..url.."raw/rpPxsp6d", tag"br",
"<Content of myfile.txt>", tag"br",
tag"br",
tag"h2" "Browser:",
"Open ", tag"a"[{href=url.."paste"}](url.."paste"), " for a web paste.", tag"br",
"It will present you a link to the paste, similar to the CLI way.", tag"br",
"The returned link will have syntax highlighting enabled. If you don't like that,", tag"br",
"just replace "..url.." with "..url.."raw/ and you'll get the raw text output,", tag"br",
"without syntax highlighting.", tag"br"
)
)
)
-- End
-- Things required to make this stuff actually work! \o/
local settings = {}
settings.url = url
settings.expiresecs = expiresecs
settings.mainpage = mainpage
settings.redis = redis
settings.maxpastesize = maxpastesize
settings.theme = theme
return settings