From cc346cdeae3ae06a77e58aafa6701eed1c8626c6 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Tue, 7 Mar 2023 15:52:24 +1100 Subject: [PATCH 01/11] Revert "Added Tideways" This reverts commit 1c2279ffdfb1b7175feb0aff7648e9e7518562ff. --- Dockerfile | 43 +++++++++++--------------------------- docker-compose.yml | 33 ++++++++++++++--------------- tideways-daemon/Dockerfile | 21 ------------------- 3 files changed, 28 insertions(+), 69 deletions(-) delete mode 100644 tideways-daemon/Dockerfile diff --git a/Dockerfile b/Dockerfile index a38ee8c..1c61967 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,18 +4,9 @@ ARG CI_DEPLOY_TOKEN ARG VANILLA_VERSION=3.3 ARG ENV ARG BRANCH -ARG TIDEWAYS_ENV -# TIDEWAYS DAEMON -ENV TIDEWAYS_SERVICE web -ENV TIDEWAYS_ENVIRONMENT=$TIDEWAYS_ENV -ENV TIDEWAYS_DAEMON_EXTRA="--env=$TIDEWAYS_ENVIRONMENT --debug" - -# VANILLA -ENV VANILLA_ENV=$ENV ENV WEB_DOCUMENT_ROOT /vanillapp -RUN echo "Tideways Daemon for '$TIDEWAYS_ENV' env" # Get the latest release of Vanilla Forums RUN wget https://github.com/vanilla/vanilla/releases/download/Vanilla_${VANILLA_VERSION}/vanilla-${VANILLA_VERSION}.zip @@ -52,11 +43,22 @@ RUN git clone --branch mfe https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platfo # then rm -R /tmp/forums-plugins/DebugPlugin; \ # fi +# Copy the Filestack plugin +RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-filestack-plugin /tmp/forums-plugins/Filestack + +#Copy the Groups plugin +RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-groups-plugin /tmp/forums-plugins/Groups + +#Copy the SumoLogic plugin +RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-sumologic-plugin /tmp/forums-plugins/Sumologic + +#Copy the TopcoderEditor plugin +RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-topcoder-editor-plugin /tmp/forums-plugins/TopcoderEditor # Copy all plugins to the Vanilla plugins folder RUN cp -r /tmp/forums-plugins/. /vanillapp/plugins -# Get the debug bar plugin +#Get the debug bar plugin RUN if [ "$ENV" = "dev" ]; then \ wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip; \ unzip KSBIPJYMC0F2.zip; \ @@ -78,24 +80,3 @@ COPY ./vanilla/. /vanillapp/. # Set permissions on config file RUN chown application:application /vanillapp/conf/config.php RUN chmod ug=rwx,o=rx /vanillapp/conf/config.php - -# Tideways -RUN apt-get update && apt-get install -yq --no-install-recommends gnupg2; -RUN echo 'deb https://packages.tideways.com/apt-packages-main any-version main' > /etc/apt/sources.list.d/tideways.list && \ - curl -L -sS 'https://packages.tideways.com/key.gpg' | apt-key add - && \ - apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get -yq install tideways-php tideways-daemon && \ - apt-get autoremove --assume-yes && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \ - echo 'extension=tideways.so\ntideways.enable_cli=0\ntideways.sample_rate=25' >> opt/docker/etc/php/php.ini; - -# Copy custom supervisor's configs and scripts -# Netcat is used to connect to a memcached server -RUN apt-get update && apt-get install -y netcat -COPY ./services/*.conf /opt/docker/etc/supervisor.d/ -COPY ./services/*.sh /opt/docker/bin/service.d/ - -# Ensure the service files are already executable -RUN chmod +x /opt/docker/bin/service.d/flush_cache.sh -RUN chmod +x /opt/docker/bin/service.d/tideways.sh \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 9819680..fcc8661 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,17 @@ -version: '3' -services: - vanilla-forums: - image: vanilla-forums:latest - container_name: vanilla-forums - env_file: - - ./vanilla.env - build: - context: . - args: - - ENV='dev' - - VANILLA_VERSION=3.3 - - CI_DEPLOY_TOKEN - - BRANCH - - TIDEWAYS_ENV - ports: - - 80:80 +version: '3' +services: + vanilla-forums: + image: vanilla-forums:latest + container_name: vanilla-forums + env_file: + - ./vanilla.env + build: + context: . + args: + - ENV + - VANILLA_VERSION=3.3 + - CI_DEPLOY_TOKEN + - BRANCH + ports: + - 80:80 - 443:443 \ No newline at end of file diff --git a/tideways-daemon/Dockerfile b/tideways-daemon/Dockerfile deleted file mode 100644 index a4bbf66..0000000 --- a/tideways-daemon/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM debian:stable-slim - -ARG TIDEWAYS_ENV -ENV TIDEWAYS_ENVIRONMENT=$TIDEWAYS_ENV -RUN echo "Tideways Daemon container for '$TIDEWAYS_ENV' env" - -RUN useradd --system tideways -RUN apt-get update && apt-get install -yq --no-install-recommends gnupg2 curl sudo ca-certificates - -RUN echo 'deb https://packages.tideways.com/apt-packages debian main' > /etc/apt/sources.list.d/tideways.list && \ - curl -L -sS 'https://packages.tideways.com/key.gpg' | apt-key add - -RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -yq tideways-daemon && \ - apt-get autoremove --assume-yes && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -EXPOSE 9135 - -USER tideways - -ENTRYPOINT ["tideways-daemon","--hostname=tideways-daemon","--address=0.0.0.0:9135"] \ No newline at end of file From 310d7b5797b52471782ba4fbde33b608f6c26fe4 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Tue, 7 Mar 2023 15:52:58 +1100 Subject: [PATCH 02/11] Revert "Issues-519: Deploy Tideways deamon in Vanilla container" This reverts commit 5d37c4d349a83d7cee028ca41e690b352ebdac5b. --- .circleci/config.yml | 2 +- Dockerfile | 1 - build.sh | 2 +- services/tideways.conf | 15 --------------- services/tideways.sh | 9 --------- 5 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 services/tideways.conf delete mode 100644 services/tideways.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index d44b265..3c2198d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,7 +31,7 @@ builddeploy_steps: &builddeploy_steps - run: *install_dependency - run: *install_deploysuite #- restore_cache: *restore_cache_settings_for_build - - run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} ${TIDEWAYS_ENV} + - run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} ${TIDEWAYS_ENVIRONMENT} #- save_cache: *save_cache_settings - deploy: name: Running MasterScript. diff --git a/Dockerfile b/Dockerfile index 1c61967..ee28ade 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,6 @@ ARG BRANCH ENV WEB_DOCUMENT_ROOT /vanillapp - # Get the latest release of Vanilla Forums RUN wget https://github.com/vanilla/vanilla/releases/download/Vanilla_${VANILLA_VERSION}/vanilla-${VANILLA_VERSION}.zip RUN unzip vanilla-${VANILLA_VERSION}.zip -d /tmp diff --git a/build.sh b/build.sh index 6a34c4b..87608fd 100755 --- a/build.sh +++ b/build.sh @@ -7,5 +7,5 @@ BRANCH=$4 TIDEWAYS_ENV=$5 UPDATE_CACHE="" echo "" > vanilla.env -ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH TIDEWAYS_ENV=$TIDEWAYS_ENV docker-compose -f docker-compose.yml build $APP_NAME +ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH TIDEWAYS_ENV=$TIDEWAYS_ENV docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME #docker create --name app $APP_NAME:latest \ No newline at end of file diff --git a/services/tideways.conf b/services/tideways.conf deleted file mode 100644 index 40e9068..0000000 --- a/services/tideways.conf +++ /dev/null @@ -1,15 +0,0 @@ -[group:tideways] -programs=tideways -priority=10 - -[program:tideways] -command=/opt/docker/bin/service.d/tideways.sh -process_name=%(program_name)s -startsecs=0 -startretries=0 -autostart=true -autorestart=false -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/services/tideways.sh b/services/tideways.sh deleted file mode 100644 index 46bee59..0000000 --- a/services/tideways.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -echo tideways.sh: Tideways Daemon for $TIDEWAYS_ENVIRONMENT -/etc/init.d/tideways-daemon start -exit_code=$? -if [ $exit_code != 0 ]; then - echo tideways.sh: exit code $exit_code -else - echo tideways.sh: started successfully. -fi \ No newline at end of file From cfc4d2fda3490a0d6e3334f0131309e79775917e Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Tue, 7 Mar 2023 15:52:58 +1100 Subject: [PATCH 03/11] Revert "Issues-570: Logging errors with Tideways" This reverts commit d923e79b2663a1929f885493d0f6c8898cccdeaa. --- vanilla/library/core/class.controller.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vanilla/library/core/class.controller.php b/vanilla/library/core/class.controller.php index fc6fc24..32dac6e 100644 --- a/vanilla/library/core/class.controller.php +++ b/vanilla/library/core/class.controller.php @@ -1733,10 +1733,6 @@ protected function _renderXml($data, $node = 'Data', $indent = '') { * @param Exception $ex The exception to render. */ public function renderException($ex) { - // FIX: https://github.com/topcoder-platform/forums/issues/570 - if (class_exists('Tideways\Profiler')) { - \Tideways\Profiler::logException($ex); - } if ($this->deliveryMethod() == DELIVERY_METHOD_XHTML) { try { // Pick our route. From 10884a81ccae4d0300a51bf2348298ca40d771df Mon Sep 17 00:00:00 2001 From: Bogdanova Olga Date: Sat, 17 Apr 2021 11:52:38 +0300 Subject: [PATCH 04/11] Revert "Updated Tideways repos" This reverts commit af95c590584191a28dd7aa34fe975f0ed0d2af82. From 323efa9ec5315a0be1c84824ec52b5e726972119 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Tue, 7 Mar 2023 15:54:52 +1100 Subject: [PATCH 05/11] Cleanup removal of tideways --- .circleci/config.yml | 4 +--- build.sh | 3 +-- docker-compose.dev.yml | 10 ---------- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c2198d..c28c27a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,7 +31,7 @@ builddeploy_steps: &builddeploy_steps - run: *install_dependency - run: *install_deploysuite #- restore_cache: *restore_cache_settings_for_build - - run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} ${TIDEWAYS_ENVIRONMENT} + - run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} #- save_cache: *save_cache_settings - deploy: name: Running MasterScript. @@ -54,7 +54,6 @@ jobs: APPNAME: "vanilla-forums" CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN BRANCH: "develop" - TIDEWAYS_ENV: "dev" steps: *builddeploy_steps "build-prod": @@ -65,7 +64,6 @@ jobs: APPNAME: "vanilla-forums" CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN BRANCH: "master" - TIDEWAYS_ENV: "production" steps: *builddeploy_steps workflows: diff --git a/build.sh b/build.sh index 87608fd..e471c0c 100755 --- a/build.sh +++ b/build.sh @@ -4,8 +4,7 @@ APP_NAME=$1 CI_DEPLOY_TOKEN=$2 ENV=$3 BRANCH=$4 -TIDEWAYS_ENV=$5 UPDATE_CACHE="" echo "" > vanilla.env -ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH TIDEWAYS_ENV=$TIDEWAYS_ENV docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME +ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME #docker create --name app $APP_NAME:latest \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 4e48415..6e1c7eb 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,13 +1,3 @@ version: '3' services: vanilla-forums: - links: - - tideways-daemon - tideways-daemon: - container_name: tideways-daemon - build: - context: ./tideways-daemon - args: - - TIDEWAYS_ENV - ports: - - 9135:9135 \ No newline at end of file From 3fab8d6e767ce3e0968fe5ceab4027e0f8e3f6c9 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Tue, 7 Mar 2023 16:01:09 +1100 Subject: [PATCH 06/11] Fix up build --- Dockerfile | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee28ade..ace2567 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,34 +35,18 @@ RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder- # Copy the forum-theme repository RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-theme.git /vanillapp/themes/topcoder -RUN git clone --branch mfe https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-theme.git /vanillapp/themes/mfe-topcoder - -# Remove DebugPlugin from PROD env -# RUN if [ "$ENV" = "prod" ]; \ -# then rm -R /tmp/forums-plugins/DebugPlugin; \ -# fi - -# Copy the Filestack plugin -RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-filestack-plugin /tmp/forums-plugins/Filestack -#Copy the Groups plugin -RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-groups-plugin /tmp/forums-plugins/Groups - -#Copy the SumoLogic plugin -RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-sumologic-plugin /tmp/forums-plugins/Sumologic - -#Copy the TopcoderEditor plugin -RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-topcoder-editor-plugin /tmp/forums-plugins/TopcoderEditor +RUN git clone --branch mfe https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-theme.git /vanillapp/themes/mfe-topcoder # Copy all plugins to the Vanilla plugins folder RUN cp -r /tmp/forums-plugins/. /vanillapp/plugins #Get the debug bar plugin -RUN if [ "$ENV" = "dev" ]; then \ - wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip; \ - unzip KSBIPJYMC0F2.zip; \ - cp -r debugbar /vanillapp/plugins; \ -fi +#RUN if [ "$ENV" = "dev" ]; then \ +# wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip; \ +# unzip KSBIPJYMC0F2.zip; \ +# cp -r debugbar /vanillapp/plugins; \ +#fi # Install Topcoder dependencies RUN composer install --working-dir /vanillapp/plugins/Topcoder From 16edee6dbd8161258b57abba7634d63f022634a6 Mon Sep 17 00:00:00 2001 From: obog Date: Fri, 10 Mar 2023 15:17:50 +0300 Subject: [PATCH 07/11] Issues-693: fixed nested categories --- .../applications/vanilla/views/categories/helper_functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vanilla/applications/vanilla/views/categories/helper_functions.php b/vanilla/applications/vanilla/views/categories/helper_functions.php index 8648128..43fcbae 100644 --- a/vanilla/applications/vanilla/views/categories/helper_functions.php +++ b/vanilla/applications/vanilla/views/categories/helper_functions.php @@ -204,7 +204,8 @@ function writeListItem($category, $depth) { + $show = false; + if ($show && $writeChildren === 'list'): ?>
From 3b0e8dc56c14c121f0a240bf4ea3d72f18f72405 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Fri, 16 Jun 2023 10:41:58 +1000 Subject: [PATCH 08/11] Make sure tideways is completely removed --- vanilla/library/core/class.controller.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vanilla/library/core/class.controller.php b/vanilla/library/core/class.controller.php index 32dac6e..40612bb 100644 --- a/vanilla/library/core/class.controller.php +++ b/vanilla/library/core/class.controller.php @@ -2112,11 +2112,6 @@ public function sendHeaders() { \Vanilla\Web\CacheControlMiddleware::sendCacheControlHeaders($this->_Headers['Cache-Control']); } - // FIX: https://github.com/topcoder-platform/forums/issues/381 - if (class_exists('Tideways\Profiler')) { - safeHeader("Server-Timing: ".\Tideways\Profiler::generateServerTimingHeaderValue(), true); - } - // Empty the collection after sending $this->_Headers = []; } From 3d121448ff01894c1dd84351c7701466847b4424 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Wed, 21 Jun 2023 17:22:18 +0530 Subject: [PATCH 09/11] root-file-system-fix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c28c27a..6c237cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ install_dependency: &install_dependency install_deploysuite: &install_deploysuite name: Installation of install_deploysuite. command: | - git clone --branch v1.4 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript + git clone --branch v1.4.15 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript cp ./../buildscript/master_deploy.sh . cp ./../buildscript/buildenv.sh . cp ./../buildscript/awsconfiguration.sh . From e01f6c4c7cb00f10857fdfa7b9334f8fe3375872 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Wed, 21 Jun 2023 18:04:28 +0530 Subject: [PATCH 10/11] Revert "root-file-system-fix" --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c237cf..c28c27a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ install_dependency: &install_dependency install_deploysuite: &install_deploysuite name: Installation of install_deploysuite. command: | - git clone --branch v1.4.15 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript + git clone --branch v1.4 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript cp ./../buildscript/master_deploy.sh . cp ./../buildscript/buildenv.sh . cp ./../buildscript/awsconfiguration.sh . From a040b240a8397cf9e0223479b44f5d3d0a906559 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Wed, 21 Jun 2023 18:05:34 +0530 Subject: [PATCH 11/11] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c28c27a..c3a12a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ install_dependency: &install_dependency install_deploysuite: &install_deploysuite name: Installation of install_deploysuite. command: | - git clone --branch v1.4 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript + git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript cp ./../buildscript/master_deploy.sh . cp ./../buildscript/buildenv.sh . cp ./../buildscript/awsconfiguration.sh .