Fixed invalid references to pastebin now scratchbox

This commit is contained in:
2026-05-31 17:13:34 -05:00
parent efc9eeb536
commit 696b5c57f7
6 changed files with 13 additions and 13 deletions
+4 -4
View File
@@ -2,7 +2,7 @@
## Purpose
This repository hosts a small self-hosted scratch service (pastebin-like) written in Go.
This repository hosts a small self-hosted scratch service written in Go.
Key product constraints:
- All routes are unauthenticated by design.
@@ -12,7 +12,7 @@ Key product constraints:
## Project layout
- `cmd/pastebin`: service entrypoint
- `cmd/scratchbox`: service entrypoint
- `internal/config`: config loading and validation
- `internal/http`: HTTP handlers and middleware
- `internal/storage`: filesystem storage and metadata index
@@ -42,7 +42,7 @@ Use `make help` as the source of truth for available build/test targets and desc
## Cobra CLI conventions
- Keep `cmd/pastebin/main.go` focused on `main()` and root command wiring.
- Put each Cobra subcommand in its own file (for example `cmd/pastebin/server.go`).
- Keep `cmd/scratchbox/main.go` focused on `main()` and root command wiring.
- Put each Cobra subcommand in its own file (for example `cmd/scratchbox/server.go`).
- Start the service through the explicit subcommand (`scratchbox server`), not from the root command directly.
- Validate command arguments with Cobra arg validators (for example `cobra.NoArgs`) where applicable.
+2 -2
View File
@@ -1,5 +1,5 @@
APP_NAME := scratchbox
CMD_DIR := ./cmd/pastebin
CMD_DIR := ./cmd/scratchbox
BIN_DIR := ./bin
BIN := $(BIN_DIR)/$(APP_NAME)
CONFIG ?= config.yaml
@@ -15,7 +15,7 @@ help:
@echo " make clean - Remove built artifacts"
run:
go run $(CMD_DIR) --config $(CONFIG)
go run $(CMD_DIR) server --config $(CONFIG)
build:
mkdir -p $(BIN_DIR)
+3 -3
View File
@@ -1,6 +1,6 @@
# Scratchbox Pastebin
# Scratchbox
Scratchbox is a minimal self-hosted pastebin service written in Go. It is intentionally unauthenticated and optimized for temporary sharing of text or small files with an expiration time.
Scratchbox is a minimal self-hosted scratch service written in Go. It is intentionally unauthenticated and optimized for temporary sharing of text or small files with an expiration time.
Each upload creates exactly one scratch. For multi-file sharing, bundle files into an archive (for example `.zip` or `.tar.gz`) and upload that single archive file.
Scratch content is stored on disk gzip-compressed transparently to reduce filesystem usage; API/UI reads return original uncompressed content.
@@ -11,7 +11,7 @@ Scratch content is stored on disk gzip-compressed transparently to reduce filesy
- `cp config.example.yaml config.yaml`
2. Adjust settings for your environment.
3. Start the server:
- `go run ./cmd/pastebin -config config.yaml`
- `go run ./cmd/scratchbox server -config config.yaml`
4. Open:
- `http://127.0.0.1:8080/`
@@ -17,9 +17,9 @@ func main() {
func newRootCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "scratchbox",
Short: "Scratchbox CLI",
SilenceUsage: true,
Use: "scratchbox",
Short: "Scratchbox CLI",
SilenceUsage: true,
SilenceErrors: true,
RunE: func(cmd *cobra.Command, _ []string) error {
return cmd.Help()
@@ -39,7 +39,7 @@ func run(configPath string) error {
return fmt.Errorf("config load failed: %w", err)
}
logger := log.New(os.Stdout, "[pastebin] ", log.LstdFlags|log.LUTC)
logger := log.New(os.Stdout, "[scratchbox] ", log.LstdFlags|log.LUTC)
store, err := storage.NewFilesystemStore(cfg.Storage.DataDir)
if err != nil {