mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-20 19:01:43 +01:00
Merge pull request #282 from lirantal/ssl-support-fixes
SSL support fixes
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -18,7 +18,7 @@ app/tests/coverage/
|
||||
|
||||
# MEAN.js app and assets
|
||||
# ======================
|
||||
config/sslcert/*.pem
|
||||
config/sslcerts/*.pem
|
||||
access.log
|
||||
|
||||
# Sublime editor
|
||||
|
||||
@@ -104,10 +104,10 @@ $ docker run -p 3000:3000 -p 35729:35729 -v /Users/mdl/workspace/mean-stack/mean
|
||||
## Running in a secure environment
|
||||
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:
|
||||
```
|
||||
$ sh generate-ssl-certs.sh
|
||||
$ sh ./scripts/generate-ssl-certs.sh
|
||||
```
|
||||
Windows users can follow instructions found [here](http://www.websense.com/support/article/kbarticle/How-to-use-OpenSSL-and-Microsoft-Certification-Authority)
|
||||
To generate the key and certificate and place them in the *config/sslcert* folder.
|
||||
To generate the key and certificate and place them in the *config/sslcerts* folder.
|
||||
|
||||
## Getting Started With MEAN.JS
|
||||
You have your application running but there is a lot of stuff to understand, we recommend you'll go over the [Official Documentation](http://meanjs.org/docs.html).
|
||||
|
||||
2
config/env/secure.js
vendored
2
config/env/secure.js
vendored
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
port: 443,
|
||||
port: 8443,
|
||||
db: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://localhost/mean',
|
||||
log: {
|
||||
// Can specify one of 'combined', 'common', 'dev', 'short', 'tiny'
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -e server.js ]
|
||||
then
|
||||
echo "Error: could not find main application server.js file"
|
||||
echo "You should run the generate-ssl-certs.sh script from the main MEAN application root directory"
|
||||
echo "i.e: bash scripts/generate-ssl-cers.sh"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
echo "Generating self-signed certificates..."
|
||||
mkdir -p ./config/sslcerts
|
||||
openssl genrsa -out ./config/sslcerts/key.pem -aes256 1024
|
||||
openssl req -new -key ./config/sslcerts/key.pem -out ./config/sslcerts/csr.pem
|
||||
openssl x509 -req -days 9999 -in ./config/sslcerts/csr.pem -signkey ./config/sslcerts/key.pem -out ./config/sslcerts/cert.pem
|
||||
Reference in New Issue
Block a user