From 959dd43db1ff7aa42f7723915f9da700a3607506 Mon Sep 17 00:00:00 2001 From: mohit rajain Date: Tue, 15 Apr 2025 10:53:39 +0200 Subject: [PATCH 1/7] WPB-17187 - Test removing the old content and overwriting it --- .github/workflows/test.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 33ff4ba..7f9d46c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -41,7 +41,14 @@ jobs: run: | mkdir -p tmp_extracted tar -xzf ./wire-docs.tar.gz -C tmp_extracted + + aws s3 rm s3://${{ secrets.DEV_BUCKET }}/latest --recursive aws s3 sync tmp_extracted/latest s3://${{ secrets.DEV_BUCKET }}/latest + + + aws s3 rm s3://${{ secrets.DEV_BUCKET }}/site --recursive aws s3 sync tmp_extracted/site s3://${{ secrets.DEV_BUCKET }}/site + + aws s3 cp tmp_extracted/versions.json s3://${{ secrets.DEV_BUCKET }}/versions.json rm -rf tmp_extracted From 4d1159f155d175c42f6d41278a6b55b4906586d8 Mon Sep 17 00:00:00 2001 From: Mohit Rajain <20745774+mohitrajain@users.noreply.github.com> Date: Wed, 16 Apr 2025 13:01:45 +0200 Subject: [PATCH 2/7] WPB-17187: clean s3 uploads and removing extra content --- .github/workflows/build.yaml | 10 ++++++++-- .github/workflows/test.yaml | 6 ++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0e98703..74af86d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: CI Build +name: Prod Env Latest Build on: pull_request: @@ -41,7 +41,13 @@ jobs: run: | mkdir -p tmp_extracted tar -xzf ./wire-docs.tar.gz -C tmp_extracted + + # removing old objects from the bucket to ensure, we don't keep objects at old path + aws s3 rm s3://${{ secrets.BUCKET }}/latest --recursive aws s3 sync tmp_extracted/latest s3://${{ secrets.BUCKET }}/latest - aws s3 sync tmp_extracted/site s3://${{ secrets.BUCKET }}/site + + # will be removed in the next commit + aws s3 rm s3://${{ secrets.BUCKET }}/site --recursive + aws s3 cp tmp_extracted/versions.json s3://${{ secrets.BUCKET }}/versions.json rm -rf tmp_extracted diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7f9d46c..214c99c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,4 +1,4 @@ -name: CI Build +name: Test Env Latest Build on: pull_request: @@ -42,13 +42,11 @@ jobs: mkdir -p tmp_extracted tar -xzf ./wire-docs.tar.gz -C tmp_extracted + # removing old objects from the bucket to ensure, we don't keep objects at old path aws s3 rm s3://${{ secrets.DEV_BUCKET }}/latest --recursive aws s3 sync tmp_extracted/latest s3://${{ secrets.DEV_BUCKET }}/latest - aws s3 rm s3://${{ secrets.DEV_BUCKET }}/site --recursive - aws s3 sync tmp_extracted/site s3://${{ secrets.DEV_BUCKET }}/site - aws s3 cp tmp_extracted/versions.json s3://${{ secrets.DEV_BUCKET }}/versions.json rm -rf tmp_extracted From d2e6853b8c3970c8b58fbf59b7f8e98eba8bb11a Mon Sep 17 00:00:00 2001 From: Mohit Rajain <20745774+mohitrajain@users.noreply.github.com> Date: Wed, 16 Apr 2025 13:04:18 +0200 Subject: [PATCH 3/7] WPB-17187: removed support to rebuild old tags with new scripts --- Makefile | 1 - build/build_versions.sh | 80 ++++++++++++++++++++++------------------- build/prepare.sh | 3 +- 3 files changed, 46 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index dd2883d..0102dbc 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,6 @@ check-deps: # fetch all the tags from the remote .PHONY: prepare prepare: check-deps - @git fetch --tags @bash build/prepare.sh # Run the all versions of the documentation diff --git a/build/build_versions.sh b/build/build_versions.sh index 81bca08..96baaa1 100644 --- a/build/build_versions.sh +++ b/build/build_versions.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -ex +set -e mike="pipenv run mike" CURRENT=$(git branch --show-current) @@ -10,8 +10,26 @@ git config --local user.name "Wire Docs" git config --local user.email "wire-docs-author@wire.com" git config --local submodule.recurse false +# this will check if there are warnings in mkdocs build, if any it will exit. +# It will be useful to find if internal referencing is broken +validate_output() { + local RED='\033[0;31m' + local output="$1" + # to get building logs + echo "$output" + # ignoring changelog.md as it is talking about past changes + remaining_warnings=$(echo "$output" | grep -i "WARNING" | grep -v "Doc file 'changelog/changelog.md' contains a link" | awk '{$1=$1};1') + + if [ -n "$remaining_warnings" ]; then + echo -e "${RED}Errors found in the output:" + echo "$remaining_warnings" + exit 1 + fi +} + # checking if it is building from a branch if [ -n "$CURRENT" ]; then + # if building locally, the local tag would be CURRENT_TAG CURRENT_TAG="$CURRENT" # useful for local users to see their diffs with each mike deploy @@ -31,22 +49,14 @@ else if [[ "${GITHUB_REF}" == refs/tags/* ]]; then # For a tag, strip the "refs/tags/" prefix. CURRENT_TAG="${GITHUB_REF#refs/tags/}" - # creating a tag when releasing a tag - git tag -f $CURRENT_TAG || true elif [[ "${GITHUB_REF}" == refs/pull/* ]]; then - # For a pull request, remove "refs/pull/" then replace "/" with "-" to get "11-merge" - pr_part="${GITHUB_REF#refs/pull/}"s - CURRENT_TAG="${pr_part//\//-}" + # we build latest everytime there is PR + CURRENT_TAG="latest" fi fi - fi -# always build the latest tag -git tag -f latest || true - -# Get all tags -TAGS=$(git tag) +git tag -f $CURRENT_TAG || true # Fetch the existing tags and their commits from mike declare -A existing_tags @@ -54,33 +64,31 @@ while read -r tag commit; do existing_tags[$tag]=$commit done < <($mike list | awk -F '[][]' '{print $1, $2}') -# Iterate over git tags -git show-ref --tags | while read -r commit tag; do - TAG=${tag#refs/tags/} - git checkout $TAG +commit=$(git show-ref "refs/tags/${CURRENT_TAG}" | awk '{print $1}') +git checkout ${CURRENT_TAG} - # pull the submodule - git submodule update --init --depth 1 wire-server +# pull the submodule +git submodule update --init --depth 1 wire-server - # Check if tag exists in mike - if [ -n "${existing_tags[$TAG]}" ]; then - existing_commit="${existing_tags[$TAG]}" - - if [ "$commit" != "$existing_commit" ]; then - echo "Tag $TAG exists but with a different commit ($existing_commit). Updating..." - $mike delete "$TAG" - $mike deploy --update-aliases "$TAG" "$commit" - else - echo "Tag $TAG already exists with the same commit ($commit). Skipping deployment." - fi +# Check if tag exists in mike +if [ -n "${existing_tags[$CURRENT_TAG]}" ]; then + existing_commit="${existing_tags[$CURRENT_TAG]}" + if [ "$commit" != "$existing_commit" ]; then + echo "Tag $CURRENT_TAG exists but with a different commit ($existing_commit). Updating..." + $mike delete "$CURRENT_TAG" + output=$($mike deploy --update-aliases "$CURRENT_TAG" "$commit" 2>&1) + validate_output "$output" else - echo "Tag $TAG does not exist. Deploying..." - $mike deploy --update-aliases "$TAG" "$commit" + echo "Tag $CURRENT_TAG already exists with the same commit ($commit). Skipping deployment." fi +else + echo "Tag $CURRENT_TAG does not exist. Deploying..." + output=$($mike deploy --update-aliases "$CURRENT_TAG" "$commit" 2>&1) + validate_output "$output" + fi - # deinit the submodule to avoid issues with the next iteration - git submodule deinit -f wire-server -done +# deinit the submodule to avoid issues with the next iteration +git submodule deinit -f wire-server -# Set the default tag and create an alias to latest -$mike set-default latest +# Set the default tag and create an alias to $CURRENT_TAG +$mike set-default $CURRENT_TAG diff --git a/build/prepare.sh b/build/prepare.sh index da67804..2744291 100644 --- a/build/prepare.sh +++ b/build/prepare.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -xeuo pipefail +set -euo pipefail # Get the current directory (i.e. the original working directory) ORIGINAL_DIR=$(pwd) @@ -47,6 +47,7 @@ if [ -d "$TEMP_DIR/.git" ]; then else echo "Cloning repository to ${TEMP_DIR}" git clone "${ORIGINAL_DIR}" "${TEMP_DIR}" + git branch --show-current > "${TEMP_DIR}/.current_branch" fi echo "Syncing all the other files changes from ${ORIGINAL_DIR}/ to ${TEMP_DIR}, to have uncommited changes, if any" From 4edf736263f23e07cde71065e03067195a7cb3ba Mon Sep 17 00:00:00 2001 From: Mohit Rajain <20745774+mohitrajain@users.noreply.github.com> Date: Wed, 16 Apr 2025 13:57:48 +0200 Subject: [PATCH 4/7] WPB-17187: fix the url structure and remove navigation links which throw warning --- mkdocs.yml | 4 +--- src/understand/sft.md | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 40c0965..62ea3ce 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,7 +5,7 @@ repo_url: https://github.com/wireapp/wire-docs edit_uri: edit/main/src/ site_author: Wire Authors site_description: "Wire Documentation" -use_directory_urls: true +use_directory_urls: false nav: - Home: README.md - Installation: @@ -48,7 +48,6 @@ nav: - Single Sign-On and User Provisioning: understand/single-sign-on/README.md - Audio/video calling, restund servers (TURN/STUN): understand/restund.md - Conference Calling 2.0 (aka SFT): understand/sft.md - - Federated Conference Calling: understand/sft#federated-conference-calling - Minio: understand/minio.md - Helm: understand/helm.md - Federation: understand/federation/README.md @@ -98,7 +97,6 @@ nav: - Legal hold: developer/reference/team/legalhold.md - User Activation: developer/reference/user/activation.md - Connection: developer/reference/user/connection.md - - Connection backend internals: developer/reference/user/connection/#connection-backend-internals - User Registration: developer/reference/user/registration.md - User Rich info: developer/reference/user/rich-info.md - Security Responses: diff --git a/src/understand/sft.md b/src/understand/sft.md index ffed35a..cf116ae 100644 --- a/src/understand/sft.md +++ b/src/understand/sft.md @@ -1,5 +1,3 @@ - - # Conference Calling 2.0 (aka SFT) ## Background From 18b28b9800b1441ab2f8132b889e4bc7ebf26de2 Mon Sep 17 00:00:00 2001 From: Mohit Rajain <20745774+mohitrajain@users.noreply.github.com> Date: Wed, 16 Apr 2025 13:58:22 +0200 Subject: [PATCH 5/7] WPB-17187: remove src/SUMMARY.md as it mkdocs .nav takes preference --- src/SUMMARY.md | 102 ------------------------------------------------- 1 file changed, 102 deletions(-) delete mode 100644 src/SUMMARY.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md deleted file mode 100644 index 4435926..0000000 --- a/src/SUMMARY.md +++ /dev/null @@ -1,102 +0,0 @@ -# Summary - -* [Wire-docs](README.md) -* [Installation](how-to/install/README.md) - * [How to plan an installation](how-to/install/planning.md) - * [Version requirements](how-to/install/version-requirements.md) - * [Dependencies on operator’s machine](how-to/install/dependencies.md) - * [How to install kubernetes (Demo)](how-to/install/kubernetes.md) - * [How to install wire-server using Helm (Demo)](how-to/install/helm.md) - * [Introduction](how-to/install/prod-intro.md) - * [How to install kubernetes and databases](how-to/install/ansible-VMs.md) - * [How to configure AWS services](how-to/install/aws-prod.md) - * [How to install wire-server using Helm](how-to/install/helm-prod.md) - * [Infrastructure configuration](how-to/install/infrastructure-configuration.md) - * [How to monitor wire-server](how-to/install/monitoring.md) - * [How to see centralized logs for wire-server](how-to/install/logging.md) - * [Ingress-controller (getting traffic in)](how-to/install/ingress.md) - * [Web app settings](how-to/install/web-app-settings.md) - * [Installing Conference Calling 2.0 (aka SFT)](how-to/install/sft.md) - * [Installing Restund](how-to/install/restund.md) - * [Configure TLS ciphers](how-to/install/tls.md) - * [Managing authentication with ansible](how-to/install/ansible-authentication.md) - * [Using tinc](how-to/install/ansible-tinc.md) - * [Troubleshooting during installation](how-to/install/troubleshooting.md) - * [Verifying your installation](how-to/install/post-install.md) -* [Administration](how-to/administrate/README.md) - * [kubernetes](how-to/administrate/kubernetes/README.md) - * [Backup and disaster recovery](how-to/administrate/backup-disaster-recovery.md) - * [Cassandra](how-to/administrate/cassandra.md) - * [Elasticsearch](how-to/administrate/elasticsearch.md) - * [Etcd](how-to/administrate/etcd.md) - * [General - Linux](how-to/administrate/general-linux.md) - * [Minio](how-to/administrate/minio.md) - * [Operational procedures](how-to/administrate/operations.md) - * [Restund (TURN)](how-to/administrate/restund.md) - * [Investigative tasks (e.g. searching for users as server admin)](how-to/administrate/users.md) -* [Reference](understand/README.md) - * [Architecture Overview](understand/overview.md) - * [Single Sign-On and User Provisioning](understand/single-sign-on/README.md) - * [Audio/video calling, restund servers (TURN/STUN)](understand/restund.md) - * [Conference Calling 2.0 (aka SFT)](understand/sft.md) - * [Federated Conference Calling](understand/sft.md#federated-conference-calling) - * [Minio](understand/minio.md) - * [Helm](understand/helm.md) - * [Federation](understand/federation/README.md) - * [Connecting Wire Clients](understand/associate/README.md) - * [Client API documentation](understand/api-client-perspective/README.md) - * [Crypto libraries and sources of randomness](understand/crypto-libs.md) - * [Block personal user creation](understand/block-user-creation.md) - * [Classified Domains](understand/classified-domains.md) - * [Federation](understand/configure-federation.md) - * [Installing and setting up Legal Hold](understand/legalhold.md) - * [Messaging Layer Security (MLS)](understand/mls.md) - * [User Searchability](understand/searchability.md) - * [Server and team feature settings](understand/team-feature-settings.md) -* [Developer Notes](developer/README.md) - * [Developer](developer/developer/README.md) - * [API versioning](developer/developer/api-versioning.md) - * [How to build wire-server](developer/developer/building.md) - * [Writing code interacting with cassandra](developer/developer/cassandra-interaction.md) - * [Changelog](developer/developer/changelog.md) - * [Coding conventions](developer/developer/coding-conventions.md) - * [Dependencies](developer/developer/dependencies.md) - * [Editor setup](developer/developer/editor-setup.md) - * [Features](developer/developer/features.md) - * [Federation API Conventions](developer/developer/federation-api-conventions.md) - * [Federation Design Aspects](developer/developer/federation-design-aspects.md) - * [Developer how-to’s](developer/developer/how-to.md) - * [Refactoring galley to support large conversations](developer/developer/large-conversations.md) - * [Linting](developer/developer/linting.md) - * [OpenTelemetry Instrumentation](developer/developer/open-telemetry.md) - * [PR Guidelines](developer/developer/pr-guidelines.md) - * [Internal processes](developer/developer/processes.md) - * [Storing SCIM-related data](developer/developer/scim/storage.md) - * [Servant](developer/developer/servant.md) - * [Testing the wire-server Haskell code base](developer/developer/testing.md) - * [Upgrading](developer/developer/upgrading.md) - * [Reference](developer/reference/README.md) - * [Config Options](developer/reference/config-options.md) - * [Creating and populating conversations](developer/reference/conversation.md) - * [Maintaining ElasticSearch](developer/reference/elastic-search.md) - * [ElasticSearch migration instructions for release 2021-02-16](developer/reference/elasticsearch-migration-2021-02-16.md) - * [Make docker and QEMU](developer/reference/make-docker-and-qemu.md) - * [OAuth](developer/reference/oauth.md) - * [SCIM tokens](developer/reference/provisioning/scim-token.md) - * [RabbitMQ Consumer](developer/reference/rabbitmq-consumer.md) - * [Spar braindump](developer/reference/spar-braindump.md) - * [Legal hold](developer/reference/team/legalhold.md) - * [User Activation](developer/reference/user/activation.md) - * [Connection](developer/reference/user/connection.md) - * [Connection backend internals](developer/reference/user/connection.md#connection-backend-internals) - * [User Registration](developer/reference/user/registration.md) - * [User Rich info](developer/reference/user/rich-info.md) -* [Security Responses](security-responses/README.md) - * [2023-01-19 - Security Advisory: HTML Injection in wire.com](security-responses/2023-01-19\_html\_injection.md) - * [2023-01-04 - Outage of wire.com caused by a DoS attack](security-responses/2023-01-04\_website\_outage.md) - * [2022-11-01 - High Severity Vulnerability in OpenSSL](security-responses/2022-11-01\_openssl.md) - * [2022-05-23 - wire.com website outage](security-responses/2022-05-23\_website\_outage.md) - * [2022-02 - CVE-2021-44521 (Cassandra "user defined functions")](security-responses/2022-02-21\_cve-2021-44521.md) - * [2021-12 - log4shell](security-responses/2021-12-15\_log4shell.md) -* [Release Notes](changelog/README.md) - * [changelog](changelog/changelog.md) From f7a6ba317cc2d482305d58fa27f223c2650c7446 Mon Sep 17 00:00:00 2001 From: Mohit Rajain <20745774+mohitrajain@users.noreply.github.com> Date: Wed, 16 Apr 2025 14:15:40 +0200 Subject: [PATCH 6/7] WPB-17187: stopping automatic redirection --- .overrides/404.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.overrides/404.html b/.overrides/404.html index 0cf2dc1..b127b20 100644 --- a/.overrides/404.html +++ b/.overrides/404.html @@ -8,7 +8,7 @@

