File tree 5 files changed +37
-23
lines changed
5 files changed +37
-23
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ RUN apt-get -qqy update \
26
26
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
27
27
28
28
COPY *.conf /etc/supervisor/conf.d/
29
- COPY --chown="${SEL_UID}:${SEL_GID}" *.sh video_ready .py /opt/bin/
29
+ COPY --chown="${SEL_UID}:${SEL_GID}" *.sh * .py /opt/bin/
30
30
31
31
USER ${SEL_UID}
32
32
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ process_name="video.recorder"
24
24
if [ " ${SE_VIDEO_RECORD_STANDALONE} " = " true" ]; then
25
25
JQ_SESSION_ID_QUERY=" .value.nodes[]?.slots[]?.session?.sessionId"
26
26
SE_NODE_PORT=${SE_NODE_PORT:- " 4444" }
27
- NODE_STATUS_ENDPOINT=" $( /opt/bin/video_gridUrl.sh ) /status"
27
+ NODE_STATUS_ENDPOINT=" $( python3 /opt/bin/video_gridUrl.py ) /status"
28
28
else
29
29
JQ_SESSION_ID_QUERY=" .[]?.node?.slots | .[0]?.session?.sessionId"
30
30
SE_NODE_PORT=${SE_NODE_PORT:- " 5555" }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ SESSION_ID=$1
8
8
if [ -n " ${SE_NODE_GRID_GRAPHQL_URL} " ]; then
9
9
GRAPHQL_ENDPOINT=${SE_NODE_GRID_GRAPHQL_URL}
10
10
else
11
- GRAPHQL_ENDPOINT=" $( /opt/bin/video_gridUrl.sh ) "
11
+ GRAPHQL_ENDPOINT=" $( python3 /opt/bin/video_gridUrl.py ) "
12
12
fi
13
13
if [[ -n ${GRAPHQL_ENDPOINT} ]] && [[ ! ${GRAPHQL_ENDPOINT} == * /graphql ]]; then
14
14
GRAPHQL_ENDPOINT=" ${GRAPHQL_ENDPOINT} /graphql"
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+ import os
3
+
4
+ def get_grid_url ():
5
+ max_time = 3
6
+ se_sub_path = os .getenv ('SE_SUB_PATH' , '' )
7
+
8
+ # If SE_SUB_PATH is "/", set it to empty string
9
+ if se_sub_path == "/" :
10
+ se_sub_path = ""
11
+
12
+ # Start with default grid URL
13
+ grid_url = os .getenv ('SE_NODE_GRID_URL' , '' )
14
+
15
+ # Check for hub/router configuration
16
+ se_hub_host = os .getenv ('SE_HUB_HOST' ) or os .getenv ('SE_ROUTER_HOST' )
17
+ se_hub_port = os .getenv ('SE_HUB_PORT' ) or os .getenv ('SE_ROUTER_PORT' )
18
+
19
+ if se_hub_host and se_hub_port :
20
+ grid_url = f"{ os .getenv ('SE_SERVER_PROTOCOL' , 'http' )} ://{ se_hub_host } :{ se_hub_port } { se_sub_path } "
21
+ # Check for standalone mode
22
+ elif (os .getenv ('DISPLAY_CONTAINER_NAME' ) and
23
+ os .getenv ('SE_VIDEO_RECORD_STANDALONE' ) == 'true' ):
24
+ display_container = os .getenv ('DISPLAY_CONTAINER_NAME' )
25
+ node_port = os .getenv ('SE_NODE_PORT' , '4444' )
26
+ grid_url = f"{ os .getenv ('SE_SERVER_PROTOCOL' , 'http' )} ://{ display_container } :{ node_port } { se_sub_path } "
27
+
28
+ # Remove trailing slash if present
29
+ grid_url = grid_url .rstrip ('/' )
30
+
31
+ return grid_url
32
+
33
+ if __name__ == "__main__" :
34
+ print (get_grid_url ())
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments