diff options
author | 2021-08-13 00:45:01 +0530 | |
---|---|---|
committer | 2021-08-13 00:45:01 +0530 | |
commit | 2d27d5e66649d4f5baf127a53ee5ae524eae3a59 (patch) | |
tree | c592ea219ac8cd987fc367f57b54034c450ab2ab /src/internal-server/config/app.js | |
parent | Ferdi v5.6.0 (diff) | |
parent | 5.6.1-nightly.24 [skip ci] (diff) | |
download | ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.tar.gz ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.tar.zst ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.zip |
chore: merge from nightly branch into release branch in prep for next beta
Diffstat (limited to 'src/internal-server/config/app.js')
-rw-r--r-- | src/internal-server/config/app.js | 240 |
1 files changed, 240 insertions, 0 deletions
diff --git a/src/internal-server/config/app.js b/src/internal-server/config/app.js new file mode 100644 index 000000000..0a1644932 --- /dev/null +++ b/src/internal-server/config/app.js | |||
@@ -0,0 +1,240 @@ | |||
1 | /** @type {import('@adonisjs/framework/src/Env')} */ | ||
2 | const Env = use('Env'); | ||
3 | |||
4 | module.exports = { | ||
5 | |||
6 | /* | ||
7 | |-------------------------------------------------------------------------- | ||
8 | | Application Name | ||
9 | |-------------------------------------------------------------------------- | ||
10 | | | ||
11 | | This value is the name of your application and can used when you | ||
12 | | need to place the application's name in a email, view or | ||
13 | | other location. | ||
14 | | | ||
15 | */ | ||
16 | |||
17 | name: Env.get('APP_NAME', 'Ferdi Internal Server'), | ||
18 | |||
19 | /* | ||
20 | |-------------------------------------------------------------------------- | ||
21 | | App Key | ||
22 | |-------------------------------------------------------------------------- | ||
23 | | | ||
24 | | App key is a randomly generated 16 or 32 characters long string required | ||
25 | | to encrypt cookies, sessions and other sensitive data. | ||
26 | | | ||
27 | */ | ||
28 | appKey: Env.getOrFail('APP_KEY'), | ||
29 | |||
30 | http: { | ||
31 | /* | ||
32 | |-------------------------------------------------------------------------- | ||
33 | | Allow Method Spoofing | ||
34 | |-------------------------------------------------------------------------- | ||
35 | | | ||
36 | | Method spoofing allows to make requests by spoofing the http verb. | ||
37 | | Which means you can make a GET request but instruct the server to | ||
38 | | treat as a POST or PUT request. If you want this feature, set the | ||
39 | | below value to true. | ||
40 | | | ||
41 | */ | ||
42 | allowMethodSpoofing: true, | ||
43 | |||
44 | /* | ||
45 | |-------------------------------------------------------------------------- | ||
46 | | Trust Proxy | ||
47 | |-------------------------------------------------------------------------- | ||
48 | | | ||
49 | | Trust proxy defines whether X-Forwarded-* headers should be trusted or not. | ||
50 | | When your application is behind a proxy server like nginx, these values | ||
51 | | are set automatically and should be trusted. Apart from setting it | ||
52 | | to true or false Adonis supports handful or ways to allow proxy | ||
53 | | values. Read documentation for that. | ||
54 | | | ||
55 | */ | ||
56 | trustProxy: false, | ||
57 | |||
58 | /* | ||
59 | |-------------------------------------------------------------------------- | ||
60 | | Subdomains | ||
61 | |-------------------------------------------------------------------------- | ||
62 | | | ||
63 | | Offset to be used for returning subdomains for a given request.For | ||
64 | | majority of applications it will be 2, until you have nested | ||
65 | | sudomains. | ||
66 | | cheatsheet.adonisjs.com - offset - 2 | ||
67 | | virk.cheatsheet.adonisjs.com - offset - 3 | ||
68 | | | ||
69 | */ | ||
70 | subdomainOffset: 2, | ||
71 | |||
72 | /* | ||
73 | |-------------------------------------------------------------------------- | ||
74 | | JSONP Callback | ||
75 | |-------------------------------------------------------------------------- | ||
76 | | | ||
77 | | Default jsonp callback to be used when callback query string is missing | ||
78 | | in request url. | ||
79 | | | ||
80 | */ | ||
81 | jsonpCallback: 'callback', | ||
82 | |||
83 | /* | ||
84 | |-------------------------------------------------------------------------- | ||
85 | | Etag | ||
86 | |-------------------------------------------------------------------------- | ||
87 | | | ||
88 | | Set etag on all HTTP response. In order to disable for selected routes, | ||
89 | | you can call the `response.send` with an options object as follows. | ||
90 | | | ||
91 | | response.send('Hello', { ignoreEtag: true }) | ||
92 | | | ||
93 | */ | ||
94 | etag: false, | ||
95 | }, | ||
96 | |||
97 | views: { | ||
98 | /* | ||
99 | |-------------------------------------------------------------------------- | ||
100 | | Cache Views | ||
101 | |-------------------------------------------------------------------------- | ||
102 | | | ||
103 | | Define whether or not to cache the compiled view. Set it to true in | ||
104 | | production to optimize view loading time. | ||
105 | | | ||
106 | */ | ||
107 | cache: Env.get('CACHE_VIEWS', true), | ||
108 | }, | ||
109 | |||
110 | static: { | ||
111 | /* | ||
112 | |-------------------------------------------------------------------------- | ||
113 | | Dot Files | ||
114 | |-------------------------------------------------------------------------- | ||
115 | | | ||
116 | | Define how to treat dot files when trying to server static resources. | ||
117 | | By default it is set to ignore, which will pretend that dotfiles | ||
118 | | does not exists. | ||
119 | | | ||
120 | | Can be one of the following | ||
121 | | ignore, deny, allow | ||
122 | | | ||
123 | */ | ||
124 | dotfiles: 'ignore', | ||
125 | |||
126 | /* | ||
127 | |-------------------------------------------------------------------------- | ||
128 | | ETag | ||
129 | |-------------------------------------------------------------------------- | ||
130 | | | ||
131 | | Enable or disable etag generation | ||
132 | | | ||
133 | */ | ||
134 | etag: true, | ||
135 | |||
136 | /* | ||
137 | |-------------------------------------------------------------------------- | ||
138 | | Extensions | ||
139 | |-------------------------------------------------------------------------- | ||
140 | | | ||
141 | | Set file extension fallbacks. When set, if a file is not found, the given | ||
142 | | extensions will be added to the file name and search for. The first | ||
143 | | that exists will be served. Example: ['html', 'htm']. | ||
144 | | | ||
145 | */ | ||
146 | extensions: false, | ||
147 | }, | ||
148 | |||
149 | locales: { | ||
150 | /* | ||
151 | |-------------------------------------------------------------------------- | ||
152 | | Loader | ||
153 | |-------------------------------------------------------------------------- | ||
154 | | | ||
155 | | The loader to be used for fetching and updating locales. Below is the | ||
156 | | list of available options. | ||
157 | | | ||
158 | | file, database | ||
159 | | | ||
160 | */ | ||
161 | loader: 'file', | ||
162 | |||
163 | /* | ||
164 | |-------------------------------------------------------------------------- | ||
165 | | Default Locale | ||
166 | |-------------------------------------------------------------------------- | ||
167 | | | ||
168 | | Default locale to be used by Antl provider. You can always switch drivers | ||
169 | | in runtime or use the official Antl middleware to detect the driver | ||
170 | | based on HTTP headers/query string. | ||
171 | | | ||
172 | */ | ||
173 | locale: 'en', | ||
174 | }, | ||
175 | |||
176 | logger: { | ||
177 | /* | ||
178 | |-------------------------------------------------------------------------- | ||
179 | | Transport | ||
180 | |-------------------------------------------------------------------------- | ||
181 | | | ||
182 | | Transport to be used for logging messages. You can have multiple | ||
183 | | transports using same driver. | ||
184 | | | ||
185 | | Available drivers are: `file` and `console`. | ||
186 | | | ||
187 | */ | ||
188 | transport: 'console', | ||
189 | |||
190 | /* | ||
191 | |-------------------------------------------------------------------------- | ||
192 | | Console Transport | ||
193 | |-------------------------------------------------------------------------- | ||
194 | | | ||
195 | | Using `console` driver for logging. This driver writes to `stdout` | ||
196 | | and `stderr` | ||
197 | | | ||
198 | */ | ||
199 | console: { | ||
200 | driver: 'console', | ||
201 | name: 'adonis-app', | ||
202 | level: 'info', | ||
203 | }, | ||
204 | |||
205 | /* | ||
206 | |-------------------------------------------------------------------------- | ||
207 | | File Transport | ||
208 | |-------------------------------------------------------------------------- | ||
209 | | | ||
210 | | File transport uses file driver and writes log messages for a given | ||
211 | | file inside `tmp` directory for your app. | ||
212 | | | ||
213 | | For a different directory, set an absolute path for the filename. | ||
214 | | | ||
215 | */ | ||
216 | file: { | ||
217 | driver: 'file', | ||
218 | name: 'adonis-app', | ||
219 | filename: 'adonis.log', | ||
220 | level: 'info', | ||
221 | }, | ||
222 | }, | ||
223 | |||
224 | /* | ||
225 | |-------------------------------------------------------------------------- | ||
226 | | Generic Cookie Options | ||
227 | |-------------------------------------------------------------------------- | ||
228 | | | ||
229 | | The following cookie options are generic settings used by AdonisJs to create | ||
230 | | cookies. However, some parts of the application like `sessions` can have | ||
231 | | separate settings for cookies inside `config/session.js`. | ||
232 | | | ||
233 | */ | ||
234 | cookie: { | ||
235 | httpOnly: true, | ||
236 | sameSite: false, | ||
237 | path: '/', | ||
238 | maxAge: 7200, | ||
239 | }, | ||
240 | }; | ||