This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A bash script to setup GIT like deployment on your server | |
echo "Enter your server address e.g 25.32.132.1 or yourserver.com" | |
read serverAddress | |
echo "Enter Username which you use to login to your server e.g ubuntu" | |
read username | |
echo "Enter path of the private key (optional)" | |
read privateKeyPath | |
echo "Path of your server directory where code should reside: e.g ~/code or /var/www (required)" | |
read tempPath |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
ssl: { | |
ca: require('fs').readFileSync(__dirname + '/ssl/ca.crt'), | |
key: require('fs').readFileSync(__dirname + '/ssl/key.key'), | |
cert: require('fs').readFileSync(__dirname + '/ssl/cert.crt') | |
}, | |
port: 443 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
ssl: { | |
ca: require('fs').readFileSync(__dirname + '/ssl/ca.crt'), | |
key: require('fs').readFileSync(__dirname + '/ssl/key.key'), | |
cert: require('fs').readFileSync(__dirname + '/ssl/cert.crt') | |
}, | |
port: 443, | |
policies: { | |
'*': 'isHTTPS' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(req, res, next) { | |
if (req.secure) { | |
// Already https; don't do anything special. | |
next(); | |
} else { | |
// Redirect to https. | |
res.redirect('https://' + req.headers.host + req.url); | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require( 'http' ); | |
module.exports.bootstrap = function(cb) { | |
//If the environment is production, then listen on port 80 | |
if(sails.config.environment === "production") { | |
http.createServer( sails.hooks.http.app ).listen( 80 ); | |
} | |
cb(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Firebase Chat</title> | |
<script src="https://cdn.tailwindcss.com"></script> | |
</head> | |
<body> |
OlderNewer