Skip to content

refactor / enable Trakt API keys from environment variables#692

Merged
vladjerca merged 3 commits intomainfrom
feat/prep_to_nuke_kodi_leaked_app
Feb 12, 2026
Merged

refactor / enable Trakt API keys from environment variables#692
vladjerca merged 3 commits intomainfrom
feat/prep_to_nuke_kodi_leaked_app

Conversation

@vladjerca
Copy link
Contributor

⚠️ Security Notice: Trakt API Application Deactivation

Important: The current Trakt API application (key and secret) will be disabled in 30 days.

  • Impact: Versions built with the old API credentials will no longer be able to use Trakt once the application is disabled.
  • Action Required (within 2 weeks): Add TRAKT_CLIENT_ID and
    TRAKT_CLIENT_SECRET to Repository Secrets so a new release can be built before the 30-day cutoff.

Overview

This PR secures the Trakt API credentials by moving them from plain text in the
source code to a build-time injection process. Keys are now obfuscated in the
codebase and only injected during the release build via GitHub Actions.

Key Changes

  • Security: Replaced hardcoded keys in traktapi.py with placeholders and
    added local XOR obfuscation.
  • Local Dev: Added support for TRAKT_CLIENT_ID and TRAKT_CLIENT_SECRET
    environment variables to override injected keys for development.
  • CI/CD: Updated .github/workflows/submit.yml to inject secrets from
    repository variables before packaging.

Maintainer Actions

  1. Add Secrets: Go to Repo Settings > Secrets and add TRAKT_CLIENT_ID and
    TRAKT_CLIENT_SECRET.
  2. Merge: Merge this PR to enable the new secure build process.

Injects Trakt client ID and secret into the traktapi.py file during the build process.
Allows specifying trakt client ID and secret via environment variables.
@razzeee
Copy link
Collaborator

razzeee commented Feb 11, 2026

The owners haven't been around for quiet some time so, we can't add stuff to the CI env.

The obfuscation is kinda pointless.

@vladjerca
Copy link
Contributor Author

vladjerca commented Feb 11, 2026

The owners haven't been around for quiet some time so, we can't add stuff to the CI env.

My understanding was that you are maintainer here (looking at history).

@razzeee according to Github you should have enough permissions to define these secrets https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-a-repository

The obfuscation is kinda pointless.

My goal is to reduce spread and make it harder than just copy / pasting the raw value from the zip file, hence not pointless.

@vladjerca
Copy link
Contributor Author

@razzeee from what I see the Trakt for Kodi is owned by razze.

@vladjerca vladjerca merged commit 8d9a7ee into main Feb 12, 2026
3 checks passed
@vladjerca vladjerca deleted the feat/prep_to_nuke_kodi_leaked_app branch February 12, 2026 12:22
@vladjerca
Copy link
Contributor Author

vladjerca commented Feb 12, 2026

I've created a new Trakt for Kodi app and renamed the old one to Trakt for Kody - Legacy (expires 1st March) - Update Required.

@razzeee / @rudf0rd / @rectifyer the Submitter fails https://github.com/trakt/script.trakt/actions/runs/21946607250/job/63385756890

Seems like the xbmc/action-kodi-addon-submitter@v1.3 fails with invalid credentials.

@vladjerca
Copy link
Contributor Author

@razzeee / @rudf0rd from what I can tell this repository was transferred over from @razzeee the submit action required this fork to function: https://github.com/razzeee/repo-scripts

@razzeee
Copy link
Collaborator

razzeee commented Feb 12, 2026

See #627 was ignored for at least 3 years

@vladjerca
Copy link
Contributor Author

@razzeee I suggest you delete your fork and we can transfer repo ownership to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants