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

cockpit: fix listen port (#371245) #374667

Merged
merged 2 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/services/monitoring/cockpit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ in {

systemd.packages = [ cfg.package ];
systemd.sockets.cockpit.wantedBy = [ "multi-user.target" ];
systemd.sockets.cockpit.listenStreams = [ "" (toString cfg.port) ];

systemd.tmpfiles.rules = [ # From $out/lib/tmpfiles.d/cockpit-tmpfiles.conf
"C /run/cockpit/inactive.motd 0640 root root - ${cfg.package}/share/cockpit/motd/inactive.motd"
Expand Down
11 changes: 6 additions & 5 deletions nixos/tests/cockpit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import ./make-test-python.nix (
};
services.cockpit = {
enable = true;
port = 7890;
openFirewall = true;
settings = {
WebService = {
Origins = "https://server:9090";
Origins = "https://server:7890";
};
};
};
Expand Down Expand Up @@ -65,7 +66,7 @@ import ./make-test-python.nix (
driver.implicitly_wait(10)
log("Opening homepage")
driver.get("https://server:9090")
driver.get("https://server:7890")
def wait_elem(by, query, timeout=10):
Expand Down Expand Up @@ -107,7 +108,7 @@ import ./make-test-python.nix (
driver.find_element(By.CSS_SELECTOR, 'button#login-button').click()
# driver.implicitly_wait(1)
# driver.get("https://server:9090/system")
# driver.get("https://server:7890/system")
log("Waiting dashboard to load")
wait_title_contains("${user}@server")
Expand Down Expand Up @@ -143,9 +144,9 @@ import ./make-test-python.nix (
start_all()
server.wait_for_unit("sockets.target")
server.wait_for_open_port(9090)
server.wait_for_open_port(7890)
client.succeed("curl -k https://server:9090 -o /dev/stderr")
client.succeed("curl -k https://server:7890 -o /dev/stderr")
print(client.succeed("whoami"))
client.succeed('PYTHONUNBUFFERED=1 selenium-script')
'';
Expand Down