File tree Expand file tree Collapse file tree 5 files changed +37
-23
lines changed Expand file tree Collapse file tree 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 \
2626 && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
2727
2828COPY *.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/
3030
3131USER ${SEL_UID}
3232
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ process_name="video.recorder"
2424if [ " ${SE_VIDEO_RECORD_STANDALONE} " = " true" ]; then
2525 JQ_SESSION_ID_QUERY=" .value.nodes[]?.slots[]?.session?.sessionId"
2626 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"
2828else
2929 JQ_SESSION_ID_QUERY=" .[]?.node?.slots | .[0]?.session?.sessionId"
3030 SE_NODE_PORT=${SE_NODE_PORT:- " 5555" }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ SESSION_ID=$1
88if [ -n " ${SE_NODE_GRID_GRAPHQL_URL} " ]; then
99 GRAPHQL_ENDPOINT=${SE_NODE_GRID_GRAPHQL_URL}
1010else
11- GRAPHQL_ENDPOINT=" $( /opt/bin/video_gridUrl.sh ) "
11+ GRAPHQL_ENDPOINT=" $( python3 /opt/bin/video_gridUrl.py ) "
1212fi
1313if [[ -n ${GRAPHQL_ENDPOINT} ]] && [[ ! ${GRAPHQL_ENDPOINT} == * /graphql ]]; then
1414 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