From 8e13d2f67145d943835d7e7a06c1f22fec639e85 Mon Sep 17 00:00:00 2001 From: Alex Collin Date: Sun, 13 Feb 2022 14:33:06 +0300 Subject: [PATCH 1/8] Add resolve in Troubleshoot Unsupported SSL version on Mac --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index aef4d89..98c9781 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,23 @@ Look into your $PATH ### Troubleshoot +#### Unsupported SSL version on Mac + +When you run make, you may encounter the following error: +``` +WARNING: /Users/alex/.rvm/rubies/ruby-2.7.5/bin/ruby is loading libcrypto in an unsafe way +zsh: abort bin/rake db:reset +``` + +You need to install openssl@1.1 and update the system symlinks. +_(Tested on Mac Intel)_ +```bash +brew install openssl@1.1 +rm /usr/local/lib/libcrypto.dylib /usr/local/lib/libssl.dylib +sudo ln -s $(brew --prefix openssl@1.1)/lib/libcrypto.dylib /usr/local/lib/ +sudo ln -s $(brew --prefix openssl@1.1)/lib/libssl.dylib /usr/local/lib +``` + #### Vault If you have a problem like: @@ -189,6 +206,7 @@ brew install libpq sudo apt-get install libpq-dev ``` + ### Why it is running on localhost:8080 not www.app.local? app.local is on http by default, but auth0 accepts localhost or https From 5039d5ddc92bd119d44e5fd0cf5dbcf44ee42c50 Mon Sep 17 00:00:00 2001 From: Alex Collin Date: Sun, 13 Feb 2022 15:34:43 +0300 Subject: [PATCH 2/8] Removing irrelevant lines in the README --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 98c9781..2127a53 100644 --- a/README.md +++ b/README.md @@ -177,10 +177,6 @@ doesn't show you anything. Please setup your direnv: https://clck.ru/XR3pC -#### Rails commands don't work in peatio on macOS - -See: https://github.com/se3000/ruby-eth/issues/47 - #### Failed to build gem pg ``` From 28bd37456140e81c1a9e8d3c75ed3e749fb993b4 Mon Sep 17 00:00:00 2001 From: Alex Collin Date: Thu, 17 Feb 2022 20:31:23 +0300 Subject: [PATCH 3/8] README edit --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2127a53..bb02033 100644 --- a/README.md +++ b/README.md @@ -146,8 +146,8 @@ _(Tested on Mac Intel)_ ```bash brew install openssl@1.1 rm /usr/local/lib/libcrypto.dylib /usr/local/lib/libssl.dylib -sudo ln -s $(brew --prefix openssl@1.1)/lib/libcrypto.dylib /usr/local/lib/ -sudo ln -s $(brew --prefix openssl@1.1)/lib/libssl.dylib /usr/local/lib +sudo ln -s /usr/local/Cellar/openssl@1.1/1.1.1m/lib/libcrypto.dylib /usr/local/lib/ +sudo ln -s /usr/local/Cellar/openssl@1.1/1.1.1m/lib/libssl.dylib /usr/local/lib ``` #### Vault @@ -230,7 +230,6 @@ Member.find_each do |member| member.get_account('usd').update_columns balance: 10000, locked: 1000 member.get_account('btc').update_columns balance: 1, locked: 1 end - ``` ### How to enable 2FA? From 1046483b93a6dbb4b57e5961b1f169496c4be8d9 Mon Sep 17 00:00:00 2001 From: Alex Collin Date: Sun, 27 Feb 2022 07:09:01 +0300 Subject: [PATCH 4/8] Add Docker for fast deployment --- Dockerfile | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 3 +-- 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..81470dc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,52 @@ +FROM ubuntu:20.04 as sys +WORKDIR $HOME +RUN apt update && apt upgrade -y +RUN apt install locales +ENV TZ=Europe/Moscow +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +ENV LANG en_US.utf8 + +FROM sys as pkgs +RUN rm /bin/sh && ln -s /bin/bash /bin/sh +RUN apt install -y make wget direnv npm curl git zlib1g-dev +RUN npm install --global yarn +RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash +RUN git -C ~/.rbenv/plugins/ruby-build pull +RUN ln -s $HOME/.rbenv/bin/rbenv /usr/bin/rbenv + +FROM pkgs as build +RUN mkdir devdax +RUN eval "$(direnv hook bash)" +COPY . devdax +WORKDIR devdax + +# Replace shell with bash so we can source files +RUN rm /bin/sh && ln -s /bin/bash /bin/sh + +# Set debconf to run non-interactively +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + +# Install base dependencies +RUN apt-get update && apt-get install -y -q --no-install-recommends \ + apt-transport-https \ + build-essential \ + ca-certificates \ + curl \ + git \ + libssl-dev \ + wget \ + && rm -rf /var/lib/apt/lists/* + +ENV NVM_DIR /usr/local/nvm +ENV NODE_VERSION 16.13.1 +ENV NVM_DIR /usr/local/nvm +RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash +RUN apt install nodejs -y + +RUN make + +ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules +ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH +RUN make + diff --git a/Makefile b/Makefile index c3dfe6b..42b664e 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,7 @@ rbenv: rbenv install -s nvm: - . ${NVM_DIR}/nvm.sh && nvm install - + . ${NVM_DIR}/nvm.sh && nvm install -s .envrc: direnv allow From 87f2b8bad20207a6dec8246867ed60613fa608d3 Mon Sep 17 00:00:00 2001 From: Alex Collin Date: Sun, 27 Feb 2022 14:29:06 +0300 Subject: [PATCH 5/8] Install target node version for baseapp --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 42b664e..af118f7 100644 --- a/Makefile +++ b/Makefile @@ -9,14 +9,18 @@ UNAME := $(shell uname) all: deps setup services configure_apps -setup: .envrc submodules rbenv nvm +setup: .envrc submodules rbenv nvm yarn @echo setup rbenv: rbenv install -s nvm: - . ${NVM_DIR}/nvm.sh && nvm install -s + . ${NVM_DIR}/nvm.sh && nvm install + +yarn: + npm install --global yarn + .envrc: direnv allow @@ -64,7 +68,7 @@ init_vault: start_baseapp: echo -n -e "\033]0;baseapp\007" - cd baseapp; PORT=3002 yarn start:all + cd baseapp; nvm install; PORT=3002 yarn start:all start_baseapp_proxy: echo -n -e "\033]0;baseapp_proxy\007" From 2b03f99082fbfe3ee4173d860e950bfe4de63b41 Mon Sep 17 00:00:00 2001 From: Alex Collin Date: Tue, 1 Mar 2022 11:54:15 +0300 Subject: [PATCH 6/8] Remove yarn installation --- Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index af118f7..74970d0 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ UNAME := $(shell uname) all: deps setup services configure_apps -setup: .envrc submodules rbenv nvm yarn +setup: .envrc submodules rbenv nvm @echo setup rbenv: @@ -18,9 +18,6 @@ rbenv: nvm: . ${NVM_DIR}/nvm.sh && nvm install -yarn: - npm install --global yarn - .envrc: direnv allow From 6ebd9dd5b3c6c6d1907eee75b441f02e2fd970e9 Mon Sep 17 00:00:00 2001 From: Alex Collin Date: Tue, 1 Mar 2022 12:00:14 +0300 Subject: [PATCH 7/8] Edit README --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index bb02033..87f5e8a 100644 --- a/README.md +++ b/README.md @@ -141,14 +141,7 @@ WARNING: /Users/alex/.rvm/rubies/ruby-2.7.5/bin/ruby is loading libcrypto in an zsh: abort bin/rake db:reset ``` -You need to install openssl@1.1 and update the system symlinks. -_(Tested on Mac Intel)_ -```bash -brew install openssl@1.1 -rm /usr/local/lib/libcrypto.dylib /usr/local/lib/libssl.dylib -sudo ln -s /usr/local/Cellar/openssl@1.1/1.1.1m/lib/libcrypto.dylib /usr/local/lib/ -sudo ln -s /usr/local/Cellar/openssl@1.1/1.1.1m/lib/libssl.dylib /usr/local/lib -``` +You need to install openssl@1.1 and solve with it [this link](https://stackoverflow.com/questions/38670295/homebrew-refusing-to-link-openssl) #### Vault From d229e2cca0248b6ab357aa479949bc30349c4b3d Mon Sep 17 00:00:00 2001 From: Alex Collin Date: Tue, 1 Mar 2022 12:03:16 +0300 Subject: [PATCH 8/8] Remove docker --- Dockerfile | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 81470dc..0000000 --- a/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -FROM ubuntu:20.04 as sys -WORKDIR $HOME -RUN apt update && apt upgrade -y -RUN apt install locales -ENV TZ=Europe/Moscow -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 -ENV LANG en_US.utf8 - -FROM sys as pkgs -RUN rm /bin/sh && ln -s /bin/bash /bin/sh -RUN apt install -y make wget direnv npm curl git zlib1g-dev -RUN npm install --global yarn -RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash -RUN git -C ~/.rbenv/plugins/ruby-build pull -RUN ln -s $HOME/.rbenv/bin/rbenv /usr/bin/rbenv - -FROM pkgs as build -RUN mkdir devdax -RUN eval "$(direnv hook bash)" -COPY . devdax -WORKDIR devdax - -# Replace shell with bash so we can source files -RUN rm /bin/sh && ln -s /bin/bash /bin/sh - -# Set debconf to run non-interactively -RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections - -# Install base dependencies -RUN apt-get update && apt-get install -y -q --no-install-recommends \ - apt-transport-https \ - build-essential \ - ca-certificates \ - curl \ - git \ - libssl-dev \ - wget \ - && rm -rf /var/lib/apt/lists/* - -ENV NVM_DIR /usr/local/nvm -ENV NODE_VERSION 16.13.1 -ENV NVM_DIR /usr/local/nvm -RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash -RUN apt install nodejs -y - -RUN make - -ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules -ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH -RUN make -