forked from cc-d/ieddit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
71 lines (50 loc) · 1.8 KB
/
config.py
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
DEBUG = True
DATABASE = 'ieddit'
PG_USER = 'postgres'
PG_PASSWORD = 'test'
PG_HOST = 'localhost'
DB_TYPE = 'sqlite'
USE_RECREATE = False
if DB_TYPE == 'sqlite':
DATABASE_URI = 'sqlite:///{0}.db'.format(PG_USER)
SQLALCHEMY_DATABASE_URI = 'sqlite:///{0}.db'.format(PG_USER)
elif DB_TYPE == 'postgres':
DATABASE_URI = 'postgres://{0}:{1}@{2}:5432/{3}'.format(PG_USER, PG_PASSWORD, PG_HOST, DATABASE)
SQLALCHEMY_DATABASE_URI = 'postgres://{0}:{1}@{2}:5432/{3}'.format(PG_USER, PG_PASSWORD, PG_HOST, DATABASE)
# This will be unique every time create_db.py is ran when testing
# to force clear sessions
SECRET_KEY = 'not-a-real-key-|r|Q09P8YG1P2|r|'
# Chhange this to your local URL. IE http://127.0.0.1
URL = 'http://dev.ieddit.com'
SQLALCHEMY_TRACK_MODIFICATIONS = False
# contet-security
CSP = False
SESSION_COOKIE_SAMESITE='Lax'
CACHE_TYPE = 'simple'
DEFAULT_CACHE_TIME = 600
RATE_LIMIT = False
RATE_LIMIT_TIME = 5
LIMITER_DEFAULTS = ['600 per minute']
CAPTCHA_ENABLE = False
# documentation of lib here is incorrect...
#CAPTCHA_NUMERIC_DIGITS = 2
CAPTCHA_LENGTH = 3
# Show captcha on comments
CAPTCHA_COMMENTS = False
SESSION_TYPE = 'filesystem'
USE_PROXIES = False
MAIL_TYPE = 'mailgun'
MAIL_FROM = 'no-reply@ieddit.com'
if MAIL_TYPE == 'mailgun':
MG_API_KEY = 'notarealkey'
MG_URL = 'https://api.mailgun.net/v3/ieddit.com'
if USE_PROXIES:
with open('proxies.txt', 'r') as p:
proxy = p.read().strip()
PROXIES = {'http':'http://' + proxy, 'https':'https://' + proxy}
else:
PROXIES = None
PHEADERS = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36'}
# Sentry settings. your_dsn should be something like https://hashstring@sentry.io/appno. You can get one by registering at sentry.io
SENTRY_ENABLED = False
SENTRY_DSN = 'your_dsn'