Skip to content

Commit

Permalink
feat: start Owncast and Caddy and ask to run postinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellklijs committed Jan 6, 2025
1 parent d69366f commit ddb8061
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ Choose your preferred method below ⬇️
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/oszuidwest/zwtv-owncast/main/install.sh)"
```
4. The installer will set everything up for you automatically.
5. As the last step it'll ask you if you want to start the services. If you choose to do so, it'll also ask you if you want to run the postinstall script.

### I Know What I'm Doing

Download the `docker-compose.yml`, `.env.example` and `Caddyfile` files from the repository and configure them as needed.

## Script for Bulk Configuration

The `postinstall.sh` script configures Owncast with custom settings, such as stream output variants. You will need to run the script manually. It sets these settings:
The `postinstall.sh` script configures Owncast with custom settings, such as stream output variants. The install script asks you if you want to run this script. If you choose not to do so, and want to do it manually later, you can do so with the command below. It sets these settings:

- 4 stream output variants (360p, 480p, 720p 1080p).
- Disable browser notifications.
Expand Down
22 changes: 22 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,25 @@ echo -e "\n\n${GREEN}✓ Installation set up at ${INSTALL_DIR}${NC}"
echo -e "${YELLOW}The .env file has been populated with the values you provided.${NC}"
echo -e "${YELLOW}To start Owncast and Caddy, navigate to ${INSTALL_DIR} and run:${NC}"
echo -e "${YELLOW}docker compose up -d${NC}\n"

# Start Owncast and Caddy
ask_user "START_OWNCAST" "y" "Do you want to start Owncast and Caddy now? (y/n)" "y/n"
if [ "$START_OWNCAST" == "y" ]; then
cd "${INSTALL_DIR}" || exit
docker compose up -d

ask_user "RUN_POSTINSTALL" "y" "Do you want to run the postinstall script? (y/n)" "y/n"

# Run the postinstall script if requested by the user
if [ "$RUN_POSTINSTALL" == "y" ]; then
echo -e "${BLUE}►► Waiting for Owncast to start${NC}"
sleep 10

echo -e "${BLUE}►► Running postinstall script${NC}"
docker run --rm \
--volume /opt/owncast/.env:/.env \
--network owncast_backend \
-e BASE_URL=http://owncast:8080 \
alpine sh -c "apk add --no-cache bash curl && bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/oszuidwest/zwtv-owncast/main/postinstall.sh)\""
fi
fi

0 comments on commit ddb8061

Please sign in to comment.