A Python content management system designed for kirsle.net featuring a blog, comments and photo albums. https://rophako.kirsle.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

139 lines
5.6 KiB

  1. # Sample config file for Rophako.
  2. #
  3. # Edit this file and save the copy as "config.py".
  4. import os
  5. _basedir = os.path.abspath(os.path.dirname(__file__))
  6. import datetime
  7. from rophako.plugin import load_plugin
  8. DEBUG = True
  9. # Unique name of your site, e.g. "kirsle.net"
  10. SITE_NAME = "example.com"
  11. # Path to your site's HTML root. Whenever Rophako tries to render a template,
  12. # it will check in your site's root for the template first before defaulting to
  13. # the default fallback pages in the rophako/www folder. All of the core
  14. # Rophako pages, e.g. for account, blog, photo albums and so on, have templates
  15. # in the default site. You can override those templates by creating files with
  16. # the same paths in your site's HTML folder.
  17. SITE_ROOT = os.path.join(_basedir, "site", "www")
  18. # E-mail addresses for site notifications (i.e. new comments).
  19. NOTIFY_ADDRESS = ["root@localhost"]
  20. # Set this to true if you want your app to force use of SSL. This will also turn
  21. # on Flask's secure-only session cookies.
  22. FORCE_SSL = False
  23. # Secret key used for session cookie signing. Make this long and hard to guess.
  24. #
  25. # Tips for creating a strong secret key:
  26. # $ python
  27. # >>> import os
  28. # >>> os.urandom(24)
  29. # '\xfd{H\xe5<\x95\xf9\xe3\x96.5\xd1\x01O<!\xd5\xa2\xa0\x9fR"\xa1\xa8'
  30. #
  31. # Then take that whole quoted string and paste it right in as the secret key!
  32. # Do NOT use that one. It was just an example! Make your own.
  33. SECRET_KEY = 'for the love of Arceus, change this key!'
  34. # Password strength: number of iterations for bcrypt to hash passwords.
  35. BCRYPT_ITERATIONS = 12
  36. # Where to save temp files for photo uploads, etc.
  37. TEMPDIR = "/tmp"
  38. # Rophako uses a flat file JSON database system, and the Redis caching server
  39. # sits between Ropahko and the filesystem.
  40. DB_ROOT = "db"
  41. REDIS_HOST = "localhost"
  42. REDIS_PORT = 6379
  43. REDIS_DB = 0
  44. REDIS_PREFIX = "rophako:"
  45. # Mail settings
  46. MAIL_METHOD = "smtp" # or "sendmail", not yet implemented
  47. MAIL_SERVER = "localhost"
  48. MAIL_PORT = 25
  49. MAIL_SENDER = "Rophako CMS <no-reply@rophako.kirsle.net>"
  50. # Emoticon theme used for blog posts and comments. Should exist at the URL
  51. # "/static/smileys" from your document root, and have a file named
  52. # "emoticons.json" inside. If you add a custom theme to your private site
  53. # folder, then also change EMOTICON_ROOT_PRIVATE to look there instead.
  54. EMOTICON_THEME = "tango"
  55. EMOTICON_ROOT_PRIVATE = os.path.join(_basedir, "rophako", "www", "static", "smileys")
  56. ################################################################################
  57. ## Blog Settings ##
  58. ################################################################################
  59. BLOG_ENTRIES_PER_PAGE = 5 # Number of entries to show per page
  60. BLOG_ENTRIES_PER_RSS = 5 # The same, but for the RSS feed
  61. BLOG_DEFAULT_CATEGORY = "Uncategorized"
  62. BLOG_DEFAULT_PRIVACY = "public"
  63. BLOG_TIME_FORMAT = "%A, %B %d %Y @ %I:%M:%S %p" # "Weekday, Month dd yyyy @ hh:mm:ss AM"
  64. BLOG_ALLOW_COMMENTS = True
  65. # RSS feed settings.
  66. RSS_TITLE = "Kirsle.net"
  67. RSS_LINK = "http://www.kirsle.net/"
  68. RSS_LANGUAGE = "en"
  69. RSS_DESCRIPTION = "The web blog of Kirsle"
  70. RSS_COPYRIGHT = "Copyright {}, Kirsle.net".format(str(datetime.datetime.now().strftime("%Y")))
  71. RSS_WEBMASTER = NOTIFY_ADDRESS[0]
  72. RSS_IMAGE_TITLE = RSS_TITLE
  73. RSS_IMAGE_URL = "http://www.kirsle.net/static/avatars/casey.png"
  74. RSS_IMAGE_WIDTH = 96
  75. RSS_IMAGE_HEIGHT = 96
  76. RSS_IMAGE_DESCRIPTION = "Kirsle's Avatar"
  77. ################################################################################
  78. ## Photo Settings ##
  79. ################################################################################
  80. # The path to where uploaded photos will be stored.
  81. # The PRIVATE path is from the perspective of the server file system.
  82. # The PUBLIC path is from the perspective of the web browser via HTTP.
  83. PHOTO_ROOT_PRIVATE = os.path.join(_basedir, "site", "www", "static", "photos")
  84. PHOTO_ROOT_PUBLIC = "/static/photos"
  85. PHOTO_DEFAULT_ALBUM = "My Photos" # Default/fallback album name.
  86. PHOTO_TIME_FORMAT = BLOG_TIME_FORMAT
  87. # Photo sizes.
  88. PHOTO_WIDTH_LARGE = 800 # Max width of full size photos.
  89. PHOTO_WIDTH_THUMB = 256 # Max square width of photo thumbnails.
  90. PHOTO_WIDTH_AVATAR = 96 # Square width of photo avatars.
  91. ################################################################################
  92. ## Comment Settings ##
  93. ################################################################################
  94. COMMENT_TIME_FORMAT = "%A, %B %d %Y @ %I:%M %p"
  95. # We use Gravatar for comments if the user provides an e-mail address. Specify
  96. # the URL to a fallback image to use in case they don't have a gravatar.
  97. COMMENT_DEFAULT_AVATAR = ""
  98. ################################################################################
  99. ## Enabled Plugins ##
  100. ################################################################################
  101. # Place all the load_plugin calls down here. Some of the plugins need to refer
  102. # to config params above so those need to get declared before the plugin begins
  103. # to initialize itself.
  104. #
  105. # Some plugins will automatically load others as dependencies, i.e. the blog
  106. # and photo will load comment, and comment will load emoticons. But it doesn't
  107. # hurt to list them all out here to be explicit anyway.
  108. load_plugin("rophako.modules.blog")
  109. load_plugin("rophako.modules.photo")
  110. load_plugin("rophako.modules.comment")
  111. load_plugin("rophako.modules.emoticons")
  112. load_plugin("rophako.modules.contact")
  113. load_plugin("rophako.modules.tracking")