Compare commits

11 Commits

Author SHA1 Message Date
684f6b1a54 feat: add restart policy for abra install service 2025-09-17 17:35:58 +02:00
b3ec5886e3 reverted last changes 2025-09-17 17:32:34 +02:00
2dd66df5c4 fix: remove invisible escape characters from common.nix
- Fix bash completion function escape characters: $${...} -> $${...}
- Replace printf with \n escapes with proper heredoc in certificate generation
- Clean up invisible characters that could cause parsing issues
2025-09-17 17:31:12 +02:00
f70ba8ae25 fix: simplify abra installation service
- Remove retry loop and internet connectivity checks from abra installation service
- Keep working sudo abra --version verification
- Simplify install() function to restart service once instead of 300 times
- Plain installation without overcomplicated logic
2025-09-17 17:24:28 +02:00
5477f97f5d feat: add APSFreeWiFi profile for public cafe networks 2025-09-17 17:05:17 +02:00
fa5b134600 fix: improve abra install retry logic and remove restart loop 2025-09-17 16:57:55 +02:00
20a7f030ef fix: remove internet wait loop, retry abra install 300 times 2025-09-17 16:49:03 +02:00
70551d1e75 fix: remove network-online dependency from abra installation service 2025-09-17 16:07:24 +02:00
d0f9117515 docs: improve slides reference with descriptive sentence 2025-09-17 11:16:14 +02:00
b8fb20b4e4 docs: add reference to workshop slides 2025-09-17 11:05:54 +02:00
cf60dbcfb8 docs: add documentation section and update recipes file location 2025-09-17 10:51:01 +02:00
4 changed files with 86 additions and 81 deletions

View File

