backend

command module
v3.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

README

Envelope Zero backend

Release Go Reference Go Report Card

Check out the documentation at envelope-zero.org!

Features

For a high level view of planned complex features, check the milestones.

To see all planned features, check the list of issues with the enhancement label.

Usage

Upgrading

See docs/upgrading.md.

Configuration

⚠ You need to configure a persistent storage to be mounted to /data, e.g. a docker volume. If you do not do this, upon deleting the container, all your data will be lost.

The backend can be configured with the following environment variables.

Name Type Default Description
API_URL string none, must be set The URL of the API, e.g. https://ez.example.com/api
GIN_MODE One of release, debug release The mode that gin runs in. Only set this to debug on your development environment!
PORT number 8080 The port the backend listens on
LOG_FORMAT One of json, human json if GIN_MODE is release, otherwise human If log output is written human readable or as JSON.
CORS_ALLOW_ORIGINS string "" ℹ This is only needed for frontend development. Defines hosts that are allowed to use cross origin requests, separated by spaces.
ENABLE_PPROF bool false If set to true, pprof profiles for application profiling are made available at /debug/pprof. ⚠ If you do not know what this means, do not turn this on.
Deployment methods

The recommended way for production deployments is to run the backend with the OCI image or a binary directly. For up-to-date binaries, check out the Releases page.

If you want to deploy with a method not listed here, you are welcome to open a discussion to ask any questions needed so that this documentation can be improved.

On Kubernetes

You can run the backend on any Kubernetes cluster with a supported version using the morremeyer/generic helm chart with the following values:

image:
  repository: ghcr.io/envelope-zero/backend
  tag: v0.2.1

# All data is stored to a sqlite database in /data.
# Make sure to persist and backup this directory.
persistence:
  enabled: true
  mountPath: /data

affinity:
  podAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchLabels:
            app.kubernetes.io/instance: ez-backend # Replace this with the name of your helm release
            app.kubernetes.io/name: generic
        topologyKey: "kubernetes.io/hostname"

ports:
  - name: http
    containerPort: 8080
    protocol: TCP

ingress:
  enabled: true
  hosts:
    - host: envelope-zero.example.com
      paths:
        - path: /api
  tls:
    - hosts:
        - envelope-zero.example.com

Supported Versions

As the backend is constantly developed, only the latest minor version is supported (versions are MAJOR.MINOR.PATCH). If you encounter an issue, please update to the latest version of the backend and verify that it still exists in that version.

Please check the releases page for the latest release.

Contributing

Please see the contribution guidelines.

Versioning

This project is versioned using Semantic Versioning 2.0.0.

The public API is defined as:

  • The API endpoints, meaning the routes, parameters, HTTP respone codes and response body format (for a function, we'd just say “the function signature“) that the HTTP server built from the code in this repository provides
  • The behavior of the API endpoints no matter the signature of the endpoint is

Not part of the public API is:

  • The go module itself, meaning that exported function signatures or behaviors can change at any point in time

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package api Code generated by swaggo/swag.
Package api Code generated by swaggo/swag.
internal
types
Package types implements special types for Envelope Zero.
Package types implements special types for Envelope Zero.
pkg

Jump to

Keyboard shortcuts

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