You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Updated Dockerfile and package.json to new Node LTS v16.13 requirement.
9
-
* Fixed Dockerfile to build PROD assets, not DEV assets.
10
9
* Fixed a bug in the `forceUppercaseOnFirst` function in the [`User model`](api/models/User.js).
11
10
* Changed default connections to datastores to have SSL enabled (must now explicitly disable SSL connections for remote servers).
12
11
* Removed use of global model names, in-favor of `sails.models` usage (for consistency, and to more easily allow disabling of global models).
13
12
14
13
### Breaking Changes
15
14
15
+
* Updated to React v18. See: [the upgrade guid to React 18](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html).
16
16
* Updated to React Router DOM v6. See: [the v5 -> v6 migration guide](https://reactrouter.com/docs/en/v6/upgrading/v5). This requires a **MAJOR** overhaul of how routes are handled.
17
17
* Moved some controllers into a "common" folder, instead of the "admin" folder (as they could be used outside of admin controls).
18
18
19
19
### Known Issues
20
20
21
-
* There is an issue with the Webpack dev server, and the way React routes are handled. Currently, if you aren't loading from an entry point, nothing renders. While this is not an issue for built assets, it is an issue if you are working with the auto-reload dev server. I'm still working on a fix for this, and suspect it's an issue from moving to new React Router.
21
+
* There is an issue with the Webpack dev server, and the way React routes are handled. Currently, if you aren't loading from an entry point (like /admin), and you refresh the page (on like /admin/dashboard), nothing renders. While this is not an issue for built assets, it is an issue if you are working with the auto-reload dev server. I'm still working on a fix for this, and suspect it's an issue from moving to the new React Router.
| npm run start | Will run both `npm run lift` and `npm run open:client` in parallel.
55
-
| npm run open:client | Will run the [Webpack Dev Server](https://webpack.js.org/configuration/dev-server/) and open a browser tab / window.
56
-
| npm run lift | The same thing as `sails lift` or `node app.js`; will "[lift our Sails](https://sailsjs.com/documentation/reference/command-line-interface/sails-lift)" instance (aka starting the API).
57
-
| npm run lift:prod | The same thing as `sails lift --prod` or `NODE_ENV=production node app.js`.
58
-
| npm run debug | Alias for `node --inspect app.js`.
59
-
| npm run build | Will run `npm run clean`, then will build production-ready files with Webpack in the `.tmp/public` folder.
60
-
| npm run build:dev | Same thing as `npm run build`, except that it will not optimize the files, retaining newlines and empty spaces.
61
-
| npm run clean | Will basically delete everything in the `.tmp` folder.
62
-
| npm run lines | Will count the lines of code in the project, minus `.gitignore`'d files, for funzies. There are currently about 7k custom lines in this repo (views, controllers, helpers, hooks, etc).
63
-
| npm run test | Run [Mocha](https://mochajs.org/) tests. Everything starts in the [`test/hooks.js`](test/hooks.js) file.
64
-
| npm run coverage | Runs [NYC](https://www.npmjs.com/package/nyc) coverage reporting of the Mocha tests, which generates HTML in `test/coverage`.
| npm run start | Will run both `npm run lift` and `npm run open:client` in parallel.|
55
+
| npm run open:client| Will run the [Webpack Dev Server](https://webpack.js.org/configuration/dev-server/) and open a browser tab / window.|
56
+
| npm run lift | The same thing as `sails lift` or `node app.js`; will "[lift our Sails](https://sailsjs.com/documentation/reference/command-line-interface/sails-lift)" instance (aka starting the API).|
57
+
| npm run lift:prod| The same thing as `sails lift --prod` or `NODE_ENV=production node app.js`.|
58
+
| npm run debug | Alias for `node --inspect app.js`.|
59
+
| npm run build | Will run `npm run clean`, then will build production-ready files with Webpack in the `.tmp/public` folder.|
60
+
| npm run build:dev| Same thing as `npm run build`, except that it will not optimize the files, retaining newlines and empty spaces.|
61
+
| npm run clean | Will basically delete everything in the `.tmp` folder.|
62
+
| npm run lines | Will count the lines of code in the project, minus `.gitignore`'d files, for funzies. There are currently about 7k custom lines in this repo (views, controllers, helpers, hooks, etc).|
63
+
| npm run test | Run [Mocha](https://mochajs.org/) tests. Everything starts in the [`test/hooks.js`](test/hooks.js) file.|
64
+
| npm run coverage | Runs [NYC](https://www.npmjs.com/package/nyc) coverage reporting of the Mocha tests, which generates HTML in `test/coverage`.|
65
65
66
66
### Environment Variables
67
67
There are a few environment variables that the remote configuration files are set up for. There are currently 3 variables that change names between DEV and PROD; this is intentional, and has proven very useful in my experience. DEV has shorter names like `DB_HOST`, where PROD has fuller names like `DB_HOSTNAME`. This helps with ensuring you are configuring the correct remote server, and has prevented accidental DEV deployments to PROD.
68
68
69
69
If you DO NOT like this behavior, and would prefer the variables stay the same across your environments, feel free to change them in [`config/env/development.js`](config/env/development.js) and [`config/env/production.js`](config/env/production.js)
| ASSETS_URL | "" (empty string) | Webpack is configured to modify static asset URLs to point to a CDN, like CloudFront. MUST end with a slash " / ", or be empty.
75
-
| BASE_URL | https://myapi.app | The address of the Sails instance.
76
-
| DB_HOST | localhost | The hostname of the datastore. (Notice this is `DB_HOSTNAME` on PROD.)
77
-
| DB_USER | root | Username for the datastore. (Notice this is `DB_USERNAME` on PROD.)
78
-
| DB_PASS | mypass | Password for the datastore. (Notice this is `DB_PASSWORD` on PROD.)
79
-
| DB_NAME | myapp | The name of the database inside the datastore.
80
-
| DB_PORT | 3306 | The port number for datastore.
81
-
| DB_SSL | false | If the datastore requires SSL, set this to "true".
82
-
| SESSION_SECRET | "" (empty string) | This is used to sign cookies, and SHOULD be set, especially on PRODUCTION environments.
| ASSETS_URL | "" (empty string) | Webpack is configured to modify static asset URLs to point to a CDN, like CloudFront. MUST end with a slash " / ", or be empty.
89
-
| BASE_URL | https://myapi.app | The address of the Sails instance.
90
-
| DB_HOSTNAME | localhost | The hostname of the datastore. (Notice this is `DB_HOST` on DEV.)
91
-
| DB_USERNAME | produser | Username for the datastore. (Notice this is `DB_USER` on DEV.)
92
-
| DB_PASSWORD | myprodpassword | Password for the datastore. (Notice this is `DB_PASS` on DEV.)
93
-
| DB_NAME | proddatabase | The name of the database inside the datastore.
94
-
| DB_PORT | 3306 | The port number for datastore.
95
-
| DB_SSL | false | If the datastore requires SSL, set this to "true".
96
-
| SESSION_SECRET | "" (empty string) | This is used to sign cookies, and SHOULD be set, especially on PRODUCTION environments.
| ASSETS_URL | "" (empty string) | ASSETS_URL | "" (empty string) | Webpack is configured to modify static asset URLs to point to a CDN, like CloudFront. MUST end with a slash " / ", or be empty. |
74
+
| BASE_URL |https://myapi.app| BASE_URL |https://myapi.app| The address of the Sails instance. |
75
+
| DB_HOST | localhost | DB_HOSTNAME | localhost | The hostname of the datastore. |
76
+
| DB_USER | root | DB_USERNAME | produser | Username for the datastore. |
77
+
| DB_PASS | mypass | DB_PASSWORD | myprodpassword | Password for the datastore. |
78
+
| DB_NAME | myapp | DB_NAME | proddatabase | The name of the database inside the datastore. |
79
+
| DB_PORT | 3306 | DB_PORT | 3306 | The port number for datastore. |
80
+
| DB_SSL | true | DB_SSL | true | If the datastore requires SSL, set this to "true". |
81
+
| SESSION_SECRET | "" (empty string) | SESSION_SECRET | "" (emptry string) | This is used to sign cookies, and SHOULD be set, especially on PRODUCTION environments. |
Automatic incoming request logging, is a 2 part process. First, the [`request-logger` hook](api/hooks/request-logger.js) gathers info from the request, and creates a new [`RequestLog` record](api/models/RequestLog.js), making sure to mask anything that may be sensitive, such as passwords. Then, a custom response gathers information from the response, again, scrubbing sensitive data (using the [customToJSON](https://sailsjs.com/documentation/concepts/models-and-orm/model-settings?identity=#customtojson) feature of Sails models) to prevent leaking of password hashes, or anything else that should never be publicly accessible. The [`keepModelsSafe` helper](api/helpers/keep-models-safe.js) and the custom responses (such as [ok](api/responses/ok.js) or [serverError](api/responses/serverError.js)) are responsible for the final leg of request logs.
0 commit comments