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

Makefile .env support #208

Merged
merged 23 commits into from
Mar 20, 2021
Merged
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
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ ifeq ($(shell uname), Darwin)
DOCKER=docker
endif

# Load dotenv configuration
ifneq (,$(wildcard ./.env))
include .env
export
endif

# Default proxeus environment
export PROXEUS_TEST_MODE?=false
export PROXEUS_ALLOW_HTTP?=true
Expand Down Expand Up @@ -66,7 +72,7 @@ all: ui server
init:
@for d in $(dependencies); do (echo "Checking $$d is installed... " && which $$d ) || ( echo "Please install $$d before continuing" && exit 1 ); done
go install golang.org/x/tools/cmd/goimports
go install github.com/go-bindata/go-bindata/go-bindata
go install github.com/go-bindata/go-bindata/...
go install github.com/golang/mock/mockgen
go install github.com/wadey/gocovmerge
go install golang.org/x/tools/cmd/godoc
Expand Down Expand Up @@ -105,6 +111,7 @@ validate: init
.PHONY: license
license:
# https://github.com/pivotal/LicenseFinder
echo "Running LicenseFinder..."
license_finder

.PHONY: doc
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ on [GitHub](https://github.com/ProxeusApp).

# Quick Starts

## One-click builds
## Automated builds

We are making facilitated build configurations available for select cloud platforms:
We are making facilitated "one click" build configurations available for select cloud platforms:

- [Linode StackScript](deploy/linode/README.md)

Expand All @@ -30,11 +30,10 @@ The quickest way to set up Proxeus for development is to use Docker, and the `do
### Get API Keys for Infura and SparkPost

The Proxeus platform depends on [Infura](https://infura.io/) and [SparkPost](https://www.sparkpost.com/)
for Ethereum and email integration respectively.
for Ethereum and email integration respectively. Create an account on those platforms
to get API Keys. These keys need to be added to corresponding environment variables.

Please create an account on those platform and get an API Keys.

See the deployment instructions in [docs/README](docs/README.md) to set up your server.
See further deployment instructions in [docs/docker](docs/docker.md) to set up your server using Docker.

If all goes well, Proxeus should be available at http://localhost:1323

Expand Down
13 changes: 8 additions & 5 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ ensure-environment() {
if ! command -v apt-get &>/dev/null; then
log-fail "This installation script supports Debian-based systems and expects apt-get."
fi

if ! command -v docker &> /dev/null; then
log-fail "Docker needs to be installed."
fi

if ! command -v docker-compose &> /dev/null; then
log-fail "Docker Compose needs to be installed."
fi
Expand Down Expand Up @@ -69,11 +69,13 @@ install-requirements() {
apt-get update -qq >/dev/null
;;
esac

apt-get -qq -y --no-install-recommends install sudo git make software-properties-common
}

install-proxeus() {
echo "--> Starting Proxeus install"

if [[ -n $GIT_BRANCH ]]; then
install-proxeus-from-source "origin/$GIT_BRANCH"
elif [[ -n $GIT_TAG ]]; then
Expand All @@ -84,7 +86,7 @@ install-proxeus() {

install-proxeus-from-source "$GIT_TAG"
else
install-proxeus-from-source
install-proxeus-from-source
fi
}

Expand All @@ -96,6 +98,8 @@ install-proxeus-from-source() {
fi

cd ./proxeus
touch ../.env
cp ../.env .
git fetch origin
[[ -n $GIT_CHECKOUT ]] && git checkout "$GIT_CHECKOUT"
make
Expand All @@ -117,4 +121,3 @@ main() {
}

main "$@"

13 changes: 5 additions & 8 deletions deploy/linode/stackscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ log "Installing Proxeus"
mkdir -p /srv
cd /srv

wget https://raw.githubusercontent.com/ProxeusApp/proxeus-core/master/bootstrap.sh;
bash bootstrap.sh

cd proxeus
cat <<END >.env
PROXEUS_BLOCKCHAIN_CONTRACT_ADDRESS=0x1d3e5c81bf4bc60d41a8fbbb3d1bae6f03a75f71
PROXEUS_ALLOW_HTTP=true
Expand All @@ -115,12 +111,13 @@ PROXEUS_VIRTUAL_HOST=$FQDN

END

log "Starting Proxeus Core"
docker-compose up -d &
wget https://raw.githubusercontent.com/ProxeusApp/proxeus-core/master/bootstrap.sh;
bash bootstrap.sh

# In a production setting you might want to use a separate env file and/or overrides
# docker-compose --env-file .env.prod -f docker-compose.yml -f docker-compose-cloud.override.yml up -d &
cd /srv/proxeus

log "Starting Proxeus Core"
docker-compose --env-file .env -f docker-compose.yml -f docker-compose-cloud.override.yml up -d &

# Open http://$FQDN:1323/init to configure your server
log "After a minute, open: http://$FQDN:1323/init"
Expand Down
4 changes: 3 additions & 1 deletion docs/build_all.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ Here is the list of dependencies:


#### Linux (Debian)

```
sudo apt-get install make golang curl npm git license-finder-pip
sudo apt-get install make golang curl npm git
```

#### OSX
Expand Down Expand Up @@ -82,6 +83,7 @@ make all
```

### Start

Run `server`.
```
./artifacts/proxeus
Expand Down
4 changes: 3 additions & 1 deletion docs/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The Proxeus software is covered by a GNU GPLv3 license.

The license terms can be found on the [Proxeus GitHub](https://github.com/ProxeusApp/proxeus-core/blob/master/LICENSE) repository.

Follow instructions at [pivotal/LicenseFinder](https://github.com/pivotal/LicenseFinder) to install a tool, and then use `make license` to check project licenses after you add any dependencies.

## Risk of cryptographic systems

By interacting with the Software in any way, you represent that you understand the inherent risks
Expand Down Expand Up @@ -34,4 +36,4 @@ and represent that such applications can be written maliciously or negligently,
liable for your interaction with such applications and that such applications may cause the loss of
property or even identity. This warning is like others provided by Proxeus later in no way evidence or
represent an on-going duty to alert you to all of the potential risks of utilizing the Software or third party
content.
content.