+ instagram service

This commit is contained in:
tmshv committed 2016-03-23 01:04:07 +03:00
1 parent 83c1e09c89
commit d15f9e162f
7 files changed
+185

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
{
"presets": ["es2015", "react", "stage-0"]
}
+10
View File
@@ -0,0 +1,10 @@
.DS_Store
.idea
*.sublime*
npm-debug.log
.private*
/node_modules
/build
/coverage
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
echo "Deploying Instagram Microservice"
#NODE_ENV=production gulp deploy
server="art.shburg.org"
tarfile="build.tar.gz"
tarpath=$TMPDIR${tarfile}
destpath="~/www/art.shburg.org/services/instagram"
echo "Packing..."
env GZIP=-9 tar -czf ${tarpath} \
--disable-copyfile \
--exclude=node_modules \
--exclude=.git \
--exclude=.idea \
--exclude=.DS_Store \
--exclude=deploy.sh \
--exclude=install.sh \
.
echo "Build file: $tarpath"
#ssh h "rm -rf $destpath/*"
scp ${tarpath} hoster@${server}:${destpath}
echo "Build file successfully uploaded on ${server}"
echo "Installing..."
ssh hoster@${server} "bash -s" -- < ./install.sh ${destpath} ${tarfile}
rm ${tarpath}
echo "Done"
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
dir_path="$1"
build_file="$2"
cd ${dir_path}
gunzip -c ${build_file} | tar xopf -
npm install --production --loglevel error
#starting www
if forever restart src/index.js; then
echo Instagram Microservice restarted
else
forever start src/index.js
echo Instagram Microservice started
fi
+39
View File
@@ -0,0 +1,39 @@
server {
listen 443 ssl;
server_name art.shburg.org;
ssl_certificate /etc/letsencrypt/live/art.shlisselburg.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/art.shlisselburg.org/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
location /api/instagram {
proxy_pass http://hudozka_instagram;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
error_log /var/log/nginx/art.shburg.instagram.error.log;
access_log /var/log/nginx/art.shburg.instagram.access.log;
}
server {
listen 80;
server_name art.shburg.org;
return 301 https://art.shburg.org$request_uri;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream hudozka_instagram {
server localhost:18000;
}
+36
View File
@@ -0,0 +1,36 @@
{
"name": "hudozka-instagram",
"version": "0.0.0",
"private": true,
"scripts": {
"webpack": "webpack"
},
"dependencies": {
"babel-core": "^6.7.2",
"babel-polyfill": "^6.7.2",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-0": "^6.5.0",
"co": "^4.6.0",
"instagram-node": "^0.5.8",
"kerberos": "0.0.19",
"koa": "^2.0.0-alpha.3",
"koa-bodyparser": "^3.0.0",
"koa-compose": "^3.1.0",
"koa-convert": "^1.2.0",
"koa-route": "^3.0.0",
"koa-session-mongo": "^1.1.0",
"koa-session-store": "^1.1.1",
"koa-static": "^2.0.0",
"mongodb": "^2.1.10",
"mz": "^2.3.1",
"react": "^0.14.7",
"react-dom": "^0.14.7",
"thunkify": "^2.1.2"
},
"devDependencies": {
"babel-loader": "^6.2.4",
"babel-preset-react": "^6.5.0",
"html-webpack-plugin": "^2.10.0",
"webpack": "^1.12.14"
}
}
@@ -0,0 +1,48 @@
import webpack from'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
// import autoprefixer from 'autoprefixer';
module.exports = {
entry: './src/app.js',
//resolve: {
// modulesDirectories: [
// './node_modules'
// ]
//},
output: {
path: './build',
filename: 'app.js'
},
// devServer: {
// historyApiFallback: true,
// hot: true,
// inline: true,
// progress: true,
// host: 'localhost',
// port: 3000
// },
plugins: [
// new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
filename: 'main.html',
title: 'Instagram',
template: 'src/templates/index.html',
inject: 'body'
})
],
module: {
loaders: [
{
test: /\.js$/,
// exclude: /node_modules/,
//exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
// presets: ['react'],
cacheDirectory: true
}
}
]
}
};