config: Update 5 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 7s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 7s
This commit is contained in:
@@ -13,7 +13,7 @@ DATA_PATH="/home/dropshell/seafile"
|
||||
|
||||
# Seafile server configuration
|
||||
SEAFILE_SERVER_HOSTNAME="seafile.example.com"
|
||||
SEAFILE_SERVER_PROTOCOL="http"
|
||||
SEAFILE_SERVER_PROTOCOL="https"
|
||||
HTTP_PORT=8080
|
||||
|
||||
# Admin credentials (change these!)
|
||||
|
||||
@@ -16,7 +16,10 @@ cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
# Stop and remove containers
|
||||
docker compose -p "${CONTAINER_NAME}" down -v 2>/dev/null || true
|
||||
|
||||
# Remove data directory
|
||||
rm -rf "${DATA_PATH}"
|
||||
# Remove data directory using Docker (files are owned by root from containers)
|
||||
if [ -d "${DATA_PATH}" ]; then
|
||||
docker run --rm -v "${DATA_PATH}:/data" alpine rm -rf /data/* /data/.[!.]* 2>/dev/null || true
|
||||
rmdir "${DATA_PATH}" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
echo "Destroyed ${CONTAINER_NAME} and all data."
|
||||
|
||||
@@ -43,6 +43,7 @@ services:
|
||||
SEAFILE_ADMIN_EMAIL: ${SEAFILE_ADMIN_EMAIL}
|
||||
SEAFILE_ADMIN_PASSWORD: ${SEAFILE_ADMIN_PASSWORD}
|
||||
SEAFILE_SERVER_HOSTNAME: ${SEAFILE_SERVER_HOSTNAME}
|
||||
SEAFILE_SERVER_PROTOCOL: ${SEAFILE_SERVER_PROTOCOL}
|
||||
SEAFILE_SERVER_LETSENCRYPT: "false"
|
||||
JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
|
||||
TIME_ZONE: ${TZ}
|
||||
|
||||
@@ -18,9 +18,31 @@ cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
# Stop existing containers
|
||||
docker compose -p "${CONTAINER_NAME}" down 2>/dev/null || true
|
||||
|
||||
# Start containers (pull latest images if available)
|
||||
docker compose -p "${CONTAINER_NAME}" up -d --pull always || _die "Failed to start containers"
|
||||
# Start containers (only pull if image missing locally)
|
||||
docker compose -p "${CONTAINER_NAME}" up -d --pull missing || _die "Failed to start containers"
|
||||
|
||||
echo "Waiting for Seafile to initialize..."
|
||||
|
||||
# Wait for Seafile to be fully ready (check for seahub process)
|
||||
# shellcheck disable=SC2034
|
||||
for i in {1..60}; do
|
||||
if docker exec "${CONTAINER_NAME}" pgrep -f "seahub" &>/dev/null; then
|
||||
echo "Seafile is ready"
|
||||
break
|
||||
fi
|
||||
sleep 3
|
||||
done
|
||||
|
||||
# Give it a moment to fully initialize
|
||||
sleep 5
|
||||
|
||||
# Always update admin credentials using Seafile's reset-admin script
|
||||
echo "Setting admin credentials..."
|
||||
docker exec "${CONTAINER_NAME}" bash -c "
|
||||
cd /opt/seafile/seafile-server-latest
|
||||
echo -e '${SEAFILE_ADMIN_EMAIL}\n${SEAFILE_ADMIN_PASSWORD}\n${SEAFILE_ADMIN_PASSWORD}' | ./reset-admin.sh
|
||||
" 2>&1
|
||||
|
||||
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."
|
||||
echo "Login with: ${SEAFILE_ADMIN_EMAIL}"
|
||||
|
||||
@@ -10,11 +10,8 @@ export SEAFILE_SERVER_HOSTNAME SEAFILE_SERVER_PROTOCOL JWT_PRIVATE_KEY TZ
|
||||
|
||||
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
|
||||
# Stop and remove containers (but preserve volumes/data)
|
||||
# Stop and remove containers (but preserve volumes/data and images)
|
||||
docker compose -p "${CONTAINER_NAME}" down || _die "Failed to stop containers"
|
||||
|
||||
# Remove images
|
||||
docker compose -p "${CONTAINER_NAME}" config --images | xargs -r docker rmi 2>/dev/null || true
|
||||
|
||||
echo "Uninstallation of ${CONTAINER_NAME} complete."
|
||||
echo "Data preserved in ${DATA_PATH}. To remove all data, use destroy.sh"
|
||||
|
||||
Reference in New Issue
Block a user