Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create LICENSE #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 40 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,47 @@
FROM ubuntu:xenial
FROM debian:stretch-slim

WORKDIR /opt/
ARG USER_ID
ARG GROUP_ID

RUN apt-get update && apt-get install -y wget nginx supervisor && \
wget https://download.litecoin.org/litecoin-0.13.2/linux/litecoin-0.13.2-x86_64-linux-gnu.tar.gz && \
tar -zvxf litecoin-0.13.2-x86_64-linux-gnu.tar.gz && \
mv litecoin-0.13.2 litecoin
ENV HOME /home/litecoin

# Tuning supervisor
RUN sed -i 's/^\(\[supervisord\]\)$/\1\nnodaemon=true/' /etc/supervisor/supervisord.conf
# add user with specified (or default) user/group ids
ENV USER_ID ${USER_ID:-1000}
ENV GROUP_ID ${GROUP_ID:-1000}

# Copy supervisor conf
COPY supervisor.conf /etc/supervisor/conf.d/programs.conf
ENV VERSION 0.18.1
ENV SHASUM 540f5add987a58fe051dbe5691b3da2fd8f8594a0f5e3443864607c075ff588a
ENV ARCH x86_64-linux-gnu
ENV IGNORE_FAILED_TESTS true

# Add nginx config
ADD nginx.conf /etc/nginx/nginx.conf
RUN mkdir -p /root/.litecoin && ln -s /etc/litecoind/litecoin.conf /root/.litecoin/litecoin.conf
RUN groupadd -g ${GROUP_ID} litecoin \
&& useradd -u ${USER_ID} -g litecoin -s /bin/bash -m -d ${HOME} litecoin

EXPOSE 443
ENV PATH "/opt/litecoin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# grab gosu for easy step-down from root
RUN set -x && apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
wget \
gosu && \
cd /tmp && \
wget https://download.litecoin.org/litecoin-${VERSION}/SHA256SUMS.asc && \
wget https://download.litecoin.org/litecoin-${VERSION}/linux/litecoin-${VERSION}-${ARCH}.tar.gz && \
echo "$SHASUM SHA256SUMS.asc" | sha256sum --check && \
sha256sum --ignore-missing --check SHA256SUMS.asc && \
tar -xf litecoin-${VERSION}-${ARCH}.tar.gz && \
echo "Running tests ..." && \
litecoin-${VERSION}/bin/test_litecoin || ${IGNORE_FAILED_TESTS} && \
install -m 0755 -D -t /usr/local/bin litecoin-${VERSION}/bin/litecoind && \
install -m 0755 -D -t /usr/local/bin litecoin-${VERSION}/bin/litecoin-cli && \
install -m 0755 -D -t /usr/local/bin litecoin-${VERSION}/bin/litecoin-tx && \
install -m 0755 -D -t /usr/local/bin litecoin-${VERSION}/bin/litecoin-wallet && \
cd / && \
apt-get purge -y \
ca-certificates \
wget && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
WORKDIR ${HOME}
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["litecoind"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Blockchain ETL

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 1 addition & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,3 @@
# litecoind
Litecoind with SSL support
Litecoind

## Deploy

### Generate SSL certs

openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout server.key -out server.crt

### Prepare config

PASSWORD=`pwgen -nB 10 1`
tee litecoin.conf << EOF
onlynet=IPv4
server=1
rpcuser=rpcuser
rpcpassword=$PASSWORD
rpcport=9332
rpcconnect=127.0.0.1
disablewallet=0
printtoconsole=1
EOF

### Deploy using Docker

mkdir litecoind-ssl data
mv server.key litecoind-ssl/
mv server.crt litecoind-ssl/
docker run -d --restart=always --name=litecoind -v ./litecoin.conf:/etc/litecoind/litecoin.conf -v ./litecoind-ssl/:/etc/litecoind-ssl/ -v ./data/:/root/ kuberstack/litecoind

### Deploy using Kubernetes

kubectl create secret generic litecoind-conf --from-file=litecoin.conf
kubectl create secret generic litecoind-ssl --from-file=server.crt --from-file=server.key

git clone https://github.com/kuberstack/litecoind
$EDITOR litecoind/kubernetes/storage.yaml # Change volume-ID
kubectl create -f ./kubernetes/
12 changes: 12 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
GOSU="gosu litecoin"
# don't use gosu when id is not 0
if [ "$(id -u)" -ne "0" ];then
GOSU=""
fi
if [[ "$1" == "litecoin-cli" || "$1" == "litecoin-tx" || "$1" == "litecoind" || "$1" == "litecoin-wallet" ]]; then
exec $GOSU "$@"
else
exec $GOSU litecoind "$@"
fi
47 changes: 0 additions & 47 deletions kubernetes/controller.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions kubernetes/service.yaml

This file was deleted.

33 changes: 0 additions & 33 deletions kubernetes/storage.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions nginx.conf

This file was deleted.

19 changes: 0 additions & 19 deletions supervisor.conf

This file was deleted.