1 | 'use strict';
|
2 |
|
3 | const path = require('path');
|
4 | const cfenv = require('cfenv');
|
5 |
|
6 | const roles = require('./all/roles');
|
7 | const env = cfenv.getAppEnv();
|
8 | env.host = env.url.replace(`:${env.port}`, '');
|
9 |
|
10 |
|
11 | module.exports = {
|
12 | applications: {
|
13 | base: 'applications',
|
14 | actions: {
|
15 | add: 'add',
|
16 | delete: 'delete',
|
17 | edit: 'edit',
|
18 | save: 'save',
|
19 | secret: 'secret',
|
20 | update: 'update',
|
21 | },
|
22 | messages: {
|
23 | missing: {
|
24 | id: 'An application with the id \'%id\' was not found',
|
25 | },
|
26 | },
|
27 | },
|
28 | content: {
|
29 | base: 'content',
|
30 | home: {
|
31 | title: 'All Content Types',
|
32 | },
|
33 | actions: {
|
34 | add: 'add',
|
35 | approve: 'approve',
|
36 | edit: 'edit',
|
37 | revisions: 'revisions',
|
38 | save: 'save',
|
39 | new: 'Save Revision',
|
40 | },
|
41 | plugins: {
|
42 | directory: [path.join(__dirname, '../input-plugins')],
|
43 | },
|
44 | directory: path.join(__dirname, '../content-types'),
|
45 | messages: {
|
46 | content: {
|
47 | title: 'Revisions for \'%id\'',
|
48 | },
|
49 | format: {
|
50 | id: 'Content ID must be in UUID format',
|
51 | revision: 'Revision must be a number',
|
52 | },
|
53 | missing: {
|
54 | type: 'Content Type \'%type\' not found',
|
55 | id: 'Content with ID \'%id\' in Content Type \'%type\' not found',
|
56 | revision: 'Revision \'%revision\' for ID \'%id\' in Content Type \'%type\' not found',
|
57 | },
|
58 | revisions: {
|
59 | title: 'Revision \'%revision\' for \'%id\'',
|
60 | },
|
61 | },
|
62 | },
|
63 | knex: {
|
64 | dialect: 'pg',
|
65 | connection: {
|
66 | host: 'localhost',
|
67 | user: 'punchcard',
|
68 | database: 'punchcard',
|
69 | },
|
70 | debug: false,
|
71 | acquireConnectionTimeout: 2000,
|
72 | },
|
73 | site: {
|
74 | name: 'Punchcard CMS',
|
75 | nav: [
|
76 | {
|
77 | path: '.',
|
78 | label: 'Home',
|
79 | },
|
80 | {
|
81 | path: 'content',
|
82 | label: 'Content',
|
83 | },
|
84 | {
|
85 | path: 'users',
|
86 | label: 'Users',
|
87 | },
|
88 | ],
|
89 | },
|
90 | authentication: {
|
91 | messages: {
|
92 | login: {
|
93 | error: 'Email and/or password incorrect',
|
94 | },
|
95 | },
|
96 | login: {
|
97 | path: '/login',
|
98 | title: 'Login',
|
99 | },
|
100 | logout: {
|
101 | path: '/logout',
|
102 | title: 'Logout',
|
103 | },
|
104 | },
|
105 | env,
|
106 | cookies: {
|
107 | secure: false,
|
108 | secret: process.env.COOKIE_SECRET || 'babka',
|
109 | },
|
110 | roles: {
|
111 | messages: {
|
112 | config: {
|
113 | type: 'Configuration must be an array',
|
114 | },
|
115 | },
|
116 | config: roles,
|
117 | },
|
118 | users: {
|
119 | base: 'users',
|
120 | actions: {
|
121 | add: 'add',
|
122 | edit: 'edit',
|
123 | delete: 'delete',
|
124 | save: 'save',
|
125 | update: 'update',
|
126 | },
|
127 | setup: {
|
128 | title: 'Create an admin account for your new CMS',
|
129 | button: 'Create Admin Account',
|
130 | },
|
131 | messages: {
|
132 | missing: {
|
133 | id: 'A user with the id \'%id\' was not found',
|
134 | },
|
135 | errors: {
|
136 | edit: 'User does not exist',
|
137 | delete: 'User does not exist',
|
138 | current: 'Cannot delete logged-in user',
|
139 | },
|
140 | format: {
|
141 | id: 'User ID must be a number.',
|
142 | },
|
143 | },
|
144 | },
|
145 | workflows: {
|
146 | messages: {
|
147 | approved: 'This content has already completed the approval process',
|
148 | missing: 'Workflow \'%workflow\' for Content Type \'%type\' not found',
|
149 | },
|
150 | },
|
151 | storage: {
|
152 | type: 'fs',
|
153 | dest: 'public/files',
|
154 | settings: {},
|
155 | public: '/files',
|
156 | temp: {
|
157 | dest: 'public/tmp/',
|
158 | public: '/tmp',
|
159 | },
|
160 | },
|
161 | };
|