mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 13:17:55 +08:00
18 lines
679 B
Bash
Executable File
18 lines
679 B
Bash
Executable File
set -eu
|
|
|
|
container=$(docker run -d --name himalaya-tests --rm -p 8080:8080 -p 143:143 stalwartlabs/stalwart:latest-alpine)
|
|
sleep 1
|
|
admin_password=$(docker logs $container 2>&1 | grep -oP "(?<=with password ')[^']+")
|
|
|
|
curl -sX POST \
|
|
-u "admin:${admin_password}" \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{"type":"domain","name":"pimalaya.org"}' \
|
|
http://localhost:8080/api/principal >/dev/null
|
|
|
|
curl -sX POST \
|
|
-u "admin:${admin_password}" \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{"type":"individual","name":"test","emails":["test@pimalaya.org"],"secrets":["test"],"roles":["user"]}' \
|
|
http://localhost:8080/api/principal >/dev/null
|