-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.py.example
83 lines (72 loc) · 2.44 KB
/
config.py.example
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#new paste defaults
defaults = {
'ttl': 1,
'lexer': 'auto',
'burn': -1,
'paste': '',
'raw': 'true'
}
#paste options
paste_limits = {
'ttl_max': 731, #maximum allowed paste ttl in hours, extra decimals
'ttl_min': 0, #minimum allowed paste ttl in hours
'burn_max': 1000, #maximum allowed reads before burning paste [default: 1000]
'burn_min': 1, #minimum allowed reads before burning paste [default: 1]
}
token_len = 6 #delete token length in bytes/characters
#flask configuration
secret_key = 'CHANGEME' #CHANGE THIS IN PRODUCTION - set it to some random string
max_content_length = 2 * 1024 * 1024 #max form upload size in bits
domain = 'http://127.0.0.1:5000' #set correctly, used for raw POST response
#max_age values
paste_max_age = 30 #keep this small. This could mean the max amount of time after a paste should no longer be available where it can still be returned. eg: paste deletes
nonpaste_max_age = 360 #pick a moderately small value if you have nginx caching in front of this, easier to invalidate cache for non paste pages that way
#postgresql configuration
dsn = "host=localhost port=5432 dbname='pastebin' user='pastebin' password='1234'"
#psycopg connection pool limits
connpool_min = 4
connpool_max = 4
#paste url
url_len = 8 #minimum paste url length in characters
url_alph = tuple("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghkmnpqrstuvwxyz") #alphabet used to generate paste url
#return messages
msg_empty_paste = "pls, actually paste something k?\n"
msg_invalid_ttl = "ttl must be between " + str(paste_limits['ttl_min']) + " and " + str(paste_limits['ttl_max']) +" hours.\n"
msg_invalid_burn = "burn count must be between " + str(paste_limits['burn_min']) + " and " + str(paste_limits['burn_max']) + ".\n"
msg_err_404 = "404 - Not Found.\n"
msg_err_401 = "401 - Unauthorized - check your delete token.\n"
msg_paste_deleted = "paste deleted successfully.\n"
#form options
ttl_options = [
('5 minutes', 0.0833),
('15 minutes', 0.25),
('30 minutes', 0.5),
('1 hour', 1),
('3 hours', 3),
('6 hours', 6),
('12 hours', 12),
('1 day', 24),
('3 days', 72),
('1 week', 168),
('2 weeks', 336),
('1 month', 730),
]
lexers_common = [
('Text Only', 'text'),
('Bash', 'bash'),
('C', 'c'),
('C++', 'cpp'),
('C#', 'csharp'),
('CSS', 'css'),
('Go', 'go'),
('HTML', 'html'),
('Java', 'java'),
('JavaScript', 'javascript'),
('JSON', 'json'),
('Perl', 'perl'),
('PHP', 'php'),
('Python', 'python'),
('Ruby', 'ruby'),
('SQL', 'sql'),
('XML', 'xml'),
]