diff --git a/NodeBase/Dockerfile.txt b/NodeBase/Dockerfile.txt index 127e580a29..21ecc7add7 100644 --- a/NodeBase/Dockerfile.txt +++ b/NodeBase/Dockerfile.txt @@ -148,4 +148,11 @@ ENV DBUS_SESSION_BUS_ADDRESS=/dev/null # Creating base directory for Xvfb RUN sudo mkdir -p /tmp/.X11-unix && sudo chmod 1777 /tmp/.X11-unix +# Copying configuration script generator +COPY generate_config /opt/bin/generate_config + +# Generating a default config during build time +RUN /opt/bin/generate_config + + EXPOSE 5900 diff --git a/NodeOpera/generate_config b/NodeBase/generate_config similarity index 64% rename from NodeOpera/generate_config rename to NodeBase/generate_config index 18d19a1808..19f038966b 100755 --- a/NodeOpera/generate_config +++ b/NodeBase/generate_config @@ -1,35 +1,29 @@ #!/bin/bash -# OPERA_VERSION=$(opera -version) - -echo "[node] -max-concurrent-sessions = ${SE_NODE_MAX_CONCURRENT_SESSIONS} -[events] +echo "[events] publish = \"tcp://${SE_EVENT_BUS_HOST}:${SE_EVENT_BUS_PUBLISH_PORT}\" subscribe = \"tcp://${SE_EVENT_BUS_HOST}:${SE_EVENT_BUS_SUBSCRIBE_PORT}\" " > /opt/selenium/config.toml - if [[ -z "${SE_NODE_HOST}" ]] || [[ -z "${SE_NODE_PORT}" ]]; then - echo "SE_NODE_HOST and SE_NODE_PORT not found." -else - echo "[server]" >> /opt/selenium/config.toml -fi - -if [[ -z "${SE_NODE_HOST}" ]] || [[ -z "${SE_NODE_PORT}" ]]; then - echo "SE_NODE_HOST and SE_NODE_PORT not found." + echo "Configuring server..." else echo "[server]" >> /opt/selenium/config.toml fi if [[ -z "${SE_NODE_HOST}" ]]; then - echo "Using default SE_NODE_HOST." + echo "Setting up SE_NODE_HOST..." else echo "hostname = \"${SE_NODE_HOST}\"" >> /opt/selenium/config.toml fi if [[ -z "${SE_NODE_PORT}" ]]; then - echo "Using default SE_NODE_PORT." + echo "Setting up SE_NODE_PORT..." else echo "port = \"${SE_NODE_PORT}\"" >> /opt/selenium/config.toml fi + +echo "[node] +max-concurrent-sessions = ${SE_NODE_MAX_CONCURRENT_SESSIONS} +" >> /opt/selenium/config.toml + diff --git a/NodeChrome/Dockerfile.txt b/NodeChrome/Dockerfile.txt index 3e4bebdab2..c5f161ab9c 100644 --- a/NodeChrome/Dockerfile.txt +++ b/NodeChrome/Dockerfile.txt @@ -46,8 +46,3 @@ RUN if [ -z "$CHROME_DRIVER_VERSION" ]; \ && mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ && chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ && sudo ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver - -COPY generate_config /opt/bin/generate_config - -# Generating a default config during build time -RUN /opt/bin/generate_config diff --git a/NodeChrome/generate_config b/NodeChrome/generate_config deleted file mode 100755 index fd20244918..0000000000 --- a/NodeChrome/generate_config +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# CHROME_VERSION=$(/usr/bin/google-chrome -version | awk '{ print $3 }') - -echo "[node] -max-concurrent-sessions = ${SE_NODE_MAX_CONCURRENT_SESSIONS} -[events] -publish = \"tcp://${SE_EVENT_BUS_HOST}:${SE_EVENT_BUS_PUBLISH_PORT}\" -subscribe = \"tcp://${SE_EVENT_BUS_HOST}:${SE_EVENT_BUS_SUBSCRIBE_PORT}\" -" > /opt/selenium/config.toml - - -if [[ -z "${SE_NODE_HOST}" ]] || [[ -z "${SE_NODE_PORT}" ]]; then - echo "SE_NODE_HOST and SE_NODE_PORT not found." -else - echo "[server]" >> /opt/selenium/config.toml -fi - -if [[ -z "${SE_NODE_HOST}" ]] || [[ -z "${SE_NODE_PORT}" ]]; then - echo "SE_NODE_HOST and SE_NODE_PORT not found." -else - echo "[server]" >> /opt/selenium/config.toml -fi - -if [[ -z "${SE_NODE_HOST}" ]]; then - echo "Using default SE_NODE_HOST." -else - echo "hostname = \"${SE_NODE_HOST}\"" >> /opt/selenium/config.toml -fi - -if [[ -z "${SE_NODE_PORT}" ]]; then - echo "Using default SE_NODE_PORT." -else - echo "port = \"${SE_NODE_PORT}\"" >> /opt/selenium/config.toml -fi diff --git a/NodeFirefox/Dockerfile.txt b/NodeFirefox/Dockerfile.txt index b6a9768069..7560565da2 100644 --- a/NodeFirefox/Dockerfile.txt +++ b/NodeFirefox/Dockerfile.txt @@ -31,15 +31,3 @@ RUN GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0. && ln -fs /opt/geckodriver-$GK_VERSION /usr/bin/geckodriver USER 1200 - -COPY generate_config /opt/bin/generate_config - -# Generating a default config during build time -RUN /opt/bin/generate_config - -#========== -# Relaxing permissions for OpenShift and other non-sudo environments -#========== -RUN sudo chmod -R 777 ${HOME} \ - && sudo chgrp -R 0 ${HOME} \ - && sudo chmod -R g=u ${HOME} diff --git a/NodeFirefox/generate_config b/NodeFirefox/generate_config deleted file mode 100755 index a68109045c..0000000000 --- a/NodeFirefox/generate_config +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -#FIREFOX_VERSION=$( firefox -version | cut -d " " -f 3 ) -#DRIVER_LOGLEVEL=${DRIVER_LOGLEVEL:-info} - -echo "[node] -max-concurrent-sessions = ${SE_NODE_MAX_CONCURRENT_SESSIONS} -[events] -publish = \"tcp://${SE_EVENT_BUS_HOST}:${SE_EVENT_BUS_PUBLISH_PORT}\" -subscribe = \"tcp://${SE_EVENT_BUS_HOST}:${SE_EVENT_BUS_SUBSCRIBE_PORT}\" -" > /opt/selenium/config.toml - - -if [[ -z "${SE_NODE_HOST}" ]] || [[ -z "${SE_NODE_PORT}" ]]; then - echo "SE_NODE_HOST and SE_NODE_PORT not found." -else - echo "[server]" >> /opt/selenium/config.toml -fi - -if [[ -z "${SE_NODE_HOST}" ]] || [[ -z "${SE_NODE_PORT}" ]]; then - echo "SE_NODE_HOST and SE_NODE_PORT not found." -else - echo "[server]" >> /opt/selenium/config.toml -fi - -if [[ -z "${SE_NODE_HOST}" ]]; then - echo "Using default SE_NODE_HOST." -else - echo "hostname = \"${SE_NODE_HOST}\"" >> /opt/selenium/config.toml -fi - -if [[ -z "${SE_NODE_PORT}" ]]; then - echo "Using default SE_NODE_PORT." -else - echo "port = \"${SE_NODE_PORT}\"" >> /opt/selenium/config.toml -fi diff --git a/NodeOpera/Dockerfile.txt b/NodeOpera/Dockerfile.txt index 4d7df13fb5..f88fc5c1a8 100644 --- a/NodeOpera/Dockerfile.txt +++ b/NodeOpera/Dockerfile.txt @@ -51,8 +51,3 @@ RUN LATEST_VERSION=$(curl -s https://api.github.com/repos/operasoftware/operachr && rm -rf /tmp/operadriver_linux64* \ && chmod 755 /opt/selenium/operadriver-${OPERA_DRIVER_VERSION} \ && sudo ln -fs /opt/selenium/operadriver-${OPERA_DRIVER_VERSION} /usr/bin/operadriver - -COPY generate_config /opt/bin/generate_config - -# Generating a default config during build time -RUN /opt/bin/generate_config