makefile: now with login!
parent
9c75522d01
commit
bfbfa79b62
54
makefile
54
makefile
|
@ -1,23 +1,55 @@
|
||||||
all: build
|
all: build
|
||||||
build:
|
|
||||||
shards build
|
|
||||||
|
|
||||||
NAME ?= John
|
NAME ?= John
|
||||||
EMAIL ?= john@example.com
|
EMAIL ?= john@example.com
|
||||||
|
|
||||||
PASSWORD_FILE ?= /tmp/PASSWORD
|
# For requests where authentication is required.
|
||||||
DATA_DIRECTORY ?= /tmp/DATA-AUTHD
|
LOGIN ?=
|
||||||
|
ifeq ($(LOGIN),)
|
||||||
|
LOGIN_OPT =
|
||||||
|
else
|
||||||
|
LOGIN_OPT = -l $(LOGIN)
|
||||||
|
endif
|
||||||
|
|
||||||
|
##################
|
||||||
|
### SETUP COMMANDS
|
||||||
|
##################
|
||||||
|
|
||||||
|
PASSWORD_FILE ?= /tmp/PASSWORD
|
||||||
setup:
|
setup:
|
||||||
@[ -f $(PASSWORD_FILE) ] || echo -n "coucou" > $(PASSWORD_FILE)
|
@[ -f $(PASSWORD_FILE) ] || echo -n "coucou" > $(PASSWORD_FILE)
|
||||||
|
|
||||||
|
DATA_DIRECTORY ?= /tmp/DATA-AUTHD
|
||||||
run-authd: setup
|
run-authd: setup
|
||||||
./bin/authd -k /tmp/PASSWORD -R -E --storage $(DATA_DIRECTORY)
|
./bin/authd -k /tmp/PASSWORD -R -E --storage $(DATA_DIRECTORY)
|
||||||
|
|
||||||
|
# First user always is the admin.
|
||||||
|
add-first-user:
|
||||||
|
./bin/authc bootstrap $(NAME) $(EMAIL)
|
||||||
|
|
||||||
|
|
||||||
|
####################
|
||||||
|
### REQUEST EXAMPLES
|
||||||
|
####################
|
||||||
|
|
||||||
|
add-user:
|
||||||
|
./bin/authc user add $(NAME) $(EMAIL) $(LOGIN_OPT)
|
||||||
|
|
||||||
|
|
||||||
|
###################
|
||||||
|
### DEVELOPER TOOLS
|
||||||
|
###################
|
||||||
|
|
||||||
|
build-server:
|
||||||
|
shards build authd
|
||||||
|
build-client:
|
||||||
|
shards build authc
|
||||||
|
|
||||||
|
build: build-server build-client
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
crystal docs
|
crystal docs
|
||||||
|
|
||||||
|
|
||||||
HTTPD_ACCESS_LOGS ?= /tmp/access-authd-docs.log
|
HTTPD_ACCESS_LOGS ?= /tmp/access-authd-docs.log
|
||||||
HTTPD_ADDR ?= 127.0.0.1
|
HTTPD_ADDR ?= 127.0.0.1
|
||||||
HTTPD_PORT ?= 9000
|
HTTPD_PORT ?= 9000
|
||||||
|
@ -25,27 +57,15 @@ DIR ?= docs
|
||||||
serve-doc:
|
serve-doc:
|
||||||
darkhttpd $(DIR) --addr $(HTTPD_ADDR) --port $(HTTPD_PORT) --log $(HTTPD_ACCESS_LOGS)
|
darkhttpd $(DIR) --addr $(HTTPD_ADDR) --port $(HTTPD_PORT) --log $(HTTPD_ACCESS_LOGS)
|
||||||
|
|
||||||
# First user always is the admin.
|
|
||||||
add-first-user:
|
|
||||||
./bin/authc bootstrap $(NAME) $(EMAIL)
|
|
||||||
|
|
||||||
add-user:
|
|
||||||
./bin/authc user add $(NAME) $(EMAIL)
|
|
||||||
|
|
||||||
print-messages:
|
print-messages:
|
||||||
cat src/requests/*.cr | ./bin/get-messages.awk
|
cat src/requests/*.cr | ./bin/get-messages.awk
|
||||||
|
|
||||||
print-message-numbers:
|
print-message-numbers:
|
||||||
make -s print-messages | grep -E "^[0-9]" | sort -n
|
make -s print-messages | grep -E "^[0-9]" | sort -n
|
||||||
|
|
||||||
print-messages-without-comments:
|
print-messages-without-comments:
|
||||||
make -s print-messages | grep -vE '^[[:blank:]]+#'
|
make -s print-messages | grep -vE '^[[:blank:]]+#'
|
||||||
|
|
||||||
print-response-messages:
|
print-response-messages:
|
||||||
cat src/responses/*.cr | ./bin/get-messages.awk
|
cat src/responses/*.cr | ./bin/get-messages.awk
|
||||||
|
|
||||||
print-response-message-numbers:
|
print-response-message-numbers:
|
||||||
make -s print-response-messages | grep -E "^[0-9]" | sort -n
|
make -s print-response-messages | grep -E "^[0-9]" | sort -n
|
||||||
|
|
||||||
print-response-messages-without-comments:
|
print-response-messages-without-comments:
|
||||||
make -s print-response-messages | grep -vE '^[[:blank:]]+#'
|
make -s print-response-messages | grep -vE '^[[:blank:]]+#'
|
||||||
|
|
Loading…
Reference in New Issue