diff --git a/.goreleaser.yaml b/.goreleaser.yaml index eafa225..32e434a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -14,7 +14,6 @@ builds: goos: - linux - darwin - - windows goarch: - amd64 - arm64 @@ -33,10 +32,6 @@ archives: wrap_in_directory: "ace-{{ .Version }}" - format_overrides: - - goos: windows - formats: [zip] - changelog: sort: asc filters: diff --git a/docs/install.md b/docs/install.md index ab7ced7..5dfb5ad 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,5 +1,14 @@ # Installing ACE +ACE supports Linux and macOS only. It does not build on Windows. On a +Windows host, run ACE in WSL or in the container image. Keep its output +directory on the Linux file system, not on a Windows drive: ACE protects +reports with POSIX file modes, and Windows drives do not keep them. + +Reports written by earlier Windows builds keep their Windows ACLs, even +after you move ACE to WSL. Other local users may be able to read the +table rows in them. Delete these reports, or restrict their ACLs by hand. + Choose the option that fits your environment: - Go install (fastest if you have Go toolchains) @@ -30,7 +39,7 @@ Grab the prebuilt archive for your platform from GitHub Releases and unpack the ```sh ACE_VER=v1.9.0 # update to the latest tag from GitHub Releases -OS=Linux # or Darwin or Windows +OS=Linux # or Darwin ARCH=x86_64 # or arm64 curl -fsSL "https://github.com/pgedge/ace/releases/download/${ACE_VER}/ace_${OS}_${ARCH}.tar.gz" -o /tmp/ace.tgz @@ -39,8 +48,7 @@ sudo install -m 0755 /tmp/ace/ace /usr/local/bin/ace ``` Notes: -- macOS uses `Darwin`; Windows archives are `.zip`. -- On Windows, place `ace.exe` somewhere on your `PATH` (e.g., `%USERPROFILE%\\bin`). +- macOS uses `Darwin`. ## Run with Docker/Podman diff --git a/pkg/common/secure_file.go b/pkg/common/secure_file.go index 22fb78d..bd9fe43 100644 --- a/pkg/common/secure_file.go +++ b/pkg/common/secure_file.go @@ -21,6 +21,10 @@ import ( // only *request* a mode, which the umask then masks off — under the usual 0022 // that lands at 0644, readable by every local user. These helpers set the mode // explicitly so it does not depend on the operator's umask. +// +// Owner-only access here comes from POSIX mode bits. On Windows, os.Chmod +// does not change the ACLs, so these helpers would not protect the files. +// For this reason ACE does not build on Windows: see secure_file_windows.go. const ( SecureFileMode os.FileMode = 0o600 SecureDirMode os.FileMode = 0o700 diff --git a/pkg/common/secure_file_windows.go b/pkg/common/secure_file_windows.go new file mode 100644 index 0000000..856a698 --- /dev/null +++ b/pkg/common/secure_file_windows.go @@ -0,0 +1,21 @@ +// /////////////////////////////////////////////////////////////////////////// +// +// # ACE - Active Consistency Engine +// +// Copyright (C) 2023 - 2026, pgEdge (https://www.pgedge.com/) +// +// This software is released under the PostgreSQL License: +// https://opensource.org/license/postgresql +// +// /////////////////////////////////////////////////////////////////////////// + +//go:build windows + +package common + +// ACE does not support Windows. The helpers in secure_file.go protect +// output files with POSIX mode bits, and Windows does not use them for +// access control: other local users could read reports that contain +// table rows. This reference to an undefined name stops the build on +// Windows, so nobody gets an unsafe binary by accident. +var _ = ACE_does_not_support_Windows