aboutsummaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
Diffstat (limited to 'cgi')
-rw-r--r--cgi/settings.py124
1 files changed, 124 insertions, 0 deletions
diff --git a/cgi/settings.py b/cgi/settings.py
new file mode 100644
index 0000000..dfe3d49
--- /dev/null
+++ b/cgi/settings.py
@@ -0,0 +1,124 @@
+# coding=utf-8
+import threading
+
+class SettingsLocal(threading.local):
+ USING_SQLALCHEMY = False # If SQLAlchemy is installed, set to True to use it
+
+ # Ignore these
+ BOARD = None
+ CONN = None
+
+ IS_TOR = None
+ IS_PROXY = None
+ HOST = None
+
+class Settings(object):
+ LANG = "es"
+
+ # *************** PATH INFORMATION ***************
+ NAME = "localhost"
+ DOMAIN = ".localdomain"
+ ROOT_DIR = "/var/www/"
+ HOME_DIR = "/var/www/"
+ IMAGES_DIR = "/var/www/"
+ STATIC_DIR = "/var/www/static/"
+ HOME_URL = "http://localhost/"
+ BOARDS_URL = "/"
+ CGI_URL = "/cgi/" # URL to folder containing the script
+ IMAGES_URL = "/"
+ STATIC_URL = "/static/"
+ USE_MULTITHREADING = False
+ MAX_PROGRAM_THREADS = 8 # Maximum threads this Python application can start (must be 2 or greater)
+ # Setting this too high can cause the program to terminate before finishing
+ # (Only needed if multithreading is on)
+
+ CONVERT_PATH = "convert" # Location to ImageMagick's convert tool
+ FFMPEG_PATH = "ffmpeg"
+ FFPROBE_PATH = "ffprobe"
+ # CONVERT_PATH = "C:\\Utils\\ImageMagick-6.7.0-Q16\\convert"
+
+ # *************** DATABASE INFORMATION ***************
+ DATABASE_HOST = "localhost"
+ DATABASE_USERNAME = "user"
+ DATABASE_PASSWORD = "pass"
+ DATABASE_DB = "db"
+ # The following two entries apply only if USING_SQLALCHEMY is set to True
+ DATABASE_POOL_SIZE = 5 # Initial number of database connections
+ DATABASE_POOL_OVERFLOW = 21 # Maximum number of database connections
+
+ # Keys
+ SECRET = 'CHANGEME' # Random seed for secure tripcodes, change it to something random
+ GOOGLE_API_KEY = ''
+ DISCORD_HOOK_URL = ''
+
+ # *************** HOME PAGE INFORMATION ***************
+ SITE_TITLE = "My site"
+ SITE_LOGO = Env.STATIC_URL + "logo.png"
+ SITE_SLOGAN = "My slogan"
+ MAINTENANCE = False # Set to True if you are making changes to the server so users can't post
+ FULL_MAINTENANCE = False
+ ENABLE_RSS = False
+ ENABLE_DISCORD_HOOK = True
+
+ # *************** BANNER INFORMATION ***************
+ ENABLE_BANNERS = True
+ banners_folder = Env.STATIC_URL + "img/" # Folder containing banners
+ banners = { # filename, width, height
+ 'default': [("default.png", "500", "81")],
+ }
+
+ # *************** IMAGES ***************
+ THUMB_QUALITY = 85 # Image quality for thumbnails (0-100)
+
+ # *************** BANS ***************
+ HTACCESS_GEN = True # Set to True to use .htaccess for bans (needed for blind bans!)
+ EXCLUDE_GLOBAL_BANS = [] # Excludes the following boards from global bans (not board specific bans)
+
+ # 'Name': ('Tripcode', 'New BBS name', 'New IB name', 'New ID', Hide Slip[bool])
+ CAPCODES = {}
+
+ # *************** BOARDS ***************
+ MAX_THREADS = 500 # IB
+ TXT_MAX_THREADS = 10000 # BBS
+
+ TRIM_METHOD = 0 # Which threads are trimmed first:
+ TXT_TRIM_METHOD = 1 # 0 = oldest (Futaba), 1 = inactive (2ch), 2 = least bumped (4chan)
+
+ CLOSE_THREAD_ON_REPLIES = 1000
+ TXT_CLOSE_THREAD_ON_REPLIES = 1000
+
+ MAX_AGE_ALERT = 0.15 # Multiplier for thread expiration alert
+
+ ALLOW_SECURE_TRIPCODES = False
+ TRIP_CHAR = '◆'
+
+ HOME_NEWS = 10 # News posts shown on home
+ HOME_LASTPOSTS = 25 # Last posts shown on home
+ HOME_NEWTHREADS = 17 # New threads shown on home
+ HOME_LASTPOSTS_LENGTH = 100
+
+ MODNEWS_MAX_POSTS = 30 # Max posts in the Manage front page
+ REPORTS_ENABLE = True # Enable or disable report system
+ REPORTS_PER_PAGE = 100
+ RECYCLEBIN_POSTS_PER_PAGE = 25
+
+ DELETE_FORBID_LENGTH = 5 # User can't delete own thread if replies exceed this
+ ARCHIVE_MIN_LENGTH = 5 # Minimum thread length to archive (0 = archive always)
+
+ # *************** STYLES ***************
+ STYLES = ('Rene', 'Dickgirl', 'Red', 'Photon', 'Cyber', 'Easymodo', 'Guro', 'Night', 'Futaba', 'Buri', 'Kraut', 'VNDB', 'Putaba')
+ STYLES_DEFAULT = 0
+
+ TXT_STYLES = ('4am', 'Amber', 'Ayashii', 'Baisano', 'BIOS', 'Blue Moon', 'Ciber', 'Futanari', 'Headline', 'Postal', 'Ventanas')
+ TXT_STYLES_DEFAULT = 3
+
+ # *************** MISC ***************
+ TIME_ZONE = -3
+ USE_MARKDOWN = False
+ USE_HTML = False
+ VIDEO_THUMBS = False
+ VIDEO_THUMBS_LIMIT = 5
+
+ SESSION_TIME = 30 * 60
+
+ _ = SettingsLocal() # Used when running multiple threads