conf.sample.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. ;<?php http_response_code(403); /*
  2. ; config file for PrivateBin
  3. ;
  4. ; An explanation of each setting can be find online at https://github.com/PrivateBin/PrivateBin/wiki/Configuration.
  5. [main]
  6. ; (optional) set a project name to be displayed on the website
  7. ; name = "PrivateBin"
  8. ; The full URL, with the domain name and directories that point to the
  9. ; PrivateBin files, including an ending slash (/). This URL is essential to
  10. ; allow Opengraph images to be displayed on social networks.
  11. ; basepath = "https://privatebin.example.com/"
  12. ; enable or disable the discussion feature, defaults to true
  13. discussion = true
  14. ; preselect the discussion feature, defaults to false
  15. opendiscussion = false
  16. ; enable or disable the display of dates & times in the comments, defaults to true
  17. ; Note that internally the creation time will still get tracked in order to sort
  18. ; the comments by creation time, but you can choose not to display them.
  19. ; discussiondatedisplay = false
  20. ; enable or disable the password feature, defaults to true
  21. password = true
  22. ; enable or disable the file upload feature, defaults to false
  23. fileupload = false
  24. ; preselect the burn-after-reading feature, defaults to false
  25. burnafterreadingselected = false
  26. ; which display mode to preselect by default, defaults to "plaintext"
  27. ; make sure the value exists in [formatter_options]
  28. defaultformatter = "plaintext"
  29. ; (optional) set a syntax highlighting theme, as found in css/prettify/
  30. ; syntaxhighlightingtheme = "sons-of-obsidian"
  31. ; size limit per document or comment in bytes, defaults to 10 Megabytes
  32. sizelimit = 10000000
  33. ; by default PrivateBin use "bootstrap5" template (tpl/bootstrap5.php).
  34. ; Optionally you can enable the template selection menu, which uses
  35. ; a session cookie to store the choice until the browser is closed.
  36. templateselection = false
  37. ; List of available for selection templates when "templateselection" option is enabled
  38. availabletemplates[] = "bootstrap5"
  39. ; set the template your installs defaults to, defaults to "bootstrap5" (tpl/bootstrap5.php)
  40. ; previews at:
  41. ; https://privatebin.info/screenshots.html
  42. ; template = "bootstrap5"
  43. ; (optional) info text to display
  44. ; use single, instead of double quotes for HTML attributes
  45. ;info = "More information on the <a href='https://privatebin.info/'>project page</a>."
  46. ; (optional) notice to display
  47. ; notice = "Note: This is a test service: Data may be deleted anytime. Kittens will die if you abuse this service."
  48. ; by default PrivateBin will guess the visitors language based on the browsers
  49. ; settings. Optionally you can enable the language selection menu, which uses
  50. ; a session cookie to store the choice until the browser is closed.
  51. languageselection = false
  52. ; set the language your installs defaults to, defaults to English
  53. ; if this is set and language selection is disabled, this will be the only language
  54. ; languagedefault = "en"
  55. ; (optional) URL shortener address to offer after a new document is created.
  56. ; It is suggested to only use this with self-hosted shorteners as this will leak
  57. ; the documents encryption key.
  58. ; urlshortener = "https://shortener.example.com/api?link="
  59. ; (optional) Whether to shorten the URL by default when a new document is created.
  60. ; If set to true, the "Shorten URL" functionality will be automatically called.
  61. ; This only works if the "urlshortener" option is set.
  62. ; shortenbydefault = false
  63. ; (optional) Let users create a QR code for sharing the document URL with one click.
  64. ; It works both when a new document is created and when you view a document.
  65. ; qrcode = true
  66. ; (optional) Let users send an email sharing the document URL with one click.
  67. ; It works both when a new document is created and when you view a document.
  68. ; email = true
  69. ; (optional) IP based icons are a weak mechanism to detect if a comment was from
  70. ; a different user when the same username was used in a comment. It might get
  71. ; used to get the IP of a comment poster if the server salt is leaked and a
  72. ; SHA512 HMAC rainbow table is generated for all (relevant) IPs.
  73. ; Can be set to one these values:
  74. ; "none" / "identicon" / "jdenticon" (default) / "vizhash".
  75. ; icon = "none"
  76. ; Content Security Policy headers allow a website to restrict what sources are
  77. ; allowed to be accessed in its context. You need to change this if you added
  78. ; custom scripts from third-party domains to your templates, e.g. tracking
  79. ; scripts or run your site behind certain DDoS-protection services.
  80. ; Check the documentation at https://content-security-policy.com/
  81. ; Notes:
  82. ; - By default this disallows to load images from third-party servers, e.g. when
  83. ; they are embedded in documents. If you wish to allow that, you can adjust the
  84. ; policy here. See https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-not-it-load-embedded-images
  85. ; for details.
  86. ; - The 'wasm-unsafe-eval' is used to enable webassembly support (used for zlib
  87. ; compression). You can remove it if compression doesn't need to be supported.
  88. ; - The 'unsafe-inline' style-src is used by Chrome when displaying PDF previews
  89. ; and can be omitted if attachment upload is disabled (which is the default).
  90. ; See https://issues.chromium.org/issues/343754409
  91. ; - To allow displaying PDF previews in Firefox or Chrome, sandboxing must also
  92. ; get turned off. The following CSP allows PDF previews:
  93. ; cspheader = "default-src 'none'; base-uri 'self'; form-action 'none'; manifest-src 'self'; connect-src * blob:; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; font-src 'self'; frame-ancestors 'none'; frame-src blob:; img-src 'self' data: blob:; media-src blob:; object-src blob:"
  94. ;
  95. ; The recommended and default used CSP is:
  96. ; cspheader = "default-src 'none'; base-uri 'self'; form-action 'none'; manifest-src 'self'; connect-src * blob:; script-src 'self' 'wasm-unsafe-eval'; style-src 'self'; font-src 'self'; frame-ancestors 'none'; frame-src blob:; img-src 'self' data: blob:; media-src blob:; object-src blob:; sandbox allow-same-origin allow-scripts allow-forms allow-modals allow-downloads"
  97. ; Enable or disable the warning message when the site is served over an insecure
  98. ; connection (insecure HTTP instead of HTTPS), defaults to true.
  99. ; Secure transport methods like Tor and I2P domains are automatically whitelisted.
  100. ; It is **strongly discouraged** to disable this.
  101. ; See https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-it-show-me-an-error-about-an-insecure-connection for more information.
  102. ; httpwarning = true
  103. ; Pick compression algorithm or disable it. Only applies to documents & comments
  104. ; created after changing the setting.
  105. ; Can be set to one these values: "none" / "zlib" (default).
  106. ; compression = "zlib"
  107. [expire]
  108. ; expire value that is selected per default
  109. ; make sure the value exists in [expire_options]
  110. default = "1week"
  111. [expire_options]
  112. ; Set each one of these to the number of seconds in the expiration period,
  113. ; or 0 if it should never expire
  114. 5min = 300
  115. 10min = 600
  116. 1hour = 3600
  117. 1day = 86400
  118. 1week = 604800
  119. ; Well this is not *exactly* one month, it's 30 days:
  120. 1month = 2592000
  121. 1year = 31536000
  122. never = 0
  123. [formatter_options]
  124. ; Set available formatters, their order and their labels
  125. plaintext = "Plain Text"
  126. syntaxhighlighting = "Source Code"
  127. markdown = "Markdown"
  128. [traffic]
  129. ; time limit between calls from the same IP address in seconds
  130. ; Set this to 0 to disable rate limiting.
  131. limit = 10
  132. ; (optional) Set IPs addresses (v4 or v6) or subnets (CIDR) which are exempted
  133. ; from the rate-limit. Invalid IPs will be ignored. If multiple values are to
  134. ; be exempted, the list needs to be comma separated. Leave unset to disable
  135. ; exemptions.
  136. ; exempted = "1.2.3.4,10.10.10/24"
  137. ; (optional) If you want only some source IP addresses (v4 or v6) or subnets
  138. ; (CIDR) to be allowed to create documents, set these here. Invalid IPs will be
  139. ; ignored. If multiple values are to be exempted, the list needs to be comma
  140. ; separated. Leave unset to allow anyone to create documents.
  141. ; creators = "1.2.3.4,10.10.10/24"
  142. ; (optional) if your website runs behind a reverse proxy or load balancer,
  143. ; set the HTTP header containing the visitors IP address, i.e. X_FORWARDED_FOR
  144. ; header = "X_FORWARDED_FOR"
  145. [purge]
  146. ; minimum time limit between two purgings of expired documents, it is only
  147. ; checked when documents get created
  148. ; Set this to 0 to run a purge every time a document is created.
  149. limit = 300
  150. ; maximum amount of expired documents to delete in one purge
  151. ; Set this to 0 to disable purging. Set it higher, if you are running a large
  152. ; site
  153. batchsize = 10
  154. [model]
  155. ; name of data model class to load and directory for storage
  156. ; the default model "Filesystem" stores everything in the filesystem
  157. class = Filesystem
  158. [model_options]
  159. dir = PATH "data"
  160. ;[model]
  161. ; example of a Google Cloud Storage configuration
  162. ;class = GoogleCloudStorage
  163. ;[model_options]
  164. ;bucket = "my-private-bin"
  165. ;prefix = "pastes"
  166. ;uniformacl = false
  167. ;[model]
  168. ; example of DB configuration for MySQL
  169. ;class = Database
  170. ;[model_options]
  171. ;dsn = "mysql:host=localhost;dbname=privatebin;charset=UTF8"
  172. ;tbl = "privatebin_" ; table prefix
  173. ;usr = "privatebin"
  174. ;pwd = "Z3r0P4ss"
  175. ;opt[12] = true ; PDO::ATTR_PERSISTENT
  176. ;[model]
  177. ; example of DB configuration for SQLite
  178. ;class = Database
  179. ;[model_options]
  180. ;dsn = "sqlite:" PATH "data/db.sq3"
  181. ;usr = null
  182. ;pwd = null
  183. ;opt[12] = true ; PDO::ATTR_PERSISTENT
  184. ;[model]
  185. ; example of DB configuration for PostgreSQL
  186. ;class = Database
  187. ;[model_options]
  188. ;dsn = "pgsql:host=localhost;dbname=privatebin"
  189. ;tbl = "privatebin_" ; table prefix
  190. ;usr = "privatebin"
  191. ;pwd = "Z3r0P4ss"
  192. ;opt[12] = true ; PDO::ATTR_PERSISTENT
  193. ;[model]
  194. ; example of S3 configuration for Rados gateway / CEPH
  195. ;class = S3Storage
  196. ;[model_options]
  197. ;region = ""
  198. ;version = "2006-03-01"
  199. ;endpoint = "https://s3.my-ceph.invalid"
  200. ;use_path_style_endpoint = true
  201. ;bucket = "my-bucket"
  202. ;accesskey = "my-rados-user"
  203. ;secretkey = "my-rados-pass"
  204. ;[model]
  205. ; example of S3 configuration for AWS
  206. ;class = S3Storage
  207. ;[model_options]
  208. ;region = "eu-central-1"
  209. ;version = "latest"
  210. ;bucket = "my-bucket"
  211. ;accesskey = "access key id"
  212. ;secretkey = "secret access key"
  213. ;[model]
  214. ; example of S3 configuration for AWS using its SDK default credential provider chain
  215. ; if relying on environment variables, the AWS SDK will look for the following:
  216. ; - AWS_ACCESS_KEY_ID
  217. ; - AWS_SECRET_ACCESS_KEY
  218. ; - AWS_SESSION_TOKEN (if needed)
  219. ; for more details, see https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html#default-credential-chain
  220. ;class = S3Storage
  221. ;[model_options]
  222. ;region = "eu-central-1"
  223. ;version = "latest"
  224. ;bucket = "my-bucket"
  225. ;[shlink]
  226. ; - Shlink requires you to make a post call with a generated API key.
  227. ; use this section to setup the API key and URL. In order to use this section,
  228. ; "urlshortener" needs to point to the base URL of your PrivateBin
  229. ; instance with "?shortenviashlink&link=" appended. For example:
  230. ; urlshortener = "${basepath}?shortenviashlink&link="
  231. ; This URL will in turn call Shlink on the server side, using the URL from
  232. ; "apiurl" and the API Key from the "apikey" parameters below.
  233. ; apiurl = "https://shlink.example.com/rest/v3/short-urls"
  234. ; apikey = "your_api_key"
  235. ;[yourls]
  236. ; When using YOURLS as a "urlshortener" config item:
  237. ; - By default, "urlshortener" will point to the YOURLS API URL, with or without
  238. ; credentials, and will be visible in public on the PrivateBin web page.
  239. ; Only use this if you allow short URL creation without credentials.
  240. ; - Alternatively, using the parameters in this section ("signature" and
  241. ; "apiurl"), "urlshortener" needs to point to the base URL of your PrivateBin
  242. ; instance with "?shortenviayourls&link=" appended. For example:
  243. ; urlshortener = "${basepath}?shortenviayourls&link="
  244. ; This URL will in turn call YOURLS on the server side, using the URL from
  245. ; "apiurl" and the "access signature" from the "signature" parameters below.
  246. ; (optional) the "signature" (access key) issued by YOURLS for the using account
  247. ; signature = ""
  248. ; (optional) the URL of the YOURLS API, called to shorten a PrivateBin URL
  249. ; apiurl = "https://yourls.example.com/yourls-api.php"
  250. ;[sri]
  251. ; Subresource integrity (SRI) hashes used in template files. Uncomment and set
  252. ; these for all js files used. See:
  253. ; https://github.com/PrivateBin/PrivateBin/wiki/FAQ#user-content-how-to-make-privatebin-work-when-i-have-changed-some-javascript-files
  254. ;js/privatebin.js = "sha512-[…]"