Browse Source

supervisord implemented

master^2
deacix 8 years ago
parent
commit
bd94152cdd
  1. 1
      .gitignore
  2. 31
      docker/Dockerfile
  3. 36
      docker/Dockerfile~
  4. 6
      docker/docker-compose.yml
  5. 729
      docker/settings.json
  6. 19
      docker/supervisord.conf
  7. 3
      docker/twister.conf

1
.gitignore vendored

@ -1,2 +1,3 @@
/build-buffer /build-buffer
node_modules node_modules
.idea

31
docker/Dockerfile

@ -4,33 +4,42 @@
FROM ubuntu:14.04 FROM ubuntu:14.04
# Install twister-core WORKDIR /opt
USER root
RUN apt-get update RUN apt-get update
RUN apt-get install -y git autoconf libtool build-essential libboost-all-dev libssl-dev libdb++-dev libminiupnpc-dev && apt-get clean RUN apt-get install -y git autoconf libtool build-essential libboost-all-dev libssl-dev libdb++-dev libminiupnpc-dev \
supervisor nodejs nodejs-legacy npm && \
apt-get clean
RUN git clone https://github.com/miguelfreitas/twister-core.git RUN git clone https://github.com/miguelfreitas/twister-core.git
RUN cd twister-core && \ RUN cd twister-core && \
./bootstrap.sh && \ ./bootstrap.sh && \
make make
RUN mkdir ~/.twister
RUN echo -e "rpcuser=user\nrpcpassword=pwd\nhtmldir=~/twister-react" > ~/.twister/twister.conf
RUN chmod 600 ~/.twister/twister.conf
RUN git clone https://github.com/Tschaul/twister-react.git RUN git clone https://github.com/Tschaul/twister-react.git
RUN git clone https://github.com/Tschaul/twister-lib-js.git RUN git clone https://github.com/Tschaul/twister-lib-js.git
RUN git clone https://github.com/digital-dreamer/twister-proxy.git RUN git clone https://github.com/digital-dreamer/twister-proxy.git
RUN apt-get install -y nodejs nodejs-legacy npm
RUN npm install -g browserify react-tools RUN npm install -g browserify react-tools
RUN cd twister-lib-js \ npm install RUN cd twister-lib-js \ npm install
RUN cd twister-react \ npm install \ npm run pull-lib-and-build RUN cd twister-proxy && npm install
RUN cd twister-proxy \ npm install RUN mv twister-react/index.html twister-react/home.html
COPY settings.json twister-proxy/ COPY settings.json twister-proxy/
CMD cd twister-core \ ./twisterd & \ cd ../twister-proxy \ node twister-proxy.js & RUN mkdir -p /root/.twister
COPY twister.conf /root/.twister/twister.conf
RUN chmod 600 /root/.twister/twister.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
VOLUME ["/root/.twister"]
CMD ["/usr/bin/supervisord"]
ENTRYPOINT []
EXPOSE 80

36
docker/Dockerfile~

@ -1,36 +0,0 @@
#
# Dockerfile for building Twister peer-to-peer micro-blogging
#
FROM ubuntu:14.04
# Install twister-core
RUN apt-get update
RUN apt-get install -y git autoconf libtool build-essential libboost-all-dev libssl-dev libdb++-dev libminiupnpc-dev && apt-get clean
RUN git clone https://github.com/miguelfreitas/twister-core.git
RUN cd twister-core && \
./bootstrap.sh && \
make
RUN mkdir ~/.twister
RUN echo -e "rpcuser=user\nrpcpassword=pwd\nhtmldir=~/twister-react" > ~/.twister/twister.conf
RUN chmod 600 ~/.twister/twister.conf
RUN git clone https://github.com/Tschaul/twister-react.git
RUN git clone https://github.com/Tschaul/twister-lib-js.git
RUN git clone https://github.com/digital-dreamer/twister-proxy.git
RUN apt-get install -y nodejs nodejs-legacy npm
RUN npm install -g browserify react-tools
RUN cd twister-lib-js \ npm install
RUN cd twister-react \ npm install \ npm run pull-lib-and-build
RUN cd twister-proxy \ npm install
COPY settings.json twister-proxy/

6
docker/docker-compose.yml

@ -0,0 +1,6 @@
version: "2"
services:
twister:
build: .
ports:
- 80

729
docker/settings.json

