Commit Graph

73 Commits

Author SHA1 Message Date
Tobias Andersen 0ee6ba4049 =Fixed problem with the stoppable wrapper not triggering the listen method on the http server object 2020-08-20 11:11:53 +02:00
toban@dfds.com b349720c75 =migrations https logic to new branch 2020-08-17 17:06:28 +02:00
Tim Jacomb c673826ebb Fix sqllite backend 2020-08-17 10:28:27 +01:00
Paul Pacheco 4cf6cf3b6c The backend listens to all interfaces by default (#1962)
* The backend listens to all interfaces by default

Previously,  if you did not specify a host,  it would only
listen to localhost,  so it would not accept connections from the network.

If you use the default generated app,  it is configured to listen to 0.0.0.0
which only listens to IPv4 interfaces.

This changes the default behavior, just listen to all interfaces.

* Add some comment
2020-08-16 09:08:36 +02:00
Patrik Oldsberg fe48229005 Merge pull request #1915 from andrewthauer/common-db-utils
Add shared database connection helpers
2020-08-15 13:57:44 +02:00
Andrew Thauer 4285289b5a only expose createDatabase + additional typing 2020-08-14 06:30:05 -04:00
Andrew Thauer 815983ae84 add shared database connection helpers 2020-08-13 22:56:47 -04:00
Paul Pacheco e9d4ec7494 Separate port and host in configuration
Many cloud providers have an environment variable PORT.
an application is supposed to listen in that port.

Currently,  the yaml for listen address looks like this:
```yaml
backend:
  listen: 0.0.0.0:7000
```

the problem is that I can't use the port environment variable there.

This PR changes it to this:
```yaml
backend:
  listen:
    host: 0.0.0.0
    port: 7000
```

if I want to use the PORT environment variable, now I can do it like this:

```yaml
backend:
  listen:
    host: 0.0.0.0
    port:
      $secret:
         env: PORT
```
2020-08-13 12:28:03 -05:00
Patrik Oldsberg 4f7464de04 Merge pull request #1860 from spotify/rugvip/config
config,config-loader: add support for suffixed config files and multiple roots
2020-08-10 11:51:07 +02:00
Patrik Oldsberg f8c696e038 v0.1.1-alpha.18 2020-08-07 17:08:28 +02:00
Patrik Oldsberg 1f2216fd77 config: flip priority order of ConfigReader.fromConfigs 2020-08-07 16:43:33 +02:00
Patrik Oldsberg a37aa1d994 config-loader: pass in env as an option 2020-08-07 11:32:06 +02:00
Patrik Oldsberg 811328ed1f config-loader: use multiple config roots 2020-08-07 10:48:28 +02:00
Patrik Oldsberg 0dd8fa2828 v0.1.1-alpha.17 2020-08-05 19:36:36 +02:00
Fredrik Adelöw 55d5fb4c2b Merge pull request #1830 from spotify/dependabot/npm_and_yarn/helmet-4.0.0
chore(deps): bump helmet from 3.23.2 to 4.0.0
2020-08-05 13:40:32 +02:00
dependabot-preview[bot] ae9f757ac3 chore(deps): bump helmet from 3.23.2 to 4.0.0
Bumps [helmet](https://github.com/helmetjs/helmet) from 3.23.2 to 4.0.0.
- [Release notes](https://github.com/helmetjs/helmet/releases)
- [Changelog](https://github.com/helmetjs/helmet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/helmetjs/helmet/compare/v3.23.2...v4.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-05 08:38:52 +00:00
Patrik Oldsberg 62222b543c config-loader,backend-common: refactor config loading to pass in path and use common util for backend 2020-08-03 21:24:44 +02:00
Andrew Thauer bd62f98070 fix: logger comment for errorhandler options 2020-07-27 07:46:33 -04:00
Patrik Oldsberg ea129d5bbd Merge pull request #1592 from andrewthauer/backend-status-checks
[Backend-Common] Add backend status check handler middleware
2020-07-27 12:53:47 +02:00
Andrew Thauer fa8e220f5c feat: ensure errors are logged in errorHandler
This adds winson logging for any 500 errors
2020-07-26 21:01:02 -04:00
Andrew Thauer 2a482bd3ef add status check router 2020-07-26 16:11:38 -04:00
Andrew Thauer 88e3581ebc feat: add backend status check handler middleware
The statusCheckHandler is a simple express middleware that helps
implement healthcheck/readiness endpoints. It can provided an optional
status function that should return a promise that resolves in either
true or false. The response will be either a 200 or 503 respectively.
Any errors that occur will be forwarded to next.
2020-07-26 15:27:00 -04:00
Patrik Oldsberg a852c2f141 config,config-loader: fix lagging versions 2020-07-24 11:38:45 +02:00
Ivan Shmidt bcd7b2661a v0.1.1-alpha.16 2020-07-24 03:44:39 +02:00
Ivan Shmidt 415bdf42e1 v0.1.1-alpha.15 2020-07-22 13:44:33 +02:00
Ivan Shmidt 53dd867c02 fix(catalog): hmr in dev mode got incorrect module ref 2020-07-22 01:30:02 +02:00
Bilawal Hameed 491d1b70e1 Bump to v0.1.1-alpha.14 2020-07-15 11:49:02 +02:00
Patrik Oldsberg 6fdcc9f59a v0.1.1-alpha.13 2020-07-07 13:16:30 +02:00
Fredrik Adelöw 7389f326d9 chore: add import/newline-after-import lint rule 2020-07-02 11:25:04 +02:00
blam 17c6030ca0 feat(scaffolder): finally managed to get typescript to play nice with the new stage approach 2020-06-27 03:41:06 +02:00
blam 85d1fbaf3c chore(backend-common): expose a create logger function 2020-06-24 13:57:19 +02:00
blam f42a541ade chore(backend-common): Fixing the headers sent issue so we dont send the response twice 2020-06-24 11:18:58 +02:00
Patrik Oldsberg dcaee07754 v0.1.1-alpha.12 2020-06-23 22:25:25 +02:00
Patrik Oldsberg 910057bc8a v0.1.1-alpha.11 2020-06-23 21:27:58 +02:00
Patrik Oldsberg 6300d4a917 v0.1.1-alpha.10 2020-06-23 16:08:05 +02:00
Fredrik Adelöw 07bc1a68a1 Merge pull request #1373 from spotify/freben/backend-config
feat(backend-common): base backend config
2020-06-22 14:48:38 +02:00
Fredrik Adelöw 609eea997a chore(backend-common): just tweaked the structure of useHotMemoize 2020-06-22 13:07:26 +02:00
Patrik Oldsberg 8127491b8b backend-common: change useHotCleanup to clean up on parents being disposed as well 2020-06-21 14:23:49 +02:00
Fredrik Adelöw 026b9547b9 address comments 2020-06-18 20:52:25 +02:00
Fredrik Adelöw 324b0a767a feat(backend-common): base backend config 2020-06-18 16:37:10 +02:00
Fredrik Adelöw 38ba897857 v0.1.1-alpha.9 2020-06-17 15:24:54 +02:00
Patrik Oldsberg 6c25e61279 packages/backend-common: move express and cors types to deps 2020-06-17 09:41:13 +02:00
Patrik Oldsberg 76fd9f9401 packages,plugins: use backend:build for all backend packages + publish config and no tsconfig 2020-06-17 00:03:28 +02:00
Ivan Shmidt 9050b2011c fix: hmr memoize 2020-06-16 12:59:45 +02:00
Ivan Shmidt 016e2d8855 fix(backend-common): move some @types to devdeps for now 2020-06-16 09:49:31 +02:00
Ivan Shmidt 404bc724fb refactor(cli): split out bundling config for BE 2020-06-16 00:27:02 +02:00
Ivan Shmidt 417a4d538e feat: more clean hot hookz 2020-06-15 22:36:36 +02:00
Ivan Shmidt 9fe15e6726 feat: point all backend to src 2020-06-15 22:34:53 +02:00
Ivan Shmidt 0c27fc1a7b Merge branch 'master' of github.com:spotify/backstage into shmidt-i/backend-hmr-2 2020-06-15 15:46:23 +02:00
Patrik Oldsberg 3bdcc175d9 packages/backend-common: import winston as namespace 2020-06-14 13:44:32 +02:00