implement remote control cli (#12) #36

Closed
igor wants to merge 0 commits from features/cli into master
Owner
No description provided.
implement remote control cli (#12)
All checks were successful
run bromal ci pipeline / build and run tests (push) Successful in 5m44s
run bromal ci pipeline / generate sbom (push) Successful in 4m40s
run bromal ci pipeline / run linters (push) Successful in 7m27s
64b16d4f0d
igor force-pushed features/cli from 64b16d4f0d
All checks were successful
run bromal ci pipeline / build and run tests (push) Successful in 5m44s
run bromal ci pipeline / generate sbom (push) Successful in 4m40s
run bromal ci pipeline / run linters (push) Successful in 7m27s
to f6dbe2a0d2
All checks were successful
run bromal ci pipeline / build and run tests (push) Successful in 4m51s
run bromal ci pipeline / run linters (push) Successful in 5m39s
run bromal ci pipeline / generate sbom (push) Successful in 3m50s
2026-09-26 13:42:53 +03:00
Compare
igor force-pushed features/cli from f6dbe2a0d2
All checks were successful
run bromal ci pipeline / build and run tests (push) Successful in 4m51s
run bromal ci pipeline / run linters (push) Successful in 5m39s
run bromal ci pipeline / generate sbom (push) Successful in 3m50s
to 05c9ead93b
All checks were successful
run bromal ci pipeline / build and run tests (push) Successful in 5m37s
run bromal ci pipeline / run linters (push) Successful in 7m25s
run bromal ci pipeline / generate sbom (push) Successful in 5m24s
2026-09-26 14:46:36 +03:00
Compare
igor force-pushed features/cli from 05c9ead93b
All checks were successful
run bromal ci pipeline / build and run tests (push) Successful in 5m37s
run bromal ci pipeline / run linters (push) Successful in 7m25s
run bromal ci pipeline / generate sbom (push) Successful in 5m24s
to aabe0b385c
Some checks failed
run bromal ci pipeline / build and run tests (push) Failing after 4m17s
run bromal ci pipeline / run linters (push) Has been skipped
run bromal ci pipeline / generate sbom (push) Has been skipped
2026-09-26 23:29:39 +03:00
Compare
igor force-pushed features/cli from aabe0b385c
Some checks failed
run bromal ci pipeline / build and run tests (push) Failing after 4m17s
run bromal ci pipeline / run linters (push) Has been skipped
run bromal ci pipeline / generate sbom (push) Has been skipped
to 20452f13bc
Some checks failed
run bromal ci pipeline / build and run tests (push) Failing after 3m56s
run bromal ci pipeline / run linters (push) Has been skipped
run bromal ci pipeline / generate sbom (push) Has been skipped
2026-09-28 15:02:12 +03:00
Compare
igor changed title from WIP: implement remote control cli (#12) to implement remote control cli (#12) 2026-09-28 15:02:57 +03:00
igor force-pushed features/cli from 20452f13bc
Some checks failed
run bromal ci pipeline / build and run tests (push) Failing after 3m56s
run bromal ci pipeline / run linters (push) Has been skipped
run bromal ci pipeline / generate sbom (push) Has been skipped
to 57f309509e
Some checks failed
run bromal ci pipeline / build and run tests (push) Failing after 3m52s
run bromal ci pipeline / run linters (push) Has been skipped
run bromal ci pipeline / generate sbom (push) Has been skipped
2026-09-28 16:12:53 +03:00
Compare
igor force-pushed features/cli from 57f309509e
Some checks failed
run bromal ci pipeline / build and run tests (push) Failing after 3m52s
run bromal ci pipeline / run linters (push) Has been skipped
run bromal ci pipeline / generate sbom (push) Has been skipped
to 1f3ac37bf4
Some checks failed
run bromal ci pipeline / build and run tests (push) Failing after 5m16s
run bromal ci pipeline / generate sbom (push) Has been skipped
run bromal ci pipeline / run linters (push) Has been skipped
2026-09-28 16:29:19 +03:00
Compare
igor force-pushed features/cli from 1f3ac37bf4
Some checks failed
run bromal ci pipeline / build and run tests (push) Failing after 5m16s
run bromal ci pipeline / generate sbom (push) Has been skipped
run bromal ci pipeline / run linters (push) Has been skipped
to e2118e142d
Some checks failed
run bromal ci pipeline / build and run tests (push) Failing after 3m51s
run bromal ci pipeline / run linters (push) Has been skipped
run bromal ci pipeline / generate sbom (push) Has been skipped
2026-09-28 20:14:58 +03:00
Compare
igor force-pushed features/cli from e2118e142d
Some checks failed
run bromal ci pipeline / build and run tests (push) Failing after 3m51s
run bromal ci pipeline / run linters (push) Has been skipped
run bromal ci pipeline / generate sbom (push) Has been skipped
to 1fe097aacb
Some checks failed
run bromal ci pipeline / generate sbom (push) Has been cancelled
run bromal ci pipeline / build and run tests (push) Successful in 5m5s
run bromal ci pipeline / run linters (push) Successful in 5m32s
2026-09-28 20:34:02 +03:00
Compare
igor force-pushed features/cli from 1fe097aacb
Some checks failed
run bromal ci pipeline / generate sbom (push) Has been cancelled
run bromal ci pipeline / build and run tests (push) Successful in 5m5s
run bromal ci pipeline / run linters (push) Successful in 5m32s
to 0a757e779d
All checks were successful
run bromal ci pipeline / build and run tests (push) Successful in 7m7s
complement integration tests / run-complement (push) Successful in 15m50s
build and push oci image / build (push) Successful in 6m57s
run bromal ci pipeline / run linters (push) Successful in 7m28s
run bromal ci pipeline / generate sbom (push) Successful in 4m25s
2026-09-28 20:59:18 +03:00
Compare
serra approved these changes 2026-09-29 09:30:48 +03:00
serra left a comment

I like the use of the builder pattern throughout. I don't see anything concerning, but I want to make sure I understand the CLI.

  • It starts a hidden node (which I'm guessing means it doesn't receive message from the rest of the cluster?)
  • It uses this node to execute CLI commands
  • The CLI can be used by other scripts for admin purposes?
I like the use of the builder pattern throughout. I don't see anything concerning, but I want to make sure I understand the CLI. - It starts a hidden node (which I'm guessing means it doesn't receive message from the rest of the cluster?) - It uses this node to execute CLI commands - The CLI can be used by other scripts for admin purposes?
@ -56,2 +57,4 @@
end
def start_phase(:maybe_start_node, _start_type, _phase_args) do
if Config.get([:cluster, :enabled]) do
Owner

I'm going to have to research Erlang clusters more to really properly review this part at some later point.

I'm going to have to research Erlang clusters more to really properly review this part at some later point.
Author
Owner

For now this switch just allowes Erlang node to be started and nothing more. The same options we can use in future for real cluster configuration.

For now this switch just allowes Erlang node to be started and nothing more. The same options we can use in future for real cluster configuration.
Author
Owner

During the development I just executed Bromal (https://dev3.bromal.im) with something like (note --sname param):

% MIX_ENV=stand BROMAL_CONFIG_FILE=../bromal.dev.toml iex --sname bromal -S mix phx.server

The contents of ../bromal.dev.toml file:

% cat ../bromal.dev.toml
### Bromal: A lightweight Matrix homeserver
###
### Configuration file for development environment.

[server]
domain = "dev3.bromal.im"

[well_known.client]
base_url = "https://dev3.bromal.im"

[well_known.federation]
server = "dev3.bromal.im:443"

[interfaces.master]
enabled = true
host = "dev3.bromal.im"
port = 8099
ip = "0.0.0.0"

[interfaces.common]
enabled = false

[interfaces.client]
enabled = false

[interfaces.server]
enabled = false

[database]
database = "bromal_dev3"

[logger]
internal = true

[media]
storage_path = "priv/spool/media/data"

[cluster]
enabled = true
During the development I just executed Bromal (https://dev3.bromal.im) with something like (note `--sname` param): ``` % MIX_ENV=stand BROMAL_CONFIG_FILE=../bromal.dev.toml iex --sname bromal -S mix phx.server ``` The contents of `../bromal.dev.toml` file: ``` % cat ../bromal.dev.toml ### Bromal: A lightweight Matrix homeserver ### ### Configuration file for development environment. [server] domain = "dev3.bromal.im" [well_known.client] base_url = "https://dev3.bromal.im" [well_known.federation] server = "dev3.bromal.im:443" [interfaces.master] enabled = true host = "dev3.bromal.im" port = 8099 ip = "0.0.0.0" [interfaces.common] enabled = false [interfaces.client] enabled = false [interfaces.server] enabled = false [database] database = "bromal_dev3" [logger] internal = true [media] storage_path = "priv/spool/media/data" [cluster] enabled = true ```
Author
Owner

@serra wrote in #36 (comment):

I like the use of the builder pattern throughout. I don't see anything concerning, but I want to make sure I understand the CLI.

To my mind, the 'builder pattern' makes a code a little bit cleaner and more maintainable even in small bromalctl script, however it is not super-widely used in Erlang/Elixir world.

* It starts a hidden node (which I'm guessing means it doesn't receive message from the rest of the cluster?)

For now it uses hidden node, just for RPC purpose, but it really doesn't matter, as we have no clustering at all. In future we can support clustering with node autodetection, consensus, etc.

* It uses this node to execute CLI commands

Yes, it uses standard Erlang's inter-node communication protocol/RPC interface nearly out-of-box, so no need to implement something REST-based, such as in other programming languages/development stacks.

* The CLI can be used by other scripts for admin purposes?

I think, yes. It can also be easily extended for any kind of admin purposes and other scripts. For now bromalctl is just a standalone script for very base tasks related to server maintaining.

@serra wrote in https://code.bromal.im/main/bromal/pulls/36#issuecomment-211: > I like the use of the builder pattern throughout. I don't see anything concerning, but I want to make sure I understand the CLI. To my mind, the 'builder pattern' makes a code a little bit cleaner and more maintainable even in small `bromalctl` script, however it is not super-widely used in Erlang/Elixir world. > * It starts a hidden node (which I'm guessing means it doesn't receive message from the rest of the cluster?) For now it uses [hidden node](https://www.erlang.org/doc/system/distributed.html#hidden-nodes), just for RPC purpose, but it really doesn't matter, as we have no clustering at all. In future we can support clustering with node autodetection, consensus, etc. > * It uses this node to execute CLI commands Yes, it uses standard Erlang's inter-node communication protocol/RPC interface nearly out-of-box, so no need to implement something REST-based, such as in other programming languages/development stacks. > * The CLI can be used by other scripts for admin purposes? I think, yes. It can also be easily extended for any kind of admin purposes and other scripts. For now `bromalctl` is just a standalone script for very base tasks related to server maintaining.
igor closed this pull request 2026-09-29 16:12:55 +03:00
All checks were successful
run bromal ci pipeline / build and run tests (push) Successful in 7m7s
complement integration tests / run-complement (push) Successful in 15m50s
build and push oci image / build (push) Successful in 6m57s
run bromal ci pipeline / run linters (push) Successful in 7m28s
run bromal ci pipeline / generate sbom (push) Successful in 4m25s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
main/bromal!36
No description provided.