@@ -2,6 +2,8 @@
Part of the Science in the City Festival - Single-participant learning environments for hands-on Co-op Cloud deployment practice. Part of the Science in the City Festival - Single-participant learning environments for hands-on Co-op Cloud deployment practice.
See the [workshop slides](https://git.dailysh.it/nextlevelshit/malta-slides) for detailed presentation and materials.
## 🚀 Quick Start ## 🚀 Quick Start
```bash ```bash
@@ -44,7 +46,7 @@ browser wordpress # Open directly in Firefox
## 💾 USB Environment ## 💾 USB Environment
Pre-configured with: Pre-configured with:
- **Automatic WiFi connection** to workshop network - **Automatic WiFi connection** to workshop network (CODE_CRISPIES) or public cafe WiFi (APSFreeWiFi)
- Docker Swarm + abra installation - Docker Swarm + abra installation
- SSH client for cloud access - SSH client for cloud access
- Wildcard DNS resolution (dnsmasq) - Wildcard DNS resolution (dnsmasq)
@@ -83,6 +85,8 @@ The VM simulates the USB experience with identical configuration and commands.
## 📚 Complete Recipe Catalog ## 📚 Complete Recipe Catalog
For the complete list of all recipes, see [RECIPES.md](docs/RECIPES.md)
Based on Co-op Cloud with quality scoring: Based on Co-op Cloud with quality scoring:
### ⭐ Tier 1 - Production Ready (Score 5) ### ⭐ Tier 1 - Production Ready (Score 5)
@@ -154,6 +158,11 @@ browser <TAB> # Shows deployed applications
- USB drive (8GB+) for workshop distribution - USB drive (8GB+) for workshop distribution
- SSH key at `~/.ssh/id_ed25519.pub` (for cloud deployment only) - SSH key at `~/.ssh/id_ed25519.pub` (for cloud deployment only)
## 📖 Documentation
- [Manual Network Setup](docs/MANUAL_NETWORK_SETUP.md)
- [USB Boot Instructions](docs/USB_BOOT_INSTRUCTIONS.md)
## 🛠️ Development Tools ## 🛠️ Development Tools
```bash ```bash

View File

@@ -246,27 +246,47 @@ isoConfig
dns = "none"; # We use dnsmasq dns = "none"; # We use dnsmasq
ensureProfiles = { ensureProfiles = {
profiles = { profiles = {
"CODE_CRISPIES" = { "CODE_CRISPIES" = {
connection = { connection = {
id = "CODE_CRISPIES"; id = "CODE_CRISPIES";
type = "wifi"; type = "wifi";
autoconnect = true; autoconnect = true;
}; };
wifi = { wifi = {
mode = "infrastructure"; mode = "infrastructure";
ssid = "CODE_CRISPIES"; ssid = "CODE_CRISPIES";
}; };
wifi-security = { wifi-security = {
key-mgmt = "wpa-psk"; key-mgmt = "wpa-psk";
psk = "scienceinthecity2025"; psk = "scienceinthecity2025";
}; };
ipv4 = { ipv4 = {
method = "auto"; method = "auto";
}; };
ipv6 = { ipv6 = {
method = "auto"; method = "auto";
}; };
}; };
"APSFreeWiFi" = {
connection = {
id = "APSFreeWiFi";
type = "wifi";
autoconnect = true;
};
wifi = {
mode = "infrastructure";
ssid = "APSFreeWiFi";
};
wifi-security = {
key-mgmt = "none";
};
ipv4 = {
method = "auto";
};
ipv6 = {
method = "auto";
};
};
}; };
}; };
}; };
@@ -493,8 +513,7 @@ isoConfig
systemd.services.workshop-abra-install = { systemd.services.workshop-abra-install = {
description = "Install abra CLI system-wide with retry logic and proper verification"; description = "Install abra CLI system-wide with retry logic and proper verification";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ]; after = [ "workshop-system-setup.service" ];
wants = [ "network-online.target" ];
path = with pkgs; [ path = with pkgs; [
bash bash
wget wget
@@ -509,69 +528,44 @@ isoConfig
]; ];
script = '' script = ''
# Enhanced installation with proper verification # Plain abra installation
export TERM=xterm-256color export TERM=xterm-256color
export HOME=/root export HOME=/root
# Check if abra is already properly installed (CORRECTED VERIFICATION) # Check if abra is already properly installed
if sudo abra --version >/dev/null 2>&1; then if sudo abra --version >/dev/null 2>&1; then
echo " abra already installed and functional" echo " abra already installed and functional"
exit 0 exit 0
fi fi
# Wait for actual internet connectivity echo "🚀 Installing abra system-wide..."
echo "🌐 Waiting for internet connectivity..."
for i in {1..30}; do
if curl -s --max-time 5 https://abra.coopcloud.tech >/dev/null 2>&1; then
echo " Internet connectivity confirmed"
break
fi
if [ $i -eq 30 ]; then
echo " No internet connectivity after 60 seconds"
exit 1
fi
sleep 2
done
# Attempt installation with retry logic # Plain installation
for attempt in {1..3}; do curl -fsSL https://install.abra.coopcloud.tech | bash
echo "🚀 Installing abra (attempt $attempt/3)..."
if curl -fsSL https://install.abra.coopcloud.tech | bash; then # Verify installation
# Verify installation success using CORRECT check method if sudo abra --version >/dev/null 2>&1; then
if sudo abra --version >/dev/null 2>&1; then echo " abra installed successfully"
echo " abra installed successfully"
# Add to bashrc only once # Add to bashrc only once
if ! grep -q "/root/.local/bin" /root/.bashrc 2>/dev/null; then if ! grep -q "/root/.local/bin" /root/.bashrc 2>/dev/null; then
echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.bashrc echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.bashrc
echo " Added /root/.local/bin to PATH in /root/.bashrc" echo " Added /root/.local/bin to PATH in /root/.bashrc"
fi
exit 0
else
echo " Installation script completed but abra not functional"
fi
else
echo " Installation attempt $attempt failed"
fi fi
if [ $attempt -lt 3 ]; then exit 0
echo " Retrying in 10 seconds..." else
sleep 10 echo " abra installation failed"
fi exit 1
done fi
echo " abra installation failed after 3 attempts"
exit 1
''; '';
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
RemainAfterExit = true; RemainAfterExit = true;
User = "root";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = "30s"; RestartSec = "30s";
User = "root";
Environment = [ Environment = [
"TERM=xterm-256color" "TERM=xterm-256color"
"HOME=/root" "HOME=/root"
@@ -1208,7 +1202,7 @@ isoConfig
install() { install() {
echo "🔄 Checking and repairing abra installation..." echo "🔄 Checking and repairing abra installation..."
# Use the CORRECT check method (matches service verification) # Check if abra is already installed
if sudo abra --version >/dev/null 2>&1; then if sudo abra --version >/dev/null 2>&1; then
echo " abra is already installed and functional" echo " abra is already installed and functional"
return 0 return 0
@@ -1217,18 +1211,17 @@ isoConfig
echo "🔄 Restarting abra installation service..." echo "🔄 Restarting abra installation service..."
sudo systemctl restart workshop-abra-install sudo systemctl restart workshop-abra-install
# Monitor installation progress # Wait for service to complete
echo "📊 Monitoring installation..." sleep 5
for i in {1..30}; do
if sudo abra --version >/dev/null 2>&1; then
echo " abra installation completed successfully!"
return 0
fi
sleep 2
done
echo " Installation still not complete. Check status:" # Check if installation succeeded
echo " sudo systemctl status workshop-abra-install" if sudo abra --version >/dev/null 2>&1; then
echo " abra installation completed successfully!"
return 0
else
echo " Installation failed. Try running 'install' again or check status:"
echo " sudo systemctl status workshop-abra-install"
fi
} }
recipes() { recipes() {

View File

@@ -91,6 +91,7 @@
| mailman3 | 3 | The GNU Mailing List Management System | [https://recipes.coopcloud.tech/mailman3](https://recipes.coopcloud.tech/mailman3) | | mailman3 | 3 | The GNU Mailing List Management System | [https://recipes.coopcloud.tech/mailman3](https://recipes.coopcloud.tech/mailman3) |
| mailu | 3 | A simple yet full-featured mail server | [https://recipes.coopcloud.tech/mailu](https://recipes.coopcloud.tech/mailu) | | mailu | 3 | A simple yet full-featured mail server | [https://recipes.coopcloud.tech/mailu](https://recipes.coopcloud.tech/mailu) |
| mastodon | 3 | A free, open-source social network server | [https://recipes.coopcloud.tech/mastodon](https://recipes.coopcloud.tech/mastodon) | | mastodon | 3 | A free, open-source social network server | [https://recipes.coopcloud.tech/mastodon](https://recipes.coopcloud.tech/mastodon) |
| matrix-synapse | 3 | A Matrix homeserver written in Python | [https://recipes.coopcloud.tech/matrix-synapse](https://recipes.coopcloud.tech/matrix-synapse) |
| matomo | 3 | A Google Analytics alternative that protects your data and your customers' privacy | [https://recipes.coopcloud.tech/matomo](https://recipes.coopcloud.tech/matomo) | | matomo | 3 | A Google Analytics alternative that protects your data and your customers' privacy | [https://recipes.coopcloud.tech/matomo](https://recipes.coopcloud.tech/matomo) |
| mattermost | 3 | Secure collaboration platform | [https://recipes.coopcloud.tech/mattermost](https://recipes.coopcloud.tech/mattermost) | | mattermost | 3 | Secure collaboration platform | [https://recipes.coopcloud.tech/mattermost](https://recipes.coopcloud.tech/mattermost) |
| mattermost-lts | 3 | Long-term support for Mattermost | [https://recipes.coopcloud.tech/mattermost-lts](https://recipes.coopcloud.tech/mattermost-lts) | | mattermost-lts | 3 | Long-term support for Mattermost | [https://recipes.coopcloud.tech/mattermost-lts](https://recipes.coopcloud.tech/mattermost-lts) |
@@ -115,6 +116,7 @@
| nextcloud | 5 | A safe home for all your data | [https://recipes.coopcloud.tech/nextcloud](https://recipes.coopcloud.tech/nextcloud) | | nextcloud | 5 | A safe home for all your data | [https://recipes.coopcloud.tech/nextcloud](https://recipes.coopcloud.tech/nextcloud) |
| nitter | 3 | An alternative Twitter front-end | [https://recipes.coopcloud.tech/nitter](https://recipes.coopcloud.tech/nitter) | | nitter | 3 | An alternative Twitter front-end | [https://recipes.coopcloud.tech/nitter](https://recipes.coopcloud.tech/nitter) |
| nocodb | 3 | An open source Airtable alternative | [https://recipes.coopcloud.tech/nocodb](https://recipes.coopcloud.tech/nocodb) | | nocodb | 3 | An open source Airtable alternative | [https://recipes.coopcloud.tech/nocodb](https://recipes.coopcloud.tech/nocodb) |
| node-red | 3 | Low-code programming for event-driven applications | [https://recipes.coopcloud.tech/node-red](https://recipes.coopcloud.tech/node-red) |
| notea | 3 | A self-hosted note-taking app | [https://recipes.coopcloud.tech/notea](https://recipes.coopcloud.tech/notea) | | notea | 3 | A self-hosted note-taking app | [https://recipes.coopcloud.tech/notea](https://recipes.coopcloud.tech/notea) |
| ntfy | 3 | A simple HTTP-based pub-sub notification service | [https://recipes.coopcloud.tech/ntfy](https://recipes.coopcloud.tech/ntfy) | | ntfy | 3 | A simple HTTP-based pub-sub notification service | [https://recipes.coopcloud.tech/ntfy](https://recipes.coopcloud.tech/ntfy) |
| oasis | 3 | A tool for building and managing online communities | [https://recipes.coopcloud.tech/oasis](https://recipes.coopcloud.tech/oasis) | | oasis | 3 | A tool for building and managing online communities | [https://recipes.coopcloud.tech/oasis](https://recipes.coopcloud.tech/oasis) |

View File

@@ -71,7 +71,7 @@
## Getting Started Commands ## Getting Started Commands
```bash ```bash
# WiFi connects automatically - no manual setup needed! # WiFi connects automatically to CODE_CRISPIES or APSFreeWiFi - no manual setup needed!
# Set up your local environment # Set up your local environment
setup setup
@@ -120,7 +120,8 @@ Name: Android, Password: (ask facilitator)
→ Note: Terminal no longer auto-starts to prevent boot hangs → Note: Terminal no longer auto-starts to prevent boot hangs
**Can't connect to internet** **Can't connect to internet**
→ WiFi should connect automatically to "CODE_CRISPIES" → WiFi should connect automatically to "CODE_CRISPIES" or "APSFreeWiFi"
→ If connecting to APSFreeWiFi, complete browser login when prompted
→ If not, use mobile hotspot as backup → If not, use mobile hotspot as backup
→ Check: nmcli connection show --active → Check: nmcli connection show --active