diff --git a/.circleci/config.yml b/.circleci/config.yml index d44b265..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 . @@ -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} #- 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/Dockerfile b/Dockerfile index a38ee8c..ace2567 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,19 +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 RUN unzip vanilla-${VANILLA_VERSION}.zip -d /tmp @@ -45,23 +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 +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 +#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 # Install Topcoder dependencies RUN composer install --working-dir /vanillapp/plugins/Topcoder @@ -78,24 +63,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/build.sh b/build.sh index 6a34c4b..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 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 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/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 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 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'): ?>
diff --git a/vanilla/library/core/class.controller.php b/vanilla/library/core/class.controller.php index fc6fc24..40612bb 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. @@ -2116,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 = []; }