-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathturtl-setup
54 lines (50 loc) · 1.84 KB
/
turtl-setup
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
#!/bin/bash
# default values
PIDFILE=${PIDFILE:-nil}
BINDADDR=${BINDADDR:-0.0.0.0}
BINDPORT=${BINDPORT:-8181}
PROD_ERR_HANDLING=${PROD_ERR_HANDLING:-t}
FQDN=${FQDN:-turtl.local}
SITE_URL=${SITE_URL:-http://turtl.local}
ADMIN_EMAIL=${ADMIN_EMAIL:[email protected]}
EMAIL_FROM=${EMAIL_FROM:[email protected]}
SMTP_USER=${SMTP_USER:-}
SMTP_PASS=${SMTP_PASS:-}
DISPLAY_ERRORS=${DISPLAY_ERRORS:-t}
DEFAULT_STORAGE_LIMIT=${DEFAULT_STORAGE_LIMIT:-100}
STORAGE_INVITE_CREDIT=${STORAGE_INVITE_CREDIT:-25}
LOCAL_UPLOAD_URL=${LOCAL_UPLOAD_URL:-http://turtl.local}
LOCAL_UPLOAD_PATH=${LOCAL_UPLOAD_PATH:-"/opt/api/uploads"}
AWS_S3_TOKEN=${AWS_S3_TOKEN:-(:token ''
:secret ''
:bucket ''
:endpoint 'https://s3.amazonaws.com')}
# generates the config-file
cat << __ENDCONFIG__ > /opt/api/config/config.lisp
(in-package :turtl)
(defparameter *root* (asdf:system-relative-pathname :turtl #P""))
(defparameter *pid-file* "${PIDFILE}")
(defvar *server-bind* "${BINDADDR}")
(defvar *server-port* ${BINDPORT})
(defvar *db-name* "turtl")
(defvar *db-host* "127.0.0.1")
(defvar *db-port* 28015)
(defvar *production-error-handling* ${PROD_ERR_HANDLING})
(defvar *enable-hsts-header* nil)
(defvar *site-url* "${SITE_URL}")
(defvar *api-path* "")
(defvar *admin-email* "${ADMIN_EMAIL}")
(defvar *email-from* "${EMAIL_FROM}")
(defvar *email-user* "${SMTP_USER}")
(defvar *email-pass* "${SMTP_PASS}")
(defvar *display-errors* ${DISPLAY_ERRORS})
(defparameter *default-storage-limit* ${DEFAULT_STORAGE_LIMIT})
(defparameter *storage-invite-credit* ${STORAGE_INVITE_CREDIT})
(vom:config :turtl :info)
(defvar *local-upload* "${LOCAL_UPLOAD_PATH}")
(defvar *local-upload-url* "${LOCAL_UPLOAD_URL}")
(defvar *amazon-s3* "${AWS_S3_TOKEN}")
__ENDCONFIG__
cat /opt/api/config/config.footer >> /opt/api/config/config.lisp
# start the turtl server
/opt/turtl-start