Skip to content

Winge19/octi-sync-server

 
 

Repository files navigation

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 github.com/golang/mock/mockgen@v1.6.0
go generate ./...

Running Tests

go test ./...

Linting

docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.49.0 golangci-lint run

About

An easy synchronization server

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 96.4%
  • Makefile 3.5%
  • Dockerfile 0.1%