@ -1,377 +1,368 @@
{ {
"Server": "Server": {
{ "ssl_key_file": "insert/path/to/your/server-key-file",
"ssl_key_file": "/etc/letsencrypt/live/example.com/privkey.pem", "ssl_certificate_file": "insert/path/to/your/ssl-certificate",
"ssl_certificate_file": "/etc/letsencrypt/live/example.com/cert.pem", "enable_https": false,
"ssl_chain_file": "/etc/letsencrypt/live/example.com/chain.pem",
"ssl_fullchain_file": "/etc/letsencrypt/live/example.com/fullchain.pem",
"enable_https": true,
"https_port": 443, "https_port": 443,
"http_port": 0 "http_port": 80
},
"RPC": {
"host": "localhost",
"port": 28332,
"user": "user",
"password": "pwd"
},
"CallLimits": [
{
"name": "getbestblockhash",
"maxPerMinute": null,
"maxPerMinutePerIP": null
}, },
"RPC":
{ {
"host": "localhost", "name": "getinfo",
"port": 28332, "maxPerMinute": 999,
"user": "user", "maxPerMinutePerIP": 999
"password": "pwd" },
{
"name": "listwalletusers",
"maxPerMinute": null,
"maxPerMinutePerIP": null
},
{
"name": "getblock",
"maxPerMinute": null,
"maxPerMinutePerIP": null
},
{
"name": "dhtget",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "listusernamespartial",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "gettrendinghashtags",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "stop",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getblockcount",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getconnectioncount",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getpeerinfo",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "addnode",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "adddnsseed",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getaddednodeinfo",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getdifficulty",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getgenerate",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "setgenerate",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "gethashespersec",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getmininginfo",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "createwalletuser",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "backupwallet",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "walletpassphrase",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "walletpassphrasechange",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "walletlock",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "encryptwallet",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getrawmempool",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getblockhash",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "gettransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "listtransactions",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "signmessage",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "verifymessage",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getwork",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getblocktemplate",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "submitblock",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "listsinceblock",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "dumpprivkey",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "dumppubkey",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "testvector",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "dumpwallet",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "importprivkey",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "importwallet",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getrawtransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "createrawtransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "decoderawtransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "sendrawtransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "sendnewusertransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "verifychain",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getlastsoftcheckpoint",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "dhtput",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "dhtputraw",
"maxPerMinute": 999,
"maxPerMinutePerIP": 999
},
{
"name": "newpostmsg",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "newpostraw",
"maxPerMinute": 999,
"maxPerMinutePerIP": 999
},
{
"name": "newdirectmsg",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "newrtmsg",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getposts",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "getdirectmsgs",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getmentions",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "setspammsg",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getspammsg",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "follow",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "unfollow",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getfollowing",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getlasthave",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "getnumpieces",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "rescandirectmsgs",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "recheckusertorrent",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getspamposts",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "torrentstatus",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
}, },
"CallLimits":
[
{
"name": "getbestblockhash",
"maxPerMinute": null,
"maxPerMinutePerIP": null
},
{
"name": "getinfo",
"maxPerMinute": 999,
"maxPerMinutePerIP": 999
},
{
"name": "listwalletusers",
"maxPerMinute": null,
"maxPerMinutePerIP": null
},
{
"name": "getblock",
"maxPerMinute": null,
"maxPerMinutePerIP": null
},
{
"name": "dhtget",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "listusernamespartial",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "gettrendinghashtags",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "stop",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getblockcount",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getconnectioncount",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getpeerinfo",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "addnode",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "adddnsseed",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getaddednodeinfo",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getdifficulty",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getgenerate",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "setgenerate",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "gethashespersec",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getmininginfo",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "createwalletuser",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "backupwallet",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "walletpassphrase",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "walletpassphrasechange",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "walletlock",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "encryptwallet",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getrawmempool",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getblockhash",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "gettransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "listtransactions",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "signmessage",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "verifymessage",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getwork",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getblocktemplate",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "submitblock",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "listsinceblock",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "dumpprivkey",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "dumppubkey",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "testvector",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "dumpwallet",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "importprivkey",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "importwallet",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getrawtransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "createrawtransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "decoderawtransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "sendrawtransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "sendnewusertransaction",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "verifychain",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getlastsoftcheckpoint",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "dhtput",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "dhtputraw",
"maxPerMinute": 999,
"maxPerMinutePerIP": 999
},
{
"name": "newpostmsg",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "newpostraw",
"maxPerMinute": 999,
"maxPerMinutePerIP": 999
},
{
"name": "newdirectmsg",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "newrtmsg",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getposts",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "getdirectmsgs",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getmentions",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "setspammsg",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getspammsg",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "follow",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "unfollow",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getfollowing",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getlasthave",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "getnumpieces",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "rescandirectmsgs",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "recheckusertorrent",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "getspamposts",
"maxPerMinute": 99999,
"maxPerMinutePerIP": 99999
},
{
"name": "torrentstatus",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
},
{
"name": "search",
"maxPerMinute": 0,
"maxPerMinutePerIP": null
}
],
"LogAsAttackThreshold":
{ {
"callsOverLimits": 30, "name": "search",
"invalidRequests": 30, "maxPerMinute": 0,
"forbiddenCalls": 30 "maxPerMinutePerIP": null
} }
],
"LogAsAttackThreshold": {
"callsOverLimits": 30,
"invalidRequests": 30,
"forbiddenCalls": 30
}
} }

19
docker/supervisord.conf

@ -0,0 +1,19 @@
[supervisord]
nodaemon=true
[program:twisterd]
command=/opt/twister-core/twisterd
user=root
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
priority=1
[program:twister-proxy]
command=node twister-proxy.js
user=root
directory=/opt/twister-proxy
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
priority=2

3
docker/twister.conf

@ -0,0 +1,3 @@
rpcuser=user
rpcpassword=pwd
htmldir=/opt/twister-react
Loading…
Cancel
Save