CatSync

module
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: MIT

README

CatSync

Sync the「cat」config.


Go Report Card GitHub release GitHub License FOSSA Status

Go CI Release Dependabot Updates CodeQL Advanced


Config & How 2 use

Default Config:
log:
  level: debug
  dir: ./logs
server:
  address: :3000
  header: CatSync
  tls:
    cert: ""
    key: ""
actions:
  - route: /
    action: 1
    actionData: Hello CatSync
    responseHeader: { }
    auth:
      ua: ""
      query:
        map: { }
        ignoreCaseCase: false


All Config Types:
// config/types.go
type Config struct {
	Log     Log      `json:"log"     optional:"true" yaml:"log"`
	Server  Server   `json:"server"  yaml:"server"`
	Actions []Action `json:"actions" optional:"true" yaml:"actions"`

	// --- INTERNAL ---
	
	ConfigPath string `json:"-" optional:"true" yaml:"-"`
}

type Log struct {
	Level string `json:"level" optional:"true" yaml:"level"`
	Dir   string `json:"dir"   optional:"true" yaml:"dir"`
}

type Server struct {
	Address string    `json:"address" yaml:"address"`
	Header  string    `json:"header"  optional:"true" yaml:"header"`
	TLS     ServerTLS `json:"tls"     optional:"true" yaml:"tls"`
}

type ServerTLS struct {
	Cert string `json:"cert" yaml:"cert"`
	Key  string `json:"key"  yaml:"key"`
}

type Action struct {
	Route          string      `json:"route"          yaml:"route"`
	Action         action.Type `json:"action"         yaml:"action"`
	ActionData     string      `json:"actionData"     yaml:"actionData"`
	ResponseHeader http.Header `json:"responseHeader" optional:"true"   yaml:"responseHeader"`
	Auth           ActionAuth  `json:"auth"           optional:"true"   yaml:"auth"`
}

type ActionAuth struct {
	UA    string          `json:"ua"    optional:"true" yaml:"ua"`
	Query ActionAuthQuery `json:"query" optional:"true" yaml:"query"`
}

type ActionAuthQuery struct {
	Map            map[string]string `json:"map"            yaml:"map"`
	IgnoreCaseCase bool              `json:"ignoreCaseCase" optional:"true" yaml:"ignoreCaseCase"`
}

const (
	File = iota
	String = 1
	TempRedirect = 2
	Redirect = 3
)

Docker

Run Docker

# Recommend
docker-compose -f docker/docker-compose.yml up -d

# OR: Replace 'latest' with 'local' to use your self-built images

docker run -d -p 3000:3000 -v ./data:/app/data:ro --name catsync catsync:latest
Build Docker image

# Recommend
goreleaser release --snapshot --clean

# OR

go build -o CatSync ./cmd
docker build -t catsync:local .

License

FOSSA Status

Directories

Path Synopsis
internal
tool
release command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL