Skip to content

Commit

Permalink
Rename BitcartCC to Bitcart (#33)
Browse files Browse the repository at this point in the history
* Rename BitcartCC to Bitcart

* Add migration scripts
  • Loading branch information
MrNaif2018 authored Sep 13, 2023
1 parent 198365a commit 3dcb44b
Show file tree
Hide file tree
Showing 59 changed files with 176 additions and 161 deletions.
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: 2.1

orbs:
bitcartcc: bitcartcc/bitcartcc-shared@1
bitcart: bitcart/bitcart-shared@2

jobs:
test:
executor: bitcartcc/docker-python
executor: bitcart/docker-python

working_directory: ~/repo

Expand All @@ -23,11 +23,11 @@ jobs:
command: |
make ci
- bitcartcc/codecov:
- bitcart/codecov:
args: ""

cansetup:
executor: bitcartcc/build-ubuntu
executor: bitcart/build-ubuntu
working_directory: ~/repo
steps:
- checkout
Expand All @@ -38,7 +38,7 @@ jobs:
sudo ./test-install.sh
deploy:
executor: bitcartcc/build-ubuntu
executor: bitcart/build-ubuntu

environment:
BUILD_PLATFORMS: linux/amd64,linux/arm64/v8
Expand All @@ -47,23 +47,23 @@ jobs:

steps:
- checkout
- bitcartcc/login-to-registries
- bitcartcc/enable-buildx
- bitcart/login-to-registries
- bitcart/enable-buildx
- run:
name: build docker image
command: |
cd generator
docker buildx build --progress plain --push --platform ${BUILD_PLATFORMS} --tag bitcartcc/docker-compose-generator:latest \
--tag ghcr.io/bitcartcc/docker-compose-generator:latest \
--tag harbor.nirvati.org/bitcartcc/docker-compose-generator:latest .
docker buildx build --progress plain --push --platform ${BUILD_PLATFORMS} --tag bitcart/docker-compose-generator:latest \
--tag ghcr.io/bitcart/docker-compose-generator:latest \
--tag harbor.nirvati.org/bitcart/docker-compose-generator:latest .
workflows:
version: 2
build:
jobs:
- bitcartcc/lint:
- bitcart/lint:
name: lint
executor: bitcartcc/build-ubuntu
executor: bitcart/build-ubuntu
- test:
requires:
- lint
Expand Down
4 changes: 2 additions & 2 deletions .circleci/test-connectivity.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

echo "Trying to connect to bitcartcc..."
echo "Trying to connect to bitcart..."
while true; do
if [ "$(curl -sL -w "%{http_code}\\n" "http://localhost/api" -o /dev/null)" == "200" ]; then
echo "Successfully contacted BitcartCC"
echo "Successfully contacted Bitcart"
break
fi
sleep 1
Expand Down
2 changes: 1 addition & 1 deletion .circleci/test-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export BITCART_CRYPTOS=btc,ltc
export BITCART_REVERSEPROXY=nginx
export BTC_LIGHTNING=true
# Use current repo's generator
export BITCARTGEN_DOCKER_IMAGE=bitcartcc/docker-compose-generator:local
export BITCARTGEN_DOCKER_IMAGE=bitcart/docker-compose-generator:local
./setup.sh

timeout 1m bash .circleci/test-connectivity.sh
Expand Down
66 changes: 33 additions & 33 deletions README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ function display_help() {
cat <<-END
Usage:
------
Backup BitcartCC files
Backup Bitcart files
This script must be run as root
-h, --help: Show help
--only-db: Backup database only. Default: false
--restart: Restart BitcartCC (to avoid data corruption if needed). Default: false
--restart: Restart Bitcart (to avoid data corruption if needed). Default: false
This script will backup the database as SQL script, essential volumes and put it to tar.gz archive
It may optionally upload the backup to a remote server
Environment variables:
Expand Down Expand Up @@ -88,7 +88,7 @@ if $ONLY_DB; then
tar -cvzf $backup_path $dbdump_path
else
if $RESTART_SERVICES; then
echo "Stopping BitcartCC"
echo "Stopping Bitcart"
bitcart_stop
fi

Expand All @@ -106,7 +106,7 @@ else
-C "$BITCART_BASE_DIRECTORY/compose" plugins

if $RESTART_SERVICES; then
echo "Restarting BitcartCC"
echo "Restarting Bitcart"
bitcart_start
fi
fi
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -e

: "${BITCARTGEN_DOCKER_IMAGE:=bitcartcc/docker-compose-generator}"
if [ "$BITCARTGEN_DOCKER_IMAGE" == "bitcartcc/docker-compose-generator:local" ]; then
: "${BITCARTGEN_DOCKER_IMAGE:=bitcart/docker-compose-generator}"
if [ "$BITCARTGEN_DOCKER_IMAGE" == "bitcart/docker-compose-generator:local" ]; then
docker build generator --tag $BITCARTGEN_DOCKER_IMAGE
else
set +e
docker pull $BITCARTGEN_DOCKER_IMAGE
docker rmi $(docker images bitcartcc/docker-compose-generator --format "{{.Tag}};{{.ID}}" | grep "^<none>" | cut -f2 -d ';') >/dev/null 2>&1
docker rmi $(docker images bitcart/docker-compose-generator --format "{{.Tag}};{{.ID}}" | grep "^<none>" | cut -f2 -d ';') >/dev/null 2>&1
set -e
fi

Expand Down
2 changes: 1 addition & 1 deletion cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker image prune -af --filter "label=org.bitcartcc.image" --filter "label!=org.bitcartcc.image=docker-compose-generator"
docker image prune -af --filter "label=org.bitcart.image" --filter "label!=org.bitcart.image=docker-compose-generator"
2 changes: 1 addition & 1 deletion compose/Dockerfile-coin.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.{{ env.name }}{{ if env.custom == "false" and env.coin != "btc" then "-"+env.coin else "" end }}
ENV IN_DOCKER=1
ENV {{ env.coin | ascii_upcase }}_HOST 0.0.0.0
LABEL org.bitcartcc.image={{ env.coin }}-daemon
LABEL org.bitcart.image={{ env.coin }}-daemon

FROM base AS compile-image

Expand Down
4 changes: 2 additions & 2 deletions compose/admin-plugins.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM bitcartcc/bitcart-admin:original
FROM bitcart/bitcart-admin:original

USER root
COPY plugins/admin modules
COPY scripts/install-ui-plugins.sh /usr/local/bin/
RUN install-ui-plugins.sh
USER node
LABEL org.bitcartcc.plugins=true
LABEL org.bitcart.plugins=true
4 changes: 2 additions & 2 deletions compose/backend-plugins.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM bitcartcc/bitcart:original
FROM bitcart/bitcart:original

COPY plugins/backend modules
COPY scripts/install-backend-plugins.sh /usr/local/bin/
RUN bash install-backend-plugins.sh
LABEL org.bitcartcc.plugins=true
LABEL org.bitcart.plugins=true
4 changes: 2 additions & 2 deletions compose/backend.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM golang:1.18-alpine AS go-builder

RUN CGO_ENABLED=0 go install -ldflags '-X main.Version=docker -X main.envFile=/app/conf/.env' github.com/bitcartcc/bitcart-cli@master
RUN CGO_ENABLED=0 go install -ldflags '-X main.Version=docker -X main.envFile=/app/conf/.env' github.com/bitcart/bitcart-cli@master

FROM python:3.9-slim-bullseye

ARG TARGETPLATFORM
ENV IN_DOCKER=1
ENV GOSU_VERSION 1.16
LABEL org.bitcartcc.image=backend
LABEL org.bitcart.image=backend

COPY bitcart /app
COPY scripts/docker-entrypoint.sh /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion compose/bch.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.electron-cash
ENV IN_DOCKER=1
ENV BCH_HOST 0.0.0.0
LABEL org.bitcartcc.image=bch-daemon
LABEL org.bitcart.image=bch-daemon

FROM base AS compile-image

Expand Down
2 changes: 1 addition & 1 deletion compose/bnb.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.bitcart-bnb
ENV IN_DOCKER=1
ENV BNB_HOST 0.0.0.0
LABEL org.bitcartcc.image=bnb-daemon
LABEL org.bitcart.image=bnb-daemon

FROM base AS compile-image

Expand Down
2 changes: 1 addition & 1 deletion compose/bsty.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.electrum-bsty
ENV IN_DOCKER=1
ENV BSTY_HOST 0.0.0.0
LABEL org.bitcartcc.image=bsty-daemon
LABEL org.bitcart.image=bsty-daemon

FROM base AS compile-image

Expand Down
2 changes: 1 addition & 1 deletion compose/btc.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.electrum
ENV IN_DOCKER=1
ENV BTC_HOST 0.0.0.0
LABEL org.bitcartcc.image=btc-daemon
LABEL org.bitcart.image=btc-daemon

FROM base AS compile-image

Expand Down
2 changes: 1 addition & 1 deletion compose/eth.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.bitcart-eth
ENV IN_DOCKER=1
ENV ETH_HOST 0.0.0.0
LABEL org.bitcartcc.image=eth-daemon
LABEL org.bitcart.image=eth-daemon

FROM base AS compile-image

Expand Down
2 changes: 1 addition & 1 deletion compose/grs.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.electrum-grs
ENV IN_DOCKER=1
ENV GRS_HOST 0.0.0.0
LABEL org.bitcartcc.image=grs-daemon
LABEL org.bitcart.image=grs-daemon

FROM base AS compile-image

Expand Down
2 changes: 1 addition & 1 deletion compose/ltc.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.electrum-ltc
ENV IN_DOCKER=1
ENV LTC_HOST 0.0.0.0
LABEL org.bitcartcc.image=ltc-daemon
LABEL org.bitcart.image=ltc-daemon

FROM base AS compile-image

Expand Down
2 changes: 1 addition & 1 deletion compose/matic.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.bitcart-matic
ENV IN_DOCKER=1
ENV MATIC_HOST 0.0.0.0
LABEL org.bitcartcc.image=matic-daemon
LABEL org.bitcart.image=matic-daemon

FROM base AS compile-image

Expand Down
2 changes: 1 addition & 1 deletion compose/sbch.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.bitcart-sbch
ENV IN_DOCKER=1
ENV SBCH_HOST 0.0.0.0
LABEL org.bitcartcc.image=sbch-daemon
LABEL org.bitcart.image=sbch-daemon

FROM base AS compile-image

Expand Down
12 changes: 6 additions & 6 deletions compose/scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/usr/bin/env sh
set -ex

# BitcartCC is configuring current instance or updating it via SSH access
# Bitcart is configuring current instance or updating it via SSH access

if [ ! -z "$SSH_KEY_FILE" ] && ! [ -f "$SSH_KEY_FILE" ]; then
echo "Creating BitcartCC SSH key File..."
ssh-keygen -t ed25519 -f "$SSH_KEY_FILE" -q -P "" -m PEM -C bitcartcc >/dev/null
echo "Creating Bitcart SSH key File..."
ssh-keygen -t ed25519 -f "$SSH_KEY_FILE" -q -P "" -m PEM -C bitcart >/dev/null
if [ -f "$SSH_AUTHORIZED_KEYS" ]; then
# Because the file is mounted, sed -i does not work
sed '/bitcartcc$/d' "$SSH_AUTHORIZED_KEYS" >"$SSH_AUTHORIZED_KEYS.new"
sed '/bitcart$/d' "$SSH_AUTHORIZED_KEYS" >"$SSH_AUTHORIZED_KEYS.new"
cat "$SSH_AUTHORIZED_KEYS.new" >"$SSH_AUTHORIZED_KEYS"
rm -rf "$SSH_AUTHORIZED_KEYS.new"
fi
fi

if [ ! -z "$SSH_KEY_FILE" ] && [ -f "$SSH_AUTHORIZED_KEYS" ] && ! grep -q "bitcartcc$" "$SSH_AUTHORIZED_KEYS"; then
echo "Adding BitcartCC SSH key to authorized keys"
if [ ! -z "$SSH_KEY_FILE" ] && [ -f "$SSH_AUTHORIZED_KEYS" ] && ! grep -q "bitcart$" "$SSH_AUTHORIZED_KEYS"; then
echo "Adding Bitcart SSH key to authorized keys"
cat "$SSH_KEY_FILE.pub" >>"$SSH_AUTHORIZED_KEYS"
fi

Expand Down
2 changes: 1 addition & 1 deletion compose/scripts/generate-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -Eeuo pipefail
images="compose/scripts/.images.json"

if [ ! -f "$images" ] || [ ! "$#" -eq 0 ]; then
wget -qO "$images" 'https://raw.githubusercontent.com/bitcartcc/bitcart/master/.circleci/images.json'
wget -qO "$images" 'https://raw.githubusercontent.com/bitcart/bitcart/master/.circleci/images.json'
fi

generated_warning() {
Expand Down
2 changes: 1 addition & 1 deletion compose/scripts/install-ui-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ for org in modules/*; do
if [ -d "$org" ]; then
for plugin in "$org"/*; do
if [ -d "$plugin" ]; then
if [ "$plugin" = "modules/@bitcartcc/core" ]; then
if [ "$plugin" = "modules/@bitcart/core" ]; then
continue
fi
found=true
Expand Down
4 changes: 2 additions & 2 deletions compose/store-plugins.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM bitcartcc/bitcart-store:original
FROM bitcart/bitcart-store:original

USER root
COPY plugins/store modules
COPY scripts/install-ui-plugins.sh /usr/local/bin/
RUN install-ui-plugins.sh
USER node
LABEL org.bitcartcc.plugins=true
LABEL org.bitcart.plugins=true
2 changes: 1 addition & 1 deletion compose/trx.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.bitcart-trx
ENV IN_DOCKER=1
ENV TRX_HOST 0.0.0.0
LABEL org.bitcartcc.image=trx-daemon
LABEL org.bitcart.image=trx-daemon

FROM base AS compile-image

Expand Down
2 changes: 1 addition & 1 deletion compose/xmr.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.bitcart-xmr
ENV IN_DOCKER=1
ENV XMR_HOST 0.0.0.0
LABEL org.bitcartcc.image=xmr-daemon
LABEL org.bitcart.image=xmr-daemon

FROM base AS compile-image

Expand Down
2 changes: 1 addition & 1 deletion compose/xrg.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV ELECTRUM_HOME /home/$ELECTRUM_USER
ENV ELECTRUM_DIRECTORY ${ELECTRUM_HOME}/.oregano
ENV IN_DOCKER=1
ENV XRG_HOST 0.0.0.0
LABEL org.bitcartcc.image=xrg-daemon
LABEL org.bitcart.image=xrg-daemon

FROM base AS compile-image

Expand Down
6 changes: 3 additions & 3 deletions contrib/upgrades/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Upgrade helpers

This directory contains a list of files to help upgrade to various BitcartCC versions.
This directory contains a list of files to help upgrade to various Bitcart versions.

To apply any fix (note, scripts are one-time only in most cases), just run:

Expand All @@ -10,7 +10,7 @@ Your docker deployment should be running.

Current list:

- `upgrade-to-5000.sh`, helps to upgrade to BitcartCC 0.5.0.0, run this in case you get a migration error (invalid foreign key constraints names). It might be required for older BitcartCC deployments, requires a running database container
- `upgrade-to-0600.sh`, helps to upgrade to BitcartCC 0.6.0.0, run this if you need to migrate your logs and images
- `upgrade-to-5000.sh`, helps to upgrade to Bitcart 0.5.0.0, run this in case you get a migration error (invalid foreign key constraints names). It might be required for older Bitcart deployments, requires a running database container
- `upgrade-to-0600.sh`, helps to upgrade to Bitcart 0.6.0.0, run this if you need to migrate your logs and images
- `upgrade-to-0610.sh`, helps to change postgresql config to allow password-less login
- `upgrade-to-0680.sh`, helps to fix permissions on tor hidden services volumes
11 changes: 11 additions & 0 deletions contrib/upgrades/upgrade-to-0800.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
. "${SCRIPT_DIR}/../../helpers.sh"
load_env

try rm /etc/profile.d/bitcartcc-env$SCRIPTS_POSTFIX.sh
try rm $HOME/bitcartcc-env$SCRIPTS_POSTFIX.sh
try systemctl disable bitcartcc$SCRIPTS_POSTFIX.service
try systemctl stop bitcartcc$SCRIPTS_POSTFIX.service
try rm /etc/systemd/system/bitcartcc$SCRIPTS_POSTFIX.service
try systemctl daemon-reload
2 changes: 1 addition & 1 deletion dev-setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
sudo apt install -y git
branch=${1:-master}
rm -rf compose/bitcart && git clone --depth=1 https://github.com/bitcartcc/bitcart -b $branch compose/bitcart
rm -rf compose/bitcart && git clone --depth=1 https://github.com/bitcart/bitcart -b $branch compose/bitcart
cd compose/bitcart
rm -rf .git
cat >conf/.env <<EOF
Expand Down
2 changes: 1 addition & 1 deletion generator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.9-alpine
LABEL org.bitcartcc.image=docker-compose-generator
LABEL org.bitcart.image=docker-compose-generator
COPY . /app/generator
WORKDIR /app
RUN pip3 install -r generator/requirements.txt
Expand Down
Loading

0 comments on commit 3dcb44b

Please sign in to comment.