Skip to content

feat(contributing): add SFTP configuration#8

Open
jnijdam wants to merge 4 commits intosaltstack-formulas:masterfrom
jnijdam:feature/jn/add-sftp
Open

feat(contributing): add SFTP configuration#8
jnijdam wants to merge 4 commits intosaltstack-formulas:masterfrom
jnijdam:feature/jn/add-sftp

Conversation

@jnijdam
Copy link
Copy Markdown

@jnijdam jnijdam commented Mar 30, 2022

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [feat] A new feature

Secondary type

  • [docs] Documentation changes
  • [test] Adding missing or correcting existing tests

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

  • Updated the README (e.g. Available states).

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).

Additional context

@jnijdam jnijdam requested a review from n-rodriguez as a code owner March 30, 2022 15:30
@jnijdam jnijdam force-pushed the feature/jn/add-sftp branch 5 times, most recently from fc63c80 to a38031d Compare March 31, 2022 08:33
@jnijdam jnijdam requested a review from a team as a code owner March 31, 2022 08:33
@jnijdam jnijdam force-pushed the feature/jn/add-sftp branch 6 times, most recently from 4f610b3 to d9407e4 Compare April 6, 2022 07:58
Copy link
Copy Markdown
Member

@daks daks left a comment

Choose a reason for hiding this comment

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

I made several comments to the code.

As noted, for now this code makes a breaking change because sftp module is activated which it was not previously.

Another problem is, when activating the sftp state (in kitchen.yml) converge do not pass. I think kitchen/inspec tests should be added to be confident in how this code works. See kitchen.yml suite section to add one to the default one.

@jnijdam jnijdam force-pushed the feature/jn/add-sftp branch 16 times, most recently from 2da6cf2 to 55abc2c Compare April 14, 2022 13:36
@jnijdam jnijdam force-pushed the feature/jn/add-sftp branch 13 times, most recently from 8e79756 to 1011e78 Compare May 3, 2022 15:05
Copy link
Copy Markdown
Member

@daks daks left a comment

Choose a reason for hiding this comment

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

You added a Kitchen test suite, some Inspec tests but those are not activated in Gitlab CI so no way to see it tests passes.

proftpd/init.sls Outdated
- group: root
- mode: 644
- template: jinja
- context:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure you need to define both context and defaults, stick with context it should be sufficient

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I confirme, context is enough thanks

Copy link
Copy Markdown
Member

@daks daks May 6, 2022

Choose a reason for hiding this comment

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

ok, in reality previously defaults was used. I don't think it changes anything but by security maybe it's better to let the previous one in place.
@myii any advice maybe?

its('content') { should include 'SFTPHostKeyrsa' }
its('content') { should include 'SFTPAuthMethods' }
its('content') { should include 'SFTPAuthorizedUserKeys' }
its('content') { should include 'Port 4000' }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the number of spaces between Port and 4000 is weird, any reason to that?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

this is what we expect to find in the final sftp.conf file.
I tried to reduce these spaces and the check fails

@jnijdam jnijdam force-pushed the feature/jn/add-sftp branch 9 times, most recently from 51c0fe5 to cd6e145 Compare May 6, 2022 08:37
Copy link
Copy Markdown
Member

@daks daks left a comment

Choose a reason for hiding this comment

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

looks quite now and could be merged soon. One thing missing is to update pillar.example, can you please add it?

proftpd/init.sls Outdated
- group: root
- mode: 644
- template: jinja
- context:
Copy link
Copy Markdown
Member

@daks daks May 6, 2022

Choose a reason for hiding this comment

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

ok, in reality previously defaults was used. I don't think it changes anything but by security maybe it's better to let the previous one in place.
@myii any advice maybe?

@daks
Copy link
Copy Markdown
Member

daks commented Jul 13, 2022

@jnijdam I'm working on improving your PR which is not functional right now. I'll add commits to it once I get a working setup

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