-
-
Notifications
You must be signed in to change notification settings - Fork 56
/
constants.py
executable file
Β·169 lines (112 loc) Β· 4.31 KB
/
constants.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
"""
This module contains all the general application settings.
"""
# Import necessary modules from the modules module
from modules import secrets, socket
# Name of the Flask application
APP_NAME = "flaskBlog" # (str)
# Version of the Flask application
APP_VERSION = "2.4.0" # (str)
# Path to the root of the application files
APP_ROOT_PATH = "." # (str)
# Hostname or IP address for the Flask application
APP_HOST = socket.gethostbyname(socket.gethostname()) # (str)
# Port number for the Flask application
APP_PORT = 5000 # (int)
# Toggle debug mode for the Flask application
DEBUG_MODE = True # (bool)
# Name of the UI framework being used
UI_NAME = "tailwindUI" # (str)
# Path to the templates folder
TEMPLATE_FOLDER = f"templates/{UI_NAME}" # (str)
# Path to the static folder
STATIC_FOLDER = f"static/{UI_NAME}" # (str)
# Toggle user login feature
LOG_IN = True # (bool)
# Toggle user registration feature
REGISTRATION = True # (bool)
# Supported languages for the application
LANGUAGES = ["en", "tr", "es", "de", "zh", "fr", "uk", "ru", "pt", "ja", "pl"] # (list)
### LOGGER SETTINGS ###
# Toggle custom logging feature
CUSTOM_LOGGER = True # (bool)
# Toggle werkzeug logging feature
WERKZEUG_LOGGER = False # (bool)
# Root path of the log folder
LOG_FOLDER_ROOT = "log/" # (str)
# Root path of the log file
LOG_FILE_ROOT = LOG_FOLDER_ROOT + "log.log" # (str)
# Root path of the danger log file
LOG_DANGER_FILE_ROOT = LOG_FOLDER_ROOT + "logDanger.log" # (str)
# Root path of the success log file
LOG_SUCCESS_FILE_ROOT = LOG_FOLDER_ROOT + "logSuccess.log" # (str)
# Root path of the warning log file
LOG_WARNING_FILE_ROOT = LOG_FOLDER_ROOT + "logWarning.log" # (str)
# Root path of the info log file
LOG_INFO_FILE_ROOT = LOG_FOLDER_ROOT + "logInfo.log" # (str)
# Root path of the app log file
LOG_APP_FILE_ROOT = LOG_FOLDER_ROOT + "logApp.log" # (str)
# Root path of the sql log file
LOG_SQL_FILE_ROOT = LOG_FOLDER_ROOT + "logSQL.log" # (str)
# Secret key for Flask sessions
APP_SECRET_KEY = secrets.token_urlsafe(32) # (str)
# Toggle permanent sessions for the Flask application
SESSION_PERMANENT = True # (bool)
# Separator text used in log files
BREAKER_TEXT = "\n" # (str)
### DATABASE SETTINGS ###
# Root path of the database folder
DB_FOLDER_ROOT = "db/" # (str)
# Root path of the users database
DB_USERS_ROOT = DB_FOLDER_ROOT + "users.db" # (str)
# Root path of the posts database
DB_POSTS_ROOT = DB_FOLDER_ROOT + "posts.db" # (str)
# Root path of the comments database
DB_COMMENTS_ROOT = DB_FOLDER_ROOT + "comments.db" # (str)
### SMTP MAIL SETTINGS ###
# SMTP server address
SMTP_SERVER = "smtp.gmail.com" # (str)
# SMTP server port
SMTP_PORT = 587 # (int)
# SMTP mail address
SMTP_MAIL = "[email protected]" # (str)
# SMTP mail password
SMTP_PASSWORD = "lsooxsmnsfnhnixy" # (str)
### DEFAULT ADMIN ACCOUNT SETTINGS ###
# Toggle creation of default admin account
DEFAULT_ADMIN = True # (bool)
# Default admin username
DEFAULT_ADMIN_USERNAME = "admin" # (str)
# Default admin email address
DEFAULT_ADMIN_EMAIL = "[email protected]" # (str)
# Default admin password
DEFAULT_ADMIN_PASSWORD = "admin" # (str)
# Default starting point score for admin
DEFAULT_ADMIN_POINT = 0 # (int)
# Default admin profile picture URL
DEFAULT_ADMIN_PROFILE_PICTURE = f"https://api.dicebear.com/7.x/identicon/svg?seed={DEFAULT_ADMIN_USERNAME}&radius=10" # (str)
### RECAPTCHA SETTINGS ###
# Toggle reCAPTCHA verification
RECAPTCHA = False # (bool)
# Toggle display of reCAPTCHA badge
RECAPTCHA_BADGE = False # (bool)
# reCAPTCHA site key
RECAPTCHA_SITE_KEY = "" # (str)
# reCAPTCHA secret key
RECAPTCHA_SECRET_KEY = "" # (str)
# reCAPTCHA verify URL
RECAPTCHA_VERIFY_URL = "https://www.google.com/recaptcha/api/siteverify" # (str)
# Toggle reCAPTCHA verification for different actions
RECAPTCHA_LOGIN = True # (bool)
RECAPTCHA_SIGN_UP = True # (bool)
RECAPTCHA_POST_CREATE = True # (bool)
RECAPTCHA_POST_EDIT = True # (bool)
RECAPTCHA_POST_DELETE = True # (bool)
RECAPTCHA_COMMENT = True # (bool)
RECAPTCHA_COMMENT_DELETE = True # (bool)
RECAPTCHA_PASSWORD_RESET = True # (bool)
RECAPTCHA_PASSWORD_CHANGE = True # (bool)
RECAPTCHA_USERNAME_CHANGE = True # (bool)
RECAPTCHA_VERIFY_USER = True # (bool)
RECAPTCHA_DELETE_USER = True # (bool)
RECAPTCHA_PROFILE_PICTURE_CHANGE = True # (bool)