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

feat(rust): add binary to compile custom branding command binaries #8744

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

adrianbenavides
Copy link
Member

@adrianbenavides adrianbenavides commented Jan 14, 2025

Binary to compile branded ockam versions

There is a new script at ockam_command/src/bin/brand.rs that can be run to compile the ockam binary with some configurable options.

The script needs a configuration that can be either passed inline, or as a path to a file. The configuration is a yaml with he following format:

bin:
  support_email: [email protected]
  # the following fields are optional
  brand_name: Brand1 # if not set, will default to Bin
  home_dir: /home/brand1 # if not set, will default to $HOME/.bin
  orchestrator_identifier: brand1 # if not set, will default to the OCKAM_CONTROLLER_IDENTITY_ID env var
  orchestrator_address: brand1.network # if not set, will default to the OCKAM_CONTROLLER_ADDR env var

We can run the script as follows: cargo run --bin brand ./config.yaml

Custom branding

The ockam_command crate now will use the compile-time env vars OCKAM_COMMAND_BIN_NAME and OCKAM_COMMAND_BRAND_NAME to replace the ockam and Ockam references in:

  • Command names
  • Command help texts: documentation of command and args, code examples, markdown files
  • Command output

We can also customize:

  • The OCKAM_HOME to be used, which will default to $HOME/.$BIN_NAME
  • Support email, which is shown in the error footer (the text in dark gray)
  • The Controller address
  • The Controller identifier

⚠️ Things that are not replaced ⚠️

  1. References to attributes that are prefixed with ockam like ockam-relay or ockam-role. Should we change this prefix?
  2. Environment variables names
  3. Logs
  4. Errors (the source location leaks the crates names)
  5. ockam enroll has a lot of ockam related output (links to docs, links to our github, the ascii header), but this command should only be used by admins anyway

New Cargo features in ockam_command

I've removed the orchestrator feature, which wasn't being used consistently, and I've added two new features:

  • admin_commands: enroll, create/delete spaces and projects, authority, sidecar, ...
  • advanced_commands: experimental or not widely used commands (tcp-listener/connection, flow control, secure-channel, ...)

So, by default, we will include the core commands that are used to create nodes, portals, relays, policies, ...

@adrianbenavides adrianbenavides requested a review from a team as a code owner January 14, 2025 07:59
@adrianbenavides adrianbenavides force-pushed the adrian/command-custom-names branch from bcd1b25 to b3bc994 Compare January 14, 2025 08:12
@adrianbenavides adrianbenavides changed the title feat(rust): add binary to compile branded command binaries feat(rust): add binary to compile custom branding command binaries Jan 14, 2025
@adrianbenavides adrianbenavides force-pushed the adrian/command-custom-names branch from b3bc994 to 672198c Compare January 14, 2025 10:00
@adrianbenavides adrianbenavides force-pushed the adrian/command-custom-names branch from 672198c to 257236a Compare January 14, 2025 10:33
Copy link
Member

@etorreborre etorreborre left a comment

Choose a reason for hiding this comment

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

🚗

@adrianbenavides adrianbenavides added this pull request to the merge queue Jan 17, 2025
Merged via the queue into develop with commit 368e1b8 Jan 17, 2025
45 checks passed
@adrianbenavides adrianbenavides deleted the adrian/command-custom-names branch January 17, 2025 07:34
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