From 51c304307fa5af962de52ea66e24defd9acdc9e6 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 4 Mar 2025 21:30:30 -0500 Subject: [PATCH] Add basic support for the services.config map. --- goolinux.json | 7 ++++++- main.go | 3 +++ services/ssh/sshd.template | 7 ++----- services/ssh/system.json | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/goolinux.json b/goolinux.json index 39114ec..2a5ed29 100644 --- a/goolinux.json +++ b/goolinux.json @@ -12,7 +12,12 @@ "services": { "proxy": { "enable": "true" }, - "ssh": { "enable": "true" }, + "ssh": { + "enable": "true", + "config": { + "banner": "くコ:彡 くコ:彡 くコ:彡\n", + }, + }, "navidrome": { "enable": "true", "provider": "docker", diff --git a/main.go b/main.go index 2800a60..42cda25 100644 --- a/main.go +++ b/main.go @@ -27,6 +27,9 @@ type NetworkingConfig struct { type ServiceConfig struct { Enable string + Config map[string]interface{} + ExtraConfig string + Src string Ports []string Volumes []string diff --git a/services/ssh/sshd.template b/services/ssh/sshd.template index 4801cd7..93f9979 100644 --- a/services/ssh/sshd.template +++ b/services/ssh/sshd.template @@ -1,6 +1,4 @@ -{{if .Ports -}} -Port {{index .Ports 0}} -{{- end}} +{{with .Ports}}Port {{index . 0}}{{end}} #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: @@ -84,8 +82,7 @@ X11Forwarding no #ChrootDirectory none #VersionAddendum none -# no default banner path -#Banner none +{{if .Config.banner}}Banner /etc/ssh/sshd_banner{{end}} # override default of no subsystems Subsystem sftp internal-sftp diff --git a/services/ssh/system.json b/services/ssh/system.json index ea4c110..0910a69 100644 --- a/services/ssh/system.json +++ b/services/ssh/system.json @@ -7,5 +7,6 @@ provider: "system", packages: [ "openssh-server" ], configFiles: [ "sshd.template:/etc/ssh/sshd_config", + "banner.template:/etc/ssh/sshd_banner", ] }