Skip to content

Instantly share code, notes, and snippets.

@liongkj
Last active January 11, 2025 01:54
Show Gist options
  • Select an option

  • Save liongkj/e3b1337c9fe30c5c9f70bd375a1fef8c to your computer and use it in GitHub Desktop.

Select an option

Save liongkj/e3b1337c9fe30c5c9f70bd375a1fef8c to your computer and use it in GitHub Desktop.
wewerss
#!/bin/bash
echo "Setting up WeeRSS..."
# Check if either docker-compose or docker compose is available
if command -v docker-compose &> /dev/null; then
DOCKER_COMPOSE_CMD="docker-compose"
elif docker compose version &> /dev/null; then
DOCKER_COMPOSE_CMD="docker compose"
else
echo "Error: Neither docker-compose nor docker compose is available"
exit 1
fi
# Create a dedicated directory for WeeRSS
INSTALL_DIR="$HOME/weerss"
echo "Creating installation directory at $INSTALL_DIR"
mkdir -p "$INSTALL_DIR"
cd "$INSTALL_DIR" || exit 1
# Prompt for AUTH_CODE
read -p "Please enter your desired AUTH_CODE (press Enter for default '123567'): " auth_code
auth_code=${auth_code:-123567}
echo "Using AUTH_CODE: $auth_code"
# Create docker-compose.yml with the user-provided AUTH_CODE
cat << EOF > docker-compose.yml
version: '3.9'
services:
app:
image: cooderl/wewe-rss-sqlite:latest
ports:
- 4000:4000
environment:
- DATABASE_TYPE=sqlite
- AUTH_CODE=$auth_code
- FEED_MODE=fulltext
- CRON_EXPRESSION=35 5,17 * * *
volumes:
- ./data:/app/data
restart: unless-stopped
EOF
# Create data directory if it doesn't exist
mkdir -p data
# Start the container in detached mode
$DOCKER_COMPOSE_CMD up -d
# Check if the container is running
if $DOCKER_COMPOSE_CMD ps | grep -q "Up"; then
echo "WeeRSS has been successfully installed and started!"
echo "Installation directory: $INSTALL_DIR"
echo "You can access it at http://localhost:4000"
echo "Your AUTH_CODE is: $auth_code"
else
echo "Error: WeeRSS failed to start properly. Please check the logs with: $DOCKER_COMPOSE_CMD logs"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment