Skip to content

Commit

Permalink
attempting to recreate `balderdashy/sails#6810
Browse files Browse the repository at this point in the history
  • Loading branch information
steinathan committed Jul 16, 2019
1 parent 6561e33 commit 2f9776d
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 124 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@

a [Sails v1](https://sailsjs.com) application

### Links
### This is an example repo to reproduce an error in a fresh Sails app

- [Sails framework documentation](https://sailsjs.com/get-started)
- [Version notes / upgrading](https://sailsjs.com/documentation/upgrading)
- [Deployment tips](https://sailsjs.com/documentation/concepts/deployment)
- [Community support options](https://sailsjs.com/support)
- [Professional / enterprise options](https://sailsjs.com/enterprise)
This is the issue url
<a href="https://github.com/balderdashy/sails/issues/6810">https://github.com/balderdashy/sails/issues/6810</a>

### Version info

This app was originally generated on Tue Jul 16 2019 19:55:05 GMT+0100 (West Africa Standard Time) using Sails v1.2.2.

<!-- Internally, Sails used [`sails-generate@1.16.13`](https://github.com/balderdashy/sails-generate/tree/v1.16.13/lib/core-generators/new). -->
### Screenshots Proof

<img src="./assets/proof/001.png">
<img src="./assets/proof/002.png">
<img src="./assets/proof/003.png">
<img src="./assets/proof/004.png">
<img src="./assets/proof/005.png">

This project's boilerplate is based on an expanded seed app provided by the [Sails core team](https://sailsjs.com/about) to make it easier for you to build on top of ready-made features like authentication, enrollment, email verification, and billing. For more information, [drop us a line](https://sailsjs.com/support).
<!-- Internally, Sails used [`sails-generate@1.16.13`](https://github.com/balderdashy/sails-generate/tree/v1.16.13/lib/core-generators/new). -->

<!--
Note: Generators are usually run using the globally-installed `sails` CLI (command-line interface). This CLI version is _environment-specific_ rather than app-specific, thus over time, as a project's dependencies are upgraded or the project is worked on by different developers on different computers using different versions of Node.js, the Sails dependency in its package.json file may differ from the globally-installed Sails CLI release it was originally generated with. (Be sure to always check out the relevant [upgrading guides](https://sailsjs.com/upgrading) before upgrading the version of Sails used by your app. If you're stuck, [get help here](https://sailsjs.com/support).)
Expand Down
Binary file added assets/proof/001.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/proof/002.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/proof/003.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/proof/004.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/proof/005.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 30 additions & 36 deletions config/datastores.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,38 @@
*/

module.exports.datastores = {


/***************************************************************************
* *
* Your app's default datastore. *
* *
* Sails apps read and write to local disk by default, using a built-in *
* database adapter called `sails-disk`. This feature is purely for *
* convenience during development; since `sails-disk` is not designed for *
* use in a production environment. *
* *
* To use a different db _in development_, follow the directions below. *
* Otherwise, just leave the default datastore as-is, with no `adapter`. *
* *
* (For production configuration, see `config/env/production.js`.) *
* *
***************************************************************************/
* *
* Your app's default datastore. *
* *
* Sails apps read and write to local disk by default, using a built-in *
* database adapter called `sails-disk`. This feature is purely for *
* convenience during development; since `sails-disk` is not designed for *
* use in a production environment. *
* *
* To use a different db _in development_, follow the directions below. *
* Otherwise, just leave the default datastore as-is, with no `adapter`. *
* *
* (For production configuration, see `config/env/production.js`.) *
* *
***************************************************************************/

default: {

/***************************************************************************
* *
* Want to use a different database during development? *
* *
* 1. Choose an adapter: *
* https://sailsjs.com/plugins/databases *
* *
* 2. Install it as a dependency of your Sails app. *
* (For example: npm install sails-mysql --save) *
* *
* 3. Then pass it in, along with a connection URL. *
* (See https://sailsjs.com/config/datastores for help.) *
* *
***************************************************************************/
// adapter: 'sails-mysql',
// url: 'mysql://user:password@host:port/database',

},


* *
* Want to use a different database during development? *
* *
* 1. Choose an adapter: *
* https://sailsjs.com/plugins/databases *
* *
* 2. Install it as a dependency of your Sails app. *
* (For example: npm install sails-mysql --save) *
* *
* 3. Then pass it in, along with a connection URL. *
* (See https://sailsjs.com/config/datastores for help.) *
* *
***************************************************************************/
adapter: "sails-mongo",
url: "mongodb://localhost:27017/smapp"
}
};
148 changes: 70 additions & 78 deletions config/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,111 +14,103 @@
*/

module.exports.models = {


/***************************************************************************
* *
* Whether model methods like `.create()` and `.update()` should ignore *
* (and refuse to persist) unrecognized data-- i.e. properties other than *
* those explicitly defined by attributes in the model definition. *
* *
* To ease future maintenance of your code base, it is usually a good idea *
* to set this to `true`. *
* *
* > Note that `schema: false` is not supported by every database. *
* > For example, if you are using a SQL database, then relevant models *
* > are always effectively `schema: true`. And if no `schema` setting is *
* > provided whatsoever, the behavior is left up to the database adapter. *
* > *
* > For more info, see: *
* > https://sailsjs.com/docs/concepts/orm/model-settings#?schema *
* *
***************************************************************************/
* *
* Whether model methods like `.create()` and `.update()` should ignore *
* (and refuse to persist) unrecognized data-- i.e. properties other than *
* those explicitly defined by attributes in the model definition. *
* *
* To ease future maintenance of your code base, it is usually a good idea *
* to set this to `true`. *
* *
* > Note that `schema: false` is not supported by every database. *
* > For example, if you are using a SQL database, then relevant models *
* > are always effectively `schema: true`. And if no `schema` setting is *
* > provided whatsoever, the behavior is left up to the database adapter. *
* > *
* > For more info, see: *
* > https://sailsjs.com/docs/concepts/orm/model-settings#?schema *
* *
***************************************************************************/

schema: true,


/***************************************************************************
* *
* How and whether Sails will attempt to automatically rebuild the *
* tables/collections/etc. in your schema. *
* *
* > Note that, when running in a production environment, this will be *
* > automatically set to `migrate: 'safe'`, no matter what you configure *
* > here. This is a failsafe to prevent Sails from accidentally running *
* > auto-migrations on your production database. *
* > *
* > For more info, see: *
* > https://sailsjs.com/docs/concepts/orm/model-settings#?migrate *
* *
***************************************************************************/

migrate: 'alter',

* *
* How and whether Sails will attempt to automatically rebuild the *
* tables/collections/etc. in your schema. *
* *
* > Note that, when running in a production environment, this will be *
* > automatically set to `migrate: 'safe'`, no matter what you configure *
* > here. This is a failsafe to prevent Sails from accidentally running *
* > auto-migrations on your production database. *
* > *
* > For more info, see: *
* > https://sailsjs.com/docs/concepts/orm/model-settings#?migrate *
* *
***************************************************************************/

migrate: "alter",

/***************************************************************************
* *
* Base attributes that are included in all of your models by default. *
* By convention, this is your primary key attribute (`id`), as well as two *
* other timestamp attributes for tracking when records were last created *
* or updated. *
* *
* > For more info, see: *
* > https://sailsjs.com/docs/concepts/orm/model-settings#?attributes *
* *
***************************************************************************/
* *
* Base attributes that are included in all of your models by default. *
* By convention, this is your primary key attribute (`id`), as well as two *
* other timestamp attributes for tracking when records were last created *
* or updated. *
* *
* > For more info, see: *
* > https://sailsjs.com/docs/concepts/orm/model-settings#?attributes *
* *
***************************************************************************/

attributes: {
createdAt: { type: 'number', autoCreatedAt: true, },
updatedAt: { type: 'number', autoUpdatedAt: true, },
id: { type: 'number', autoIncrement: true, },
createdAt: { type: "number", autoCreatedAt: true },
updatedAt: { type: "number", autoUpdatedAt: true },
// id: { type: 'number', autoIncrement: true, },
//--------------------------------------------------------------------------
// /\ Using MongoDB?
// || Replace `id` above with this instead:
//
// ```
// id: { type: 'string', columnName: '_id' },
id: { type: "string", columnName: "_id" }
// ```
//
// Plus, don't forget to configure MongoDB as your default datastore:
// https://sailsjs.com/docs/tutorials/using-mongo-db
//--------------------------------------------------------------------------
},


