-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdemo-restart.sh
executable file
·36 lines (26 loc) · 1.17 KB
/
demo-restart.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -ex
cd /home/ubuntu/demo
git pull
sudo iptables -A INPUT -p tcp --dport 80 -j DROP
docker compose pull
docker compose down -v
docker compose up -d immich-server
until curl 127.0.0.1:2283/api/server-info/ping; do sleep 1; done
curl --location --request POST '127.0.0.1:2283/api/auth/admin-sign-up' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "demo",
"name": "John Doe"
}'
docker compose up -d
sudo iptables -D INPUT -p tcp --dport 80 -j DROP
accessToken=$(curl -d '{"email": "[email protected]", "password": "demo"}' -H "Content-Type: application/json" -X POST 127.0.0.1:2283/api/auth/login | jq -r '.accessToken')
header="Authorization: Bearer ${accessToken}"
apiKey=`curl -d '{"name": "Demo controller", "permissions": ["all"]}' -H "Content-Type: application/json" -H "$header" -X POST 127.0.0.1:2283/api/api-keys | jq -r '.secret'`
docker run --rm -v /home/ubuntu/demo/images:/import --network demo_default \
-e IMMICH_INSTANCE_URL="http://immich-server:2283/api" -e IMMICH_API_KEY="$apiKey" \
--pull always ghcr.io/immich-app/immich-cli:latest \
upload -r -h /import
docker system prune -f