Skip to content

Conversation

@joseivanlopez
Copy link
Contributor

@joseivanlopez joseivanlopez commented Apr 15, 2025

Problem

The CLI allows connecting to a different server by using the --api <URL> option, but that URL differs from the URL you use in the browser (https://localhost vs https://localhost/api). Ideally, the same URL should be used for both CLI and browser clients.

#2263

Solution

The --api option is replaced by --host, which allows indicating a host name or IP address without the /api suffix. The protocol is optional, using https if omitted. The default host is http://localhost.

Examples:

$ agama --host https://my-server.lan config show
$ agama --host my-server.lan config show
$ agama --host 192.168.100.101 config show

@joseivanlopez joseivanlopez marked this pull request as ready for review April 16, 2025 05:38
@mvidner
Copy link
Contributor

mvidner commented Apr 16, 2025

This will break my use case of connecting to the same host but different port (forwarded to a container)

Copy link
Contributor

@mvidner mvidner left a comment

Choose a reason for hiding this comment

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

This will break my use case of connecting to the same host but different port (forwarded to a container)

OK, false alarm, it will continue to work, but the description did not make it clear.

But let me put the examples where the user will see them.

Also omit the default value fro mthe description, clap provides it
automatically:

```console
[...]
Options:
      --host <HOST>  URI pointing to Agama's remote host [default: http://localhost]
[...]

[...]
Options:
      --host <HOST>
          URI pointing to Agama's remote host.

          Examples: https://my-server.lan my-server.local localhost:10443

          [default: http://localhost]
[...]
```
Copy link
Contributor

@mvidner mvidner left a comment

Choose a reason for hiding this comment

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

With my improvement, I like it too now :)

@joseivanlopez joseivanlopez merged commit 77ebeb1 into agama-project:master Apr 16, 2025
1 check passed
@imobachgs imobachgs mentioned this pull request Apr 22, 2025
imobachgs added a commit that referenced this pull request Apr 22, 2025
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Apr 23, 2025
https://build.opensuse.org/request/show/1272124
by user IGonzalezSosa + anag_factory
- Version 14

- CLI: wait a bit between selecting the product to install and
  registering it so the Web UI has enough time to process all
  events (gh#agama-project/agama#2274)

- Allow to log in into multiple systems (gh#agama-project/agama#2261).
- Do not interactively ask for accepting insecure connections.

- Report and emit changes to the connections states. (gh#agama-project/agama#2247).
- Do not write wireless security settings when they are not used.

- Add missing help to finish command (gh#agama-project/agama#2272).

- Replace --api option by --host (gh#agama-project/agama#2271).

- Prevent agama-web-server from getting stuck in the POST
  /api/profile/autoyast calls (gh#agama-project/agama#2259).
- Temporarily disable AutoYaST profiles fetch errors.

- Allow to specify extra ker
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