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

config: make sftp could be configured dynamically #562

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

Vicente-Cheng
Copy link
Contributor

@Vicente-Cheng Vicente-Cheng commented Sep 4, 2023

Problem:
Give the way to config sftp dynamically

Solution:
We could set up the harvester.os.sshd.sftp to true.
The harvester-installer would create the related config file by stage AfterInstallChrootCommands

We also need the harvester/os2#78
That would include the customer config that we would like to add.

Related Issue:
harvester/harvester#4480

Test plan:

  • Perform an ipxe-example installation with this config
    os:
      sshd:
         sftp: true
    
  • Try to access sftp
    sftp [email protected]
    ([email protected]) Password:
    Connected to 192.168.0.30.
    sftp> 
    

@Vicente-Cheng
Copy link
Contributor Author

Hi @guangbochen, @bk201,

This is an easy way to make config sftp simple.
For this implementation, we only support automatic installation (which means we need to load the harvester config).
We could also implement the related part if we would like to expose this to the interactive installation mode.

What do you think of this implementation?

@bk201 bk201 requested review from ibrokethecloud and removed request for guangbochen October 5, 2023 07:27
@bk201
Copy link
Member

bk201 commented Oct 5, 2023

@ibrokethecloud Please help check the issue and give some feedback. Thanks!

@ibrokethecloud
Copy link
Contributor

the config for AfterInstallChrootCommands is going to be lost post an upgrade.

would it be feasible to make this an addon? and run a daemonset serving sftp? This way we can rollout updates and ensure service is maintained post upgrade?

@Vicente-Cheng Vicente-Cheng marked this pull request as ready for review December 8, 2023 08:21
@Vicente-Cheng
Copy link
Contributor Author

the config for AfterInstallChrootCommands is going to be lost post an upgrade.

would it be feasible to make this an addon? and run a daemonset serving sftp? This way we can rollout updates and ensure service is maintained post upgrade?

After I checked, the /etc/ssh is the persistent path. Anything we added on it will be saved even we do a system upgrade.
So I think we could simply apply this file.

pkg/config/config.go Outdated Show resolved Hide resolved
    - add `harvester.os.sshd.sftp` to config `sftp` dynamically

Signed-off-by: Vicente Cheng <[email protected]>
Copy link
Contributor

@ibrokethecloud ibrokethecloud left a comment

Choose a reason for hiding this comment

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

lgtm. thanks.

@bk201 bk201 merged commit c3aab22 into harvester:master Jan 5, 2024
4 checks passed
@Vicente-Cheng
Copy link
Contributor Author

@Mergifyio backport v1.2

Copy link

mergify bot commented Jan 5, 2024

backport v1.2

✅ Backports have been created

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.

3 participants