/******************************************************************************
* *
* The set of DEKs (data encryption keys) for at-rest encryption. *
* i.e. when encrypting/decrypting data for attributes with `encrypt: true`. *
* *
* > The `default` DEK is used for all new encryptions, but multiple DEKs *
* > can be configured to allow for key rotation. In production, be sure to *
* > manage these keys like you would any other sensitive credential. *
* *
* > For more info, see: *
* > https://sailsjs.com/docs/concepts/orm/model-settings#?dataEncryptionKeys *
* *
******************************************************************************/
* *
* The set of DEKs (data encryption keys) for at-rest encryption. *
* i.e. when encrypting/decrypting data for attributes with `encrypt: true`. *
* *
* > The `default` DEK is used for all new encryptions, but multiple DEKs *
* > can be configured to allow for key rotation. In production, be sure to *
* > manage these keys like you would any other sensitive credential. *
* *
* > For more info, see: *
* > https://sailsjs.com/docs/concepts/orm/model-settings#?dataEncryptionKeys *
* *
******************************************************************************/

dataEncryptionKeys: {
default: 'G6PmSRezd1smXvAiGUCK5Bv2Ukq6IyvaZbbbvGzSeLQ='
default: "C/AKr0fo/MwxMVqa5OhoLVnaHx9AeG2QtXfS08HPbyU="
},


/***************************************************************************
* *
* Whether or not implicit records for associations should be cleaned up *
* automatically using the built-in polyfill. This is especially useful *
* during development with sails-disk. *
* *
* Depending on which databases you're using, you may want to disable this *
* polyfill in your production environment. *
* *
* (For production configuration, see `config/env/production.js`.) *
* *
***************************************************************************/
* *
* Whether or not implicit records for associations should be cleaned up *
* automatically using the built-in polyfill. This is especially useful *
* during development with sails-disk. *
* *
* Depending on which databases you're using, you may want to disable this *
* polyfill in your production environment. *
* *
* (For production configuration, see `config/env/production.js`.) *
* *
***************************************************************************/

cascadeOnDestroy: true


};
5 changes: 3 additions & 2 deletions config/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ module.exports.session = {
* of your users, forcing them to log in again. *
* *
***************************************************************************/
secret: "7fdca2c7ecdc07c00c6edd4566ffee57"
secret: "7fdca2c7ecdc07c00c6edd4566ffee57",
adapter: "connect-mongo",
url: "mongodb://localhost:27017/smapp-sessions"

/***************************************************************************
* *
Expand All @@ -30,7 +32,6 @@ module.exports.session = {
* https://sailsjs.com/config/session *
* *
***************************************************************************/

// isSessionDisabled: function(req) {
// return !!req.path.match(req._sails.LOOKS_LIKE_ASSET_RX);
// }
Expand Down

0 comments on commit 2f9776d

Please sign in to comment.