Force build new nginx without confd
This commit is contained in:
@@ -632,6 +632,7 @@ class AppBase:
|
|||||||
|
|
||||||
# I wonder if this actually works
|
# I wonder if this actually works
|
||||||
url = "%s%s" % (self.base_url, stream_path)
|
url = "%s%s" % (self.base_url, stream_path)
|
||||||
|
self.logger.info(f"[DEBUG][%s] Sending result to %s" % (self.current_execution_id, url))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
log_contents = "disabled: add env SHUFFLE_LOGS_DISABLED=true to Orborus to re-enable logs for apps. Can not be enabled natively in Cloud except in Hybrid mode."
|
log_contents = "disabled: add env SHUFFLE_LOGS_DISABLED=true to Orborus to re-enable logs for apps. Can not be enabled natively in Cloud except in Hybrid mode."
|
||||||
@@ -656,6 +657,13 @@ class AppBase:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Check if type of headers is right
|
||||||
|
if not isinstance(headers, dict):
|
||||||
|
headers = {}
|
||||||
|
|
||||||
|
if not "User-Agent" in headers:
|
||||||
|
headers["User-Agent"] = "Shuffle App"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
finished = False
|
finished = False
|
||||||
ret = {}
|
ret = {}
|
||||||
@@ -684,23 +692,23 @@ class AppBase:
|
|||||||
headerauth = headers["Authorization"]
|
headerauth = headers["Authorization"]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
self.logger.info(f"[ERROR] Bad resp ({ret.status_code}) in send_result for url '{url}'. Execution ID: %d, Authorization: %d, Header Auth: %d" % (len(action_result["execution_id"]), len(action_result["authorization"]), len(headerauth)))
|
self.logger.info(f"[ERROR] Bad resp ({ret.status_code}) in send_result for url '{url}'. Execution ID: %d, Authorization: %d, Header Auth: %d" % (len(action_result["execution_id"]), len(action_result["authorization"]), len(headerauth)))
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.info(f"[ERROR] Bad resp ({ret.status_code}) in send_result for url '{url}' (no detail)")
|
self.logger.info(f"[ERROR] Bad resp ({ret.status_code}) in send_result for url '{url}' (no detail)")
|
||||||
pass
|
|
||||||
|
|
||||||
time.sleep(sleeptime)
|
time.sleep(sleeptime)
|
||||||
|
|
||||||
|
|
||||||
# Proxyerrror
|
# Proxyerrror
|
||||||
except requests.exceptions.ProxyError as e:
|
except requests.exceptions.ProxyError as e:
|
||||||
|
self.logger.info(f"[ERROR][{self.current_execution_id}] Proxy error in send_result for url '{url}': {e}")
|
||||||
|
|
||||||
self.proxy_config = {}
|
self.proxy_config = {}
|
||||||
continue
|
continue
|
||||||
|
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
time.sleep(sleeptime)
|
self.logger.info(f"[ERROR][{self.current_execution_id}] Request error in send_result for url '{url}': {e}")
|
||||||
|
|
||||||
# Check if we have a read timeout. If we do, exit as we most likely sent the result without getting a good result
|
# Check if we have a read timeout. If we do, exit as we most likely sent the result without getting a good result
|
||||||
if "Read timed out" in str(e):
|
if "Read timed out" in str(e):
|
||||||
@@ -713,24 +721,34 @@ class AppBase:
|
|||||||
finished = True
|
finished = True
|
||||||
break
|
break
|
||||||
|
|
||||||
|
time.sleep(sleeptime)
|
||||||
|
|
||||||
#time.sleep(5)
|
#time.sleep(5)
|
||||||
continue
|
continue
|
||||||
except TimeoutError as e:
|
except TimeoutError as e:
|
||||||
|
self.logger.info(f"[ERROR][{self.current_execution_id}] Timeout error in send_result for url '{url}': {e}")
|
||||||
|
|
||||||
time.sleep(sleeptime)
|
time.sleep(sleeptime)
|
||||||
|
|
||||||
#time.sleep(5)
|
#time.sleep(5)
|
||||||
continue
|
continue
|
||||||
except requests.exceptions.ConnectionError as e:
|
except requests.exceptions.ConnectionError as e:
|
||||||
|
self.logger.info(f"[ERROR][{self.current_execution_id}] Connection error in send_result for url '{url}': {e}")
|
||||||
|
|
||||||
time.sleep(sleeptime)
|
time.sleep(sleeptime)
|
||||||
|
|
||||||
#time.sleep(5)
|
#time.sleep(5)
|
||||||
continue
|
continue
|
||||||
except http.client.RemoteDisconnected as e:
|
except http.client.RemoteDisconnected as e:
|
||||||
|
self.logger.info(f"[ERROR][{self.current_execution_id}] RemoteDisconnected error in send_result for url '{url}': {e}")
|
||||||
|
|
||||||
time.sleep(sleeptime)
|
time.sleep(sleeptime)
|
||||||
|
|
||||||
#time.sleep(5)
|
#time.sleep(5)
|
||||||
continue
|
continue
|
||||||
except urllib3.exceptions.ProtocolError as e:
|
except urllib3.exceptions.ProtocolError as e:
|
||||||
|
self.logger.info(f"[ERROR][{self.current_execution_id}] ProtocolError error in send_result for url '{url}': {e}")
|
||||||
|
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
#time.sleep(5)
|
#time.sleep(5)
|
||||||
@@ -3668,7 +3686,7 @@ class AppBase:
|
|||||||
#self.logger.info()
|
#self.logger.info()
|
||||||
|
|
||||||
if not multiexecution:
|
if not multiexecution:
|
||||||
self.logger.info("NOT MULTI EXEC")
|
#self.logger.info("NOT MULTI EXEC")
|
||||||
# Runs a single iteration here
|
# Runs a single iteration here
|
||||||
new_params = self.validate_unique_fields(params)
|
new_params = self.validate_unique_fields(params)
|
||||||
if isinstance(new_params, list) and len(new_params) == 1:
|
if isinstance(new_params, list) and len(new_params) == 1:
|
||||||
|
|||||||
+14
-9
@@ -25,29 +25,34 @@ COPY ./*.json /usr/src/app/
|
|||||||
RUN npm run build --loglevel verbose 2>&1
|
RUN npm run build --loglevel verbose 2>&1
|
||||||
|
|
||||||
# Production environment
|
# Production environment
|
||||||
FROM nginx:1.21.5
|
FROM nginx:1.26.0
|
||||||
|
|
||||||
RUN mkdir -p /usr/share/nginx/html/build
|
RUN mkdir -p /usr/share/nginx/html/build
|
||||||
RUN mkdir -p /usr/share/nginx/html/css
|
RUN mkdir -p /usr/share/nginx/html/css
|
||||||
RUN mkdir -p /usr/share/nginx/html/js
|
RUN mkdir -p /usr/share/nginx/html/js
|
||||||
RUN mkdir -p /usr/share/nginx/html/img
|
RUN mkdir -p /usr/share/nginx/html/img
|
||||||
|
|
||||||
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
|
|
||||||
|
|
||||||
#Localhost certificate challenge: Y#XwrJ#DoZGz2w6x
|
# Localhost certificate challenge: Y#XwrJ#DoZGz2w6x
|
||||||
|
# Cert challenge doesn't matter to be here or not, as ALL production setups should be using their own certificates + reverse proxy: https://shuffler.io/docs/configuration#using-the-nginx-reverse-proxy-for-tls/ssl
|
||||||
|
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
|
||||||
COPY --from=builder /usr/src/app/certs/fullchain.pem /etc/nginx/fullchain.cert.pem
|
COPY --from=builder /usr/src/app/certs/fullchain.pem /etc/nginx/fullchain.cert.pem
|
||||||
COPY --from=builder /usr/src/app/certs/privkey.pem /etc/nginx/privkey.pem
|
COPY --from=builder /usr/src/app/certs/privkey.pem /etc/nginx/privkey.pem
|
||||||
|
|
||||||
# install CONFD
|
# install CONFD
|
||||||
ENV CONFD_VERSION 0.16.0
|
|
||||||
RUN apt-get update && apt-get install -y curl && apt-get clean
|
RUN apt-get update && apt-get install -y curl && apt-get clean
|
||||||
RUN curl -sSL https://github.com/kelseyhightower/confd/releases/download/v${CONFD_VERSION}/confd-${CONFD_VERSION}-linux-amd64 -o /usr/local/bin/confd && \
|
COPY ./confd/templates/nginx.conf /etc/nginx/nginx.conf
|
||||||
chmod +x /usr/local/bin/confd
|
|
||||||
COPY ./confd /etc/confd
|
|
||||||
|
|
||||||
|
## OLD CONFD THINGS (not compatible with arm)
|
||||||
|
#ENV CONFD_VERSION 0.16.0
|
||||||
|
#RUN curl -sSL https://github.com/kelseyhightower/confd/releases/download/v${CONFD_VERSION}/confd-${CONFD_VERSION}-linux-amd64 -o /usr/local/bin/confd && \
|
||||||
|
# chmod +x /usr/local/bin/confd
|
||||||
|
#COPY ./confd /etc/confd
|
||||||
# rewrite command & entrypoint with ours
|
# rewrite command & entrypoint with ours
|
||||||
COPY ./entrypoint.sh /
|
#COPY ./entrypoint.sh /
|
||||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
#ENTRYPOINT [ "/entrypoint.sh" ]
|
||||||
|
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# generate configs
|
# generate configs - is this necessary?
|
||||||
/usr/local/bin/confd -backend="env" -confdir="/etc/confd" -onetime
|
# Removing confd if possible
|
||||||
|
#/usr/local/bin/confd -backend="env" -confdir="/etc/confd" -onetime
|
||||||
|
|
||||||
# run main command
|
# run main command
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user