Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding COMPANION_SECRET does not pick up the secret value #5236

Closed
2 tasks done
gprasad98 opened this issue Jun 7, 2024 · 1 comment
Closed
2 tasks done

Adding COMPANION_SECRET does not pick up the secret value #5236

gprasad98 opened this issue Jun 7, 2024 · 1 comment
Assignees
Labels

Comments

@gprasad98
Copy link

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

Testing a Companion server in standalone for our application. Running it with the secret as either env variable or through a config json doesn't seem to work. Config below

{
    "server": {
      "host": "companion.xxx.com",
      "protocol": "https"
    },
    "allowLocalUrls": true,
    "filePath": "/home/user/uppy/data",
    "uploadUrls": ["https://xxx.example.com"],
    "streamingUpload": true,
    "secret": "IssaSecretThatMightWork"
}

Also tried COMPANION_SECRET as well as COMPANION_SECRET_FILE which did not help

Expected behavior

Companion uses the provided secret string IssaSecretThatMightWork

Actual behavior

It does not use the provided string instead there is a warning on secret not being set

0|companio | companion: 2024-06-07T13:31:17.362Z [warn] startup.secret auto-generating server secret because none was specified
0|companio | companion: 2024-06-07T13:31:17.397Z [info] jobs.cleanup.start starting clean up job
0|companio | companion: 2024-06-07T13:31:17.431Z [info]  Welcome to Companion! v4.13.3
0|companio | companion: 2024-06-07T13:31:17.432Z [info]  Listening on http://localhost:3020
@mifi
Copy link
Contributor

mifi commented Jun 11, 2024

I suspect that companion detects the secret correctly, but it triggers the warning message due to preAuthSecret not being set. see

if (!companionOptions.preAuthSecret) companionOptions.preAuthSecret = generateSecret()

If you don't use the preauth feature in companion, you should be able to disable the message by setting a dummy value e.g. COMPANION_PREAUTH_SECRET=unused

we should probably improve this log message to include "preauth secret" in this case

mifi added a commit that referenced this issue Jun 12, 2024
@aduh95 aduh95 closed this as completed in 3371880 Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants