Fixed invalid references to pastebin now scratchbox
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Purpose
|
## 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:
|
Key product constraints:
|
||||||
- All routes are unauthenticated by design.
|
- All routes are unauthenticated by design.
|
||||||
@@ -12,7 +12,7 @@ Key product constraints:
|
|||||||
|
|
||||||
## Project layout
|
## Project layout
|
||||||
|
|
||||||
- `cmd/pastebin`: service entrypoint
|
- `cmd/scratchbox`: service entrypoint
|
||||||
- `internal/config`: config loading and validation
|
- `internal/config`: config loading and validation
|
||||||
- `internal/http`: HTTP handlers and middleware
|
- `internal/http`: HTTP handlers and middleware
|
||||||
- `internal/storage`: filesystem storage and metadata index
|
- `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
|
## Cobra CLI conventions
|
||||||
|
|
||||||
- Keep `cmd/pastebin/main.go` focused on `main()` and root command wiring.
|
- Keep `cmd/scratchbox/main.go` focused on `main()` and root command wiring.
|
||||||
- Put each Cobra subcommand in its own file (for example `cmd/pastebin/server.go`).
|
- 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.
|
- 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.
|
- Validate command arguments with Cobra arg validators (for example `cobra.NoArgs`) where applicable.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
APP_NAME := scratchbox
|
APP_NAME := scratchbox
|
||||||
CMD_DIR := ./cmd/pastebin
|
CMD_DIR := ./cmd/scratchbox
|
||||||
BIN_DIR := ./bin
|
BIN_DIR := ./bin
|
||||||
BIN := $(BIN_DIR)/$(APP_NAME)
|
BIN := $(BIN_DIR)/$(APP_NAME)
|
||||||
CONFIG ?= config.yaml
|
CONFIG ?= config.yaml
|
||||||
@@ -15,7 +15,7 @@ help:
|
|||||||
@echo " make clean - Remove built artifacts"
|
@echo " make clean - Remove built artifacts"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
go run $(CMD_DIR) --config $(CONFIG)
|
go run $(CMD_DIR) server --config $(CONFIG)
|
||||||
|
|
||||||
build:
|
build:
|
||||||
mkdir -p $(BIN_DIR)
|
mkdir -p $(BIN_DIR)
|
||||||
|
|||||||
@@ -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.
|
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.
|
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`
|
- `cp config.example.yaml config.yaml`
|
||||||
2. Adjust settings for your environment.
|
2. Adjust settings for your environment.
|
||||||
3. Start the server:
|
3. Start the server:
|
||||||
- `go run ./cmd/pastebin -config config.yaml`
|
- `go run ./cmd/scratchbox server -config config.yaml`
|
||||||
4. Open:
|
4. Open:
|
||||||
- `http://127.0.0.1:8080/`
|
- `http://127.0.0.1:8080/`
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ func run(configPath string) error {
|
|||||||
return fmt.Errorf("config load failed: %w", err)
|
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)
|
store, err := storage.NewFilesystemStore(cfg.Storage.DataDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Reference in New Issue
Block a user