2019-09-16 09:38:33 +00:00
|
|
|
export GIT_ROOT = $(shell git rev-parse --show-toplevel)
|
2019-02-06 16:47:01 +00:00
|
|
|
|
2019-12-20 13:09:39 +00:00
|
|
|
RED := $(shell tput -Txterm setaf 1)
|
|
|
|
GRN := $(shell tput -Txterm setaf 2)
|
|
|
|
YLW := $(shell tput -Txterm setaf 3)
|
|
|
|
RST := $(shell tput -Txterm sgr0)
|
|
|
|
BLD := $(shell tput bold)
|
2019-02-06 16:47:01 +00:00
|
|
|
|
|
|
|
# Settings
|
2019-02-18 15:23:18 +00:00
|
|
|
export LOG_LEVEL ?= INFO
|
|
|
|
export LISTEN_PORT ?= 30303
|
|
|
|
export RPC_PORT ?= 8545
|
2019-11-15 09:35:26 +00:00
|
|
|
export API_MODULES ?= eth,net,web3,admin,mailserver
|
2019-02-06 16:47:01 +00:00
|
|
|
export CONTAINER_NAME ?= status-go-mailserver
|
2019-02-18 15:23:18 +00:00
|
|
|
export DATA_PATH ?= /var/tmp/status-go-mail
|
2019-04-01 12:08:52 +00:00
|
|
|
export REGISTER_TOPIC ?= whispermail
|
|
|
|
export MAIL_PASSWORD ?= status-offline-inbox
|
2019-02-06 16:47:01 +00:00
|
|
|
# Necessary to make mailserver available publicly
|
2019-02-18 15:23:18 +00:00
|
|
|
export PUBLIC_IP ?= $(shell curl -s https://ipecho.net/plain)
|
2019-02-06 16:47:01 +00:00
|
|
|
|
2020-01-23 09:33:47 +00:00
|
|
|
all: checks start show info enode enode-qr
|
2019-02-06 16:47:01 +00:00
|
|
|
|
|
|
|
checks:
|
2019-12-16 22:27:01 +00:00
|
|
|
ifeq (, $(shell which docker))
|
2019-12-20 13:09:39 +00:00
|
|
|
$(error $(RED)No 'docker' in your $$PATH. Please install it$(RST))
|
2019-12-16 22:27:01 +00:00
|
|
|
endif
|
|
|
|
ifeq (, $(shell docker version | grep Server))
|
2019-12-20 13:09:39 +00:00
|
|
|
$(error $(RED)No permissions to run 'docker'. Add yourself to docker group$(RST))
|
2019-12-16 22:27:01 +00:00
|
|
|
endif
|
2019-02-06 16:47:01 +00:00
|
|
|
ifeq (, $(shell which docker-compose))
|
2019-12-20 13:09:39 +00:00
|
|
|
$(error $(RED)No 'docker-compose' in your $$PATH. Please install it$(RST))
|
2019-02-06 16:47:01 +00:00
|
|
|
endif
|
|
|
|
ifeq (, $(shell which jq))
|
2019-12-20 13:09:39 +00:00
|
|
|
$(error $(RED)No 'jq' in your $$PATH. Please install it$(RST))
|
2019-02-06 16:47:01 +00:00
|
|
|
endif
|
|
|
|
ifndef PUBLIC_IP
|
2019-12-20 13:09:39 +00:00
|
|
|
$(error $(RED)$$PUBLIC_IP not set! Export it as environment variable$(RST))
|
2019-02-06 16:47:01 +00:00
|
|
|
endif
|
|
|
|
ifndef CONTAINER_NAME
|
2019-12-20 13:09:39 +00:00
|
|
|
$(error $(RED)$$CONTAINER_NAME not set! Export it as environment variable$(RST))
|
2019-02-06 16:47:01 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
start: config
|
|
|
|
docker-compose up -d
|
|
|
|
|
|
|
|
stop:
|
|
|
|
docker-compose down
|
|
|
|
|
|
|
|
logs:
|
|
|
|
docker-compose logs -f -t --tail=100
|
|
|
|
|
|
|
|
enode:
|
2019-09-16 09:38:33 +00:00
|
|
|
@$(GIT_ROOT)/_assets/scripts/get_enode.sh
|
2019-02-06 16:47:01 +00:00
|
|
|
|
2020-01-23 09:33:47 +00:00
|
|
|
enode-qr:
|
|
|
|
@$(GIT_ROOT)/_assets/scripts/get_enode.sh --qr
|
|
|
|
|
2019-09-16 09:38:33 +00:00
|
|
|
config:
|
|
|
|
@$(GIT_ROOT)/_assets/scripts/gen_config.sh
|
2019-02-06 16:47:01 +00:00
|
|
|
|
|
|
|
info:
|
2019-12-20 13:09:39 +00:00
|
|
|
@echo "$(GRN)Your mailserver is listening on:$(RST) $(BLD)$(PUBLIC_IP):$(LISTEN_PORT)$(RST)"
|
|
|
|
@echo "$(YLW)Make sure that address and TCP port are available from the internet!$(RST)"
|
|
|
|
@echo "$(GRN)Your enode address is:$(RST)"
|
2019-02-06 16:47:01 +00:00
|
|
|
|
|
|
|
show:
|
2019-09-16 09:38:33 +00:00
|
|
|
@docker ps \
|
|
|
|
--filter='name=$(CONTAINER_NAME)' \
|
|
|
|
--format="table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Ports}}"
|
2019-02-06 16:47:01 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
docker-compose rm -s -f
|