Repository navigation
Merged
Conversation
…s in 3.1 SOFASCORE_API_TOKEN, SOFASCORE_ALLOWED_HOSTS, USE_PROXY and PROXY_URL are deprecated but still read, as their new environment names, with a warning that they are removed in 3.2. Dropping them silently left an upgraded server without its access token or host allow-list, and sent SofaScore requests from the real address instead of the proxy. The new name (or a flag, token_env, proxy_env) wins when both are set and the old one is reported as ignored. PROXY_URL alone still does not switch the proxy on. The value keeps the secret handling of the new name, and config show, doctor, diagnostics and the Settings page (new optional replaced_by field) say it came from the deprecated name. The Docker entry point counts SOFASCORE_ALLOWED_HOSTS as given again.
This was referenced Oct 9, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FX-35, release-blocking for 3.1.0. Owner decision of 2026-10-09: the 2.x names that 3.0.0 documented for protecting the server are still read in 3.1, with a deprecation warning, and removed in 3.2. The orchestrator added the proxy names under the same rule because they are a privacy matter.
Problem
P30 (#186) stopped reading every 2.x environment name, and a name that is still set only produces a
legacy_namewarning. But 3.0.0's README anddocs/deploytold users to protect the server withSOFASCORE_API_TOKENandSOFASCORE_ALLOWED_HOSTS. Upgrading to 3.1 without renaming them would have:USE_PROXY/PROXY_URL, sent SofaScore requests from the user's real address instead of the configured proxy.The Docker entry point made the allow-list case worse. It no longer counted
SOFASCORE_ALLOWED_HOSTSas "given", so it exportedSOFASCORE_SERVER__ALLOWED_HOSTS=localhost,…, which would have overridden the old list even after the loader read it again.Change
Loader (
sofascore_scraper/config/loader.py): a small explicit tableDEPRECATED_NAMESwith four names that are deprecated but still read:SOFASCORE_API_TOKENserver.tokenSOFASCORE_SERVER__TOKEN(env only)SOFASCORE_ALLOWED_HOSTSserver.allowed_hostsSOFASCORE_SERVER__ALLOWED_HOSTS/server.allowed_hostsUSE_PROXYclient.use_proxySOFASCORE_CLIENT__USE_PROXY/client.use_proxyPROXY_URLclient.proxySOFASCORE_CLIENT__PROXY/client.proxyRules:
coerce, and a secret is stripped. It sits in the environment layer, so it wins oversofascore.tomlandoverrides.json, as the legacy environment layer did in 3.0. One difference from 3.0: there an old name that came only from.envranked below the file. 3.1 loads.envinto the environment, so the old name now ranks like any.envline, the same as the new names. ItsSourcecarriesdeprecated=True, and its layer isenv, so the Settings page row is locked.token_env/proxy_envthat names a variable. Whentoken_env/proxy_envnames the old variable itself (whatssc config init --from-legacywrites), the variable is read through that setting and gives no warning, as before.PROXY_URLon its own does not turn the proxy on, as in 3.0 and 2.x: it needsUSE_PROXY=true(decision D19's auto-enable applies to new names only).ConfigErrorthat names the old variable, for exampleUSE_PROXY: expected true or false…. This differs from 3.0, whereUSE_PROXY=maybesilently meant false; values like1/yesnow mean true, as for the new name.USE_PROXYandPROXY_URLare added to the watched environment names, so a change is seen without a reload. The twoSOFASCORE_*names were already covered by the prefix.Warning text (code
legacy_name, the same in the log,config show/config validatewarnings and diagnostics):SOFASCORE_API_TOKEN (set in the environment) is deprecated; still read in 3.1, removed in 3.2; use SOFASCORE_SERVER__TOKEN.SOFASCORE_API_TOKEN (set in .env) is ignored because SOFASCORE_SERVER__TOKEN is also set; SOFASCORE_API_TOKEN is deprecated and removed in 3.2: remove it.… is no longer read since 3.1; use ….Where the old name shows up:
ssc doctor: new stringsdoctor_env_deprecated_nameanddoctor_env_deprecated_ignored(en and tr). They show where the name is set (.envor the environment) using the FX-33 origin rule, and the fix line works as before.ssc config show: each row has a newreplaced_byfield (null unless the value came from a deprecated name). The text output readsserver.token = "***" [env: SOFASCORE_API_TOKEN, deprecated, use SOFASCORE_SERVER__TOKEN].settings.warningslist holding the loader's warnings, which contain names only.Settinggains an optionalreplaced_by. This is an additive API change:docs/api/openapi-v1.jsonandfrontend/src/api/v1/schema.tswere regenerated. The locked row says "Set by the old environment variable SOFASCORE_API_TOKEN. It is deprecated: still read in 3.1, removed in 3.2. Rename it to SOFASCORE_SERVER__TOKEN." (en and tr).security.token_variable(): namesSOFASCORE_API_TOKENwhen the token came from it, so the short-token start-up warning names the right variable.Secret handling. A token from the old name gets the same treatment as one from
SOFASCORE_SERVER__TOKEN:server.token, and writing another key does not carry the token intooverrides.json.config show, the Settings API, diagnostics and logs.redactalready knew both old names.PROXY_URLshows only the masked user info, and its row is locked.SOFASCORE_API_TOKENfrom its isolated environment.serve --host 0.0.0.0starts with the old allow-list name, as in 3.0. The list comes from the settings,allowed_hosts_from = "settings", and nothing is written to the environment.Docker entry point: counts
SOFASCORE_ALLOWED_HOSTSagain, from the environment or from.env, as 3.0 did. A test case covers each source.Docs:
docs/deploy/README.md(access token and host allow-list sections),.env.example, thedocker-compose.ymlcomment, and the entry point and module docstrings now say the four names still work in 3.1 with a warning and are removed in 3.2.README.md/README.tr.mdon main have no "Upgrading from 3.0" section (it comes with #195), so suggested wording is below. Not touched:CHANGELOG.md,research/**,docs/design/**.Tests
tests/test_fx35_deprecated_names.py, for each of the four names:env, deprecated and locked, and the warning names where it is set (environment or.env);Plus:
token_env/proxy_envwin; the variable named by--from-legacyis silent.PROXY_URLalone does not turn the proxy on;USE_PROXY=falseturns off a new-name proxy./api/v1, with and without a root path (/sofa); the new name wins when both are set.overrides.json; the proxy password is masked and its row locked.serve:--host 0.0.0.0starts withSOFASCORE_ALLOWED_HOSTS, andexposed_without_tokengoes away withSOFASCORE_API_TOKEN.config show/config validategive the JSON and text described above.doctor: each name in.envand in the environment, the both-set case, and Turkish.Adjusted existing tests:
SOFASCORE_API_TOKEN/PROXY_URLas "not read" now useSOFA_CAPTCHA_TOKEN, which is still not read;USE_PROXY/PROXY_URLto be read and the new name to win;replaced_by;Local runs:
STORE_SHADOW_CHECK=1: 9779 passed, 39 skipped, 22 deselectedruff check .: cleannpm ci,npm run build,npm run lintandnpm test(368 passed)Changelog entry
For the release PR #195. Add under a new
### Deprecatedheading in## [3.1.0]:and replace the first bullet of "Upgrading from 3.0" in the same section with:
If the "Removed" section lists "the 2.x environment names", make it "the 2.x environment names (except the four under Deprecated)".
README wording (for #195, "Upgrading from 3.0")
README.md, replacing the bullet "Rename the 2.x environment names.":
README.tr.md, replacing "2.x ortam adlarını yeniden adlandırın.":
The "Configuration" bullet ("The variable names of 2.x … are not read since 3.1.0") could add: "; four of them (
SOFASCORE_API_TOKEN,SOFASCORE_ALLOWED_HOSTS,USE_PROXY,PROXY_URL) are deprecated and still read until 3.2". In Turkish: "; dördü (SOFASCORE_API_TOKEN,SOFASCORE_ALLOWED_HOSTS,USE_PROXY,PROXY_URL) kullanımdan kalktı ve 3.2'ye kadar okunur".Other 2.x names: reported, not changed
API_BASE_URL(client.base_url): this is the only other one whose loss touches privacy. A 2.x/3.0 user who pointed it at their own relay or mirror would, after 3.1, send requests straight towww.sofascore.comfrom their own address. 3.0's docs did not present it as a protection, anddoctorflags a non-SofaScore base URL anyway.SOFASCORE_THROTTLE_DIR,REQUEST_RATE_LIMIT,MAX_CONCURRENT: losing them can raise the request rate (several processes no longer share one budget, or the default rate applies). That is a block risk, not a security or privacy one.IGNORE_RATE_LIMITgoing away is safer, andLOG_DIR,SOFASCORE_BROWSER_PROFILEandDATA_DIRchange locations only.