diff --git a/.claude/settings.local.json b/.claude/settings.local.json index a24a752..bbba024 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -4,7 +4,9 @@ "Bash(npx svelte-check *)", "Bash(npm install *)", "Bash(npx tsc *)", - "Bash(docker compose *)" + "Bash(docker compose *)", + "Bash(npx prisma *)", + "Bash(npm run *)" ] } } diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3285ea7..69addb8 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -13,6 +13,7 @@ env: jobs: build: + if: github.repository == 'willuhmjs/wytui' runs-on: ${{ matrix.runner }} strategy: matrix: @@ -77,7 +78,7 @@ jobs: merge: runs-on: ubuntu-latest - if: github.event_name != 'pull_request' + if: github.repository == 'willuhmjs/wytui' && github.event_name != 'pull_request' needs: build permissions: contents: read diff --git a/.github/workflows/helm-publish.yml b/.github/workflows/helm-publish.yml index 0993a7b..d39b475 100644 --- a/.github/workflows/helm-publish.yml +++ b/.github/workflows/helm-publish.yml @@ -12,6 +12,7 @@ env: jobs: helm: + if: github.repository == 'willuhmjs/wytui' runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 9484829..6367829 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,6 +17,7 @@ concurrency: jobs: deploy: + if: github.repository == 'willuhmjs/wytui' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/.gitignore b/.gitignore index 6edb203..b3586b4 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,6 @@ extension-artifacts/ wytui-extension-*.zip extension/.amo-upload-uuid + +# Qwen tooling artifacts +.qwen/ diff --git a/charts/wytui/templates/config/secret.yaml b/charts/wytui/templates/config/secret.yaml index ad31c8c..9fe2d24 100644 --- a/charts/wytui/templates/config/secret.yaml +++ b/charts/wytui/templates/config/secret.yaml @@ -22,6 +22,15 @@ stringData: {{- end }} --- {{- if and .Values.oidc.enabled (not .Values.oidc.secret.existing) }} +{{- $oidcClientId := .Values.oidc.secret.clientId -}} +{{- $oidcClientSecret := .Values.oidc.secret.clientSecret -}} +{{- $oidcIssuer := .Values.oidc.secret.issuer -}} +{{- $existingOidc := (lookup "v1" "Secret" .Release.Namespace .Values.oidc.secret.name) -}} +{{- if $existingOidc -}} + {{- if not $oidcClientId -}}{{- $oidcClientId = index $existingOidc.data .Values.oidc.secret.clientIdKey | default "" | b64dec -}}{{- end -}} + {{- if not $oidcClientSecret -}}{{- $oidcClientSecret = index $existingOidc.data .Values.oidc.secret.clientSecretKey | default "" | b64dec -}}{{- end -}} + {{- if not $oidcIssuer -}}{{- $oidcIssuer = index $existingOidc.data .Values.oidc.secret.issuerKey | default "" | b64dec -}}{{- end -}} +{{- end -}} apiVersion: v1 kind: Secret metadata: @@ -29,7 +38,7 @@ metadata: namespace: {{ .Release.Namespace }} type: Opaque stringData: - {{ .Values.oidc.secret.clientIdKey }}: {{ .Values.oidc.secret.clientId | quote }} - {{ .Values.oidc.secret.clientSecretKey }}: {{ .Values.oidc.secret.clientSecret | quote }} - {{ .Values.oidc.secret.issuerKey }}: {{ .Values.oidc.secret.issuer | quote }} + {{ .Values.oidc.secret.clientIdKey }}: {{ $oidcClientId | quote }} + {{ .Values.oidc.secret.clientSecretKey }}: {{ $oidcClientSecret | quote }} + {{ .Values.oidc.secret.issuerKey }}: {{ $oidcIssuer | quote }} {{- end }} diff --git a/docker-init.sh b/docker-init.sh index 30128b9..d5315b5 100755 --- a/docker-init.sh +++ b/docker-init.sh @@ -6,6 +6,29 @@ set -e ENV_FILE=".env" +# Ensure KEY exists with a non-empty value in $ENV_FILE. +# Appends the key if missing, fills it in if present but empty. +# $1 = key name, $2 = value to use when the key is missing/empty +ensure_var() { + local key="$1" + local value="$2" + + # Already set with a non-empty value -> leave it alone + if grep -qE "^${key}=.+" "$ENV_FILE" 2>/dev/null; then + return + fi + + if grep -qE "^${key}=" "$ENV_FILE" 2>/dev/null; then + # Present but empty -> fill in the value + sed -i.bak "s|^${key}=.*|${key}=${value}|" "$ENV_FILE" && rm -f "$ENV_FILE.bak" + echo " • Set empty ${key}" + else + # Missing entirely -> append it + printf '%s=%s\n' "$key" "$value" >> "$ENV_FILE" + echo " • Added missing ${key}" + fi +} + # Check if .env exists if [ ! -f "$ENV_FILE" ]; then echo "📝 No .env file found. Generating secure credentials..." @@ -38,10 +61,18 @@ EOF echo "" else echo "✅ Using existing $ENV_FILE" + + # An existing .env may predate Docker support (e.g. a dev file with only + # DATABASE_URL). Ensure the variables docker-compose.yml requires are present. + echo "🔧 Ensuring Docker Compose credentials are set..." + ensure_var POSTGRES_USER postgres + ensure_var POSTGRES_PASSWORD "$(openssl rand -hex 32)" + ensure_var POSTGRES_DB wytui + ensure_var AUTH_SECRET "$(openssl rand -hex 32)" fi -# Check if credentials are set -if grep -q "POSTGRES_PASSWORD=$" "$ENV_FILE" 2>/dev/null || grep -q "AUTH_SECRET=$" "$ENV_FILE" 2>/dev/null; then +# Final safety net: refuse to start with empty required credentials +if grep -qE "^POSTGRES_PASSWORD=$" "$ENV_FILE" 2>/dev/null || grep -qE "^AUTH_SECRET=$" "$ENV_FILE" 2>/dev/null; then echo "⚠️ WARNING: Empty credentials detected in $ENV_FILE" echo " Please set POSTGRES_PASSWORD and AUTH_SECRET" exit 1 diff --git a/src/lib/components/download/SubscriptionConfig.svelte b/src/lib/components/download/SubscriptionConfig.svelte new file mode 100644 index 0000000..594f5b3 --- /dev/null +++ b/src/lib/components/download/SubscriptionConfig.svelte @@ -0,0 +1,181 @@ + + +
+ Automatically save downloads to your library (requires library + path configured) +
++ Additional download options to apply to all videos from this + subscription +
+