-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.coffee
62 lines (60 loc) · 2.13 KB
/
config.coffee
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
fs = require 'fs'
pkg = require './package.json'
phonetic = require 'phonetic'
module.exports = {
# backend-only vars
pkg
listenOn: [
protocol: 'http'
module: 'http'
hostname: '0.0.0.0'
port: 3000
options: undefined # options for module.createServer
headers: # extra headers
'Cache-Control': 'no-cache, no-store, must-revalidate'
'Pragma': 'no-cache'
'Expires': '0'
'Server': "#{pkg.name}/#{pkg.version}"
],
subpath: '/' # host tastebin under a subpath
tastesDir: 'tastes' # where are tastes stored
git: {
enable: true # enable git versioning for tastes
remoteUrl: do () -> # enable pushing automatically to a remote
if fs.existsSync '.git'
"#{__dirname}/.git"
else
undefined
upstream: 'tastes' # which upstream branch to push to?
}
maxListCount: 100 # list only the most recent 100 tastes
maxSize: '128kb' # allow only tastes smaller than 128 kilobytes
maxFilenameLength: 256 # allow tastes to have maximum 256 characters
maxLifetimeCount: 500 # keep no more than the most recent 500 tastes
maxLifetimeDays: 12 * 30 # keep tastes created withing the last 360 days
maxLifetimeIgnoreFiles: [
'.gitignore'
]
generate: () -> # function to generate random names
phonetic.generate {syllables: 10, capFirst: false}
morgan: # logging https://github.com/expressjs/morgan
format: 'common'
# backend & frontend vars
title: "#{pkg.name}/#{pkg.version}"
newTaste: [ # content for the "new taste" page
'A. \#{metaKeyName}+E to Edit'
'B. \#{metaKeyName}+S to Save'
' \#{metaKeyName}+Shift+S to Save As'
' Save As with a leading dot to hide'
'C. Esc to cancel editing'
].join '\n'
stylesheets: '' # extra stylesheets
scripts: '' # extra scripts
theme: 'index' # default theme
themes: [ # available themes
'index'
'distraction-free'
]
hljsStyle: 'solarized_dark' # default style
hljsStyles: undefined # restrict available styles
}