Skip to content

chore(agent): organized go based agent config and key into dedicated directory#5943

Open
ltan10 wants to merge 1 commit intoshellhub-io:masterfrom
ltan10:chore/group-agent-etc-files
Open

chore(agent): organized go based agent config and key into dedicated directory#5943
ltan10 wants to merge 1 commit intoshellhub-io:masterfrom
ltan10:chore/group-agent-etc-files

Conversation

@ltan10
Copy link

@ltan10 ltan10 commented Mar 4, 2026

What kind of change does this PR introduce?

  • Bugfix
  • New Feature
  • Feature Improvment
  • Refactoring
  • Documentation
  • Other, please describe:

Description:

  • Organized go based agent config and key files into own dedicated directory in /etc/agent-agent
  • Modified default PRIVATE_KEY value for podman, snap and docker installation in shell install script

@ltan10 ltan10 requested a review from a team as a code owner March 4, 2026 23:59
@ltan10 ltan10 marked this pull request as draft March 5, 2026 00:25
@ltan10 ltan10 force-pushed the chore/group-agent-etc-files branch from fbab19e to a7beeba Compare March 5, 2026 01:01
@ltan10 ltan10 marked this pull request as ready for review March 5, 2026 01:05
@ltan10 ltan10 force-pushed the chore/group-agent-etc-files branch from a7beeba to 1e42d5b Compare March 5, 2026 07:17
@ltan10 ltan10 changed the title chore: organized go based agent config and key into dedicated directory chore(agent): organized go based agent config and key into dedicated directory Mar 5, 2026
@ltan10 ltan10 force-pushed the chore/group-agent-etc-files branch from 1e42d5b to 50f40b7 Compare March 10, 2026 00:43
Copy link
Member

@otavio otavio left a comment

Choose a reason for hiding this comment

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

The biggest problem I foresee here is migrating the field-deployed agents.

So even though I agree with the idea of this change, we need to consider how we will migrate the existing agents to work with this new approach or provide a backward-compatible way for them to keep working.

How do you foresee solving this issue?

@ltan10
Copy link
Author

ltan10 commented Mar 10, 2026

With all the testing. I've stumbled upon this myself.
From what I have seen, the migration is fine. as the install script during the migration from roofts to go based binary for the agents already leave the config.json behind and recreate the the new env config file.

The only persistent remaining file is just shellhub.key

Two methods for transition:

  1. Just install/add/upgrade agent as normal using install script as per normal
  • New shellhub.key gets regenerated in the new directory and device appears for pending approval.
  • Requires user to manually remove existing accepted devices due to hostname clashes and accept the new pending devices
    or
  1. Use existing shellhub.key on device by manually transfering it to /etc/shellhub-agent prior to executing install script.
  • install script agent upgrade will just use existing key.

@otavio someone should be able to replicate my findings for confirmation.
I have been generally just been using option 1. And have only tested on the standalone deployment.
If someone can verify that i have changed the correct sections for the other installation methods and test, that would be great.

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