barycenter/deploy/freebsd/barycenter
Till Wegmueller c8b27bf196
feat: add deployment configurations for multiple platforms
Add comprehensive deployment support for:
- Docker: Multi-stage Dockerfile with security hardening
- Docker Compose: Production-ready compose file with volume persistence
- Kubernetes: Complete Helm chart with configurable values, ingress, PVC
- Linux: systemd service unit with extensive security hardening
- FreeBSD: rc.d init script with proper daemon management
- illumos/Solaris: SMF manifest with service contract management

Each platform includes:
- Installation scripts/manifests
- Configuration examples
- Management instructions
- Security best practices
- Troubleshooting guides

The Helm chart provides:
- Configurable resources and autoscaling
- Security contexts and pod security
- Health checks (liveness/readiness probes)
- Ingress with TLS support
- Persistent volume claims
- Service account management

All deployments follow security best practices:
- Non-root user execution
- Minimal privileges
- Read-only root filesystems where applicable
- Resource limits
- Network policies

Added DEPLOYMENT.md with comprehensive deployment guide covering
all platforms, configuration options, and production checklist.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 15:30:46 +01:00

59 lines
1.6 KiB
Bash

#!/bin/sh
#
# PROVIDE: barycenter
# REQUIRE: NETWORKING DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable barycenter:
#
# barycenter_enable="YES"
# barycenter_config="/usr/local/etc/barycenter/config.toml" # optional
# barycenter_user="barycenter" # optional
# barycenter_group="barycenter" # optional
# barycenter_env="RUST_LOG=info" # optional
. /etc/rc.subr
name="barycenter"
rcvar=barycenter_enable
load_rc_config $name
: ${barycenter_enable:="NO"}
: ${barycenter_user:="barycenter"}
: ${barycenter_group:="barycenter"}
: ${barycenter_config:="/usr/local/etc/barycenter/config.toml"}
: ${barycenter_env:=""}
pidfile="/var/run/${name}.pid"
command="/usr/local/bin/barycenter"
command_args="--config ${barycenter_config}"
# Daemon management
barycenter_start_precmd()
{
# Check if binary exists
if [ ! -x "${command}" ]; then
err 1 "${command} not found or not executable"
fi
# Check if config exists
if [ ! -f "${barycenter_config}" ]; then
err 1 "Config file ${barycenter_config} not found"
fi
# Ensure data directory exists
if [ ! -d "/var/db/barycenter" ]; then
mkdir -p /var/db/barycenter
chown ${barycenter_user}:${barycenter_group} /var/db/barycenter
fi
}
start_precmd="barycenter_start_precmd"
# Use daemon to run in background
command_interpreter="/usr/sbin/daemon"
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} -u ${barycenter_user} ${barycenter_env:+-o ${barycenter_env}} /usr/local/bin/barycenter --config ${barycenter_config}"
run_rc_command "$1"