Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·71 lines (61 loc) · 2.17 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·71 lines (61 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env sh
# draftcat one-line installer for a host that already has Docker.
#
# curl -fsSL https://raw.githubusercontent.com/renezander030/draftcat/master/install.sh | sh
#
# Pulls the published image, scaffolds an env file + compose with a persistent
# volume for state.db, and prints the two steps left. It does NOT start the
# service or touch anything outside $DRAFTCAT_DIR. Re-running is safe: an
# existing .env is kept.
set -eu
DIR="${DRAFTCAT_DIR:-$HOME/draftcat}"
IMAGE="ghcr.io/renezander030/draftcat"
if ! command -v docker >/dev/null 2>&1; then
echo "draftcat: Docker is required but not found." >&2
echo " Install it first: https://docs.docker.com/engine/install/" >&2
exit 1
fi
if ! docker compose version >/dev/null 2>&1; then
echo "draftcat: 'docker compose' (v2) is required. Update Docker, then re-run." >&2
exit 1
fi
echo "draftcat: installing into $DIR"
mkdir -p "$DIR"
cd "$DIR"
if [ ! -f .env ]; then
cat > .env <<'EOF'
# draftcat secrets — fill these in, then: docker compose up -d
DRAFTCAT_TG_TOKEN= # Telegram bot token from @BotFather
OPENROUTER_API_KEY= # https://openrouter.ai/keys
DRAFTCAT_TG_ALLOWED_USERS= # your Telegram user ID(s), comma-separated
# DRAFTCAT_TG_CHAT_ID= # optional — defaults to the first allowed user
EOF
echo "draftcat: wrote $DIR/.env"
else
echo "draftcat: keeping existing $DIR/.env"
fi
cat > docker-compose.yml <<EOF
# Generated by install.sh. Config + skills are baked into the image; tokens
# come from .env; state.db lives on the named volume.
services:
draftcat:
image: $IMAGE
restart: unless-stopped
env_file: .env
environment:
- DRAFTCAT_STATE_PATH=/data/state.db
volumes:
- draftcat-state:/data
volumes:
draftcat-state:
EOF
echo "draftcat: wrote $DIR/docker-compose.yml"
echo "draftcat: pulling $IMAGE ..."
docker pull "$IMAGE"
cat <<EOF
draftcat is installed. Two steps left:
1. Edit $DIR/.env — Telegram bot token, OpenRouter key, your Telegram user ID
2. cd $DIR && docker compose up -d
Then message your bot on Telegram; it sends drafts for you to approve.
To receive inbound from an agent/harness, see the README "Deploy — where it runs".
EOF