Skip to content

[5.x]: Cannot use env vars for plugin licenses #18186

@harry2909

Description

@harry2909

What happened?

Description

When trying to store env variables in the plugin licenses, craft seems to just revert them back to the plain text value whenever we run project config apply.

Happy to send a video over to an email for evidence, though this has been reported internally as being really sporadic.

Update:
I have actually just noticed, it looks like something is writing to my .env file? If I use $license as the env var in the CMS, it then adds that env var to the file. Though I would've thought if the env var already exists and the license key is set to use it in the project config, it wouldn't matter.

Steps to reproduce

  1. Save an env variable in a plugin license
  2. Craft shows that there are pending project config changes
  3. Run pc/apply
  4. Plugin license now shows plain text key instead of env var

Expected behavior

Actual behavior

Craft CMS version

5.7.0

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions