server

package module
v0.0.0-...-93d1698 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

README

Local development environment

This repository provides a Taskfile for setting up a local development environment with MinIO and Vault.

Prerequisites

  • Install Task
    • Before using Taskfile, set the environment variable:
      export TASK_X_REMOTE_TASKFILES=1
      
      (Add this to your shell configuration file, e.g., .bashrc or .zshrc, for persistence.)
    • To skip confirmation prompts when running tasks, use the --yes flag:
      task --yes taskname
      

Default setup

To start the local development environment with default settings, run:

task setup:dev-environment

This command will:

  1. Start a MinIO server with a default bucket
  2. Start a Vault server in development mode
  3. Configure the Vault plugin with default parameters
Configuration parameters
Parameter Default Value Description
project_name trdl-test-project1 The name of the project/bucket in MinIO
signatures_count 0 Number of required verified signatures
git_repo_url https://github.com/werf/trdl-test-project Git repository URL for TRDL metadata
git_trdl_path p1/trdl.yaml Path to TRDL configuration in the repository
git_trdl_channels_path p1/trdl_channels.yaml Path to TRDL channels configuration
vault_addr http://localhost:8200 Vault server address
minio_data_dir .minio_data Local directory for MinIO data
minio_container trdl_dev_minio MinIO container name
vault_container trdl_dev_vault Vault container name
s3_access_key minioadmin MinIO access key
s3_secret_key minioadmin MinIO secret key
minio_port 9000 MinIO service port
minio_console_port 9001 MinIO console port
vault_port 8200 Vault service port
version dev Version tag for builds

Custom setup

You can override default values by passing them as variables:

task setup:dev-environment --project_name=my-custom-project --signatures_count=2 --git_repo_url=https://github.com/example/repo --git_trdl_path=trdl.yaml --git_trdl_channels_path=trdl_channels.yaml

This will:

  • Use my-custom-project as the bucket/project name
  • Require 2 verified signatures
  • Set custom Git repository URL and paths

Cleaning up

To remove all containers and clean up data:

task dev:cleanup

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SystemClock util.Clock = util.NewSystemClock()

Functions

func Factory

func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error)

func GetTrdlChannelsConfig

func GetTrdlChannelsConfig(gitRepo *git.Repository, trdlChannelsPath string) (*config.TrdlChannels, error)

func NewErrIncorrectChannelName

func NewErrIncorrectChannelName(chnl string) error

func NewErrPublishingNonExistingReleases

func NewErrPublishingNonExistingReleases(releases []string) error

func ValidatePublishConfig

func ValidatePublishConfig(ctx context.Context, publisher publisher.Interface, publisherRepository publisher.RepositoryInterface, config *config.TrdlChannels, logger hclog.Logger) error

func ValidateReleaseVersion

func ValidateReleaseVersion(releaseVersion string) error

Types

type Backend

type Backend struct {
	*framework.Backend
	TasksManager    tasks_manager.ActionsInterface
	Publisher       publisher.Interface
	BackendPeriodic BackendPeriodicInterface
}

func NewBackend

func NewBackend(logger hclog.Logger) (*Backend, error)

func (*Backend) InitPaths

func (b *Backend) InitPaths(modules ...BackendModuleInterface)

func (*Backend) InitPeriodicFunc

func (b *Backend) InitPeriodicFunc(modules ...BackendModuleInterface)

func (*Backend) Periodic

func (b *Backend) Periodic(ctx context.Context, req *logical.Request) error

type BackendModuleInterface

type BackendModuleInterface interface {
	Paths() []*framework.Path
	PeriodicFunc(ctx context.Context, req *logical.Request) error
}

type BackendPeriodicInterface

type BackendPeriodicInterface interface {
	Periodic(ctx context.Context, req *logical.Request) error
}

Jump to

Keyboard shortcuts

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