secret

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package secret encrypts small secrets (service keys, plugin keys, storage credentials) before they are stored, with AES-256-GCM.

The key comes from PANELARR_SECRET_KEY (base64 of 32 bytes) or, when that isn't set, from a key file in the server's config directory, generated on first use. Keep the key with your database backups: without it, stored passwords can't be read back.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Box

type Box struct {
	// contains filtered or unexported fields
}

Box seals and opens secrets. It loads its key on first use, so the server runs fine without a key until a secret has to be stored.

func NewBox

func NewBox(envKey, keyFile string) *Box

NewBox returns a box whose key is envKey (base64) when set, otherwise the key in keyFile, created when missing.

func (*Box) Open

func (b *Box) Open(sealed string) (string, error)

Open decrypts a value from Seal.

func (*Box) Seal

func (b *Box) Seal(plain string) (string, error)

Seal encrypts plain.

Jump to

Keyboard shortcuts

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