Skip to content

Extend remsh to read cookie from various sources #5539

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jiahuili430
Copy link
Contributor

Overview

We can set cookies using ./dev/run --erlang-cookie=crumbles or vm.args: -setcookie crumbles.

If neither of them is set or we set the cookie in both places, then the Erlang node will read the cookie from ~/.erlang.cookie.

Add this mechanism to the remsh script to extend flexibility.

Related PR: #5531

Testing recommendations

# After the change it should pass
./dev/run --admin=adm:pass -n 1 --erlang-cookie=crumbles --no-eval 'dev/remsh'

Related Issues or Pull Requests

Checklist

  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • Documentation changes were made in the src/docs folder
  • Documentation changes were backported (separated PR) to affected branches

We can set cookies using `./dev/run --erlang-cookie=crumbles` or
`vm.args`: `-setcookie crumbles`.

If neither of them is set or we set the cookie in both places, then
the Erlang node will read the cookie from `~/.erlang.cookie`.

Add this mechanism to the `remsh` script to extend flexibility.

Related PR: #5531
erl -name "$NAME" -remsh "$NODE" -hidden
fi

erl -name "$NAME" -remsh "$NODE" -hidden
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? We have it in the "else" branch already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that line should be removed. Thank you for the review.

Gábor thought the script is too complicated and adding an environment variable would be enough.
Probably I'll repurpose this PR to combine remsh and remsh-tls once I figured out why it fails in OTP 26.

@jiahuili430 jiahuili430 marked this pull request as draft May 16, 2025 12:53
@big-r81
Copy link
Contributor

big-r81 commented May 16, 2025

Thanks for looking into it, but wouldn't it be better to maintain only one remsh` script, which can be used for 'dev' and 'prod'?

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.

2 participants