chocolatey / chocolatey-licensed-issues

Issues for Licensed Editions of Chocolatey
19 stars 13 forks source link

New License Enables Licensed Feed Even When Originally Disabled #362

Open sync-by-unito[bot] opened 12 months ago

sync-by-unito[bot] commented 12 months ago

What You Are Seeing?

When a new Chocolatey license is installed on a machine it is re-adding the chocolatey.licensed source. The issue is, it is re-enabling this source even if before the new license file is placed this source was marked as disabled.

What is Expected?

If the chocolatey.licensed source is marked as disabled. When adding a new license file Chocolatey should respect the config statement of the source being disabled and simply change the auth to the feed with the new license id value only.

Chocolatey should only update the sources saved auth and not re-enable the source.

How Did You Get This To Happen? (Steps to Reproduce)

  1. Have a licensed Chocolatey instance (chocolatey, chocolatey.extension, and a business license installed)
  2. Disable the chocolatey.licensed source
  3. Place a newer license file at C:\ProgramData\chocolatey\license
  4. Run choco source list and see that when Chocolatey reads the new license file it updates the source auth an re-enables it.

System Details

Output Log

N/A as didn't see any relevant parts. Happy to supply if needed.

Workarounds

  1. Run a choco source disable -n chocolatey.licensed after placing/deploying your new license file.

Proposed Solution

  1. Likely reference the current state of the source(enabled or disabled) and bake that into the code behind Chocolatey CLI/Extension that is auto updating the source when a new license is placed.

Related Issues and Tickets

Done Checklist

┆Issue is synchronized with this Gitlab issue by Unito