diff --git a/build/deb/debian/blockbook-ethereum-testnet-ropsten.conffiles b/build/deb/debian/blockbook-ethereum-testnet-ropsten.conffiles new file mode 100644 index 00000000..1de1ede3 --- /dev/null +++ b/build/deb/debian/blockbook-ethereum-testnet-ropsten.conffiles @@ -0,0 +1 @@ +/opt/coins/blockbook/ethereum_testnet_ropsten/config/blockchaincfg.json diff --git a/build/deb/debian/blockbook-ethereum-testnet-ropsten.cron.daily b/build/deb/debian/blockbook-ethereum-testnet-ropsten.cron.daily new file mode 100644 index 00000000..90b88dea --- /dev/null +++ b/build/deb/debian/blockbook-ethereum-testnet-ropsten.cron.daily @@ -0,0 +1,2 @@ +#!/bin/sh +/opt/coins/blockbook/ethereum_testnet_ropsten/bin/logrotate.sh diff --git a/build/deb/debian/blockbook-ethereum-testnet-ropsten.dirs b/build/deb/debian/blockbook-ethereum-testnet-ropsten.dirs new file mode 100644 index 00000000..b197ca12 --- /dev/null +++ b/build/deb/debian/blockbook-ethereum-testnet-ropsten.dirs @@ -0,0 +1,2 @@ +/opt/coins/data/ethereum_testnet_ropsten/blockbook +/opt/coins/blockbook/ethereum_testnet_ropsten/logs diff --git a/build/deb/debian/blockbook-ethereum-testnet-ropsten.install b/build/deb/debian/blockbook-ethereum-testnet-ropsten.install new file mode 100755 index 00000000..d5116464 --- /dev/null +++ b/build/deb/debian/blockbook-ethereum-testnet-ropsten.install @@ -0,0 +1,6 @@ +#!/usr/bin/dh-exec +blockbook /opt/coins/blockbook/ethereum_testnet_ropsten/bin +cert /opt/coins/blockbook/ethereum_testnet_ropsten +static /opt/coins/blockbook/ethereum_testnet_ropsten +configs/ethereum_testnet_ropsten.json => /opt/coins/blockbook/ethereum_testnet_ropsten/config/blockchaincfg.json +logrotate.sh /opt/coins/blockbook/ethereum_testnet_ropsten/bin diff --git a/build/deb/debian/blockbook-ethereum-testnet-ropsten.links b/build/deb/debian/blockbook-ethereum-testnet-ropsten.links new file mode 100644 index 00000000..81565550 --- /dev/null +++ b/build/deb/debian/blockbook-ethereum-testnet-ropsten.links @@ -0,0 +1,2 @@ +/opt/coins/blockbook/ethereum_testnet_ropsten/cert/testcert.crt /opt/coins/blockbook/ethereum_testnet_ropsten/cert/blockbook.crt +/opt/coins/blockbook/ethereum_testnet_ropsten/cert/testcert.key /opt/coins/blockbook/ethereum_testnet_ropsten/cert/blockbook.key diff --git a/build/deb/debian/blockbook-ethereum-testnet-ropsten.postinst b/build/deb/debian/blockbook-ethereum-testnet-ropsten.postinst new file mode 100644 index 00000000..738dc5f7 --- /dev/null +++ b/build/deb/debian/blockbook-ethereum-testnet-ropsten.postinst @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +case "$1" in + + configure) + if ! id -u blockbook-ethereum &> /dev/null + then + useradd --system -M -U blockbook-ethereum -s /bin/false + fi + + for dir in /opt/coins/data/ethereum_testnet_ropsten/blockbook /opt/coins/blockbook/ethereum_testnet_ropsten/logs + do + if [ "$(stat -c '%U' $dir)" != "blockbook-ethereum" ] + then + chown -R blockbook-ethereum:blockbook-ethereum $dir + fi + done + ;; + +esac + +#DEBHELPER# diff --git a/build/deb/debian/blockbook-ethereum-testnet-ropsten.service b/build/deb/debian/blockbook-ethereum-testnet-ropsten.service new file mode 100644 index 00000000..9769553d --- /dev/null +++ b/build/deb/debian/blockbook-ethereum-testnet-ropsten.service @@ -0,0 +1,43 @@ +# It is not recommended to modify this file in-place, because it will +# be overwritten during package upgrades. If you want to add further +# options or overwrite existing ones then use +# $ systemctl edit blockbook-ethereum-testnet-ropsten.service +# See "man systemd.service" for details. + +[Unit] +Description=Blockbook daemon (Ethereum testnet ropsten) +After=network.target +Wants=backend-ethereum-testnet-ropsten.service + +[Service] +ExecStart=/opt/coins/blockbook/ethereum_testnet_ropsten/bin/blockbook -blockchaincfg=/opt/coins/blockbook/ethereum_testnet_ropsten/config/blockchaincfg.json -datadir=/opt/coins/data/ethereum_testnet_ropsten/blockbook/db -sync -httpserver=:19036 -socketio=:19136 -certfile=/opt/coins/blockbook/ethereum_testnet_ropsten/cert/blockbook -explorer=https://ropsten.etherscan.io/ -log_dir=/opt/coins/blockbook/ethereum_testnet_ropsten/logs +User=blockbook-ethereum +Type=simple +Restart=on-failure +WorkingDirectory=/opt/coins/blockbook/ethereum_testnet_ropsten + +# Resource limits +LimitNOFILE=500000 + +# Hardening measures +#################### + +# Provide a private /tmp and /var/tmp. +PrivateTmp=true + +# Mount /usr, /boot/ and /etc read-only for the process. +ProtectSystem=full + +# Disallow the process and all of its children to gain +# new privileges through execve(). +NoNewPrivileges=true + +# Use a new /dev namespace only populated with API pseudo devices +# such as /dev/null, /dev/zero and /dev/random. +PrivateDevices=true + +# Deny the creation of writable and executable memory mappings. +MemoryDenyWriteExecute=true + +[Install] +WantedBy=multi-user.target diff --git a/build/deb/debian/blockbook-ethereum.conffiles b/build/deb/debian/blockbook-ethereum.conffiles new file mode 100644 index 00000000..9d3fed9c --- /dev/null +++ b/build/deb/debian/blockbook-ethereum.conffiles @@ -0,0 +1 @@ +/opt/coins/blockbook/ethereum/config/blockchaincfg.json diff --git a/build/deb/debian/blockbook-ethereum.cron.daily b/build/deb/debian/blockbook-ethereum.cron.daily new file mode 100644 index 00000000..a90741d2 --- /dev/null +++ b/build/deb/debian/blockbook-ethereum.cron.daily @@ -0,0 +1,2 @@ +#!/bin/sh +/opt/coins/blockbook/ethereum/bin/logrotate.sh diff --git a/build/deb/debian/blockbook-ethereum.dirs b/build/deb/debian/blockbook-ethereum.dirs new file mode 100644 index 00000000..9dd4ebc4 --- /dev/null +++ b/build/deb/debian/blockbook-ethereum.dirs @@ -0,0 +1,2 @@ +/opt/coins/data/ethereum/blockbook +/opt/coins/blockbook/ethereum/logs diff --git a/build/deb/debian/blockbook-ethereum.install b/build/deb/debian/blockbook-ethereum.install new file mode 100755 index 00000000..0bda1fbc --- /dev/null +++ b/build/deb/debian/blockbook-ethereum.install @@ -0,0 +1,6 @@ +#!/usr/bin/dh-exec +blockbook /opt/coins/blockbook/ethereum/bin +cert /opt/coins/blockbook/ethereum +static /opt/coins/blockbook/ethereum +configs/ethereum.json => /opt/coins/blockbook/ethereum/config/blockchaincfg.json +logrotate.sh /opt/coins/blockbook/ethereum/bin diff --git a/build/deb/debian/blockbook-ethereum.links b/build/deb/debian/blockbook-ethereum.links new file mode 100644 index 00000000..9a5c6965 --- /dev/null +++ b/build/deb/debian/blockbook-ethereum.links @@ -0,0 +1,2 @@ +/opt/coins/blockbook/ethereum/cert/testcert.crt /opt/coins/blockbook/ethereum/cert/blockbook.crt +/opt/coins/blockbook/ethereum/cert/testcert.key /opt/coins/blockbook/ethereum/cert/blockbook.key diff --git a/build/deb/debian/blockbook-ethereum.postinst b/build/deb/debian/blockbook-ethereum.postinst new file mode 100644 index 00000000..87fd699b --- /dev/null +++ b/build/deb/debian/blockbook-ethereum.postinst @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +case "$1" in + + configure) + if ! id -u blockbook-ethereum &> /dev/null + then + useradd --system -M -U blockbook-ethereum -s /bin/false + fi + + for dir in /opt/coins/data/ethereum/blockbook /opt/coins/blockbook/ethereum/logs + do + if [ "$(stat -c '%U' $dir)" != "blockbook-ethereum" ] + then + chown -R blockbook-ethereum:blockbook-ethereum $dir + fi + done + ;; + +esac + +#DEBHELPER# diff --git a/build/deb/debian/blockbook-ethereum.service b/build/deb/debian/blockbook-ethereum.service new file mode 100644 index 00000000..9d6dc97d --- /dev/null +++ b/build/deb/debian/blockbook-ethereum.service @@ -0,0 +1,43 @@ +# It is not recommended to modify this file in-place, because it will +# be overwritten during package upgrades. If you want to add further +# options or overwrite existing ones then use +# $ systemctl edit blockbook-ethereum.service +# See "man systemd.service" for details. + +[Unit] +Description=Blockbook daemon (Ethereum mainnet) +After=network.target +Wants=backend-ethereum.service + +[Service] +ExecStart=/opt/coins/blockbook/ethereum/bin/blockbook -blockchaincfg=/opt/coins/blockbook/ethereum/config/blockchaincfg.json -datadir=/opt/coins/data/ethereum/blockbook/db -sync -httpserver=:9036 -socketio=:9136 -certfile=/opt/coins/blockbook/ethereum/cert/blockbook -explorer=https://etherscan.io/ -log_dir=/opt/coins/blockbook/ethereum/logs +User=blockbook-ethereum +Type=simple +Restart=on-failure +WorkingDirectory=/opt/coins/blockbook/ethereum + +# Resource limits +LimitNOFILE=500000 + +# Hardening measures +#################### + +# Provide a private /tmp and /var/tmp. +PrivateTmp=true + +# Mount /usr, /boot/ and /etc read-only for the process. +ProtectSystem=full + +# Disallow the process and all of its children to gain +# new privileges through execve(). +NoNewPrivileges=true + +# Use a new /dev namespace only populated with API pseudo devices +# such as /dev/null, /dev/zero and /dev/random. +PrivateDevices=true + +# Deny the creation of writable and executable memory mappings. +MemoryDenyWriteExecute=true + +[Install] +WantedBy=multi-user.target diff --git a/build/deb/debian/control b/build/deb/debian/control index 214557a7..851f5979 100644 --- a/build/deb/debian/control +++ b/build/deb/debian/control @@ -64,3 +64,13 @@ Package: blockbook-litecoin-testnet Architecture: amd64 Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, backend-litecoin-testnet Description: Satoshilabs blockbook server (Litecoin testnet) + +Package: blockbook-ethereum +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, backend-ethereum +Description: Satoshilabs blockbook server (Litecoin mainnet) + +Package: blockbook-ethereum-testnet +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, backend-ethereum-testnet-ropsten +Description: Satoshilabs blockbook server (Litecoin testnet)