aboutsummaryrefslogtreecommitdiff
path: root/cgi/settings.py
blob: dfe3d49e429c99420a0f82f033729c59a3500d33 (plain) (blame)
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
# 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