From c23f8386ec24677076f14fe961dea05954317a68 Mon Sep 17 00:00:00 2001 From: Igor Shishkin Date: Sat, 6 Jul 2024 09:44:03 +0300 Subject: [PATCH] Add project skeleton Signed-off-by: Igor Shishkin --- .gitignore | 4 +++ .goreleaser.yaml | 74 ++++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 16 ++++++++++ Dockerfile.access | 11 +++++++ Dockerfile.manage | 11 +++++++ README.md | 1 + SECURITY.md | 14 +++++++++ cmd/access/main.go | 10 +++++++ cmd/cli/main.go | 10 +++++++ cmd/manage/main.go | 10 +++++++ go.mod | 3 ++ 11 files changed, 164 insertions(+) create mode 100644 .goreleaser.yaml create mode 100644 CONTRIBUTING.md create mode 100644 Dockerfile.access create mode 100644 Dockerfile.manage create mode 100644 SECURITY.md create mode 100644 cmd/access/main.go create mode 100644 cmd/cli/main.go create mode 100644 cmd/manage/main.go create mode 100644 go.mod diff --git a/.gitignore b/.gitignore index 6f6f5e6..bcadde6 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,7 @@ # Go workspace file go.work go.work.sum + +# Build binaries +/archived +/dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..afda7a1 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,74 @@ +--- +version: 2 +builds: + - id: archived-access + main: ./cmd/access + binary: archived-access + ldflags: + - -s -w -X main.appVersion={{.Version}} -X main.buildTimestamp={{.Date}} + env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + - arm64 + goamd64: ["v1", "v2", "v3"] + goarm: ["7"] + mod_timestamp: "{{ .CommitTimestamp }}" + - id: archived-cli + main: ./cmd/cli + binary: archived-cli + ldflags: + - -s -w -X main.appVersion={{.Version}} -X main.buildTimestamp={{.Date}} + env: + - CGO_ENABLED=0 + goos: + - darwin + - dragonfly + - freebsd + - linux + - netbsd + - openbsd + - solaris + - windows + goarch: + # x86 + - amd64 + - "386" + + # ARM + - arm64 + - arm + + # MIPS + - mips64 + - mips64le + - mips + - mipsle + goamd64: ["v1", "v2", "v3"] + goarm: ["6", "7"] + gomips: ["hardfloat", "softfloat"] + mod_timestamp: "{{ .CommitTimestamp }}" + - id: archived-manage + main: ./cmd/manage + binary: archived-manage + ldflags: + - -s -w -X main.appVersion={{.Version}} -X main.buildTimestamp={{.Date}} + env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + - arm64 + goamd64: ["v1", "v2", "v3"] + goarm: ["7"] + mod_timestamp: "{{ .CommitTimestamp }}" +archives: + - format: binary +checksum: + name_template: "checksums.txt" + algorithm: sha256 + split: false + disable: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9f44d99 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# Contributing guidelines + +archived is open to contribution in any possible way. If you'd like to help +project feel free to: + +* Send patches to improve archived functionality +* Fix some bugs +* Write some documentation +* Propose any changes +* Your own way ;) + +That's all for now, any other particular case could be discused in Discussions +and/or issues. + +But please don't forget to write tests for your code and follow existent +practices ;) diff --git a/Dockerfile.access b/Dockerfile.access new file mode 100644 index 0000000..6188382 --- /dev/null +++ b/Dockerfile.access @@ -0,0 +1,11 @@ +FROM alpine:3.20.0 AS certificates + +RUN apk add --update --no-cache \ + ca-certificates=20240226-r0 + +FROM scratch + +COPY --from=certificates /etc/ssl/cert.pem /etc/ssl/cert.pem +COPY --chmod=0755 --chown=root:root dist/archived-access_linux_arm64/archived-access /archived-access + +ENTRYPOINT [ "/archived-access" ] diff --git a/Dockerfile.manage b/Dockerfile.manage new file mode 100644 index 0000000..edf1f51 --- /dev/null +++ b/Dockerfile.manage @@ -0,0 +1,11 @@ +FROM alpine:3.20.0 AS certificates + +RUN apk add --update --no-cache \ + ca-certificates=20240226-r0 + +FROM scratch + +COPY --from=certificates /etc/ssl/cert.pem /etc/ssl/cert.pem +COPY --chmod=0755 --chown=root:root dist/archived-manage_linux_amd64_v3/archived-manage /archived-manage + +ENTRYPOINT [ "/archived-manage" ] diff --git a/README.md b/README.md index 0712940..ca21c87 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # archived + Cloud native service so store versioned data in space-efficient manner diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..5bf6f08 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,14 @@ +# Security Policy + +## Supported Versions + +archived uses trunk-based development model with periodic semver releases marked +against master branch right when the target feature is completed for particular +milestone. Which means the most recent release is considered stable, secure and +contains all the most recent features. + +## Reporting a Vulnerability + +To make a report please use GitHub security section and click "Report a vulnerability" +button to fill details. Please don't forget to add archived version, Ceph version +and any other related details to reproduce the issue. diff --git a/cmd/access/main.go b/cmd/access/main.go new file mode 100644 index 0000000..1d5bf4a --- /dev/null +++ b/cmd/access/main.go @@ -0,0 +1,10 @@ +package main + +var ( + appVersion = "n/a (dev build)" + buildTimestamp = "undefined" +) + +func main() { + panic("not implemented") +} diff --git a/cmd/cli/main.go b/cmd/cli/main.go new file mode 100644 index 0000000..1d5bf4a --- /dev/null +++ b/cmd/cli/main.go @@ -0,0 +1,10 @@ +package main + +var ( + appVersion = "n/a (dev build)" + buildTimestamp = "undefined" +) + +func main() { + panic("not implemented") +} diff --git a/cmd/manage/main.go b/cmd/manage/main.go new file mode 100644 index 0000000..a683c77 --- /dev/null +++ b/cmd/manage/main.go @@ -0,0 +1,10 @@ +package manage + +var ( + appVersion = "n/a (dev build)" + buildTimestamp = "undefined" +) + +func main() { + panic("not implemented") +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..d717a08 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/teran/archived + +go 1.22.5