feat: add portable local and remote page publishing - #4
Merged
Conversation
go install now points at the cmd/pages package, the path that actually works. The root command answers --help and -h with usage on stdout and exit 0, matching the subcommands.
The repository is one command, so the main package lives at the module root like other single-command Go tools. go install github.com/suraciii/pages@latest now works directly; the Dockerfile and docs follow.
The root main.go is a thin stub calling cli.Run, so go install github.com/suraciii/pages@latest works while the command implementation stays organized in internal/cli, like hugo and other single-command tools.
serve and generate-token now share /etc/pages/tokens.json by default. PAGES_TOKENS_FILE and --tokens-file remain explicit overrides. The customer docs use the short default-path commands, and the README heading uses TL;DR.
The README now gives the basic local path first, then the remote path with a minimal Caddyfile. Reference Caddy configurations set /srv/pages/public explicitly, and the generate-token grammar matches Go flag parsing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pagesbinary from the module root with three commands:serve,publish, andgenerate-token.serveand verifies the public URL.--destis the short alias for--destination.--identity.User-facing commands
Minimal local Publish uses the current directory as the Destination:
pages publish --file report.html --slug reportAn explicit local Destination writes to that Public Root:
pages publish --file report.html --slug report --dest pages-publicRemote Publish uses an HTTP(S) Destination and an environment Token:
Service administration uses the same Destination name:
Implementation
internal/cli.PAGES_DESTINATION, config, then current directory.os.UserConfigDirfor portable defaults while preserving--config-dir,--config, and--tokens-fileoverrides.Verification
make cigo test -race ./...ci / testpassed on0202c8bad214146cd8377926940a0e1a238a8041All automated tests use an in-memory filesystem and injected HTTP transport. They do not access the host filesystem or network.