Giter VIP home page Giter VIP logo

kohrindo's Introduction

Build Status

Development

SETUP

git clone https://github.com/sairoutine/kohrindo.git
sudo npm install -g supervisor
# Redis Install
sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo yum --enablerepo=remi,remi-test install -y redis
sudo chkconfig --add redis
sudo chkconfig --level 345 redis on
sudo service redis start
# Mysql 5.6 Install
sudo yum -y install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
sudo yum -y install mysql-community-server
sudo chkconfig mysqld on
sudo service mysqld start
# Install Java
sudo yum install -y java-1.8.0-openjdk
# Install ElasticSearch
sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
vim /etc/yum.repos.d/elasticsearch.repo
sudo yum install elasticsearch
chkconfig --add elasticsearch
sudo service elasticsearch start
# Install Kuromoji
sudo yum install -y /usr/lib64/libssl3.so
/usr/share/elasticsearch/bin/plugin install analysis-kuromoji
# Install node v1.2
fab root_install_node12 -H localhost
# Install ImageMagick
sudo yum install -y ImageMagick-c++ ImageMagick-c++-devel
# setup db
mysql -uroot < ./kohrindo/bin/db_setup.sql

vim ./start_kohrindo.sh
chmod 0700 ./start_kohrindo.sh

start_kohrindo.sh

#!/bin/sh

# Twitter Auth Key
export TWITTER_CONSUMER_KEY=""
export TWITTER_CONSUMER_SECRET=""

# セッションのシークレットキー
export SESSION_SECRET=""

# 環境
export NODE_ENV="development"
#export NODE_ENV="production"

cd ./kohrindo
npm install
npm start

/etc/yum.repos.d/elasticsearch.repo

[elasticsearch-2.0]
name=Elasticsearch repository for 2.0 packages
baseurl=http://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1

Production

mysql server setup on db01

sudo yum -y install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
sudo yum -y install mysql-community-server
sudo chkconfig mysqld on
git clone https://github.com/sairoutine/sai-chan.com-mysql.git
sudo cp sai-chan.com-mysql/my.cnf /etc/my.cnf
sudo service mysqld start
# 10.3.0.110 is ap001
echo 'grant all privileges on *.* to root@"10.3.0.110" with grant option;' | mysql -uroot

redis server setup on db01

sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo yum --enablerepo=remi,remi-test install -y redis
sudo chkconfig --add redis
sudo chkconfig --level 345 redis on

# modify bind 127.0.0.1 -> bind db01
vim /etc/redis.conf

sudo service redis start

elasticsearch setup on db01

# Install Java
sudo yum install -y java-1.8.0-openjdk
# Install ElasticSearch
sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
vim /etc/yum.repos.d/elasticsearch.repo
sudo yum install -y elasticsearch
chkconfig --add elasticsearch
sudo service elasticsearch start
# Install Kuromoji
sudo yum install -y /usr/lib64/libssl3.so
/usr/share/elasticsearch/bin/plugin install analysis-kuromoji

app server setup on ap001

# node 0.12.2 Install
fab root_install_node12 -H localhost
# npm Install
sudo yum install -y epel-release
sudo yum install -y npm --enablerepo=epel
# Install ImageMagick
sudo yum install -y gcc gcc-c++
sudo yum install -y ImageMagick-c++ ImageMagick-c++-devel
# Install forever
sudo npm install -g forever
# Add node user
sudo useradd node
su - node
# git clone apps
git clone https://github.com/sairoutine/kohrindo.git /home/node/kohrindo

# setup db
mysql -uroot < ./kohrindo/bin/db_setup.sql
mysql -uroot < ./kohrindo/bin/load_surugaya_csv.sql

vim ./start_kohrindo.sh
chmod 0700 ./start_kohrindo.sh

Install Mackerel

To see https://mackerel.io/orgs/sairoutine/instruction-agent

integrating release

git pull --rebase
npm install
forever restartall

kohrindo's People

Contributors

sairoutine avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

kohrindo's Issues

Cannot read property 'match' of undefined

https://www.melonbooks.co.jp/detail/detail.php?product_id=24357

