Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit c931012

Browse files
committed
Fix tests & refactor SSL support
1 parent b0d8b47 commit c931012

30 files changed

+448
-401
lines changed

.editorconfig

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,23 @@ insert_final_newline = true
1414
# Standard at: https://github.com/felixge/node-style-guide
1515
[**.js, **.json]
1616
trim_trailing_whitespace = true
17-
indent_style = space
18-
indent_size = 2
19-
max_line_length = 80
17+
indent_style = tab
2018
quote_type = single
2119
curly_bracket_next_line = false
2220
spaces_around_operators = true
2321
space_after_control_statements = true
2422
space_after_anonymous_functions = false
2523
spaces_in_brackets = false
2624

27-
# https://github.com/jedmao/codepainter
28-
[node_modules/**.js]
29-
codepaint = false
30-
3125
# No Standard. Please document a standard if different from .js
3226
[**.yml, **.html, **.css]
3327
trim_trailing_whitespace = true
34-
indent_style = space
35-
indent_size = 2
28+
indent_style = tab
3629

3730
# No standard. Please document a standard if different from .js
3831
[**.md]
39-
indent_style = space
40-
41-
# Standard at:
42-
[**.py]
43-
indent_style = space
44-
indent_size = 4
32+
indent_style = tab
4533

4634
# Standard at:
4735
[Makefile]
48-
indent_style = tab
49-
indent_size = 8
36+
indent_style = tab

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ $
100100
$ docker run -p 3000:3000 -p 35729:35729 -v /Users/mdl/workspace/mean-stack/mean/public:/home/mean/public -v /Users/mdl/workspace/mean-stack/mean/app:/home/mean/app --link db:db_1 mean
101101
```
102102

103+
## Running in a secure environment
104+
To run your application in a secure manner you'll need to use OpenSSL and generate a set of self-signed certificates. Unix-based users can use the following commnad:
105+
```
106+
$ sh generate-ssl-certs.sh
107+
```
108+
Windows users can follow instructions found [here](http://www.websense.com/support/article/kbarticle/How-to-use-OpenSSL-and-Microsoft-Certification-Authority)
109+
To generate the key and certificate and place them in the [config/sslcerts](config/sslcerts) folder.
110+
103111
## Getting Started With MEAN.JS
104112
You have your application running but there are a lot of stuff to understand, we recommend you'll go over the [Official Documentation](http://meanjs.org/docs.html).
105113
In the docs we'll try to explain both general concepts of MEAN components and give you some guidelines to help you improve your development process. We tried covering as many aspects as possible, and will keep update it by your request, you can also help us develop the documentation better by checking out the *gh-pages* branch of this repository.

app/controllers/errors.server.controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var getUniqueErrorMessage = function(err) {
1010
var fieldName = err.err.substring(err.err.lastIndexOf('.$') + 2, err.err.lastIndexOf('_1'));
1111
output = fieldName.charAt(0).toUpperCase() + fieldName.slice(1) + ' already exists';
1212

13-
} catch(ex) {
13+
} catch (ex) {
1414
output = 'Unique field already exists';
1515
}
1616

@@ -22,7 +22,7 @@ var getUniqueErrorMessage = function(err) {
2222
*/
2323
exports.getErrorMessage = function(err) {
2424
var message = '';
25-
25+
2626
if (err.code) {
2727
switch (err.code) {
2828
case 11000:
@@ -39,4 +39,4 @@ exports.getErrorMessage = function(err) {
3939
}
4040

4141
return message;
42-
};
42+
};

app/controllers/users/users.password.server.controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ exports.reset = function(req, res, next) {
174174
subject: 'Your password has been changed',
175175
html: emailHTML
176176
};
177-
177+
178178
smtpTransport.sendMail(mailOptions, function(err) {
179179
done(err, 'done');
180180
});
@@ -242,4 +242,4 @@ exports.changePassword = function(req, res) {
242242
message: 'User is not signed in'
243243
});
244244
}
245-
};
245+
};

app/models/user.server.model.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ var UserSchema = new Schema({
8686
resetPasswordToken: {
8787
type: String
8888
},
89-
resetPasswordExpires: {
90-
type: Date
91-
}
89+
resetPasswordExpires: {
90+
type: Date
91+
}
9292
});
9393

9494
/**

app/routes/users.server.routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ module.exports = function(app) {
4747
// Setting the linkedin oauth routes
4848
app.route('/auth/linkedin').get(passport.authenticate('linkedin'));
4949
app.route('/auth/linkedin/callback').get(users.oauthCallback('linkedin'));
50-
50+
5151
// Setting the github oauth routes
5252
app.route('/auth/github').get(passport.authenticate('github'));
5353
app.route('/auth/github/callback').get(users.oauthCallback('github'));
5454

5555
// Finish by binding the user middleware
5656
app.param('userId', users.userByID);
57-
};
57+
};

0 commit comments

Comments
 (0)