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

ci: no snooping rvd build + windows build configuration #596

Merged
merged 9 commits into from Dec 2, 2023

Conversation

XavierChanth
Copy link
Member

@XavierChanth XavierChanth commented Nov 29, 2023

closes #520

- What I did

rvd stuff:

  • Added a compile time ENABLE_SNOOP boolean flag to enable snooping and disabled it by default
    • Removes the parameter from the parser / usage info by default
    • Hard disables it where the snoop boolean is passed into the SocketConnector constructor by default
  • Added a new debug folder + sshrvd_debug binary in the multibuild

Windows stuff:

  • Added .exe extension to windows binaries
  • Removed sshrvd, sshnpd binaries from windows release

- How I did it

- How to verify it

See https://github.com/atsign-foundation/sshnoports/actions/runs/7048957823

- Description for the changelog
ci: no snooping rvd build + windows build configuration


steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # v1.6.0
- run: mkdir sshnp
- run: mkdir tarball
- if: ${{ matrix.os != 'windows-latest' }}
run: mkdir sshnp/debug
- run: dart pub get
Copy link
Member Author

Choose a reason for hiding this comment

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

did a separate mkdir instead of mkdir -p because I'm fairly confident that the powershell mkdir doesn't support that flag.

defaultsTo: false,
help: 'Snoop on traffic passing through service',
);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Disable the flag in the parser / usage

@@ -43,7 +44,7 @@ class SshrvdParams {
managerAtsign: r['manager'],
ipAddress: r['ip'],
verbose: r['verbose'],
snoop: r['snoop'],
snoop: BuildEnv.enableSnoop && r['snoop'],
Copy link
Member Author

Choose a reason for hiding this comment

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

Block the boolean condition from trying to call r['snoop'] (which will be null since we didn't add the parser flag - see the other comment in this file)

session,
forAtsign,
BuildEnv.enableSnoop && snoop,
);

Copy link
Member Author

Choose a reason for hiding this comment

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

Disable snooping at the point of passing it to the socket connector

- if: ${{ matrix.os != 'windows-latest' }}
run: dart compile exe bin/sshrvd.dart -v -o sshnp/sshrvd${{ matrix.ext }}
- if: ${{ matrix.os != 'windows-latest' }}
run: dart compile exe bin/sshrvd.dart -D ENABLE_SNOOP=true -v -o sshnp/debug/sshrvd${{ matrix.ext }}
- run: cp -r templates sshnp/templates
Copy link
Member Author

Choose a reason for hiding this comment

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

Disable certain binaries on windows and add their file extension

@@ -9,7 +9,7 @@ RUN set -eux; \
arm64) ARCH="arm64";; \
riscv64) ARCH="riscv64";; \
esac; \
mkdir sshnp; \
mkdir -p sshnp/debug; \
Copy link
Member Author

Choose a reason for hiding this comment

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

mkdir -p is okay here since Dockerfile.package is linux only

Copy link
Member Author

Choose a reason for hiding this comment

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

(The output folder name is hard-coded to linux in this file as well)

cpswan
cpswan previously approved these changes Nov 30, 2023
@XavierChanth
Copy link
Member Author

XavierChanth commented Nov 30, 2023

@cpswan I forgot to review the completion of the multibuild yesterday, I missed a ; in a line I added to a run step in the Dockerfile. Re-running the multibuild now, I also want to verify the contents of the build before we merge this PR. Will let you know when I'm ready for another review

@gkc gkc marked this pull request as draft December 1, 2023 11:31
@XavierChanth XavierChanth marked this pull request as ready for review December 2, 2023 02:13
@XavierChanth
Copy link
Member Author

I've verified the contents of the build, snooping is not currently disabled, however that is because we need to release the latest version of noports_core and uptake it in sshnoports

@XavierChanth XavierChanth merged commit d718e6e into trunk Dec 2, 2023
20 checks passed
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.

Separate binaries for -s switch
2 participants