From 9d783128eb28c2d4e7e6a149bd9ea17fd4a839cb Mon Sep 17 00:00:00 2001 From: Lauren Barker Date: Mon, 20 Oct 2025 13:00:11 -0700 Subject: [PATCH 1/8] Turn on link-fragments linting for doc-locale --- .../.markdownlint/.markdownlint-cli2.yaml | 2 +- scripts/docs_i18n_verify_links | 138 ++++++++++++++++++ 2 files changed, 139 insertions(+), 1 deletion(-) create mode 100755 scripts/docs_i18n_verify_links diff --git a/doc-locale/.markdownlint/.markdownlint-cli2.yaml b/doc-locale/.markdownlint/.markdownlint-cli2.yaml index 2f2bf65d93..d4662c06b9 100644 --- a/doc-locale/.markdownlint/.markdownlint-cli2.yaml +++ b/doc-locale/.markdownlint/.markdownlint-cli2.yaml @@ -29,5 +29,5 @@ config: reference-links-images: false # MD052 ul-style: # MD004 style: "dash" - link-fragments: false # MD051 + link-fragments: true # MD051 fix: false diff --git a/scripts/docs_i18n_verify_links b/scripts/docs_i18n_verify_links new file mode 100755 index 0000000000..c24c8d82aa --- /dev/null +++ b/scripts/docs_i18n_verify_links @@ -0,0 +1,138 @@ +#!/usr/bin/env bash +# Script to validate i18n anchor links in localized documentation +# This script: +# 1. Warns when translated headings don't have English anchor links +# 2. Fails when anchor links don't work (using lychee) + +set -o pipefail + +COLOR_RED=$'\e[31m' +COLOR_GREEN=$'\e[32m' +COLOR_YELLOW=$'\e[33m' +COLOR_BLUE=$'\e[34m' +COLOR_RESET=$'\e[39m' + +cd "$(dirname "$0")/.." || exit 1 + +echo -e "${COLOR_GREEN}INFO: Validating i18n anchor links at path $(pwd)...${COLOR_RESET}\n" + +# Arrays to store file information +MISSING_ANCHOR_FILES=() +MISSING_ANCHOR_DETAILS=() +CORRECT_ANCHOR_FILES=() +LYCHEE_CHECK_FILES=() + +# Set defaults for documentation paths +MD_DOC_PATH='docs-locale' + +# Run options if files specified on command line +if [ -n "$1" ]; then + MD_DOC_PATH="$*" + echo -e "${COLOR_GREEN}INFO: Checking specified files: ${MD_DOC_PATH}${COLOR_RESET}\n" +fi + +# Function to check for missing anchor links in translated headings +check_missing_anchors() { + echo -e "${COLOR_GREEN}INFO: Checking for missing English anchor links in translated headings...${COLOR_RESET}\n" + + local missing_count=0 + local total_files=0 + local files_with_correct_anchors=0 + local files_with_missing_anchors=0 + + # Find all markdown files in doc-locale + while IFS= read -r -d '' file; do + # Skip if file doesn't exist (in case of glob expansion issues) + [[ -f "$file" ]] || continue + + ((total_files++)) + + # Extract headings that don't have anchor links + local missing_in_file="" + local line_num=0 + local has_missing_anchors=false + local has_headings=false + local file_missing_count=0 + local in_code_block=false + local code_fence="" + + while IFS= read -r line; do + ((line_num++)) + + # Check for code block markers (``` or ~~~) + if [[ "$line" =~ ^(\`\`\`|~~~) ]]; then + if [[ "$in_code_block" == false ]]; then + in_code_block=true + code_fence="${BASH_REMATCH[1]}" + elif [[ "$line" =~ ^${code_fence} ]]; then + in_code_block=false + code_fence="" + fi + continue + fi + + # Skip lines inside code blocks + if [[ "$in_code_block" == true ]]; then + continue + fi + + # Check if line is a heading (starts with ##) + if [[ "$line" =~ ^#{2,6}[[:space:]] ]]; then + has_headings=true + # Check if it doesn't end with {#anchor-name} pattern + if [[ ! "$line" =~ \{#[a-zA-Z0-9_-]+\}[[:space:]]*$ ]]; then + # Extract just the heading text for cleaner display + heading_text=$(echo "$line" | sed 's/^#*[[:space:]]*//') + missing_in_file="${missing_in_file} Line ${line_num}: ${heading_text}\n" + ((missing_count++)) + ((file_missing_count++)) + has_missing_anchors=true + fi + fi + done < "$file" + + # Process the file based on findings + if [[ "$has_missing_anchors" == true ]]; then + MISSING_ANCHOR_FILES+=("$file") + MISSING_ANCHOR_DETAILS+=("$missing_in_file") + ((files_with_missing_anchors++)) + elif [[ "$has_headings" == true ]]; then + CORRECT_ANCHOR_FILES+=("$file") + LYCHEE_CHECK_FILES+=("$file") + ((files_with_correct_anchors++)) + fi + # Note: Files without any headings are silently skipped + + done < <(find "${MD_DOC_PATH}" -type f -name "*.md" -print0 2>/dev/null || echo -n) + + # Return total missing count + return $missing_count +} + +# Run the checks +check_missing_anchors +TOTAL_MISSING=$? + +# Output summary +echo -e "\n${COLOR_GREEN}=== SUMMARY ===${COLOR_RESET}" +echo -e "${COLOR_RED}Files with missing anchor links: ${#MISSING_ANCHOR_FILES[@]}${COLOR_RESET}" +echo -e "${COLOR_GREEN}Files with correct English anchor links: ${#CORRECT_ANCHOR_FILES[@]} (will be checked by lychee)${COLOR_RESET}" +echo -e "${COLOR_YELLOW}Total missing anchors: ${TOTAL_MISSING}${COLOR_RESET}" + +# List files with missing anchors and their line numbers +if [[ ${#MISSING_ANCHOR_FILES[@]} -gt 0 ]]; then + echo -e "\n${COLOR_RED}Files with missing anchor links:${COLOR_RESET}" + for i in "${!MISSING_ANCHOR_FILES[@]}"; do + echo -e "\n ${COLOR_YELLOW}✗ ${MISSING_ANCHOR_FILES[$i]}${COLOR_RESET}" + echo -e "${MISSING_ANCHOR_DETAILS[$i]}" + done +fi + +# Add exit code based on findings +if [[ ${#MISSING_ANCHOR_FILES[@]} -gt 0 ]]; then + echo -e "\n${COLOR_RED}ERROR: Found ${TOTAL_MISSING} missing anchor links in ${#MISSING_ANCHOR_FILES[@]} files${COLOR_RESET}" + exit 1 +else + echo -e "\n${COLOR_GREEN}SUCCESS: All headings have proper English anchor links${COLOR_RESET}" + exit 0 +fi -- GitLab From eda9bd5a072de290d557b5c8c1c2ef0de8ca108a Mon Sep 17 00:00:00 2001 From: Lauren Barker Date: Mon, 20 Oct 2025 13:54:16 -0700 Subject: [PATCH 2/8] Script to identify files with anchors --- scripts/docs_i18n_verify_links | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docs_i18n_verify_links b/scripts/docs_i18n_verify_links index c24c8d82aa..fe583320b6 100755 --- a/scripts/docs_i18n_verify_links +++ b/scripts/docs_i18n_verify_links @@ -23,7 +23,7 @@ CORRECT_ANCHOR_FILES=() LYCHEE_CHECK_FILES=() # Set defaults for documentation paths -MD_DOC_PATH='docs-locale' +MD_DOC_PATH='doc-locale' # Run options if files specified on command line if [ -n "$1" ]; then -- GitLab From b448ff692b10db3213f8ffc82740cb6b014ad4d7 Mon Sep 17 00:00:00 2001 From: Lauren Barker Date: Mon, 20 Oct 2025 13:54:36 -0700 Subject: [PATCH 3/8] Add english anchors --- doc-locale/ja-jp/charts/globals.md | 211 ++++++++++++++--------------- 1 file changed, 105 insertions(+), 106 deletions(-) diff --git a/doc-locale/ja-jp/charts/globals.md b/doc-locale/ja-jp/charts/globals.md index 6246f24eb9..c0f29f4915 100644 --- a/doc-locale/ja-jp/charts/globals.md +++ b/doc-locale/ja-jp/charts/globals.md @@ -47,7 +47,7 @@ title: グローバル変数を使用してチャートを設定する - [ジョブ](#jobs) - [Traefik](#traefik) -## ホストの設定 +## ホストの設定 {#configure-host-settings} GitLabグローバルホストの設定は、`global.hosts`キーの下にあります。 @@ -105,7 +105,7 @@ global: | `pages.https` | 文字列 | | `global.pages.https`、`global.hosts.pages.https`、または`global.hosts.https`が`true`の場合、プロジェクト設定UIにおいて、GitLab PagesのURLには`http://`ではなく`https://`を使用します。 | | `ssh` | 文字列 | | SSH経由でリポジトリを複製するためのホスト名。設定されている場合、`global.hosts.domain`と`global.hosts.hostSuffix`の設定に関係なくこのホスト名が使用されます。 | -### hostSuffix +### hostSuffix {#hostsuffix} ベース`domain`を使用してホスト名を構成する際には`hostSuffix`がサブドメインに付加されますが、独自の`name`が設定されているホストには使用されません。 @@ -118,7 +118,7 @@ global: hostSuffix: staging ``` -## Horizontal Pod Autoscalerの設定 +## Horizontal Pod Autoscalerの設定 {#configure-horizontal-pod-autoscaler-settings} HPAのGitLabグローバルホストの設定は、`global.hpa`キーの下にあります: @@ -126,7 +126,7 @@ HPAのGitLabグローバルホストの設定は、`global.hpa`キーの下に | :----------- | :-------: | :------ | :-------------------------------------------------------------------- | | `apiVersion` | 文字列 | | HorizontalPodAutoscalerオブジェクトの定義で使用するAPIバージョン。 | -## PodDisruptionBudgetの設定 +## PodDisruptionBudgetの設定 {#configure-poddisruptionbudget-settings} PDBのGitLabグローバルホストの設定は、`global.pdb`キーの下にあります: @@ -134,7 +134,7 @@ PDBのGitLabグローバルホストの設定は、`global.pdb`キーの下に | :----------- | :-------: | :------ | :-------------------------------------------------------------------- | | `apiVersion` | 文字列 | | PodDisruptionBudgetオブジェクトの定義で使用するAPIバージョン。 | -## CronJobの設定 +## CronJobの設定 {#configure-cronjob-settings} CronJobのGitLabグローバルホストの設定は、`global.batch.cronJob`キーの下にあります: @@ -142,7 +142,7 @@ CronJobのGitLabグローバルホストの設定は、`global.batch.cronJob`キ | :----------- | :-------: | :------ | :-------------------------------------------------------------------- | | `apiVersion` | 文字列 | | CronJobオブジェクトの定義で使用するAPIバージョン。 | -## モニタリングの設定 +## モニタリングの設定 {#configure-monitoring-settings} ServiceMonitorとPodMonitorのGitLabのグローバル設定は、`global.monitoring`キーの下にあります: @@ -150,7 +150,7 @@ ServiceMonitorとPodMonitorのGitLabのグローバル設定は、`global.monito | :----------- | :-------: | :------ | :-------------------------------------------------------------------- | | `enabled` | ブール値 | `false` | `monitoring.coreos.com/v1`APIの可用性に関係なく、モニタリングリソースを有効にします。 | -## Ingressの設定 +## Ingressの設定 {#configure-ingress-settings} IngressのGitLabグローバルホストの設定は、`global.ingress`キーの下にあります: @@ -173,7 +173,7 @@ IngressのGitLabグローバルホストの設定は、`global.ingress`キーの - [`AWS`](https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/examples/aws/ingress.yaml) - [`GKE`](https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/examples/gke/ingress.yaml) -### Ingressパス +### Ingressパス {#ingress-path} このチャートでは、Ingressオブジェクトの`path`エントリの定義を変更する必要があるユーザーを支援する手段として、`global.ingress.path`を採用しています。多くのユーザーはこの設定を必要としないため、_設定しないでください_。 @@ -181,7 +181,7 @@ GCPで`ingress.class: gce`、AWSで`ingress.class: alb`を利用する場合な この設定により、このチャート全体としてIngressリソースのすべての`path`エントリのレンダリングでこれが使用されるようになります。唯一の例外として、[`gitlab/webservice`デプロイの設定](gitlab/webservice/_index.md#deployments-settings)にデータを入力する場合には`path`を指定する必要があります。 -### クラウドプロバイダーロードバランサー +### クラウドプロバイダーロードバランサー {#cloud-provider-loadbalancers} さまざまなクラウドプロバイダーのロードバランサーの実装は、このチャートの一部としてデプロイされるIngressリソースとNGINXコントローラーの設定に影響を与えます。次の表に例を示します。 @@ -191,7 +191,7 @@ GCPで`ingress.class: gce`、AWSで`ingress.class: alb`を利用する場合な | AWS | 7 | [`aws/elb-layer7-loadbalancer`](https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/examples/aws/elb-layer7-loadbalancer.yaml) | | AWS | 7 | [`aws/alb-full`](https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/examples/aws/alb-full.yaml) | -### `global.ingress.configureCertmanager` +### `global.ingress.configureCertmanager` {#globalingressconfigurecertmanager} Ingressオブジェクトの[cert-manager](https://cert-manager.io/docs/installation/helm/)の自動設定を制御するグローバル設定。`true`の場合は、`certmanager-issuer.email`が設定されている必要があります。 @@ -204,7 +204,7 @@ Ingressオブジェクトの[cert-manager](https://cert-manager.io/docs/installa - `minio.ingress.tls.secretName` - `global.ingress.annotations` -### `global.ingress.useNewIngressForCerts` +### `global.ingress.useNewIngressForCerts` {#globalingressusenewingressforcerts} `cert-manager`の動作を変更して、毎回動的に作成される新しいIngressを使用してACMEチャレンジ検証を実行するようにするためのグローバル設定。 @@ -212,7 +212,7 @@ Ingressオブジェクトの[cert-manager](https://cert-manager.io/docs/installa GKE Ingressコントローラーで使用する場合、`global.ingress.useNewIngressForCerts`を`true`に設定することはできません。これを有効にすることについて詳しくは、[リリースノート](../releases/7_0.md#bundled-certmanager)を参照してください。 -## GitLabバージョン +## GitLabバージョン {#gitlab-version} {{< alert type="note" >}} @@ -228,7 +228,7 @@ GKE Ingressコントローラーで使用する場合、`global.ingress.useNewIn これは、`webservice`、`sidekiq`、および`migration`のチャートで使用されるデフォルトのイメージタグに影響します。`gitaly`、`gitlab-shell`、および`gitlab-runner`のイメージタグは、個別に更新して、GitLabバージョンと互換性のあるバージョンにする必要があります。 -## すべてのイメージタグへのサフィックスの追加 +## すべてのイメージタグへのサフィックスの追加 {#adding-suffix-to-all-image-tags} Helmチャートで使用されるすべてのイメージの名前にサフィックスを追加する場合は、`global.image.tagSuffix`キーを使用することができます。このユースケースの例としては、GitLabからfips準拠のコンテナイメージを使用する場合があり、それらはすべてイメージタグに拡張子`-fips`を付けて構成されます。 @@ -236,7 +236,7 @@ Helmチャートで使用されるすべてのイメージの名前にサフィ --set global.image.tagSuffix="-fips" ``` -## すべてのコンテナのカスタムタイムゾーン +## すべてのコンテナのカスタムタイムゾーン {#custom-time-zone-for-all-containers} すべてのGitLabコンテナに対してカスタムタイムゾーンを設定する場合は、`global.time_zone`キーを使用することができます。使用可能な値については、[tzデータベースのタイムゾーンのリスト](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)の`TZ identifier`を参照してください。デフォルトは`UTC`です。 @@ -244,7 +244,7 @@ Helmチャートで使用されるすべてのイメージの名前にサフィ --set global.time_zone="America/Chicago" ``` -## PostgreSQLの設定 +## PostgreSQLの設定 {#configure-postgresql-settings} GitLabのグローバルPostgreSQLの設定は、`global.psql`キーの下にあります。GitLabでは、`main`データベース用と`ci`用の2つのデータベース接続を使用しています。デフォルトの場合、これらの指すPostgreSQLデータベースは同じです。 @@ -302,13 +302,13 @@ global: | `applicationName` | 文字列 | | データベースに接続しているアプリケーションの名前。空文字列(`""`)に設定すると、これを無効にすることができます。デフォルトの場合、実行中のプロセスの名前(`sidekiq`、`puma`など)に設定されます。 | | `ci.enabled` | ブール値 | `true` | [2つのデータベース接続](#configure-multiple-database-connections)を有効にします。 | -### チャートごとのPostgreSQL +### チャートごとのPostgreSQL {#postgresql-per-chart} 一部の複雑なデプロイでは、このチャートの複数の部分についてPostgreSQLの設定を異なるものにすることが望ましい場合があります。`v4.2.0`の時点では、`gitlab.sidekiq.psql`など、`global.psql`内で使用可能なすべてのプロパティをチャートごとに設定できます。ローカル設定を指定した場合、それによってグローバル値がオーバーライドされます。_存在しないもの_については、`global.psql`から継承されます(`psql.load_balancing`を除く)。 設計上、[PostgreSQLのロードバランシング](#postgresql-load-balancing)がグローバルから継承_されることはありません_。 -### PostgreSQL SSL +### PostgreSQL SSL {#postgresql-ssl} {{< alert type="note" >}} @@ -345,7 +345,7 @@ global: PGSSLROOTCERT: '/etc/gitlab/postgres/ssl/server-ca.pem' ``` -### PostgreSQLのロードバランシング +### PostgreSQLのロードバランシング {#postgresql-load-balancing} このチャートでは、HA方式でPostgreSQLをデプロイしないため、この機能を使用するには、[外部PostgreSQL](../advanced/external-db/_index.md)を使用する必要があります。 @@ -397,7 +397,7 @@ global: replica_check_interval: # See documentation ``` -### 複数のデータベース接続を設定する +### 複数のデータベース接続を設定する {#configure-multiple-database-connections} {{< history >}} @@ -407,7 +407,7 @@ global: GitLab 16.0におけるGitLabのデフォルトでは、同じPostgreSQLデータベースを指す2つのデータベース接続を使用します。 -## Redisの設定 +## Redisの設定 {#configure-redis-settings} GitLabグローバルRedisの設定は、`global.redis`キーの下にあります。 @@ -444,7 +444,7 @@ global: | `auth.secret` | 文字列 | | Redisの`auth.secret`属性は、プル元となるKubernetesの`Secret`の名前を定義します。 | | `scheme` | 文字列 | `redis` | Redis URLの生成に使用するURIスキーム。有効な値は、`redis`、`rediss`、および`tcp`です。`rediss`(SSL暗号化接続)スキームを使用する場合、サーバーで使用される証明書は、システムで信頼するチェーンの一部でなければなりません。そのためには、[カスタム公開認証局(CA)](#custom-certificate-authorities)のリストに追加することができます。 | -### Redisチャート固有の設定 +### Redisチャート固有の設定 {#configure-redis-chart-specific-settings} [Redisチャート](https://github.com/bitnami/charts/tree/main/bitnami/redis)を直接設定するための設定は、`redis`キーの下にあります。 @@ -459,7 +459,7 @@ redis: 詳細については、[全設定のリスト](https://artifacthub.io/packages/helm/bitnami/redis/11.3.4#parameters)を参照してください。 -### Redis Sentinelのサポート +### Redis Sentinelのサポート {#redis-sentinel-support} 現在のRedis Sentinelサポートでサポートされるのは、GitLabチャートはと別個にデプロイされたSentinelだけです。その結果として、GitLabチャートによる Redisデプロイを`redis.install=false`により無効にする必要があります。Redisパスワードを含むKubernetes Secretを、GitLabチャートをデプロイする前に手動で作成する必要があります。 @@ -494,7 +494,7 @@ global: 上記の表でも指定されているのでない限り、一般的な[Redis設定](#configure-redis-settings)に含まれる先行するすべてのRedis属性は、Sentinelサポートに引き続き適用されます。 -#### Redis Sentinelのパスワードサポート +#### Redis Sentinelのパスワードサポート {#redis-sentinel-password-support} {{< history >}} @@ -535,7 +535,7 @@ global: `sentinelAuth`は、[Redisインスタンス固有の設定](#multiple-redis-support)または[`global.redis.redisYmlOverride`](../advanced/external-redis/_index.md#redisyml-override)でオーバーライドできないことに注意してください。 -### 複数のRedisのサポート +### 複数のRedisのサポート {#multiple-redis-support} GitLabチャートには、さまざまな永続クラス用に別個のRedisインスタンスで実行するためのサポートが含まれています。現在のところ、次のとおりです。 @@ -657,7 +657,7 @@ global: インスタンス定義ごとに、Redis Sentinelのサポートも使用できます。Sentinelの設定は**共有されません**。Sentinelを使用するインスタンスごとに指定する必要があります。Sentinelサーバーの設定に使用する属性については、[Sentinelの設定](#redis-sentinel-support)を参照してください。 -### セキュアなRedisスキーム(SSL)を指定する +### セキュアなRedisスキーム(SSL)を指定する {#specify-secure-redis-scheme-ssl} SSLでRedisに接続するには、次のようにします。 @@ -679,7 +679,7 @@ SSLでRedisに接続するには、次のようにします。 1. Bitnamiの[TLSを有効にする手順](https://github.com/bitnami/charts/tree/main/bitnami/redis#securing-traffic-using-tls)に従います。チャートコンポーネントが、Redis証明書の作成に使用する公開認証局(CA)を信頼していることを確認します。 1. 任意。カスタム公開認証局を使用する場合については、[カスタム公開認証局(CA)](#custom-certificate-authorities)のグローバル設定を参照してください。 -### パスワードレスRedisサーバー +### パスワードレスRedisサーバー {#password-less-redis-servers} Google Cloud Memorystoreなどの一部のRedisサービスでは、パスワードとそれに関連する`AUTH`コマンドを使用しません。パスワードの使用と要件は、次の設定により無効にできます。 @@ -693,7 +693,7 @@ redis: enabled: false ``` -## レジストリの設定 +## レジストリの設定 {#configure-gitaly-settings} レジストリのグローバル設定は、`global.registry`キーの下にあります。 @@ -722,7 +722,7 @@ global: `host`は、自動生成された外部レジストリホスト名参照をオーバーライドするために使用されます。 -### notifications(通知) +### notifications(通知){#notifications} この設定は、[レジストリ通知](https://distribution.github.io/distribution/about/notifications/)を設定するために使用されます。これは、(アップストリームの指定に従って)マップを取り込みますが、Kubernetes Secretsとして機密ヘッダーを提供するという機能が追加されています。たとえば、認証ヘッダーには機密データが含まれ、他のヘッダーには標準のデータが含まれている次のスニペットについて考えてみましょう。 @@ -750,7 +750,7 @@ global: この例の場合、ヘッダー`X-Random-Config`は標準のヘッダーであり、その値は`values.yaml`ファイル内に、または`--set`フラグを介してプレーンテキストで指定できます。ただし、ヘッダー`Authorization`は機密ヘッダーであるため、Kubernetes secretからマウントすることをお勧めします。シークレットの構造の詳細については、[シークレットに関するドキュメント](../installation/secrets.md#registry-sensitive-notification-headers)を参照してください -## Gitalyの設定 +## Gitalyの設定 {#configure-gitaly-settings} Gitalyのグローバル設定は、`global.gitaly`キーの下にあります。 @@ -773,7 +773,7 @@ global: secretName: gitlab-gitaly-tls ``` -### Gitalyホスト +### Gitalyホスト {#gitaly-hosts} [Gitaly](https://gitlab.com/gitlab-org/gitaly)は、Gitリポジトリへの高レベルRPCアクセスを提供するサービスであり、GitLabによってなされるすべてのGit呼び出しを処理します。 @@ -789,7 +789,7 @@ global: 現時点で、Gitaly認証トークンは、内部または外部のすべてのGitalyサービスで同一であることが期待されています。これらが揃っていることを確認してください。詳細については、[イシュー#1992](https://gitlab.com/gitlab-org/charts/gitlab/-/issues/1992)を参照してください。 -#### internal(内部) +#### internal(内部){#internal} 現在のところ、`internal`キーは1つのキー`names`だけで構成されており、これはチャートによって管理される[ストレージ名](https://docs.gitlab.com/administration/repository_storage_paths/)のリストです。リスト内の名前ごとに(*論理的な順序*で)1つのポッドが生成されます。その名前は`${releaseName}-gitaly-${ordinal}`です(`ordinal`は`names`リスト内のインデックス)。動的なプロビジョニングが有効になっている場合、`PersistentVolumeClaim`は一致します。 @@ -799,7 +799,7 @@ global: [複数の内部ノードの設定](https://gitlab.com/gitlab-org/charts/gitlab/blob/master/examples/gitaly/values-multiple-internal.yaml)のサンプルがexamplesフォルダーにあります。 -#### external(外部) +#### external(外部){#external} `external`キーは、クラスターの外部にあるGitalyノードの設定を提供します。このリストの各項目には、次の3つのキーがあります。 @@ -812,7 +812,7 @@ GitLabでは、[外部Gitalyサービスの使用](../advanced/external-gitaly/_ 可用性の高いGitalyサービスを提供するために、外部[Praefect](https://docs.gitlab.com/administration/gitaly/praefect/)を使用することもできます。クライアントにとっては違いがないため、2つの設定は交換可能です。 -#### 混合 +#### 混合 {#mixed} 内部Gitalyノードと外部Gitalyノードの両方を使用することは可能ですが、次の点に注意してください。 @@ -821,7 +821,7 @@ GitLabでは、[外部Gitalyサービスの使用](../advanced/external-gitaly/_ examplesフォルダーに、[内部ノードと外部ノードの混合設定](https://gitlab.com/gitlab-org/charts/gitlab/blob/master/examples/gitaly/values-multiple-mixed.yaml)の例があります。 -### authToken +### authToken {#authToken} Gitalyの`authToken`属性には、次の2つのサブキーがあります。 @@ -830,7 +830,7 @@ Gitalyの`authToken`属性には、次の2つのサブキーがあります。 すべてのGitalyノードで同じ認証トークンを**共有する**必要があります。 -### 非推奨のGitaly設定 +### 非推奨のGitaly設定 {#deprecated-gitaly-settings} | 名前 | 型 | デフォルト | 説明 | |:---------------------------- |:-------:|:------- |:----------- | @@ -838,23 +838,22 @@ Gitalyの`authToken`属性には、次の2つのサブキーがあります。 | `port`*(非推奨)* | 整数 | `8075` | Gitalyサーバーへの接続に使用するポート。 | | `serviceName`*(非推奨)* | 文字列 | | Gitalyサーバーを操作している`service`の名前。これが存在して、`host`が存在しない場合、チャートでは、`host`値ではなくサービスのホスト名(および現在の`.Release.Name`)をテンプレートとして設定します。これは、GitalyをGitLabチャート全体の一部として使用する場合に便利です。 | -### TLSの設定 +### TLSの設定 {#tls-settings} TLS経由で動作するようにGitalyを設定する方法について詳しくは、[Gitalyチャートのドキュメント](gitlab/gitaly#running-gitaly-over-tls)をご覧ください。 -## Praefectの設定 - +## Praefectの設定 {#configure-praefect-settings} Praefectのグローバル設定は、`global.praefect`キーの下にあります。 Praefectはデフォルトで無効になっています。追加の設定なしで有効にした場合、Gitalyレプリカが3つ作成され、デフォルトのPostgreSQLインスタンス上にPraefectデータベースを手動で作成する必要があります。 -### Praefectを有効にする +### Praefectを有効にする {#enable-praefect} デフォルト設定でPraefectを有効にするには、`global.praefect.enabled=true`を設定します。 Praefectを使用してGitalyクラスターを操作する方法の詳細については、[Praefectのドキュメント](https://docs.gitlab.com/administration/gitaly/praefect/)を参照してください。 -### Praefectのグローバル設定 +### Praefectのグローバル設定 {#global-settings-for-praefect} ```yaml global: @@ -879,7 +878,7 @@ global: | psql.user | 文字列 | `praefect` | 使用するデータベースユーザー | | psql.dbName | 文字列 | `praefect` | 使用するデータベースの名前 | -## MinIOの設定 +## MinIOの設定 {#configure-minio-settings} {#configure-minio-settings} GitLabのグローバルMinIO設定は、`global.minio`キーの下にあります。これらの設定の詳細については、[MinIOチャート](minio/_index.md)内のドキュメントを参照してください。 @@ -890,7 +889,7 @@ global: credentials: {} ``` -## appConfigの設定 +## appConfigの設定 {#configure-appconfig-settings} {#configure-appconfig-settings} [Webservice](gitlab/webservice/_index.md)、[Sidekiq](gitlab/sidekiq/_index.md)、および [Gitaly](gitlab/gitaly/_index.md)のチャートでは複数の設定が共有されており、それらは`global.appConfig`キーで設定されます。 @@ -1042,7 +1041,7 @@ global: routingRules: [] ``` -### 一般的なアプリケーション設定 +### 一般的なアプリケーション設定 {#general-application-settings} {#general-application-settings} Railsアプリケーションの一般的なプロパティを微調整するために使用できる`appConfig`設定について、以下に説明します。 @@ -1063,7 +1062,7 @@ Railsアプリケーションの一般的なプロパティを微調整するた | `webhookTimeout` | 整数 | (空) | [フックが失敗したと見なされる](https://docs.gitlab.com/user/project/integrations/webhooks/#webhook-fails-or-multiple-webhook-requests-are-triggered)までの待機時間(秒単位)。 | | `graphQlTimeout` | 整数 | (空) | Railsが[GraphQLリクエストを完了](https://docs.gitlab.com/api/graphql/#limits)するまでの時間(秒単位)。 | -#### コンテンツセキュリティポリシー +#### コンテンツセキュリティポリシー {#content-security-policy} {#content-security-policy} コンテンツセキュリティポリシー(CSP)を設定することは、JavaScriptクロスサイトスクリプティング(XSS)攻撃を阻止するのに役立ちます。設定の詳細については、GitLabドキュメントを参照してください。[コンテンツセキュリティポリシーのドキュメント](https://docs.gitlab.com/omnibus/settings/configuration/#set-a-content-security-policy) @@ -1096,7 +1095,7 @@ global: CSPルールを不適切に設定すると、GitLabが正常に動作しなくなる可能性があります。ポリシーを実際に展開していく前に、`report_only`を`true`に変更して設定をテストするとよいかもしれません。 -#### defaultProjectsFeatures +#### defaultProjectsFeatures {#defaultprojectsfeatures} {#defaultprojectsfeatures} 新規プロジェクト作成時に、対応する各機能をデフォルトで有効にするかどうかを決定するフラグ。どのフラグもデフォルトは`true`です。 @@ -1110,7 +1109,7 @@ defaultProjectsFeatures: containerRegistry: true ``` -### Gravatar/Libravatarの設定 +### Gravatar/Libravatarの設定 {#gravatar-libravatar-settings} デフォルトの場合、チャートはgravatar.comで利用可能なGravatarアバターサービスと連携します。とはいえ、必要に応じてカスタムLibravatarサービスも使用できます: @@ -1119,7 +1118,7 @@ defaultProjectsFeatures: | `gravatar.plainURL` | 文字列 | (空) | [LibravatarインスタンスのHTTP URL(gravatar.comの使用に代わるもの)](https://docs.gitlab.com/administration/libravatar/)。 | | `gravatar.sslUrl` | 文字列 | (空) | [LibravatarインスタンスのHTTPS URL(gravatar.comの使用に代わるもの)](https://docs.gitlab.com/administration/libravatar/)。 | -### GitLabインスタンスに対するAnalyticsサービスのフック +### GitLabインスタンスに対するAnalyticsサービスのフック {#hooking-analytics-services-to-the-gitlab-instance} Google AnalyticsやMatomoなどのAnalyticsサービス設定は、`appConfig`の下の`extra`キーで定義されています。 @@ -1133,7 +1132,7 @@ Google AnalyticsやMatomoなどのAnalyticsサービス設定は、`appConfig` | `extra.googleTagManagerNonceId` | 文字列 | (空) | GoogleタグマネージャーID。 | | `extra.bizible` | ブール値 | `false` | Bizibleスクリプトを有効にする場合はtrueに設定 | -### 統合されたオブジェクトストレージ +### 統合されたオブジェクトストレージ {#consolidated-object-storage} オブジェクトストレージの個々の設定方法について説明する以下のセクションに加えて、これらの項目の共有設定を使いやすくするため、統合されたオブジェクトストレージ設定が追加されました。`object_store`を利用すると、`connection`を1回設定するだけで、オブジェクトストレージでサポートされる機能のうち、`connection`プロパティでは個別に設定されないものすべてに対してそれが使用されるようになります。 @@ -1159,7 +1158,7 @@ Google AnalyticsやMatomoなどのAnalyticsサービス設定は、`appConfig` [接続](#connection)に`AWS`プロバイダー(内蔵MinIOなどのS3互換プロバイダー)を使用する場合、GitLab Workhorseにより、ストレージ関連のすべてのアップロードをオフロードできます。この統合設定を使用する場合、これは自動的に有効になります。 -### バケットを指定する +### バケットを指定する {#specify-buckets} オブジェクトは、タイプごとに異なるバケットに格納する必要があります。デフォルトの場合、GitLabがタイプごとに使用するバケット名は次のとおりです。 @@ -1188,7 +1187,7 @@ Google AnalyticsやMatomoなどのAnalyticsサービス設定は、`appConfig` --set global.appConfig.dependencyProxy.bucket= ``` -#### storage_options +#### storage_options {#storage_options} `storage_options`は、[S3サーバー側の暗号化](https://docs.gitlab.com/administration/object_storage/#server-side-encryption-headers)を設定するために使用されます。 @@ -1212,7 +1211,7 @@ Google AnalyticsやMatomoなどのAnalyticsサービス設定は、`appConfig` server_side_encryption_kms_key_id: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab ``` -### LFS、アーティファクト、アップロード、パッケージ、外部MR差分、および依存プロキシ +### LFS、アーティファクト、アップロード、パッケージ、外部MR差分、および依存プロキシ {#lfs-artifacts-uploads-packages-external-mr-diffs-and-dependency-proxy} これらの設定の詳細を以下に示します。`bucket`プロパティのデフォルト値を除けば、構造的に同じなので、ドキュメントを個別に繰り返すことはしません。 @@ -1232,7 +1231,7 @@ Google AnalyticsやMatomoなどのAnalyticsサービス設定は、`appConfig` | `bucket` | 文字列 | さまざま | オブジェクトストレージプロバイダーから使用するバケットの名前。サービスに応じて、デフォルトは`git-lfs`、`gitlab-artifacts`、`gitlab-uploads`、`gitlab-packages`のどれかになります。 | | `connection` | 文字列 | `{}` | [下記を参照](#connection)。 | -#### connection(接続) +#### connection(接続) {#connection} `connection`プロパティは、Kubernetes Secretに移行されました。このシークレットの内容は、YAML形式のファイルでなければなりません。デフォルトは`{}`であり、`global.minio.enabled`が`true`の場合は無視されます。 @@ -1256,21 +1255,21 @@ kubectl create secret generic gitlab-rails-storage \ --from-file=connection=rails.yaml ``` -#### when(外部MR差分のみ) +#### when(外部MR差分のみ) {#when-only-for-external-mr-diffs} `externalDiffs`の設定には、[オブジェクトストレージに特定の差分を条件付きで保存する](https://docs.gitlab.com/administration/merge_request_diffs/#alternative-in-database-storage)ための追加キー`when`があります。Railsコードによってデフォルト値が割り当てられるようにするため、チャートではこの設定がデフォルトで空のままになっています。 -#### CDN(CIアーティファクトのみ) +#### CDN(CIアーティファクトのみ) {#cdn-only-for-ci-artifacts} `artifacts`の設定には、[Google Cloud Storageバケットより前にGoogle CDNを設定する](../advanced/external-object-storage/_index.md#google-cloud-cdn)ための追加キー`cdn`があります。 -### 受信メールの設定 +### 受信メールの設定 {#incoming-email-settings} 受信メールの設定については、[コマンドラインオプション](../installation/command-line-options.md#incoming-email-configuration)のページで説明されています。 -### KASの設定 +### KASの設定 {#kas-settings} -#### カスタムシークレット +#### カスタムシークレット {#custom-secret} オプションとして、KAS `secret`の名前と`key`をカスタマイズできます。そのためには、以下のようにしてHelmの`--set variable`オプションを使用するか、 @@ -1291,7 +1290,7 @@ global: シークレット値をカスタマイズする場合は、[シークレットに関するドキュメント](../installation/secrets.md#gitlab-kas-secret)を参照してください。 -#### カスタムURL +#### カスタムURL {#custom-urls} GitLabバックエンドでKASに使用されるURLは、Helmの`--set variable`オプションを使用してカスタマイズできます。 @@ -1312,7 +1311,7 @@ global: clientTimeoutSeconds: 10 # Optional, default is 5 seconds ``` -#### 外部KAS +#### 外部KAS {#external-kas} 外部KASサーバー(チャートによって管理されていないもの)は、それを明示的に有効にして必要なURLを設定することにより、GitLabバックエンドに認識させることができます。そのためには、以下のようにしてHelmの`--set variable`オプションを使用するか、 @@ -1335,7 +1334,7 @@ global: clientTimeoutSeconds: 10 # Optional, default is 5 seconds ``` -#### TLSの設定 +#### TLSの設定 {#tls-settings-1} KASでは、その`kas`ポッドと他のGitLabチャートコンポーネントとの間のTLS通信がサポートされています。 @@ -1371,7 +1370,7 @@ global: caSecretName: *internal-ca ``` -### レビュアーの推奨設定 +### レビュアーの推奨設定 {#suggested-reviewers-settings} {{< alert type="note" >}} @@ -1398,7 +1397,7 @@ global: シークレット値をカスタマイズする場合は、[シークレットに関するドキュメント](../installation/secrets.md#gitlab-suggested-reviewers-secret)を参照してください。 -### LDAP +### LDAP {#ldap} `ldap.servers`の設定により、[LDAP](https://docs.gitlab.com/administration/auth/ldap/)ユーザー認証を設定できます。これはマップとして提示され、ソースからのインストールと同じようにして、`gitlab.yml`の中の適切なLDAPサーバー設定に変換されます。 @@ -1442,7 +1441,7 @@ Helmの`--set`項目の中で、カンマは[特殊文字](https://helm.sh/docs/ {{< /alert >}} -#### LDAP Webサインインを無効にする +#### LDAP Webサインインを無効にする {#disable-ldap-web-sign-in} SAMLなどの代替手段が望ましいなら、Web UIを通じてLDAP認証情報を使用しないようにすると便利な場合があります。これにより、グループ同期にLDAPを使用しつつ、SAML Identity Providerがカスタム2FAなどの追加チェックを処理できるようになります。 @@ -1450,7 +1449,7 @@ LDAP Webサインインが無効になっている場合、ユーザーのサイ WebサインインにLDAPを使用することを無効にするには、`global.appConfig.ldap.preventSignin: true`を設定します。 -#### カスタムCAまたは自己署名LDAP証明書の使用 +#### カスタムCAまたは自己署名LDAP証明書の使用 {#using-a-custom-ca-or-self-signed-ldap-certificates} LDAPサーバーでカスタムCAまたは自己署名証明書を使用する場合は、以下を実行する必要があります。 @@ -1487,7 +1486,7 @@ GitLab 15.9以降、`/etc/ssl/certs/`の証明書に`ca-cert-`のプレフィッ 詳細については、[カスタム公開認証局(CA)](#custom-certificate-authorities)を参照してください。 -### DuoAuth +### DuoAuth {#duoauth} [GitLab Duoで2要素認証(2FA)を有効にする](https://docs.gitlab.com/user/profile/account/two_factor_authentication/#enable-one-time-password)には、以下の設定を使用します。 @@ -1510,7 +1509,7 @@ global: | `integrationKey` | 文字列 | | GitLab Duo APIインテグレーションキー | | `secretKey` | | | GitLab Duo APIシークレットキー。[シークレットの名前とキーの名前で構成](#configure-the-gitlab-duo-secret-key)されていなければなりません。 | -### GitLab Duoシークレットキーを設定する +### GitLab Duoシークレットキーを設定する {#configure-the-cisco-duo-secret-key} GitLab HelmチャートでGitLab Duo認証インテグレーションを設定するには、`global.appConfig.duoAuth.secretKey.secret`の設定の中でGitLab Duo認証secret_key値を含むシークレットを提供する必要があります。 @@ -1520,7 +1519,7 @@ GitLab Duoアカウント`secretKey`を格納するKubernetes Secretオブジェ kubectl create secret generic --from-literal=secretKey= ``` -### OmniAuth +### OmniAuth {#omniauth} GitLabでは、OmniAuthを利用することにより、ユーザーがGitHub、Google、その他の一般的なサービスを使用してサインインできるようになっています。詳細については、GitLabの[OmniAuthドキュメント](https://docs.gitlab.com/integration/omniauth/#configure-common-settings)を参照してください。 @@ -1558,7 +1557,7 @@ omniauth: | `syncProfileAttributes` | | `['email']` | | `syncProfileFromProvider` | | `[]` | -#### プロバイダー +#### プロバイダー {#providers} `providers`は、ソースからインストールする場合と同じように、`gitlab.yml`の設定に使用されるマップの配列として提示されます。[サポートされているプロバイダー](https://docs.gitlab.com/integration/omniauth/#supported-providers)の利用可能な選択については、GitLabドキュメントを参照してください。デフォルトは`[]`です。 @@ -1643,7 +1642,7 @@ omniauth: `--set`引数は使い方が複雑であるため、ユーザーは、YAMLスニペットを使用し、`-f omniauth.yaml`によって`helm`に渡したいと思うかもしれません。 -### Cronジョブ関連の設定 +### Cronジョブ関連の設定 {#cron-jobs-related-settings} Sidekiqには、cronスタイルのスケジュールを使用して定期的に実行されるように設定できるメンテナンスジョブが含まれています。いくつかの例を以下に示します。ジョブのその他の例については、サンプル[`gitlab.yml`](https://gitlab.com/gitlab-org/gitlab/blob/master/config/gitlab.yml.example)の`cron_jobs`と`ee_cron_jobs`のセクションを参照してください。 @@ -1661,7 +1660,7 @@ global: cron: "*/7 * * * *" ``` -### Sentryの設定 +### Sentryの設定 {#sentry-settings} これらの設定は、[SentryによるGitLabエラーレポート](https://docs.gitlab.com/omnibus/settings/configuration/#error-reporting-and-logging-with-sentry)を有効にするために使用します。 @@ -1682,7 +1681,7 @@ global: | `clientside_dsn` | 文字列 | | フロントエンドエラーのSentry DSN | | `environment` | 文字列 | | [Sentry環境](https://docs.sentry.io/concepts/key-terms/environments/)を参照 | -### `gitlab_docs`の設定 +### `gitlab_docs`の設定 {#gitlab_docs-settings} これらの設定は、`gitlab_docs`を有効するために使用します。 @@ -1699,7 +1698,7 @@ global: | `enabled` | ブール値 | `false` | `gitlab_docs`を有効または無効にする | | `host` | 文字列 | "" | ドキュメントホスト | -### スマートカード認証の設定 +### スマートカード認証の設定 {#smartcard-authentication-settings} ```yaml global: @@ -1720,7 +1719,7 @@ global: | `sanExtensions` | ブール値 | `false` | ユーザーと証明書を照合するためにSAN拡張機能を使用できるようにします。 | | `requiredForGitAccess` | ブール値 | `false` | Gitアクセスのためのスマートカードサインインでブラウザセッションを必須にします。 | -### Sidekiqルーティングルールの設定 +### Sidekiqルーティングルールの設定 {#sidekiq-routing-rules-settings} GitLabでは、ジョブのスケジュールを設定する前に、ワーカーから目的のキューへのジョブルーティングがサポートされています。Sidekiqクライアントは、設定されたルーティングルールリストに基づいてジョブを照合します。ルールは先頭から順に評価され、特定のワーカーで一致した時点で、そのワーカーの処理は停止されます(最初の一致が優先されます)。ワーカーがどのルールにも一致しない場合、ワーカー名から生成されるキュー名に戻ります。 @@ -1745,7 +1744,7 @@ global: - ["*", "default"] ``` -## Railsの設定 +## Railsの設定 {#configure-rails-settings} GitLabスイートの大部分はRailsに基づいています。そのため、このプロジェクト内の多くのコンテナはこのスタックで動作します。以下の設定は、それらのコンテナすべてに適用され、個別に設定するのではなく、グローバルに設定するための簡単なアクセス手段となります。 @@ -1756,7 +1755,7 @@ global: enabled: true ``` -## Workhorseの設定 +## Workhorseの設定 {#configure-workhorse-settings} GitLabスイートのいくつかのコンポーネントは、GitLab Workhorseを介してAPIと通信します。現在、これはWebserviceチャートの一部となっています。これらの設定は、GitLab Workhorseに接続することの必要なすべてのチャートで使用されます。それは、個別に設定するのではなく、グローバルに設定するための簡単なアクセス手段となります。 @@ -1776,7 +1775,7 @@ global: | port | 整数 | `8181` | 関連するAPIサーバーのポート番号。 | | tls.enabled | ブール値 | `false` | `true`に設定すると、WorkhorseのTLSサポートが有効になります。 | -### Bootsnapキャッシュ +### Bootsnapキャッシュ {#bootsnap-cache} Railsコードベースでは、[ShopifyのBootsnap](https://github.com/Shopify/bootsnap) Gemを使用しています。その動作を設定するため、以下の設定が使用されます。 @@ -1786,7 +1785,7 @@ Railsコードベースでは、[ShopifyのBootsnap](https://github.com/Shopify/ 可能な場合は、これを有効にしておくことをお勧めします。 -## GitLab Shellを設定する +## GitLab Shellを設定する {#configure-gitlab-shell} [GitLab Shell](gitlab/gitlab-shell/_index.md)チャートのグローバル設定には、複数の項目があります。 @@ -1807,7 +1806,7 @@ global: | `hostKeys` | | | GitLab Shellチャート固有のドキュメントにある[hostKeys](gitlab/gitlab-shell/_index.md#hostkeyssecret)を参照。 | | `tcp.proxyProtocol` | ブール値 | `false` | 具体的なドキュメントについては、下記の[TCPプロキシプロトコル](#tcp-proxy-protocol)を参照。 | -### ポート +### ポート {#port} IngressがSSHトラフィックを渡すために使用するポートと、GitLabから提供されるSSH URLで使用されるポートは、`global.shell.port`により制御できます。これは、サービスがリッスンするポートと、プロジェクトUIで提供されるSSHクローンURLに反映されます。 @@ -1830,7 +1829,7 @@ nginx-ingress: type: NodePort ``` -### TCPプロキシプロトコル +### TCPプロキシプロトコル {#tcp-proxy-protocol} SSH Ingressで[プロキシプロトコル](https://www.haproxy.com/blog/use-the-proxy-protocol-to-preserve-a-clients-ip-address)の処理を有効にすると、プロキシプロトコルヘッダーを追加するアップストリームプロキシからの接続を適切に処理できます。それにより、SSHが追加のヘッダーを受信してSSHが損なわれるのを防ぐことができます。 @@ -1843,7 +1842,7 @@ global: proxyProtocol: true # default false ``` -## GitLab Pagesを設定する +## GitLab Pagesを設定する {#configure-gitlab-pages} 他のチャートで使用されるグローバルGitLab Pages設定についてのドキュメントは、`global.pages`キーの下にあります。 @@ -1896,7 +1895,7 @@ global: | `apiSecret.key` | 文字列 | | APIキーシークレットのうち、APIキーが格納されるキー。 | | `namespaceInPath` | ブール値 | false | (ベータ版)ワイルドカードなしでのDNS設定をサポートするため、URLパスでのネームスペースを有効または無効にします。詳細については、[PagesドメインのワイルドカードなしDNSのドキュメント](gitlab/gitlab-pages/_index.md#pages-domain-without-wildcard-dns)を参照してください。 | -## Webサービスの設定 +## Webサービスの設定 {#configure-webservice} (他のチャートでも使用される)Webサービスのグローバル設定についてのドキュメントは、`global.webservice`キーの下にあります。 @@ -1906,7 +1905,7 @@ global: workerTimeout: 60 ``` -### workerTimeout +### workerTimeout {#workertimeout} WebサービスワーカープロセスがWebサービスマスタープロセスによって強制終了されるまでのリクエストタイムアウト(秒単位)を設定します。デフォルト値は60秒です。 @@ -1921,7 +1920,7 @@ gitlab: GITLAB_RAILS_WAIT_TIMEOUT: "90" ``` -## カスタム公開認証局(CA) +## カスタム公開認証局(CA) {#custom-certificate-authorities} {{< alert type="note" >}} @@ -1966,7 +1965,7 @@ global: シークレットまたはConfigMapは、任意の数を指定でき、そのそれぞれにPEMエンコードのCA証明書を保持する任意の数のキーを含めることができます。これらは、`global.certificates.customCAs`の下のエントリとして設定します。マウントする特定のキーのリストを示す`keys:`が指定されているのでない限り、すべてのキーがマウントされます。すべてのシークレットおよびConfigMapにわたるマウントされたキーは、いずれも一意でなければなりません。シークレットとConfigMapには任意の方法で名前を付けることができますが、キー名の競合があっては*なりません*。 -## アプリケーションリソース +## アプリケーションリソース {#application-resource} GitLabには、オプションで[Applicationリソース](https://github.com/kubernetes-sigs/application)を含めることができます。これは、クラスター内でGitLabアプリケーションを識別するために作成できます。バージョン`v1beta1`の[Application CRD](https://github.com/kubernetes-sigs/application#installing-the-crd)がすでにクラスターにデプロイされている必要があります。 @@ -1995,11 +1994,11 @@ certmanager: install: false ``` -## GitLabベースイメージ +## GitLabベースイメージ {#gitlab-base-image} GitLab Helmチャートでは、さまざまな初期化タスクのために1つの共通のGitLabベースイメージを使用します。このイメージではUBIビルドがサポートされており、レイヤを他のイメージと共有します。 -## サービスアカウント +## サービスアカウント {#service-accounts} GitLab Helmチャートでは、カスタム[サービスアカウント](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/)を使用してポッドを実行することができます。これは、`global.serviceAccount`の中で次のように設定します。 @@ -2025,7 +2024,7 @@ global: {{< /alert >}} -## アノテーション +## アノテーション {#annotations} Deployment、Service、およびIngressの各オブジェクトには、カスタムアノテーション適用できます。 @@ -2044,7 +2043,7 @@ global: environment: production ``` -## ノードセレクター +## ノードセレクター {#node-selector} カスタム`nodeSelector`をすべてのコンポーネントにグローバルに適用することができます。グローバルのデフォルト値があるなら、各サブチャートで個別にそれをオーバーライドすることもできます。 @@ -2060,9 +2059,9 @@ global: {{< /alert >}} -## ラベル +## ラベル {#labels} -### 共通ラベル +### 共通ラベル {#common-labels} ラベルは、設定`common.labels`を使用することにより、さまざまなオブジェクトによって作成されるほぼすべてのオブジェクトに適用できます。これは、`global`キーの下、または特定のチャートの設定の下で適用できます。例: @@ -2094,7 +2093,7 @@ gitlab: ここで利用している一部のチャートは、このラベル設定から除外されています。これらの追加ラベルを受け取るのは、[GitLabコンポーネントのサブチャート](gitlab/_index.md)だけです。 -### ポッド +### `pod` {#pod} カスタムラベルは、さまざまなデプロイとジョブに適用できます。これらのラベルは、このHelmチャートによって構築される既存のラベルまたは事前設定済みラベルを補完するものです。これらの補足ラベルは、`matchSelectors`では**利用されません**。 @@ -2105,7 +2104,7 @@ global: environment: production ``` -### サービス +### サービス {#service} カスタムラベルをサービスに適用することができます。これらのラベルは、このHelmチャートによって構築される既存のラベルまたは事前設定済みラベルを補完するものです。 @@ -2116,7 +2115,7 @@ global: environment: production ``` -## トレーシング +## トレーシング {#tracing} GitLab Helmチャートではトレーシングがサポートされており、それは次のようにして設定できます。 @@ -2131,7 +2130,7 @@ global: - `global.tracing.connection.string`は、トレーシングスパンの送信先を設定するために使用します。詳細については、[GitLabトレーシングのドキュメント](https://docs.gitlab.com/development/distributed_tracing/)を参照してください - `global.tracing.urlTemplate`は、GitLabパフォーマンスバーでのトレーシング情報URLレンダリングのためのテンプレートとして使用します。 -## extraEnv +## `extraEnv` {#extraenv} `extraEnv`を使用すると、GitLabチャート(`charts/gitlab/charts`)によりデプロイされるポッド内のすべてのコンテナで、追加の環境変数を公開できます。グローバルレベルで設定された追加の環境変数は、チャートレベルで指定された変数にマージされ、チャートレベルで指定された変数が優先されます。 @@ -2144,7 +2143,7 @@ global: SOME_OTHER_KEY: some_other_value ``` -## extraEnvFrom +## `extraEnvFrom` {#extraenvfrom} `extraEnvFrom`を使用すると、ポッド内のすべてのコンテナで、他のデータソースからの追加の環境変数を公開できます。追加の環境変数は、`global`レベル(`global.extraEnvFrom`)およびサブチャートレベル(`.extraEnvFrom`)で設定できます。 @@ -2178,7 +2177,7 @@ gitlab: {{< /alert >}} -## OAuthの設定 +## OAuthの設定 {#configure-oauth-settings} OAuthインテグレーションは、サポートするサービスに合わせてすぐに利用できる設定になっています。`global.oauth`で指定されているサービスは、デプロイ中に、OAuthクライアントアプリケーションとして自動的にGitLabに登録されます。デフォルトでは、アクセス制御が有効になっている場合、このリストにGitLab Pagesが含まれています。 @@ -2203,7 +2202,7 @@ global: シークレットの詳細については、[シークレットのドキュメント](../installation/secrets.md#oauth-integration)を参照してください。 -## Kerberos +## Kerberos {#Kerberos} GitLab HelmチャートでKerberosインテグレーションを設定するには、GitLabホストのサービスプリンシパルを指定したKerberos [keytab](https://web.mit.edu/kerberos/krb5-devel/doc/basic/keytab_def.html)を含むシークレットを、`global.appConfig.kerberos.keytab.secret`設定に指定する必要があります。keytabファイルがない場合は、Kerberos管理者にお問い合わせください。 @@ -2241,7 +2240,7 @@ global: 詳細については、[Kerberosのドキュメント](https://docs.gitlab.com/integration/kerberos/)を参照してください。 -### Kerberos専用ポート +### Kerberos専用ポート {#dedicated-port-for-kerberos} GitLabでは、Git操作にHTTPプロトコルを使用する場合、認証交換で`negotiate`ヘッダーが含まれていると基本認証にフォールバックするというGitの制限の回避策として、[Kerberosネゴシエーション専用ポート](https://docs.gitlab.com/integration/kerberos/#http-git-access-with-kerberos-token-passwordless-authentication)の使用がサポートされています。 @@ -2268,11 +2267,11 @@ global: {{< /alert >}} -### LDAPカスタム許可レルム +### LDAPカスタム許可レルム {#ldap-custom-allowed-realms} ユーザーのLDAP DNがユーザーのKerberosレルムと一致しない場合、LDAPのアイデンティティとKerberosのアイデンティティをリンクするために使用されるドメインのセットを、`global.appConfig.kerberos.simpleLdapLinkingAllowedRealms`により指定できます。詳細については、[Kerberosインテグレーションのドキュメントに含まれるカスタム許可レルムのセクション](https://docs.gitlab.com/integration/kerberos/#custom-allowed-realms)を参照してください。 -## 送信メール +## 送信メール {#outgoing-email} 送信メールは、`global.smtp.*`、`global.appConfig.microsoft_graph_mailer.*`、および`global.email.*`により設定できます。 @@ -2308,11 +2307,11 @@ global: [LinuxパッケージSMTP設定のドキュメント](https://docs.gitlab.com/omnibus/settings/smtp/)に、詳しい例が含まれています。 -## プラットフォーム +## プラットフォーム {#platform} `platform`キーは、GKEやEKSなどの特定のプラットフォームをターゲットとする特定の機能のために予約されています。 -## アフィニティ +## アフィニティ {#affinity} アフィニティは、`global.antiAffinity`と`global.affinity`により設定できます。アフィニティを使用すると、ノードのラベルまたはノードで既に実行されているポッドのラベルに基づいて、ポッドをスケジュールできるノードを制限できます。これにより、ポッドをクラスター全体に分散させたり、特定のノードを選択したりして、ノードに障害が発生した場合の復元力を高めることができます。 @@ -2339,7 +2338,7 @@ global: [ポッド間アフィニティとアンチアフィニティ](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity)に関するKubernetesリファレンス -## ポッドの優先度とプリエンプション +## ポッドの優先度とプリエンプション {#pod-priority-and-preemption} ポッドの優先度は、`global.priorityClassName`により、またはサブチャートごとに`priorityClassName`により設定できます。ポッドの優先度を設定すると、保留中のポッドのスケジューリングを可能にするために、優先度の低いポッドを排除するようスケジューラーに対して指示することができます。 @@ -2352,7 +2351,7 @@ global: | :-------------------| :--: | :------ | :------------------------------- | | `priorityClassName` | 文字列 | | ポッドに割り当てられる優先度クラス。 | -## ログローテーション +## ログローテーション {#log-rotation} {{< history >}} @@ -2367,7 +2366,7 @@ global: - [`GITLAB_LOGGER_TRUNCATE_INTERVAL`](https://gitlab.com/gitlab-org/cloud-native/gitlab-logger#truncate-logs-interval)。 - [`GITLAB_LOGGER_MAX_FILESIZE`](https://gitlab.com/gitlab-org/cloud-native/gitlab-logger#max-log-file-size)。 -## ジョブ +## ジョブ {#jobs} 元々、GitLabのジョブには、Helmの`.Release.Revision`がサフィックスとして付いていましたが、`helm upgrade --install`を実行すると、何も変更されていなくても、常にジョブが更新されてしまうため、理想的な方法ではありませんでした。また、ArgoCDを使用している場合などに、`helm template`に基づくワークフローでの適切な動作の妨げにもなっていました。名前の中に`.Release.Revision`を使用するという決定は、ジョブが1回しか実行されない可能性があり、かつ`helm uninstall`がジョブを削除しないという前提に基づいていましたが、これは(現在では)間違っています。 @@ -2399,7 +2398,7 @@ helm --set global.job.nameSuffixOverride=$(date +%Y-%m-%d-%H | :--------------------| :--: | :------ | :-------------------------------------------------------- | | `nameSuffixOverride` | 文字列 | | 自動的に生成されるハッシュを置き換えるカスタムサフィックス | -## Traefik +## Traefik {#traefik} Traefikは、`globals.traefik`により設定できます。 -- GitLab From 3408bd2dff8cecdefce0599e8d4e72ff8604789b Mon Sep 17 00:00:00 2001 From: Lauren Barker Date: Mon, 20 Oct 2025 14:09:33 -0700 Subject: [PATCH 4/8] Add lychee CI check to /doc-locale --- .gitlab/ci/checks.yml | 15 +++ scripts/docs_i18n_verify_links | 165 ++++++--------------------------- 2 files changed, 44 insertions(+), 136 deletions(-) diff --git a/.gitlab/ci/checks.yml b/.gitlab/ci/checks.yml index e116733a34..e806bf4724 100644 --- a/.gitlab/ci/checks.yml +++ b/.gitlab/ci/checks.yml @@ -110,6 +110,21 @@ docs-i18n-lint paths: - if: '$PIPELINE_TYPE =~ /MR_PIPELINE$/' - if: '$PIPELINE_TYPE =~ /BRANCH_PIPELINE$/' +# Perform lychee check on documentation Markdown files +docs-i18n-lint_links: + image: ${DOCS_LINT_IMAGE} + stage: prepare + cache: {} + dependencies: [] + before_script: [] + script: + - scripts/docs_i18n_verify_links + rules: + - !reference [.rule:skip_if_dev] + - if: '$PIPELINE_TYPE =~ /DOCS_PIPELINE/' + - if: '$PIPELINE_TYPE =~ /MR_PIPELINE$/' + - if: '$PIPELINE_TYPE =~ /BRANCH_PIPELINE$/' + docs-test hugo: image: registry.gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/docs-gitlab-com-builder:hugo-0.150.1 stage: prepare diff --git a/scripts/docs_i18n_verify_links b/scripts/docs_i18n_verify_links index fe583320b6..19b33cf05f 100755 --- a/scripts/docs_i18n_verify_links +++ b/scripts/docs_i18n_verify_links @@ -1,138 +1,31 @@ -#!/usr/bin/env bash -# Script to validate i18n anchor links in localized documentation -# This script: -# 1. Warns when translated headings don't have English anchor links -# 2. Fails when anchor links don't work (using lychee) - -set -o pipefail - -COLOR_RED=$'\e[31m' -COLOR_GREEN=$'\e[32m' -COLOR_YELLOW=$'\e[33m' -COLOR_BLUE=$'\e[34m' -COLOR_RESET=$'\e[39m' - -cd "$(dirname "$0")/.." || exit 1 - -echo -e "${COLOR_GREEN}INFO: Validating i18n anchor links at path $(pwd)...${COLOR_RESET}\n" - -# Arrays to store file information -MISSING_ANCHOR_FILES=() -MISSING_ANCHOR_DETAILS=() -CORRECT_ANCHOR_FILES=() -LYCHEE_CHECK_FILES=() - -# Set defaults for documentation paths -MD_DOC_PATH='doc-locale' - -# Run options if files specified on command line -if [ -n "$1" ]; then - MD_DOC_PATH="$*" - echo -e "${COLOR_GREEN}INFO: Checking specified files: ${MD_DOC_PATH}${COLOR_RESET}\n" -fi - -# Function to check for missing anchor links in translated headings -check_missing_anchors() { - echo -e "${COLOR_GREEN}INFO: Checking for missing English anchor links in translated headings...${COLOR_RESET}\n" - - local missing_count=0 - local total_files=0 - local files_with_correct_anchors=0 - local files_with_missing_anchors=0 - - # Find all markdown files in doc-locale - while IFS= read -r -d '' file; do - # Skip if file doesn't exist (in case of glob expansion issues) - [[ -f "$file" ]] || continue - - ((total_files++)) - - # Extract headings that don't have anchor links - local missing_in_file="" - local line_num=0 - local has_missing_anchors=false - local has_headings=false - local file_missing_count=0 - local in_code_block=false - local code_fence="" - - while IFS= read -r line; do - ((line_num++)) - - # Check for code block markers (``` or ~~~) - if [[ "$line" =~ ^(\`\`\`|~~~) ]]; then - if [[ "$in_code_block" == false ]]; then - in_code_block=true - code_fence="${BASH_REMATCH[1]}" - elif [[ "$line" =~ ^${code_fence} ]]; then - in_code_block=false - code_fence="" - fi - continue - fi - - # Skip lines inside code blocks - if [[ "$in_code_block" == true ]]; then - continue - fi - - # Check if line is a heading (starts with ##) - if [[ "$line" =~ ^#{2,6}[[:space:]] ]]; then - has_headings=true - # Check if it doesn't end with {#anchor-name} pattern - if [[ ! "$line" =~ \{#[a-zA-Z0-9_-]+\}[[:space:]]*$ ]]; then - # Extract just the heading text for cleaner display - heading_text=$(echo "$line" | sed 's/^#*[[:space:]]*//') - missing_in_file="${missing_in_file} Line ${line_num}: ${heading_text}\n" - ((missing_count++)) - ((file_missing_count++)) - has_missing_anchors=true - fi +#!/bin/bash +# create_fallback_links.sh + +# Base directories +DOC_DIR="doc" +LOCALE_BASE_DIR="doc-locale" + +# Process each locale directory +for locale_dir in "$LOCALE_BASE_DIR"/*; do + # Skip if not a directory + [ -d "$locale_dir" ] || continue + + echo "Processing locale: $locale_dir" + + # Find all files in doc directory and create symlinks + ( + cd "$DOC_DIR" || exit 1 + find . -type f -name "*.md" | while read -r file; do + # Check if corresponding file exists in this locale + if [ ! -f "../$locale_dir/$file" ]; then + # Create directory structure if needed + mkdir -p "../$locale_dir/$(dirname "$file")" + # Create symbolic link to original + ln -s "$(realpath "$file")" "../$locale_dir/$file" fi - done < "$file" - - # Process the file based on findings - if [[ "$has_missing_anchors" == true ]]; then - MISSING_ANCHOR_FILES+=("$file") - MISSING_ANCHOR_DETAILS+=("$missing_in_file") - ((files_with_missing_anchors++)) - elif [[ "$has_headings" == true ]]; then - CORRECT_ANCHOR_FILES+=("$file") - LYCHEE_CHECK_FILES+=("$file") - ((files_with_correct_anchors++)) - fi - # Note: Files without any headings are silently skipped - - done < <(find "${MD_DOC_PATH}" -type f -name "*.md" -print0 2>/dev/null || echo -n) - - # Return total missing count - return $missing_count -} - -# Run the checks -check_missing_anchors -TOTAL_MISSING=$? - -# Output summary -echo -e "\n${COLOR_GREEN}=== SUMMARY ===${COLOR_RESET}" -echo -e "${COLOR_RED}Files with missing anchor links: ${#MISSING_ANCHOR_FILES[@]}${COLOR_RESET}" -echo -e "${COLOR_GREEN}Files with correct English anchor links: ${#CORRECT_ANCHOR_FILES[@]} (will be checked by lychee)${COLOR_RESET}" -echo -e "${COLOR_YELLOW}Total missing anchors: ${TOTAL_MISSING}${COLOR_RESET}" - -# List files with missing anchors and their line numbers -if [[ ${#MISSING_ANCHOR_FILES[@]} -gt 0 ]]; then - echo -e "\n${COLOR_RED}Files with missing anchor links:${COLOR_RESET}" - for i in "${!MISSING_ANCHOR_FILES[@]}"; do - echo -e "\n ${COLOR_YELLOW}✗ ${MISSING_ANCHOR_FILES[$i]}${COLOR_RESET}" - echo -e "${MISSING_ANCHOR_DETAILS[$i]}" - done -fi + done + ) +done -# Add exit code based on findings -if [[ ${#MISSING_ANCHOR_FILES[@]} -gt 0 ]]; then - echo -e "\n${COLOR_RED}ERROR: Found ${TOTAL_MISSING} missing anchor links in ${#MISSING_ANCHOR_FILES[@]} files${COLOR_RESET}" - exit 1 -else - echo -e "\n${COLOR_GREEN}SUCCESS: All headings have proper English anchor links${COLOR_RESET}" - exit 0 -fi +# Now run lychee +lychee --offline --include-fragments "$LOCALE_BASE_DIR" \ No newline at end of file -- GitLab From 39fc36a23b9951e1fba349d0def794378ff4e345 Mon Sep 17 00:00:00 2001 From: Lauren Barker Date: Mon, 20 Oct 2025 16:43:35 -0700 Subject: [PATCH 5/8] Fix link-fragments from CI --- doc-locale/ja-jp/charts/globals.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc-locale/ja-jp/charts/globals.md b/doc-locale/ja-jp/charts/globals.md index c0f29f4915..6478ff9164 100644 --- a/doc-locale/ja-jp/charts/globals.md +++ b/doc-locale/ja-jp/charts/globals.md @@ -693,7 +693,7 @@ redis: enabled: false ``` -## レジストリの設定 {#configure-gitaly-settings} +## レジストリの設定 {#configure-registry-settings} レジストリのグローバル設定は、`global.registry`キーの下にあります。 @@ -843,6 +843,7 @@ Gitalyの`authToken`属性には、次の2つのサブキーがあります。 TLS経由で動作するようにGitalyを設定する方法について詳しくは、[Gitalyチャートのドキュメント](gitlab/gitaly#running-gitaly-over-tls)をご覧ください。 ## Praefectの設定 {#configure-praefect-settings} + Praefectのグローバル設定は、`global.praefect`キーの下にあります。 Praefectはデフォルトで無効になっています。追加の設定なしで有効にした場合、Gitalyレプリカが3つ作成され、デフォルトのPostgreSQLインスタンス上にPraefectデータベースを手動で作成する必要があります。 @@ -1507,7 +1508,7 @@ global: | `enabled` | ブール値 | `false` | GitLab Duoとのインテグレーションを有効または無効にする | | `hostname` | 文字列 | | GitLab Duo APIのホスト名 | | `integrationKey` | 文字列 | | GitLab Duo APIインテグレーションキー | -| `secretKey` | | | GitLab Duo APIシークレットキー。[シークレットの名前とキーの名前で構成](#configure-the-gitlab-duo-secret-key)されていなければなりません。 | +| `secretKey` | | | GitLab Duo APIシークレットキー。[シークレットの名前とキーの名前で構成](#configure-the-cisco-duo-secret-key)されていなければなりません。 | ### GitLab Duoシークレットキーを設定する {#configure-the-cisco-duo-secret-key} @@ -2202,7 +2203,7 @@ global: シークレットの詳細については、[シークレットのドキュメント](../installation/secrets.md#oauth-integration)を参照してください。 -## Kerberos {#Kerberos} +## Kerberos {#kerberos} GitLab HelmチャートでKerberosインテグレーションを設定するには、GitLabホストのサービスプリンシパルを指定したKerberos [keytab](https://web.mit.edu/kerberos/krb5-devel/doc/basic/keytab_def.html)を含むシークレットを、`global.appConfig.kerberos.keytab.secret`設定に指定する必要があります。keytabファイルがない場合は、Kerberos管理者にお問い合わせください。 -- GitLab From 8f7f46fec9cdf6a419de53222a0b9985f056e041 Mon Sep 17 00:00:00 2001 From: Lauren Barker Date: Mon, 20 Oct 2025 16:52:33 -0700 Subject: [PATCH 6/8] Fix links caught by CI --- doc-locale/ja-jp/charts/globals.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc-locale/ja-jp/charts/globals.md b/doc-locale/ja-jp/charts/globals.md index 6478ff9164..51c3cf38b8 100644 --- a/doc-locale/ja-jp/charts/globals.md +++ b/doc-locale/ja-jp/charts/globals.md @@ -210,7 +210,7 @@ Ingressオブジェクトの[cert-manager](https://cert-manager.io/docs/installa デフォルトのロジック(`global.ingress.useNewIngressForCerts`が`false`の場合)は、検証のために既存のIngressを再利用します。このデフォルトは、状況によっては適切ではありません。フラグを`true`に設定すると、検証のたびに新しいIngressオブジェクトが作成されます。 -GKE Ingressコントローラーで使用する場合、`global.ingress.useNewIngressForCerts`を`true`に設定することはできません。これを有効にすることについて詳しくは、[リリースノート](../releases/7_0.md#bundled-certmanager)を参照してください。 +GKE Ingressコントローラーで使用する場合、`global.ingress.useNewIngressForCerts`を`true`に設定することはできません。これを有効にすることについて詳しくは ## GitLabバージョン {#gitlab-version} @@ -2264,7 +2264,7 @@ global: {{< alert type="note" >}} -[`nginx-ingress` Helmチャートのフォーク](nginx/fork.md)に関する現在の制限のため、現在のところ、`dedicatedPort`を指定しても、チャートの`nginx-ingress`コントローラーで使用するためのポートは公開されません。クラスターのオペレーターが、このポートを自分で公開する必要があります。詳細について、また可能な回避策については、[こちらのチャートイシュー](https://gitlab.com/gitlab-org/charts/gitlab/-/issues/3531)を参照してください。 +[`nginx-ingress` Helmチャートのフォーク](nginx/_index.md)に関する現在の制限のため、現在のところ、`dedicatedPort`を指定しても、チャートの`nginx-ingress`コントローラーで使用するためのポートは公開されません。クラスターのオペレーターが、このポートを自分で公開する必要があります。詳細について、また可能な回避策については、[こちらのチャートイシュー](https://gitlab.com/gitlab-org/charts/gitlab/-/issues/3531)を参照してください。 {{< /alert >}} -- GitLab From 2de2f8cc0f4b9e660f944822a787034a9eefe706 Mon Sep 17 00:00:00 2001 From: Lauren Barker Date: Mon, 20 Oct 2025 17:15:51 -0700 Subject: [PATCH 7/8] Fixes from Duo --- .gitlab/ci/checks.yml | 2 +- scripts/docs_i18n_verify_links | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.gitlab/ci/checks.yml b/.gitlab/ci/checks.yml index e806bf4724..771e71e5fd 100644 --- a/.gitlab/ci/checks.yml +++ b/.gitlab/ci/checks.yml @@ -111,7 +111,7 @@ docs-i18n-lint paths: - if: '$PIPELINE_TYPE =~ /BRANCH_PIPELINE$/' # Perform lychee check on documentation Markdown files -docs-i18n-lint_links: +docs-i18n-lint-links: image: ${DOCS_LINT_IMAGE} stage: prepare cache: {} diff --git a/scripts/docs_i18n_verify_links b/scripts/docs_i18n_verify_links index 19b33cf05f..830864ba5e 100755 --- a/scripts/docs_i18n_verify_links +++ b/scripts/docs_i18n_verify_links @@ -1,10 +1,21 @@ #!/bin/bash -# create_fallback_links.sh +set -euo pipefail # Base directories DOC_DIR="doc" LOCALE_BASE_DIR="doc-locale" +# Validate required directories exist +if [ ! -d "$DOC_DIR" ]; then + echo "Error: $DOC_DIR directory not found" + exit 1 +fi + +if [ ! -d "$LOCALE_BASE_DIR" ]; then + echo "Error: $LOCALE_BASE_DIR directory not found" + exit 1 +fi + # Process each locale directory for locale_dir in "$LOCALE_BASE_DIR"/*; do # Skip if not a directory @@ -17,7 +28,9 @@ for locale_dir in "$LOCALE_BASE_DIR"/*; do cd "$DOC_DIR" || exit 1 find . -type f -name "*.md" | while read -r file; do # Check if corresponding file exists in this locale - if [ ! -f "../$locale_dir/$file" ]; then + if [ ! -f "../$locale_dir/$file" ] || [ -L "../$locale_dir/$file" ]; then + # Remove existing symlink if present + [ -L "../$locale_dir/$file" ] && rm "../$locale_dir/$file" # Create directory structure if needed mkdir -p "../$locale_dir/$(dirname "$file")" # Create symbolic link to original @@ -28,4 +41,4 @@ for locale_dir in "$LOCALE_BASE_DIR"/*; do done # Now run lychee -lychee --offline --include-fragments "$LOCALE_BASE_DIR" \ No newline at end of file +lychee --offline --include-fragments "$LOCALE_BASE_DIR" -- GitLab From ce2d44e85854ff5b2238bbb686c3ff28d3694c15 Mon Sep 17 00:00:00 2001 From: Lauren Barker Date: Tue, 21 Oct 2025 15:13:20 -0700 Subject: [PATCH 8/8] Consolidate i18n verifcation to single script --- .gitlab/ci/checks.yml | 4 +- scripts/docs_i18n_verify.sh | 204 +++++++++++++++++++++++++++++++++ scripts/docs_i18n_verify_links | 44 ------- scripts/docs_i18n_verify_paths | 79 ------------- 4 files changed, 206 insertions(+), 125 deletions(-) create mode 100755 scripts/docs_i18n_verify.sh delete mode 100755 scripts/docs_i18n_verify_links delete mode 100755 scripts/docs_i18n_verify_paths diff --git a/.gitlab/ci/checks.yml b/.gitlab/ci/checks.yml index 771e71e5fd..cab8814e23 100644 --- a/.gitlab/ci/checks.yml +++ b/.gitlab/ci/checks.yml @@ -103,7 +103,7 @@ docs-i18n-lint paths: dependencies: [] before_script: [] script: - - scripts/docs_i18n_verify_paths + - scripts/docs_i18n_verify.sh --verify-paths rules: - !reference [.rule:skip_if_dev] - if: '$PIPELINE_TYPE =~ /DOCS_PIPELINE/' @@ -118,7 +118,7 @@ docs-i18n-lint-links: dependencies: [] before_script: [] script: - - scripts/docs_i18n_verify_links + - scripts/docs_i18n_verify.sh --check-links rules: - !reference [.rule:skip_if_dev] - if: '$PIPELINE_TYPE =~ /DOCS_PIPELINE/' diff --git a/scripts/docs_i18n_verify.sh b/scripts/docs_i18n_verify.sh new file mode 100755 index 0000000000..ca74d40934 --- /dev/null +++ b/scripts/docs_i18n_verify.sh @@ -0,0 +1,204 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Script to manage localized documentation verification and testing +# Usage: +# ./docs_i18n_verify.sh --verify-paths # Check if all localized files have English originals +# ./docs_i18n_verify.sh --check-links # Create temp directory with symlinks and run lychee + +readonly DOC_DIR="doc" +readonly LOCALE_BASE_DIR="doc-locale" +readonly LOCALE_PATH_REGEX="^doc-locale/[^/]+/(.+)$" + +# Utility functions +log_info() { echo "$@"; } +log_error() { echo "$@" >&2; } +log_success() { echo -e "\n✅ $*"; } +log_failure() { echo -e "\n❌ $*" >&2; } + +validate_directories() { + local missing_dirs=() + [[ ! -d "$DOC_DIR" ]] && missing_dirs+=("$DOC_DIR") + [[ ! -d "$LOCALE_BASE_DIR" ]] && missing_dirs+=("$LOCALE_BASE_DIR") + + if [[ ${#missing_dirs[@]} -gt 0 ]]; then + log_error "Error: Required directories not found: ${missing_dirs[*]}" + exit 1 + fi +} + +show_help() { + cat << EOF +Usage: $0 [OPTION] + +Options: + --verify-paths Check if all localized files have English originals + --check-links Create temp directory with symlinks and run lychee + --help, -h Show this help message + +Examples: + $0 --verify-paths + $0 --check-links +EOF +} + +print_error_report() { + local title="$1" + local -n items=$2 + local description="$3" + + log_failure "$title: Found ${#items[@]} issues." + log_error "===== ${title^^} =====" + [[ -n "$description" ]] && log_error "$description" + + for item in "${items[@]}"; do + log_error " - $item" + done + log_error "==========================" +} + +verify_orphaned_paths() { + log_info "Checking if localized documentation files have matching English originals..." + + local failed_routes=() + local unexpected_paths=() + local failed=0 + + while IFS= read -r -d '' locale_file; do + if [[ "$locale_file" =~ $LOCALE_PATH_REGEX ]]; then + local file_path="${BASH_REMATCH[1]}" + local original_file="$DOC_DIR/$file_path" + + if [[ ! -f "$original_file" ]]; then + log_error "Error: Original English file does not exist: $original_file" + log_error "For localized file: $locale_file" + failed_routes+=("$original_file → $locale_file") + failed=1 + else + log_info "Verified: $locale_file → $original_file" + fi + else + log_error "Warning: Unexpected path format: $locale_file" + unexpected_paths+=("$locale_file") + fi + done < <(find "$LOCALE_BASE_DIR" -type f -name "*.md" -print0) + + # Report errors in order of severity + if [[ ${#unexpected_paths[@]} -gt 0 ]]; then + print_error_report "PATH FORMAT VERIFICATION FAILED" unexpected_paths \ + "Expected: doc-locale//" + log_error "Please ensure all files follow the expected directory structure." + exit 2 + fi + + if [[ $failed -ne 0 ]]; then + print_error_report "PATH VERIFICATION FAILED" failed_routes \ + "MISSING ENGLISH PATH => LOCALIZED VERSION" + log_error "Please ensure all localized content has corresponding English files." + exit 1 + fi + + log_success "Verification successful! All localized files have matching English originals." +} + +setup_temp_directory() { + local script_dir project_dir timestamp + script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + project_dir="$(dirname "$script_dir")" + timestamp=$(date +%Y%m%d_%H%M%S) + + TEMP_DIR="$project_dir/lychee_test_$timestamp" + mkdir -p "$TEMP_DIR" + log_info "Created temporary directory: $TEMP_DIR" +} + +cleanup_temp_directory() { + if [[ -n "${TEMP_DIR:-}" && -d "$TEMP_DIR" ]]; then + log_info "Cleaning up temporary directory: $TEMP_DIR" + rm -rf "$TEMP_DIR" + fi + + # Only remove temp base directory if it's specifically our created temp directory pattern + local temp_base="${TEMP_DIR%/*}" + if [[ -d "$temp_base" && "$temp_base" =~ lychee_test_ && -z "$(ls -A "$temp_base" 2>/dev/null)" ]]; then + rmdir "$temp_base" + fi +} + +create_symlinks_for_locale() { + local locale_dir="$1" + local locale_name + locale_name=$(basename "$locale_dir") + log_info "Processing locale: $locale_name" + + ( + cd "$DOC_DIR" || exit 1 + find . -type f -name "*.md" | while read -r file; do + local source_file target_dir target_file + source_file="$(pwd)/$file" + target_dir="$locale_dir/$(dirname "$file")" + target_file="$locale_dir/$file" + + # Create symlink if file doesn't exist or is already a symlink + if [[ ! -f "$target_file" || -L "$target_file" ]]; then + [[ -L "$target_file" ]] && rm "$target_file" + mkdir -p "$target_dir" + ln -s "$source_file" "$target_file" + log_info " Created symlink: $file" + fi + done + ) +} + +check_links() { + # Comment out to see directory created for lychee test + trap cleanup_temp_directory EXIT + + validate_directories + setup_temp_directory + + # Create temporary locale base directory and copy content + local temp_locale_base + temp_locale_base="$TEMP_DIR/$(basename "$LOCALE_BASE_DIR")" + mkdir -p "$temp_locale_base" + + log_info "Copying locale directories to temporary location..." + if ! cp -r "$LOCALE_BASE_DIR"/* "$temp_locale_base/" 2>/dev/null; then + log_info "No locale files found to copy (this is normal if doc-locale is empty)" + fi + + # Process each locale directory + for locale_dir in "$temp_locale_base"/*; do + [[ -d "$locale_dir" ]] && create_symlinks_for_locale "$locale_dir" + done + + log_info "Running lychee on temporary directory..." + lychee --offline --include-fragments "$temp_locale_base" +} + +# Main script logic +main() { + case "${1:-}" in + --verify-paths) + verify_orphaned_paths + ;; + --check-links) + check_links + ;; + --help|-h) + show_help + ;; + "") + log_error "Error: No argument provided" + show_help + exit 1 + ;; + *) + log_error "Error: Unknown argument '$1'" + show_help + exit 1 + ;; + esac +} + +main "$@" diff --git a/scripts/docs_i18n_verify_links b/scripts/docs_i18n_verify_links deleted file mode 100755 index 830864ba5e..0000000000 --- a/scripts/docs_i18n_verify_links +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -set -euo pipefail - -# Base directories -DOC_DIR="doc" -LOCALE_BASE_DIR="doc-locale" - -# Validate required directories exist -if [ ! -d "$DOC_DIR" ]; then - echo "Error: $DOC_DIR directory not found" - exit 1 -fi - -if [ ! -d "$LOCALE_BASE_DIR" ]; then - echo "Error: $LOCALE_BASE_DIR directory not found" - exit 1 -fi - -# Process each locale directory -for locale_dir in "$LOCALE_BASE_DIR"/*; do - # Skip if not a directory - [ -d "$locale_dir" ] || continue - - echo "Processing locale: $locale_dir" - - # Find all files in doc directory and create symlinks - ( - cd "$DOC_DIR" || exit 1 - find . -type f -name "*.md" | while read -r file; do - # Check if corresponding file exists in this locale - if [ ! -f "../$locale_dir/$file" ] || [ -L "../$locale_dir/$file" ]; then - # Remove existing symlink if present - [ -L "../$locale_dir/$file" ] && rm "../$locale_dir/$file" - # Create directory structure if needed - mkdir -p "../$locale_dir/$(dirname "$file")" - # Create symbolic link to original - ln -s "$(realpath "$file")" "../$locale_dir/$file" - fi - done - ) -done - -# Now run lychee -lychee --offline --include-fragments "$LOCALE_BASE_DIR" diff --git a/scripts/docs_i18n_verify_paths b/scripts/docs_i18n_verify_paths deleted file mode 100755 index cbd055b3fe..0000000000 --- a/scripts/docs_i18n_verify_paths +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - -# Script to verify that all localized documentation files have matching English originals -# Exit codes: -# 0 - All localized files have matching English originals -# 1 - One or more localized files are missing English originals -# 2 - Found files with unexpected path format - -set -euo pipefail - -echo "Checking if localized documentation files have matching English originals..." - -# Track different types of issues -FAILED_ROUTES=() -UNEXPECTED_PATHS=() - -check_file_exists() { - local locale_file=$1 - local original_file=$2 - - if [[ ! -f "$original_file" ]]; then - echo "Error: Original English file does not exist: $original_file" >&2 - echo "For localized file: $locale_file" >&2 - FAILED_ROUTES+=("$original_file → $locale_file") - return 1 - else - echo "Verified: $locale_file → $original_file" - return 0 - fi -} - -FAILED=0 - -echo "Checking for localized pages without English equivalents..." -while IFS= read -r -d '' locale_file; do - if [[ "$locale_file" =~ ^doc-locale/[^/]+/(.+)$ ]]; then - file_path="${BASH_REMATCH[1]}" - else - echo "Warning: Unexpected path format: $locale_file" >&2 - UNEXPECTED_PATHS+=("$locale_file") - continue # Skip this file but track it - fi - - original_file="doc/$file_path" - - if ! check_file_exists "$locale_file" "$original_file"; then - FAILED=1 - fi -done < <(find doc-locale -type f -name "*.md" -print0) - -# Check for unexpected path formats first -if [[ ${#UNEXPECTED_PATHS[@]} -gt 0 ]]; then - echo -e "\n❌ Path format verification failed: Found ${#UNEXPECTED_PATHS[@]} files with unexpected path format:\n" >&2 - echo -e "===== UNEXPECTED PATH FORMATS =====" >&2 - echo -e "Expected: doc-locale//" >&2 - echo -e "Found:" >&2 - for path in "${UNEXPECTED_PATHS[@]}"; do - echo " - $path" >&2 - done - echo -e "=====================================\n" >&2 - echo -e "Please ensure all files follow the expected directory structure.\n" >&2 - exit 2 -fi - -# Then check for missing English originals -if [[ $FAILED -ne 0 ]]; then - echo -e "\n❌ Path verification failed: Found ${#FAILED_ROUTES[@]} localized files without matching English originals.\n" >&2 - echo -e "===== MISSING ENGLISH ORIGINALS =====\n" >&2 - echo -e "MISSING ENGLISH PATH => LOCALIZED VERSION" >&2 - echo -e "----------------------------------------" >&2 - for route in "${FAILED_ROUTES[@]}"; do - echo "$route" >&2 - done - echo -e "\n=====================================" >&2 - echo -e "Please ensure all localized content has corresponding English files.\n" >&2 - exit 1 -fi - -echo -e "\n✅ Verification successful! All localized files have matching English originals." -- GitLab