Skip to content

Commit 78d8607

Browse files
committed
Update installation scripts and configuration for cross-platform support; set default listening port to 1237 and bump version to 0.1.0
1 parent ca0d697 commit 78d8607

7 files changed

Lines changed: 263 additions & 37 deletions

File tree

README.md

Lines changed: 64 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,70 @@ CROW-Client is a Python-based task execution agent that:
3131
- **Production-Ready**: Type-safe request/response validation using Pydantic
3232
- **Easy Integration**: Simple CLI startup and configuration
3333

34+
## 🚀 Installation (Linux, macOS, Windows)
35+
36+
CROW Client can be installed with a single command on all major operating systems. The installer scripts are fetched directly from this repository and executed locally.
37+
38+
### ⚠️ Security Note
39+
40+
This executes a remote script from this repository. Only run it if you trust the source.
41+
42+
---
43+
44+
## Linux / macOS (bash)
45+
46+
### Linux
47+
48+
```bash
49+
curl -fsSL https://raw.githubusercontent.com/Cron-Routine-Orchestrator-Webapp/CROW-Client/main/installer/install_linux.sh | bash
50+
```
51+
52+
### macOS:
53+
54+
```bash
55+
curl -fsSL https://raw.githubusercontent.com/Cron-Routine-Orchestrator-Webapp/CROW-Client/main/installer/install_macos.sh | bash
56+
```
57+
58+
---
59+
60+
## Windows (PowerShell)
61+
62+
Run in PowerShell:
63+
64+
```powershell
65+
iwr https://raw.githubusercontent.com/Cron-Routine-Orchestrator-Webapp/CROW-Client/main/installer/install_windows.ps1 -UseBasicParsing | iex
66+
```
67+
68+
---
69+
70+
## What this does
71+
72+
Each installer will:
73+
74+
- Fetch the latest release from GitHub
75+
- Download the correct platform ZIP asset
76+
- Extract the `crow-client` executable
77+
- Install it into a user-local directory
78+
- Register it for auto-start:
79+
- Linux: `systemd --user`
80+
- macOS: `launchd`
81+
- Windows: Startup folder shortcut
82+
- The client will start and listen on `0.0.0.0:1237` for incoming task requests from the CROW-Server.
83+
84+
---
85+
86+
## File locations after install
87+
88+
- Linux: `~/.local/share/crow-client`
89+
- macOS: `~/Library/Application Support/crow-client`
90+
- Windows: `%APPDATA%\crow-client`
91+
92+
---
93+
94+
## Updating
95+
96+
Re-run the same command to update to the latest version. The installer will replace the existing installation with the newest release automatically.
97+
3498
## 🏗️ Architecture
3599

36100
```
@@ -67,40 +131,6 @@ CROW-Client Architecture:
67131
- `pydantic` >= 2.13.4 - Data validation and serialization
68132
- `websockets` >= 16.0 - WebSocket protocol implementation
69133

70-
## 🚀 Quick Start
71-
72-
### Installation
73-
74-
1. Clone the repository:
75-
76-
```bash
77-
git clone https://github.com/Cron-Routine-Orchestrator-Webapp/CROW-Client.git
78-
cd CROW-Client
79-
```
80-
81-
2. Create a virtual environment (recommended):
82-
83-
```bash
84-
python3 -m venv venv
85-
source venv/bin/activate # On Windows: venv\Scripts\activate
86-
```
87-
88-
3. Install the package:
89-
90-
```bash
91-
pip install -e .
92-
```
93-
94-
### Running the Client
95-
96-
Start the CROW-Client WebSocket server:
97-
98-
```bash
99-
python -m client
100-
```
101-
102-
The client will start and listen on `localhost:5000` for incoming task requests from the CROW-Server.
103-
104134
## 📂 Project Structure
105135

106136
```

installer/install_linux.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
# =========================
6+
# CONFIG
7+
# =========================
8+
REPO="Cron-Routine-Orchestrator-Webapp/CROW-Client"
9+
10+
ZIP_NAME="crow-client-Linux.zip"
11+
BINARY_NAME="crow-client"
12+
13+
INSTALL_DIR="$HOME/.local/share/crow-client"
14+
SERVICE_DIR="$HOME/.config/systemd/user"
15+
SERVICE_FILE="$SERVICE_DIR/crow-client.service"
16+
# =========================
17+
18+
echo "Fetching latest release..."
19+
20+
LATEST_URL=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" \
21+
| grep "browser_download_url" \
22+
| grep "$ZIP_NAME" \
23+
| cut -d '"' -f 4 \
24+
| head -n 1)
25+
26+
if [[ -z "$LATEST_URL" ]]; then
27+
echo "No matching Linux release found."
28+
exit 1
29+
fi
30+
31+
TMP_ZIP="/tmp/crow-client.zip"
32+
33+
curl -L "$LATEST_URL" -o "$TMP_ZIP"
34+
35+
rm -rf "$INSTALL_DIR"
36+
mkdir -p "$INSTALL_DIR"
37+
38+
unzip -o "$TMP_ZIP" -d "$INSTALL_DIR" >/dev/null
39+
40+
BIN_PATH=$(find "$INSTALL_DIR" -type f -name "$BINARY_NAME" | head -n 1)
41+
42+
if [[ -z "$BIN_PATH" ]]; then
43+
echo "Binary not found."
44+
exit 1
45+
fi
46+
47+
chmod +x "$BIN_PATH"
48+
49+
mkdir -p "$SERVICE_DIR"
50+
51+
cat > "$SERVICE_FILE" <<EOF
52+
[Unit]
53+
Description=CROW Client
54+
After=network.target
55+
56+
[Service]
57+
ExecStart=$BIN_PATH
58+
Restart=always
59+
RestartSec=5
60+
61+
[Install]
62+
WantedBy=default.target
63+
EOF
64+
65+
systemctl --user daemon-reload
66+
systemctl --user enable crow-client.service
67+
systemctl --user start crow-client.service
68+
69+
echo "Installation complete. CROW Client is now running as a systemd service."