Page moved or not found

The page you're looking for may have moved under a versioned path.

- You’ll be automatically redirected to the latest version of this page, if it exists. + Please update the bookmarks or the reference to these pages to the following link if, the new location exists.

👉 Redirect to /latest/... @@ -26,7 +26,7 @@

Page moved or not found

const link = document.getElementById("redirect-link"); link.href = newPath; link.textContent = newPath; // Set both href and visible text - window.location.replace(newPath); + //window.location.replace(newPath); } })(); From 0083cb74f42b8718c514fe382753d6df10e5e00a Mon Sep 17 00:00:00 2001 From: Mohit Rajain <20745774+mohitrajain@users.noreply.github.com> Date: Wed, 16 Apr 2025 15:33:48 +0200 Subject: [PATCH 7/7] WPB-17187: stopping automatic redirection --- .overrides/404.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.overrides/404.html b/.overrides/404.html index b127b20..c27b373 100644 --- a/.overrides/404.html +++ b/.overrides/404.html @@ -8,7 +8,7 @@

Page moved or not found

The page you're looking for may have moved under a versioned path.

- Please update the bookmarks or the reference to these pages to the following link if, the new location exists. + Please update your bookmarks or references to these pages to the following link if the new location exists. If the page is no longer available, it is possible that it has been moved. Try searching the entire documentation to find the new location.

👉 Redirect to /latest/...