Skip to content

Commit

Permalink
fix pre-commit and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PrivatePuffin committed Oct 19, 2024
1 parent 2acb59c commit 4ab41d4
Show file tree
Hide file tree
Showing 203 changed files with 9,107 additions and 9,135 deletions.
1 change: 0 additions & 1 deletion .github/actions/collect-changes/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ runs:
# Set output to changed charts
echo "Changed charts: ${CHARTS[*]}"
printf "::set-output name=addedOrModified::%s\n" "${CHARTS[*]}"
2 changes: 1 addition & 1 deletion .github/renovate/special/customClusterManagers.json5
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
// "versioningTemplate": "redhat"
// }
]
}
}
6 changes: 3 additions & 3 deletions .github/scripts/cr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ parse_command_line() {
check_existing_tag() {
local chart_name="$1"
local tag="$2"

echo "Checking if tag '$tag' exists for chart '$chart_name' on OCI..."

# Query the OCI registry for existing tags
local response
response=$(curl -s -H "Authorization: Bearer ${quay_token}" \
Expand All @@ -97,7 +97,7 @@ check_existing_tag() {

local tag_exists
tag_exists=$(echo "$response" | jq -r --arg tag "$tag" '.tags[]? | select(.name == $tag) | .name')

if [[ "$tag_exists" == "$tag" ]]; then
echo "Tag '$tag' already exists for chart '$chart_name'."
return 0
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/charts-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
pull-requests: write
name: "${{ github.ref == 'refs/heads/master' && '(Production)' || '(Preview)' }}"
runs-on: actions-runners

steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
Expand Down Expand Up @@ -79,12 +79,12 @@ jobs:
pre-commit run --all ||:
# Fix sh files to always be executable
find . -name '*.sh' | xargs chmod +x
- name: Install Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # tag=v3
with:
version: v3.14.0

# Optional step if GPG signing is used
- name: Prepare GPG key
if: github.event_name == 'push'
Expand All @@ -100,12 +100,12 @@ jobs:
env:
GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}"
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"

- name: Helm | Login
if: github.event_name == 'push'
shell: bash
run: echo ${{ secrets.QUAY_SECRET }} | helm registry login -u ${{ secrets.QUAY_USER }} --password-stdin quay.io

- name: Release Charts
shell: bash
if: github.event_name == 'push'
Expand All @@ -117,7 +117,7 @@ jobs:
install="$RUNNER_TOOL_CACHE/cr/${{ inputs.version }}/$(uname -m)"
echo "$install" >> "$GITHUB_PATH"
./.github/scripts/cr.sh --quay-token "${{ secrets.QUAY_TOKEN }}" --instal-dir $install
- name: Helm | Logout
shell: bash
if: github.event_name == 'push'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/clustertool.release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ jobs:
version: "~> v2" # or 'latest', 'nightly', semver
env:
GITHUB_TOKEN: "${{ secrets.BOT_TOKEN }}"

4 changes: 2 additions & 2 deletions .github/workflows/containers.build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
- id: reduce
run: |
CONTAINERS=$(jq --raw-output '.changed_files | fromjson | .[] |= sub("(?<filepath>/?containers/(?<first_directory>(?<root1>[/]?)[^/]+/)(?<second_directory>(?<root2>[/]?)[^/]+)(?<extra_paths>/[^/]+)*)"; "\(.second_directory)") | unique' changes.json)
# Set the containers output
echo ::set-output name=containers::${CONTAINERS}
# Check if containers were found and set the containers_found output
if [[ "$CONTAINERS" == "[]" || -z "$CONTAINERS" ]]; then
echo "No Containers Found, Skipping"
Expand Down
9 changes: 1 addition & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: remove-tabs

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace # trims trailing whitespace.
exclude: ^archive/
Expand Down Expand Up @@ -48,10 +48,3 @@ repos:
exclude: ^archive/
- id: rst-backticks
exclude: ^archive/

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
exclude: (^archive|^website\/public|templates\/.*|crds\/.*|README.md|CHANGELOG.md|questions.yaml|devcontainer.json|^clustertool)
files: \.(js|ts|jsx|tsx|css|less|html|json|markdown|md|yaml|yml)$
3 changes: 1 addition & 2 deletions charts/incubator/comet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ persistence:
enabled: true
type: emptyDir
mountPath: "/.cache"

cnpg:
main:
enabled: true
Expand All @@ -53,4 +53,3 @@ cnpg:
portal:
open:
enabled: true

8 changes: 4 additions & 4 deletions charts/incubator/riven/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ workload:
RIVEN_FORCE_ENV: "true"
ZURG_URL: somezurgurl:9999
# Set this to your rclone's mount `__all__` dir if using Zurg
RIVEN_SYMLINK_RCLONE_PATH: "/mnt/zurg/__all__"
RIVEN_SYMLINK_RCLONE_PATH: "/mnt/zurg/__all__"
# This is the path that symlinks will be placed in
RIVEN_SYMLINK_LIBRARY_PATH: "/mnt/library"
RIVEN_SYMLINK_LIBRARY_PATH: "/mnt/library"
RIVEN_DATABASE_HOST: '{{ printf "postgresql+psycopg2://%s:%s@%s.%s/%s" .Values.cnpg.main.user .Values.cnpg.main.creds.password (.Values.cnpg.main.creds.host | trimAll "\"") .Release.Namespace .Values.cnpg.main.database }}'
RIVEN_DOWNLOADERS_REAL_DEBRID_ENABLED: "false"
# set your real debrid api key
RIVEN_DOWNLOADERS_REAL_DEBRID_API_KEY: "xxxxx"
RIVEN_UPDATERS_PLEX_ENABLED: "false"
RIVEN_UPDATERS_PLEX_URL: "http://plex:32400"
# set your plex token"
RIVEN_UPDATERS_PLEX_TOKEN: "xxxxx"
RIVEN_UPDATERS_PLEX_TOKEN: "xxxxx"
RIVEN_CONTENT_OVERSEERR_ENABLED: "false"
RIVEN_CONTENT_OVERSEERR_URL: "http://overseerr:5055"
# set your overseerr token
Expand Down Expand Up @@ -94,7 +94,7 @@ persistence:
data:
enabled: true
mountPath: "/riven/data"
zurg-all:
zurg-all:
enabled: true
mountPath: "/mnt/zurg/__all__"
library:
Expand Down
3 changes: 1 addition & 2 deletions charts/incubator/zilean/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ persistence:
data:
enabled: true
mountPath: "/app/data"

cnpg:
main:
enabled: true
Expand All @@ -39,4 +39,3 @@ cnpg:
portal:
open:
enabled: true

52 changes: 26 additions & 26 deletions charts/incubator/zurg/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ workload:
type: tcp
env:
# forces the use of env vars to be always used!
zurg_FORCE_ENV: "true"
zurg_FORCE_ENV: "true"
# Set this to your rclone's mount `__all__` dir if using Zurg
LOG_LEVEL: DEBUG
LOG_LEVEL: DEBUG

zurg:
token: YOURTOKEN
Expand Down Expand Up @@ -65,13 +65,13 @@ configmap:
# Zurg configuration version
zurg: v1
token: {{ .Values.zurg.token }} # https://real-debrid.com/apitoken
# basic functionality
host: "[::]" # do not change this if you are running it inside a docker container
port: 9999 # do not change this if you are running it inside a docker container
concurrent_workers: 32
check_for_changes_every_secs: 10
# misc configs
retain_folder_name_extension: false # if true, zurg won't modify the filenames from real-debrid
retain_rd_torrent_name: true # if true, it will strictly follow RD API torrent name property w/c should make this more compatible with rdt-client
Expand All @@ -81,7 +81,7 @@ configmap:
enable_repair: false # Don't change this, we run a separate zurg for doing repairs without blocking i/o
on_library_update: sh plex_update.sh "$@"
ignore_renames: true
# advanced alternative for Jellyfin/Emby support
# on_library_update: |-
# # Log the updated directories and send refresh request to autoscan
Expand All @@ -90,10 +90,10 @@ configmap:
# echo "Detected update on: $arg"
# # URL encode the directory path
# encoded_arg=$(python -c "import urllib.parse; print(urllib.parse.quote_plus('$arg'))")
# curl -s -X GET "http://autoscan:3030/triggers/manual?dir=/storage/realdebrid-zurg/$encoded_arg"
# curl -s -X GET "http://autoscan:3030/triggers/manual?dir=/storage/realdebrid-zurg/$encoded_arg"
# done
# echo "All updated sections refreshed."
# network configs
network_buffer_size: 1048576 # 1 MiB
serve_from_rclone: false # serve file data from rclone, not from zurg (zurg will only provide rclone the link to download)
Expand All @@ -112,7 +112,7 @@ configmap:
# - 32.download.real-debrid.com
# - 34.download.real-debrid.com
# - 40.download.real-debrid.com
# List of directory definitions and their filtering rules
directories:
# Configuration for anime shows
Expand All @@ -124,13 +124,13 @@ configmap:
- has_episodes: true # intelligent detection of episode files inside a torrent
- any_file_inside_regex: /^\[/ # usually anime starts with [ e.g. [SubsPlease]
- any_file_inside_not_regex: /s\d\de\d\d/i # and usually anime doesn't use SxxExx
shows:
group: media
group_order: 20
filters:
- has_episodes: true # intelligent detection of episode files inside a torrent
movies:
group: media # because anime, shows and movies are in the same group,
group_order: 30 # and anime and shows has a lower group_order number than movies, all torrents that doesn't fall into the previous 2 will fall into movies
Expand All @@ -143,56 +143,56 @@ configmap:
data:
plex_update.sh: |
#!/bin/bash
# PLEX PARTIAL SCAN script or PLEX UPDATE script
# When zurg detects changes, it can trigger this script IF your config.yml contains
# on_library_update: sh plex_update.sh "$@"
# Modified from https://github.com/debridmediamanager/zurg-testing/blob/main/plex_update.sh
plex_url="http://plex:32400" # If you're using zurg inside a Docker container, by default it is 172.17.0.1:32400
token="yourplextoken" # open Plex in a browser, open dev console and copy-paste this: window.localStorage.getItem("myPlexAccessToken")
zurg_mount="/storage/realdebrid-zurg" # replace with your zurg mount path, ensure this is what Plex sees
# Get the list of section IDs
section_ids=$(curl -sLX GET "$plex_url/library/sections" -H "X-Plex-Token: $token" | xmllint --xpath "//Directory/@key" - | sed 's/key="//g' | tr '"' '\n')
for arg in "$@"
do
modified_arg="$zurg_mount/$arg"
echo "Detected update on: $arg"
echo "Absolute path: $modified_arg"
##### START Added by ElfHosted for auto DMM symlinking ###
echo "Symlinking $modified_arg to /storage/symlinks/real-debrid-blackhole/$arg"
# Ensure blackhole exists
mkdir -p /storage/symlinks/real-debrid-blackhole/movies
mkdir -p /storage/symlinks/real-debrid-blackhole/shows
# Copy to the RD blackhole, preserving the directory structure
cp -rs "$modified_arg/"* "/storage/symlinks/real-debrid-blackhole/$(echo $arg | cut -f1 -d/)/"
##### END Added by ElfHosted for auto DMM symlinking ###
encoded_arg=$(echo -n "$modified_arg" | python3 -c "import sys, urllib.parse as ul; print (ul.quote_plus(sys.stdin.read()))")
if [ -z "$encoded_arg" ]; then
echo "Error: Encoded argument is empty. Check the input or encoding process."
continue
fi
for section_id in $section_ids
do
final_url="${plex_url}/library/sections/${section_id}/refresh?path=${encoded_arg}&X-Plex-Token=${token}"
echo "Encoded argument: $encoded_arg"
echo "Section ID: $section_id"
echo "Final URL: $final_url"
curl -s "$final_url"
done
done
echo "All updated sections refreshed"
# credits to godver3
# credits to godver3
2 changes: 1 addition & 1 deletion clustertool/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ ssh-public-key.txt
*.DS_Store
!/embed/**
.DS_Store
.github
.github
36 changes: 18 additions & 18 deletions clustertool/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
"recommendations": [
"golang.go",
"redhat.vscode-yaml",
"formulahendry.code-runner",
"streetsidesoftware.code-spell-checker",
"Codium.codium",
"mrmlnc.vscode-duplicate",
"IgorSbitnev.error-gutters",
"usernamehw.errorlens",
"mhutchie.git-graph",
"eamodio.gitlens",
"vivaldy22.go-auto-struct-tag",
"msyrus.go-doc",
"766b.go-outliner",
"premparihar.gotestexplorer",
"yzhang.markdown-all-in-one",
"searKing.preview-vscode",
"zxh404.vscode-proto3",
"DavidAnson.vscode-markdownlint",
"GitHub.copilot"
"formulahendry.code-runner",
"streetsidesoftware.code-spell-checker",
"Codium.codium",
"mrmlnc.vscode-duplicate",
"IgorSbitnev.error-gutters",
"usernamehw.errorlens",
"mhutchie.git-graph",
"eamodio.gitlens",
"vivaldy22.go-auto-struct-tag",
"msyrus.go-doc",
"766b.go-outliner",
"premparihar.gotestexplorer",
"yzhang.markdown-all-in-one",
"searKing.preview-vscode",
"zxh404.vscode-proto3",
"DavidAnson.vscode-markdownlint",
"GitHub.copilot"
]
}
}
2 changes: 1 addition & 1 deletion clustertool/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{

}
}
2 changes: 1 addition & 1 deletion clustertool/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
"problemMatcher" : []
},
]
}
}
Loading

0 comments on commit 4ab41d4

Please sign in to comment.