octi-sync-server

command module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

Octi Sync Server - Easy Synchronization!

Coverage Status Go Report Card FOSSA Status

Build CodeQL

License

FOSSA Status

Developing and Operating the Server

Running the Server
In Kubernetes

Pre-Requisites:

  • Kustomize
  • A Kubernetes Cluster

Please see deploy/kustomize for a kustomization.yaml that you can use to deploy the Application.

By default, the Deployment creates a Redis to join the Server which is not bound to any PV. This makes it not ready for productive use out of the box

From Docker

Pre-Requisites:

  • Docker
docker run ghcr.io/jakob-moeller-cloud/octi-sync-server:latest

You can verify build the build integrity with the provided cosign.pub Public Key:

docker run -it --rm -v $PWD:/repo gcr.io/projectsigstore/cosign verify --key /repo/cosign.pub ghcr.io/jakob-moeller-cloud/octi-sync-server:latest

Make sure to open Port 8080 if you want the server to be reachable. Also, you might want to bind in config.yml via volume to override configuration values.

From Source
go run .

Adjust configuration parameters in config.yml where necessary!

For running a redis locally for testing, use

docker run -it --rm -p 6379:6379 --name octi-redis redis:latest
From Release

First download the artifact:

VERSION=0.2.3-alpha4 \
RELEASE=https://github.com/jakob-moeller-cloud/octi-sync-server/releases/download/v$VERSION; \
wget $RELEASE/octi-sync-server_${VERSION}_Linux_x86_64.tar.gz

Next download the signature:

To verify the integrity of the checksums of the remote build before downloading:

## note that PUBLIC_KEY is coming from the repository here, you can also download it before and use a local mount
PUBLIC_KEY=/repo/cosign.pub \
VERSION=0.2.3-alpha4 \
RELEASE=https://github.com/jakob-moeller-cloud/octi-sync-server/releases/download/v$VERSION; \
docker run -it --rm -v $PWD:/repo gcr.io/projectsigstore/cosign \
  verify-blob --key PUBLIC_KEY \
  --signature $RELEASE/checksums.txt.sig \
  $RELEASE/checksums.txt

Now verify the downloaded artifact from above

PUBLIC_KEY=/repo/cosign.pub \
VERSION=0.2.3-alpha4 \
RELEASE=https://github.com/jakob-moeller-cloud/octi-sync-server/releases/download/v$VERSION; \
echo "$(wget -qO /dev/stdout $RELEASE/checksums.txt | grep octi-sync-server_${VERSION}_Linux_x86_64.tar.gz)" | \
sha256sum --check
Inspecting and Recreating The OpenAPI Definitions and Mocks
V1

You can access the active JSON-Formatted OpenAPI Definition under

http://localhost:8080/v1/openapi.

You can introspect the API with Swagger-UI using a static Path or from the hosted Server. For ease of development, you can introspect locally with

# URL is where the server is hosted, 
# remember that by default it will be blocked by CORS!
docker run -it --rm \
    -p 80:8080 \
    -e URL=http://localhost:8080/v1/openapi \
    -v $(pwd)/api/v1:/v1 swaggerapi/swagger-ui

and then opening your browser on http://localhost:80 while running the server.

You can recreate the Definitions and Mocks with

go install go.uber.org/mock/[email protected]
go generate ./...
Running Tests
go test ./...
Linting
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.49.0 golangci-lint run

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1
v1/REST
Package REST provides primitives to interact with the openapi HTTP API.
Package REST provides primitives to interact with the openapi HTTP API.
middleware
mock
Code generated by MockGen.
Code generated by MockGen.
redis/mock
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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