/home/node/kohrindo/lib/external_doujin_info.js:123
                        var matches = thumbnail_path.match(/resize_image\.php\?image\=([0-9]+)(\.jp
                                                    ^
TypeError: Cannot read property 'match' of undefined
    at Object.callback (/home/node/kohrindo/lib/external_doujin_info.js:123:32)
    at Object.<anonymous> (/home/node/kohrindo/node_modules/cheerio-httpcli/lib/client.js:247:17)
    at /home/node/kohrindo/node_modules/cheerio-httpcli/lib/client.js:164:11
    at Unzip.onEnd (zlib.js:227:5)
    at Unzip.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)
error: Forever detected script exited with code: 1

Failed to find request token in session

{"name":"kohrindo","hostname":"ap001","pid":32938,"level":50,"user_id":0,"path":"/auth/twitter/callback?oauth_token=mmxwdwaaaaaagkgbaaabutzsgsy&oauth_verifier=lpfyws4lodemcnkdvyq38rhasol4m979","message":"Error: Failed to find request token in session\n    at Strategy.OAuthStrategy.authenticate (/home/node/kohrindo/node_modules/passport-twitter/node_modules/passport-oauth1/lib/strategy.js:142:54)\n    at Strategy.authenticate (/home/node/kohrindo/node_modules/passport-twitter/lib/strategy.js:85:40)\n    at attempt (/home/node/kohrindo/node_modules/passport/lib/middleware/authenticate.js:348:16)\n    at authenticate (/home/node/kohrindo/node_modules/passport/lib/middleware/authenticate.js:349:7)\n    at Layer.handle [as handle_request] (/home/node/kohrindo/node_modules/express/lib/router/layer.js:95:5)\n    at next (/home/node/kohrindo/node_modules/express/lib/router/route.js:131:13)\n    at Route.dispatch (/home/node/kohrindo/node_modules/express/lib/router/route.js:112:3)\n    at Layer.handle [as handle_request] (/home/node/kohrindo/node_modules/express/lib/router/layer.js:95:5)\n    at /home/node/kohrindo/node_modules/express/lib/router/index.js:277:22\n    at Function.process_params (/home/node/kohrindo/node_modules/express/lib/router/index.js:330:12)\n    at next (/home/node/kohrindo/node_modules/express/lib/router/index.js:271:10)\n    at /home/node/kohrindo/node_modules/express/lib/router/index.js:618:15\n    at next (/home/node/kohrindo/node_modules/express/lib/router/index.js:256:14)\n    at Function.handle (/home/node/kohrindo/node_modules/express/lib/router/index.js:176:3)\n    at router (/home/node/kohrindo/node_modules/express/lib/router/index.js:46:12)\n    at Layer.handle [as handle_request] (/home/node/kohrindo/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/home/node/kohrindo/node_modules/express/lib/router/index.js:312:13)\n    at /home/node/kohrindo/node_modules/express/lib/router/index.js:280:7\n    at Function.process_params (/home/node/kohrindo/node_modules/express/lib/router/index.js:330:12)\n    at next (/home/node/kohrindo/node_modules/express/lib/router/index.js:271:10)\n    at module.exports (/home/node/kohrindo/middleware/override-render.js:68:5)\n    at Layer.handle [as handle_request] (/home/node/kohrindo/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/home/node/kohrindo/node_modules/express/lib/router/index.js:312:13)\n    at /home/node/kohrindo/node_modules/express/lib/router/index.js:280:7\n    at Function.process_params (/home/node/kohrindo/node_modules/express/lib/router/index.js:330:12)\n    at next (/home/node/kohrindo/node_modules/express/lib/router/index.js:271:10)\n    at SessionStrategy.strategy.pass (/home/node/kohrindo/node_modules/passport/lib/middleware/authenticate.js:325:9)\n    at SessionStrategy.authenticate (/home/node/kohrindo/node_modules/passport/lib/strategies/session.js:71:10)\n    at attempt (/home/node/kohrindo/node_modules/passport/lib/middleware/authenticate.js:348:16)\n    at authenticate (/home/node/kohrindo/node_modules/passport/lib/middleware/authenticate.js:349:7)\n    at Layer.handle [as handle_request] (/home/node/kohrindo/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/home/node/kohrindo/node_modules/express/lib/router/index.js:312:13)\n    at /home/node/kohrindo/node_modules/express/lib/router/index.js:280:7\n    at Function.process_params (/home/node/kohrindo/node_modules/express/lib/router/index.js:330:12)","msg":"","time":"2015-11-25T04:36:15.565Z","v":0}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.