config: Update 7 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 22s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 22s
This commit is contained in:
@@ -9,7 +9,7 @@ services:
|
||||
network_mode: host
|
||||
volumes:
|
||||
- ./mediamtx.yml:/mediamtx.yml
|
||||
- ${RECORDINGS_PATH}:/recordings
|
||||
- ${RECORDINGS_FOLDER}:/recordings
|
||||
environment:
|
||||
- MTX_PROTOCOLS=tcp
|
||||
- CAMERA_USER=${CAMERA_USER}
|
||||
@@ -34,7 +34,7 @@ services:
|
||||
depends_on:
|
||||
- mediamtx
|
||||
volumes:
|
||||
- ${RECORDINGS_PATH}:/recordings
|
||||
- ${RECORDINGS_FOLDER}:/recordings
|
||||
environment:
|
||||
- SQUASHKIWI_API=${SQUASHKIWI_API}
|
||||
- COURT_ID=${COURT_ID}
|
||||
@@ -58,7 +58,7 @@ services:
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./web:/usr/share/nginx/html:ro
|
||||
- ${RECORDINGS_PATH}:/recordings:ro
|
||||
- ${RECORDINGS_FOLDER}:/recordings:ro
|
||||
- nginx-cache:/var/cache/nginx
|
||||
depends_on:
|
||||
- mediamtx
|
||||
|
@@ -1,7 +1,8 @@
|
||||
# SquashKiwi Streaming Configuration
|
||||
# Edit this file to configure your streaming service
|
||||
|
||||
LOCAL_DATA_FOLDER="/home/dropshell/example-squashkiwi-streaming"
|
||||
LOCAL_DATA_FOLDER="/home/dropshell/example-squashkiwi-streaming-data"
|
||||
RECORDINGS_FOLDER="/home/dropshell/example-squashkiwi-streaming-recordings"
|
||||
|
||||
|
||||
# Camera Configuration
|
||||
@@ -18,7 +19,6 @@ COURT_NAME=Court 1
|
||||
SQUASHKIWI_API=https://squash.kiwi/api
|
||||
|
||||
# Recording Settings
|
||||
RECORDINGS_PATH="/home/dropshell/example-squashkiwi-streaming/recordings"
|
||||
RECORDING_RETENTION_DAYS=30
|
||||
RECORDING_QUALITY=high
|
||||
IDLE_TIMEOUT=300
|
||||
|
@@ -1,11 +1,15 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC1091
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "PROJECT_NAME" "LOCAL_DATA_FOLDER"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${SCRIPT_DIR}/_paths.sh"
|
||||
_check_required_env_vars "LOCAL_DATA_FOLDER"
|
||||
|
||||
cd "${LOCAL_DATA_FOLDER}/config" || _die "Failed to change to config directory"
|
||||
"${SCRIPT_DIR}/uninstall.sh"
|
||||
|
||||
echo "Destroying ${PROJECT_NAME} containers and networks..."
|
||||
docker compose down -v || _die "Failed to destroy Docker Compose services"
|
||||
# shellcheck disable=SC2046
|
||||
destroy_items $(get_squashkiwi_streaming_paths) || _die "Failed to destroy ${LOCAL_DATA_FOLDER}"
|
||||
rm -rf "${RECORDINGS_FOLDER}"
|
||||
|
||||
echo "Destroyed ${CONTAINER_NAME}"
|
||||
|
||||
echo "${PROJECT_NAME} destroyed (configuration and recordings preserved)"
|
@@ -8,13 +8,11 @@ _check_required_env_vars "PROJECT_NAME" "LOCAL_DATA_FOLDER" "CAMERA_IP" "COURT_I
|
||||
# Create directories
|
||||
# shellcheck disable=SC2046
|
||||
create_items $(get_squashkiwi_streaming_paths) || _die "Failed to create directories"
|
||||
mkdir -p "${RECORDINGS_FOLDER}"
|
||||
|
||||
# Copy configuration files
|
||||
cp -r "${SCRIPT_DIR}/config/"* "${LOCAL_DATA_FOLDER}/config/" || _die "Failed to copy config files"
|
||||
|
||||
# Update recordings path in service.env
|
||||
sed -i "s|RECORDINGS_PATH=.*|RECORDINGS_PATH=${LOCAL_DATA_FOLDER}/recordings|" "${LOCAL_DATA_FOLDER}/config/service.env"
|
||||
|
||||
# Test Docker
|
||||
_check_docker_installed || _die "Docker test failed, aborting installation..."
|
||||
|
||||
|
@@ -1,55 +1,22 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC1091
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "PROJECT_NAME" "LOCAL_DATA_FOLDER"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${SCRIPT_DIR}/_paths.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME" "LOCAL_DATA_FOLDER" "BACKUP_FILE" "TEMP_DIR"
|
||||
|
||||
BACKUP_DIR="${HOME}/backups/${PROJECT_NAME}"
|
||||
# RESTORE SCRIPT
|
||||
# The restore script is OPTIONAL.
|
||||
# It is used to restore the service on the server from a backup file.
|
||||
# It is called with one argument: the path to the backup file.
|
||||
|
||||
# List available backups
|
||||
echo "Available backups:"
|
||||
ls -1t "${BACKUP_DIR}"/*.tar.gz 2>/dev/null | head -10 | nl
|
||||
# # Stop container before backup
|
||||
"${SCRIPT_DIR}/uninstall.sh" || _die "Failed to uninstall service before restore"
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "No backups found in ${BACKUP_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
# shellcheck disable=SC2046
|
||||
restore_items $(get_squashkiwi_streaming_paths) || _die "Failed to restore data folder from backup"
|
||||
|
||||
# Select backup
|
||||
read -p "Enter backup number to restore (or path to backup file): " selection
|
||||
# reinstall service
|
||||
"${SCRIPT_DIR}/install.sh" || _die "Failed to reinstall service after restore"
|
||||
|
||||
if [[ -f "$selection" ]]; then
|
||||
BACKUP_FILE="$selection"
|
||||
else
|
||||
BACKUP_FILE=$(ls -1t "${BACKUP_DIR}"/*.tar.gz 2>/dev/null | sed -n "${selection}p")
|
||||
fi
|
||||
|
||||
if [[ ! -f "$BACKUP_FILE" ]]; then
|
||||
echo "Backup file not found: ${BACKUP_FILE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Restoring from: ${BACKUP_FILE}"
|
||||
read -p "This will overwrite current configuration. Continue? (yes/no): " confirmation
|
||||
|
||||
if [[ "$confirmation" != "yes" ]]; then
|
||||
echo "Restore cancelled"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Stop services
|
||||
bash "${SCRIPT_DIR}/stop.sh" || true
|
||||
|
||||
# Backup current config
|
||||
if [[ -d "${LOCAL_DATA_FOLDER}/config" ]]; then
|
||||
mv "${LOCAL_DATA_FOLDER}/config" "${LOCAL_DATA_FOLDER}/config.bak.$(date +%Y%m%d_%H%M%S)"
|
||||
fi
|
||||
|
||||
# Extract backup
|
||||
tar -xzf "${BACKUP_FILE}" -C "${LOCAL_DATA_FOLDER}" || _die "Failed to extract backup"
|
||||
|
||||
echo "✓ Backup restored"
|
||||
|
||||
# Restart services
|
||||
bash "${SCRIPT_DIR}/start.sh"
|
||||
|
||||
echo "Restore complete!"
|
||||
echo "Restore complete! Service is running again on port $HOST_PORT with restored website."
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC1091
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
_check_required_env_vars "PROJECT_NAME" "LOCAL_DATA_FOLDER"
|
||||
|
||||
cd "${LOCAL_DATA_FOLDER}/config" || _die "Failed to change to config directory"
|
||||
|
@@ -3,22 +3,9 @@
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "PROJECT_NAME" "LOCAL_DATA_FOLDER"
|
||||
|
||||
echo "WARNING: This will remove all ${PROJECT_NAME} containers, images, and data!"
|
||||
echo "Recordings will be permanently deleted."
|
||||
read -p "Are you sure? (yes/no): " confirmation
|
||||
|
||||
if [[ "$confirmation" != "yes" ]]; then
|
||||
echo "Uninstall cancelled"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd "${LOCAL_DATA_FOLDER}/config" || _die "Failed to change to config directory"
|
||||
|
||||
# Stop and remove containers
|
||||
docker compose down -v --rmi all || true
|
||||
docker compose down || true
|
||||
|
||||
# Remove local data
|
||||
echo "Removing local data folder: ${LOCAL_DATA_FOLDER}"
|
||||
rm -rf "${LOCAL_DATA_FOLDER}"
|
||||
|
||||
echo "${PROJECT_NAME} has been completely uninstalled"
|
||||
echo "${PROJECT_NAME} has been uninstalled"
|
||||
|
Reference in New Issue
Block a user