add seafile
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 7s

This commit is contained in:
j
2025-12-29 12:53:02 +13:00
parent 53e34ad6f3
commit 2053e78ee0
14 changed files with 352 additions and 0 deletions

29
seafile/install.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
source "${AGENT_PATH}/common.sh"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
_check_required_env_vars "CONTAINER_NAME" "DATA_PATH" "MYSQL_ROOT_PASSWORD" "SEAFILE_ADMIN_EMAIL" "SEAFILE_ADMIN_PASSWORD" "SEAFILE_SERVER_HOSTNAME"
_check_docker_installed || _die "Docker test failed, aborting installation..."
# Create data directories
mkdir -p "${DATA_PATH}/mariadb" "${DATA_PATH}/seafile-data"
# Export variables for docker compose
export CONTAINER_NAME DATA_PATH HTTP_PORT IMAGE_REGISTRY IMAGE_REPO IMAGE_TAG
export MYSQL_ROOT_PASSWORD DB_PASSWORD SEAFILE_ADMIN_EMAIL SEAFILE_ADMIN_PASSWORD
export SEAFILE_SERVER_HOSTNAME SEAFILE_SERVER_PROTOCOL TZ
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
# Pull images
docker compose pull || _die "Failed to pull images"
# Stop existing containers
docker compose down 2>/dev/null || true
# Start containers
docker compose up -d || _die "Failed to start containers"
echo "Installation of ${CONTAINER_NAME} complete"
echo "Access Seafile at ${SEAFILE_SERVER_PROTOCOL}://${SEAFILE_SERVER_HOSTNAME}:${HTTP_PORT}"
echo "Note: First startup may take a few minutes while Seafile initializes the database."