From af14ca7c4f754b07a5f32efc5265632f539ef103 Mon Sep 17 00:00:00 2001 From: KurekMartin <79570332+KurekMartin@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:10:40 +0200 Subject: [PATCH 1/4] i18n: add Czech translation (#1477) * add Czech translation * fix formatting --- quartz/i18n/index.ts | 2 + quartz/i18n/locales/cs-CZ.ts | 84 ++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 quartz/i18n/locales/cs-CZ.ts diff --git a/quartz/i18n/index.ts b/quartz/i18n/index.ts index edde307f5..2fba70e16 100644 --- a/quartz/i18n/index.ts +++ b/quartz/i18n/index.ts @@ -19,6 +19,7 @@ import pt from "./locales/pt-BR" import hu from "./locales/hu-HU" import fa from "./locales/fa-IR" import pl from "./locales/pl-PL" +import cs from "./locales/cs-CZ" export const TRANSLATIONS = { "en-US": enUs, @@ -62,6 +63,7 @@ export const TRANSLATIONS = { "hu-HU": hu, "fa-IR": fa, "pl-PL": pl, + "cs-CZ": cs, } as const export const defaultTranslation = "en-US" diff --git a/quartz/i18n/locales/cs-CZ.ts b/quartz/i18n/locales/cs-CZ.ts new file mode 100644 index 000000000..bf089d137 --- /dev/null +++ b/quartz/i18n/locales/cs-CZ.ts @@ -0,0 +1,84 @@ +import { Translation } from "./definition" + +export default { + propertyDefaults: { + title: "Bez názvu", + description: "Nebyl uveden žádný popis", + }, + components: { + callout: { + note: "Poznámka", + abstract: "Abstract", + info: "Info", + todo: "Todo", + tip: "Tip", + success: "Úspěch", + question: "Otázka", + warning: "Upozornění", + failure: "Chyba", + danger: "Nebezpečí", + bug: "Bug", + example: "Příklad", + quote: "Citace", + }, + backlinks: { + title: "Příchozí odkazy", + noBacklinksFound: "Nenalezeny žádné příchozí odkazy", + }, + themeToggle: { + lightMode: "Světlý režim", + darkMode: "Tmavý režim", + }, + explorer: { + title: "Procházet", + }, + footer: { + createdWith: "Vytvořeno pomocí", + }, + graph: { + title: "Graf", + }, + recentNotes: { + title: "Nejnovější poznámky", + seeRemainingMore: ({ remaining }) => `Zobraz ${remaining} dalších →`, + }, + transcludes: { + transcludeOf: ({ targetSlug }) => `Zobrazení ${targetSlug}`, + linkToOriginal: "Odkaz na původní dokument", + }, + search: { + title: "Hledat", + searchBarPlaceholder: "Hledejte něco", + }, + tableOfContents: { + title: "Obsah", + }, + contentMeta: { + readingTime: ({ minutes }) => `${minutes} min čtení`, + }, + }, + pages: { + rss: { + recentNotes: "Nejnovější poznámky", + lastFewNotes: ({ count }) => `Posledních ${count} poznámek`, + }, + error: { + title: "Nenalezeno", + notFound: "Tato stránka je buď soukromá, nebo neexistuje.", + home: "Návrat na domovskou stránku", + }, + folderContent: { + folder: "Složka", + itemsUnderFolder: ({ count }) => + count === 1 ? "1 položka v této složce." : `${count} položek v této složce.`, + }, + tagContent: { + tag: "Tag", + tagIndex: "Rejstřík tagů", + itemsUnderTag: ({ count }) => + count === 1 ? "1 položka s tímto tagem." : `${count} položek s tímto tagem.`, + showingFirst: ({ count }) => `Zobrazují se první ${count} tagy.`, + totalTags: ({ count }) => `Nalezeno celkem ${count} tagů.`, + }, + }, +} as const satisfies Translation From 313cef60ee8d2454263d8ae7671c846f4d418f0e Mon Sep 17 00:00:00 2001 From: Julia van der Kris Date: Mon, 7 Oct 2024 04:15:19 +0200 Subject: [PATCH 2/4] infra: build quartz docker image to GHCR (#1192) * Add GitHub action to build & push Docker image to GHCR * Use double quotes to keep `prettier` happy :) * Don't run Docker build & push on forks * -1 char commit lmao * Add git metadata to Docker image * Apply Aaron's patch * chore: run prettier --------- Signed-off-by: Aaron Pham Co-authored-by: Aaron Pham --- .github/workflows/docker-build-push.yaml | 117 +++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .github/workflows/docker-build-push.yaml diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml new file mode 100644 index 000000000..e72c96700 --- /dev/null +++ b/.github/workflows/docker-build-push.yaml @@ -0,0 +1,117 @@ +name: Docker build & push image + +on: + push: + branches: [v4] + tags: ["v*"] + pull_request: + branches: [v4] + paths: + - .github/workflows/docker-build-push.yaml + - quartz/** + workflow_dispatch: + +jobs: + build: + if: ${{ github.repository == 'jackyzha0/quartz' }} # Comment this out if you want to publish your own images on a fork! + runs-on: ubuntu-latest + steps: + - name: Set lowercase repository owner environment variable + run: | + echo "OWNER_LOWERCASE=${OWNER,,}" >> ${GITHUB_ENV} + env: + OWNER: "${{ github.repository_owner }}" + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4.4.1 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + install: true + driver-opts: | + image=moby/buildkit:master + network=host + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@v3.7.0 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + if: github.event_name != 'pull_request' + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata tags and labels on PRs + if: github.event_name == 'pull_request' + id: meta-pr + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz + tags: | + type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }} + labels: | + org.opencontainers.image.source="https://github.com/${{ github.repository_owner }}/quartz" + - name: Extract metadata tags and labels for main, release or tag + if: github.event_name != 'pull_request' + id: meta + uses: docker/metadata-action@v5 + with: + flavor: | + latest=auto + images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}}.{{minor}}.{{patch}} + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }} + labels: | + maintainer=${{ github.repository_owner }} + org.opencontainers.image.source="https://github.com/${{ github.repository_owner }}/quartz" + + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v6 + with: + push: true + build-args: | + GIT_SHA=${{ env.GITHUB_SHA }} + DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }} + tags: ${{ steps.meta.outputs.tags || steps.meta-pr.outputs.tags }} + labels: ${{ steps.meta.outputs.labels || steps.meta-pr.outputs.labels }} + cache-from: type=gha + cache-to: type=gha + + - name: Sign the released image + if: ${{ github.event_name != 'pull_request' }} + env: + COSIGN_EXPERIMENTAL: "true" + run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes {}@${{ steps.build-and-push.outputs.digest }} + - name: Run Trivy in GitHub SBOM mode and submit results to Dependency Graph + uses: aquasecurity/trivy-action@master + if: ${{ github.event_name != 'pull_request' }} + with: + image-ref: "ghcr.io/${{ github.repository_owner }}/quartz:sha-${{ env.GITHUB_SHA_SHORT }}" + format: "github" + output: "dependency-results.sbom.json" + github-pat: ${{ secrets.GITHUB_TOKEN }} + scanners: "vuln" + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + if: ${{ github.event_name != 'pull_request' }} + with: + image-ref: "ghcr.io/${{ github.repository_owner }}/quartz:sha-${{ env.GITHUB_SHA_SHORT }}" + format: "sarif" + output: "trivy-results.sarif" + severity: "CRITICAL" + scanners: "vuln" + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + if: ${{ github.event_name != 'pull_request' }} + with: + sarif_file: "trivy-results.sarif" From 66d7dd8677e5ef05c97773f3590d43ef97d21d98 Mon Sep 17 00:00:00 2001 From: Aaron Pham Date: Sun, 6 Oct 2024 22:34:31 -0400 Subject: [PATCH 3/4] fix(ci): run build on tags (#1483) * fix(ci): run build on tags Signed-off-by: Aaron Pham * chore: update docker warning and not push on PR Signed-off-by: Aaron Pham --------- Signed-off-by: Aaron Pham --- .github/workflows/docker-build-push.yaml | 4 ++-- Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml index e72c96700..61ec110e6 100644 --- a/.github/workflows/docker-build-push.yaml +++ b/.github/workflows/docker-build-push.yaml @@ -3,7 +3,7 @@ name: Docker build & push image on: push: branches: [v4] - tags: ["v*"] + tags: ["v*"] pull_request: branches: [v4] paths: @@ -78,7 +78,7 @@ jobs: id: build-and-push uses: docker/build-push-action@v6 with: - push: true + push: ${{ github.event_name != 'pull_request' }} build-args: | GIT_SHA=${{ env.GITHUB_SHA }} DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }} diff --git a/Dockerfile b/Dockerfile index 1d9e5915f..4493853e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-slim as builder +FROM node:20-slim AS builder WORKDIR /usr/src/app COPY package.json . COPY package-lock.json* . From 497d51973ae2a986373decbfeb7a1afe229e5fd6 Mon Sep 17 00:00:00 2001 From: Aaron Pham Date: Mon, 7 Oct 2024 02:52:14 -0400 Subject: [PATCH 4/4] chore(ci): remove signing and vuln (#1484) Signed-off-by: Aaron Pham --- .github/workflows/docker-build-push.yaml | 29 ------------------------ 1 file changed, 29 deletions(-) diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml index 61ec110e6..f3bd2cdb3 100644 --- a/.github/workflows/docker-build-push.yaml +++ b/.github/workflows/docker-build-push.yaml @@ -86,32 +86,3 @@ jobs: labels: ${{ steps.meta.outputs.labels || steps.meta-pr.outputs.labels }} cache-from: type=gha cache-to: type=gha - - - name: Sign the released image - if: ${{ github.event_name != 'pull_request' }} - env: - COSIGN_EXPERIMENTAL: "true" - run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes {}@${{ steps.build-and-push.outputs.digest }} - - name: Run Trivy in GitHub SBOM mode and submit results to Dependency Graph - uses: aquasecurity/trivy-action@master - if: ${{ github.event_name != 'pull_request' }} - with: - image-ref: "ghcr.io/${{ github.repository_owner }}/quartz:sha-${{ env.GITHUB_SHA_SHORT }}" - format: "github" - output: "dependency-results.sbom.json" - github-pat: ${{ secrets.GITHUB_TOKEN }} - scanners: "vuln" - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - if: ${{ github.event_name != 'pull_request' }} - with: - image-ref: "ghcr.io/${{ github.repository_owner }}/quartz:sha-${{ env.GITHUB_SHA_SHORT }}" - format: "sarif" - output: "trivy-results.sarif" - severity: "CRITICAL" - scanners: "vuln" - - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 - if: ${{ github.event_name != 'pull_request' }} - with: - sarif_file: "trivy-results.sarif"