mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-21 23:20:23 +00:00
update nginx
This commit is contained in:
parent
6ef55aeb83
commit
5eb133e5b5
3 changed files with 23 additions and 6 deletions
|
@ -10,7 +10,6 @@ COPY ./config/initproxy.conf /data/nginx/proxy_host/
|
|||
#RUN touch /etc/s6-overlay/s6-rc.d/user/contents.d/init_user
|
||||
#RUN chmod -R 755 /etc/s6-overlay/s6-rc.d/init_user
|
||||
|
||||
|
||||
COPY ./s6/init_user/init_user.sh /app/init_user.sh
|
||||
RUN chmod +x /app/init_user.sh
|
||||
CMD ["/bin/sh", "-c", "/app/init_user.sh && tail -f /dev/null"]
|
|
@ -22,10 +22,28 @@ while [ -z "$token" ]; do
|
|||
done
|
||||
|
||||
echo "Change username(email)" >> /tmp/userlog
|
||||
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d '{"email": "'$username'", "nickname": "admin", "is_disabled": false, "roles": ["admin"]}' http://localhost:81/api/users/1
|
||||
while true; do
|
||||
response=$(curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d '{"email": "'$username'", "nickname": "admin", "is_disabled": false, "roles": ["admin"]}' http://localhost:81/api/users/1)
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "HTTP call successful"
|
||||
break
|
||||
else
|
||||
echo "HTTP call Change username failed, retrying..." >> /tmp/userlog
|
||||
sleep 5
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Update password" >> /tmp/userlog
|
||||
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d '{"type":"password","current":"changeme","secret":"'$password'"}' http://localhost:81/api/users/1/auth
|
||||
while true; do
|
||||
response=$(curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d '{"type":"password","current":"changeme","secret":"'$password'"}' http://localhost:81/api/users/1/auth)
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "HTTP call successful"
|
||||
break
|
||||
else
|
||||
echo "HTTP call Update password failed, retrying..." >> /tmp/userlog
|
||||
sleep 5
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Save to credential"
|
||||
json="{\"username\":\"$username\",\"password\":\"$password\"}"
|
||||
|
|
|
@ -4,7 +4,7 @@ set -e
|
|||
|
||||
trap "sleep 1; continue" ERR
|
||||
|
||||
try_times=30
|
||||
try_times=100
|
||||
counter=1
|
||||
portainer_username="admin"
|
||||
|
||||
|
@ -38,7 +38,8 @@ copy_credential() {
|
|||
|
||||
while true; do
|
||||
set +e
|
||||
|
||||
|
||||
sleep 3
|
||||
printf "Try to get credentials for %d times\n" "$counter"
|
||||
|
||||
copy_credential "websoft9-git" "/var/websoft9/credential" "websoft9-apphub" "/websoft9/credentials/credential_git"
|
||||
|
@ -56,7 +57,6 @@ while true; do
|
|||
fi
|
||||
fi
|
||||
|
||||
sleep 3
|
||||
set -e
|
||||
|
||||
counter=$((counter + 1))
|
||||
|
|
Loading…
Reference in a new issue