Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
Warp Proxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Warp Proxy
Commits
f39a194f
Commit
f39a194f
authored
Sep 07, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add healthy check
parent
a9b17e15
Pipeline
#16407
passed with stages
in 2 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
+31
-5
entrypoint.sh
entrypoint.sh
+31
-5
No files found.
entrypoint.sh
View file @
f39a194f
...
...
@@ -11,16 +11,42 @@ while [[ "$daemonReady" != "0" ]]; do
done
echo
"Daemon started"
if
[[
!
-f
"/var/lib/cloudflare-warp/reg.json"
]]
;
then
initProxy
()
{
if
[[
!
-f
"/var/lib/cloudflare-warp/reg.json"
]]
;
then
if
[[
-n
"
$WARP_LICENSE
"
]]
;
then
warp-cli
--accept-tos
set-license
"
$WARP_LICENSE
"
else
warp-cli
--accept-tos
register
fi
fi
fi
warp-cli set-mode proxy
warp-cli set-proxy-port
$LOCAL_PROXY_PORT
warp-cli connect
}
watcher
()
{
workedOnce
=
0
while
true
;
do
echo
"Checking proxy status"
curl
-x
localhost:
$LOCAL_PROXY_PORT
-o
/dev/null
-s
https://www.google.com/
checkResult
=
$?
if
[[
$checkResult
-gt
0
]]
;
then
if
[[
$workedOnce
-eq
0
]]
;
then
echo
"Proxy is still starting up"
else
echo
"Proxy is down, restarting"
initProxy
fi
sleep
10
else
echo
"Proxy is up"
workedOnce
=
1
sleep
5
fi
done
}
warp-cli set-mode proxy
warp-cli set-proxy-port
$LOCAL_PROXY_PORT
warp-cli connect
initProxy
watcher &
"
$@
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment