diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3af255b..597e661 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -38,11 +38,11 @@ nfpms: deb: file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}" scripts: - postinstall: ./scripts/nfpm/install.sh + postinstall: ./scripts/nfpm/postinstall.sh rpm: file_name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Arch }}" scripts: - preinstall: ./scripts/nfpm/install.sh + postinstall: ./scripts/nfpm/postinstall.sh rpm: signature: key_file: key.gpg @@ -53,10 +53,6 @@ nfpms: - src: ./scripts/nfpm/grendel.toml.default dst: /etc/grendel/grendel.toml type: "config|noreplace" - file_info: - mode: 0600 - owner: grendel - group: grendel - src: ./scripts/nfpm/grendel.service dst: /usr/lib/systemd/system/grendel.service checksum: diff --git a/CHANGELOG.md b/CHANGELOG.md index d8b40c2..6f69fc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ ## [Unreleased] +## [0.0.7] - 2022-06-09 + +- Fix bug in marshalling interface names +- Fix ubuntu autoinstall template + - Set root password in Ubuntu autoinstall template + - Add dhcp4 network configs for default nic +- Templatize the kernel command line for images +- Add support for translating butane configs to ignition +- Update ipxe to latest release +- Add rpm/deb package building + ## [0.0.6] - 2021-10-25 - Add support for kickstarting both uefi and legacy bios nodes from the same @@ -52,3 +63,4 @@ [0.0.4]: https://github.com/ubccr/grendel/releases/tag/v0.0.4 [0.0.5]: https://github.com/ubccr/grendel/releases/tag/v0.0.5 [0.0.6]: https://github.com/ubccr/grendel/releases/tag/v0.0.6 +[0.0.7]: https://github.com/ubccr/grendel/releases/tag/v0.0.7 diff --git a/api/server.go b/api/server.go index 09a1eaf..ff0eb43 100644 --- a/api/server.go +++ b/api/server.go @@ -160,6 +160,9 @@ func (s *Server) Serve() error { if err != nil { return err } + if err := os.Chmod(s.SocketPath, 0770); err != nil { + return err + } e.Listener = unixListener s.Scheme = "http" log.Printf("Listening on unix domain socket: %s", s.SocketPath) diff --git a/scripts/nfpm/install.sh b/scripts/nfpm/postinstall.sh similarity index 84% rename from scripts/nfpm/install.sh rename to scripts/nfpm/postinstall.sh index 28d531d..fcc56db 100755 --- a/scripts/nfpm/install.sh +++ b/scripts/nfpm/postinstall.sh @@ -11,23 +11,29 @@ cleanInstall() { mkdir -p /var/lib/grendel/images /var/lib/grendel/repo /var/lib/grendel/templates chown grendel:grendel /var/lib/grendel /var/lib/grendel/images /var/lib/grendel/repo /var/lib/grendel/templates chmod 755 /var/lib/grendel + chmod 775 /var/lib/grendel/images /var/lib/grendel/repo /var/lib/grendel/templates + + if [ -f "/etc/grendel/grendel.toml" ]; then + chmod 660 /etc/grendel/grendel.toml + chown grendel:grendel /etc/grendel/grendel.toml + fi if [ -x "/usr/bin/deb-systemd-helper" ]; then - printf "\033[32m Installing grendel.service systemd using deb\033[0m\n" deb-systemd-helper purge grendel.service >/dev/null deb-systemd-helper unmask grendel.service >/dev/null elif [ -x "/usr/bin/systemctl" ]; then - printf "\033[32m Enable grendel.service in systemd\033[0m\n" systemctl daemon-reload ||: systemctl unmask grendel.service ||: systemctl preset grendel.service ||: systemctl enable grendel.service ||: - systemctl restart grendel.service ||: fi } upgrade() { printf "\033[32m Upgrading grendel\033[0m\n" + if [ -x "/usr/bin/systemctl" ]; then + systemctl restart grendel.service ||: + fi } # Step 2, check if this is a clean install or an upgrade @@ -45,7 +51,6 @@ case "$action" in cleanInstall ;; "2" | "upgrade") - printf "\033[32m Post Install of an upgrade\033[0m\n" upgrade ;; *)