diff --git a/.github/workflows/translate_af.yml b/.github/workflows/translate_af.yml index d189c3a85..3555b6843 100644 --- a/.github/workflows/translate_af.yml +++ b/.github/workflows/translate_af.yml @@ -21,8 +21,11 @@ jobs: run-translation: runs-on: ubuntu-latest container: - # Use the image you pushed to GHCR image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest + environment: prod + env: + LANGUAGE: Afrikaans + BRANCH: af steps: - name: Checkout code diff --git a/.github/workflows/translate_de.yml b/.github/workflows/translate_de.yml index 57ee8e30e..359487159 100644 --- a/.github/workflows/translate_de.yml +++ b/.github/workflows/translate_de.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: de @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: German BRANCH: de - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_el.yml b/.github/workflows/translate_el.yml index 1217f30e6..6e00805ee 100644 --- a/.github/workflows/translate_el.yml +++ b/.github/workflows/translate_el.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: el @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Greek BRANCH: el - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC @@ -116,4 +78,4 @@ jobs: # Sync the build to S3 - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete \ No newline at end of file + run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete diff --git a/.github/workflows/translate_es.yml b/.github/workflows/translate_es.yml index 5316161b4..2dd4be727 100644 --- a/.github/workflows/translate_es.yml +++ b/.github/workflows/translate_es.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: es @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Spanish BRANCH: es - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_fr.yml b/.github/workflows/translate_fr.yml index 0e0a522c0..0b0ddfac3 100644 --- a/.github/workflows/translate_fr.yml +++ b/.github/workflows/translate_fr.yml @@ -1,4 +1,4 @@ -name: Translator to FR (French) +name: Translator to FR (FRench) on: push: @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: fr @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: French BRANCH: fr - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_hi.yml b/.github/workflows/translate_hi.yml index 20d008d11..0e76fc9ca 100644 --- a/.github/workflows/translate_hi.yml +++ b/.github/workflows/translate_hi.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: hi @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Hindi BRANCH: hi - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_it.yml b/.github/workflows/translate_it.yml index 16c966aa0..f0748a397 100644 --- a/.github/workflows/translate_it.yml +++ b/.github/workflows/translate_it.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: it @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Italian BRANCH: it - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC @@ -116,4 +78,4 @@ jobs: # Sync the build to S3 - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete \ No newline at end of file + run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete diff --git a/.github/workflows/translate_ja.yml b/.github/workflows/translate_ja.yml index d29f810ed..692201f6b 100644 --- a/.github/workflows/translate_ja.yml +++ b/.github/workflows/translate_ja.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: ja @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Japanese BRANCH: ja - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_ko.yml b/.github/workflows/translate_ko.yml index 38937cb19..710517aaf 100644 --- a/.github/workflows/translate_ko.yml +++ b/.github/workflows/translate_ko.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: ko @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Korean BRANCH: ko - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC @@ -116,4 +78,4 @@ jobs: # Sync the build to S3 - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete \ No newline at end of file + run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete diff --git a/.github/workflows/translate_pl.yml b/.github/workflows/translate_pl.yml index 86b3e8cb5..3ebc0cfdd 100644 --- a/.github/workflows/translate_pl.yml +++ b/.github/workflows/translate_pl.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: pl @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Polish BRANCH: pl - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC @@ -116,4 +78,4 @@ jobs: # Sync the build to S3 - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete \ No newline at end of file + run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete diff --git a/.github/workflows/translate_pt.yml b/.github/workflows/translate_pt.yml index 5120bbce7..3ea67af24 100644 --- a/.github/workflows/translate_pt.yml +++ b/.github/workflows/translate_pt.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: pt @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Portuguese BRANCH: pt - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_sr.yml b/.github/workflows/translate_sr.yml index c32640acd..a2419adad 100644 --- a/.github/workflows/translate_sr.yml +++ b/.github/workflows/translate_sr.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: sr @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Serbian BRANCH: sr - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC @@ -116,4 +78,4 @@ jobs: # Sync the build to S3 - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete \ No newline at end of file + run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete diff --git a/.github/workflows/translate_sw.yml b/.github/workflows/translate_sw.yml index 67ee51b2f..70e1d4018 100644 --- a/.github/workflows/translate_sw.yml +++ b/.github/workflows/translate_sw.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: sw @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Swahili BRANCH: sw - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC @@ -116,4 +78,4 @@ jobs: # Sync the build to S3 - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete \ No newline at end of file + run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete diff --git a/.github/workflows/translate_tr.yml b/.github/workflows/translate_tr.yml index 3bb3ae441..17942145c 100644 --- a/.github/workflows/translate_tr.yml +++ b/.github/workflows/translate_tr.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: tr @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Turkish BRANCH: tr - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC @@ -116,4 +78,4 @@ jobs: # Sync the build to S3 - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete \ No newline at end of file + run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete diff --git a/.github/workflows/translate_uk.yml b/.github/workflows/translate_uk.yml index 17a3caa0d..fa0f823c6 100644 --- a/.github/workflows/translate_uk.yml +++ b/.github/workflows/translate_uk.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: uk @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Ukranian BRANCH: uk - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC diff --git a/.github/workflows/translate_zh.yml b/.github/workflows/translate_zh.yml index c77966e0d..08a93e0db 100644 --- a/.github/workflows/translate_zh.yml +++ b/.github/workflows/translate_zh.yml @@ -8,6 +8,7 @@ on: - 'scripts/**' - '.gitignore' - '.github/**' + - Dockerfile workflow_dispatch: concurrency: zh @@ -19,93 +20,54 @@ permissions: jobs: run-translation: runs-on: ubuntu-latest + container: + image: ghcr.io/HackTricks-wiki/hacktricks-cloud/translator-image:latest environment: prod env: LANGUAGE: Chinese BRANCH: zh - + steps: - name: Checkout code uses: actions/checkout@v2 with: - fetch-depth: 0 #Needed to download everything to be able to access the master & language branches - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip3 install openai tqdm tiktoken + fetch-depth: 0 - # Install Rust and Cargo - - name: Install Rust and Cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - # Install mdBook and Plugins - - name: Install mdBook and Plugins + - name: Update & install translator.py (if needed) run: | - cargo install mdbook - cargo install mdbook-alerts - cargo install mdbook-reading-time - cargo install mdbook-pagetoc - cargo install mdbook-tabs - cargo install mdbook-codename - - - - name: Update & install wget & translator.py - run: | - sudo apt-get update - sudo apt-get install wget -y cd scripts rm -f translator.py wget https://raw.githubusercontent.com/carlospolop/hacktricks-cloud/master/scripts/translator.py cd .. - - - name: Download language branch #Make sure we have last version + + - name: Download language branch run: | git config --global user.name 'Translator' git config --global user.email 'github-actions@github.com' - git checkout "$BRANCH" + git checkout af git pull git checkout master - name: Run translation script on changed files run: | - echo "Starting translations" - echo "Commit: $GITHUB_SHA" - - # Export the OpenAI API key as an environment variable export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} - - # Run the translation script on each changed file git diff --name-only HEAD~1 | grep -v "SUMMARY.md" | while read -r file; do if echo "$file" | grep -qE '\.md$'; then echo -n "$file , " >> /tmp/file_paths.txt - else - echo "Skipping $file" fi done + python scripts/translator.py --language "Afrikaans" --branch "af" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - echo "Translating $(cat /tmp/file_paths.txt)" - python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 - - # Push changes to the repository - name: Commit and push changes run: | - git checkout "$BRANCH" + git checkout af git add -A - git commit -m "Translated $BRANCH files" || true - git push --set-upstream origin "$BRANCH" + git commit -m "Translated Afrikaans files" || true + git push --set-upstream origin af - # Build the mdBook - name: Build mdBook - run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) + run: | + MDBOOK_BOOK__LANGUAGE=af mdbook build || (cat hacktricks-preprocessor-error.log && exit 1) # Login in AWs - name: Configure AWS credentials using OIDC @@ -116,4 +78,4 @@ jobs: # Sync the build to S3 - name: Sync to S3 - run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete \ No newline at end of file + run: aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete diff --git a/Dockerfile b/Dockerfile index 6dc4dc95c..3c043f46f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,8 +28,3 @@ RUN cargo install mdbook-codename # Set the working directory WORKDIR /app -# (Optional) Copy your script(s) into the image -# COPY translator.py /app/translator.py - -# (Optional) Set an entrypoint or default command -# ENTRYPOINT ["mdbook"] diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md index 82263d1c0..564cec455 100644 --- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md @@ -382,4 +382,3 @@ According to the [**docs**](https://learn.microsoft.com/en-us/azure/role-based-a {{#include ../../../banners/hacktricks-training.md}} -