installer/install_macos.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
# =========================
6+
# CONFIG
7+
# =========================
8+
REPO="Cron-Routine-Orchestrator-Webapp/CROW-Client"
9+
10+
ZIP_NAME="crow-client-macOS.zip"
11+
BINARY_NAME="crow-client"
12+
13+
INSTALL_DIR="$HOME/Library/Application Support/crow-client"
14+
PLIST_DIR="$HOME/Library/LaunchAgents"
15+
PLIST_FILE="$PLIST_DIR/com.crow.client.plist"
16+
# =========================
17+
18+
echo "Fetching latest release..."
19+
20+
LATEST_URL=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" \
21+
| grep "browser_download_url" \
22+
| grep "$ZIP_NAME" \
23+
| cut -d '"' -f 4 \
24+
| head -n 1)
25+
26+
if [[ -z "$LATEST_URL" ]]; then
27+
echo "No matching macOS release found."
28+
exit 1
29+
fi
30+
31+
TMP_ZIP="/tmp/crow-client.zip"
32+
33+
curl -L "$LATEST_URL" -o "$TMP_ZIP"
34+
35+
rm -rf "$INSTALL_DIR"
36+
mkdir -p "$INSTALL_DIR"
37+
38+
unzip -o "$TMP_ZIP" -d "$INSTALL_DIR" >/dev/null
39+
40+
BIN_PATH=$(find "$INSTALL_DIR" -type f -name "$BINARY_NAME" | head -n 1)
41+
42+
if [[ -z "$BIN_PATH" ]]; then
43+
echo "Binary not found."
44+
exit 1
45+
fi
46+
47+
chmod +x "$BIN_PATH"
48+
49+
mkdir -p "$PLIST_DIR"
50+
51+
cat > "$PLIST_FILE" <<EOF
52+
<?xml version="1.0" encoding="UTF-8"?>
53+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
54+
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
55+
<plist version="1.0">
56+
<dict>
57+
<key>Label</key>
58+
<string>com.crow.client</string>
59+
60+
<key>ProgramArguments</key>
61+
<array>
62+
<string>$BIN_PATH</string>
63+
</array>
64+
65+
<key>RunAtLoad</key>
66+
<true/>
67+
68+
<key>KeepAlive</key>
69+
<true/>
70+
</dict>
71+
</plist>
72+
EOF
73+
74+
launchctl load "$PLIST_FILE"
75+
76+
echo "Installation complete. CROW Client is now running as a Launch Agent."

installer/install_windows.ps1

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# =========================
2+
# CONFIG
3+
# =========================
4+
$Repo = "Cron-Routine-Orchestrator-Webapp/CROW-Client"
5+
6+
$ZipName = "crow-client-Windows.zip"
7+
$BinaryName = "crow-client.exe"
8+
9+
$InstallDir = "$env:APPDATA\crow-client"
10+
$StartupDir = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup"
11+
$ShortcutPath = "$StartupDir\crow-client.lnk"
12+
# =========================
13+
14+
Write-Output "Fetching latest release..."
15+
16+
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/$Repo/releases/latest"
17+
18+
$asset = $release.assets | Where-Object { $_.name -eq $ZipName } | Select-Object -First 1
19+
20+
if (-not $asset) {
21+
Write-Error "No matching Windows release found."
22+
exit 1
23+
}
24+
25+
$zipPath = "$env:TEMP\crow-client.zip"
26+
27+
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $zipPath
28+
29+
if (Test-Path $InstallDir) {
30+
Remove-Item $InstallDir -Recurse -Force
31+
}
32+
33+
New-Item -ItemType Directory -Path $InstallDir | Out-Null
34+
35+
Expand-Archive -Path $zipPath -DestinationPath $InstallDir -Force
36+
37+
$exe = Get-ChildItem -Path $InstallDir -Recurse -Filter $BinaryName | Select-Object -First 1
38+
39+
if (-not $exe) {
40+
Write-Error "Binary not found."
41+
exit 1
42+
}
43+
44+
# Create shortcut for autostart
45+
$WshShell = New-Object -ComObject WScript.Shell
46+
$Shortcut = $WshShell.CreateShortcut($ShortcutPath)
47+
$Shortcut.TargetPath = $exe.FullName
48+
$Shortcut.WorkingDirectory = $exe.Directory.FullName
49+
$Shortcut.Save()
50+
51+
Write-Output "Installed on Windows."

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "crow-client"
3-
version = "0.0.2"
3+
version = "0.1.0"
44
description = "CROW-Client"
55
readme = "README.md"
66
requires-python = ">=3.10"

src/client/communication/web_sockets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async def work(self, websocket) -> None:
5050
print("Connection closed")
5151

5252
async def run(self) -> None:
53-
async with serve(self.work, "localhost", 5000) as server:
53+
async with serve(self.work, "0.0.0.0", 1237) as server:
5454
await server.serve_forever()
5555

5656

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)