Compare commits

...
20 Commits
Author SHA1 Message Date
libretech 684f6b1a54 feat: add restart policy for abra install service 2025-09-17 17:35:58 +02:00
libretech b3ec5886e3 reverted last changes 2025-09-17 17:32:34 +02:00
libretech 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
libretech 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
libretech 5477f97f5d feat: add APSFreeWiFi profile for public cafe networks 2025-09-17 17:05:17 +02:00
libretech fa5b134600 fix: improve abra install retry logic and remove restart loop 2025-09-17 16:57:55 +02:00
libretech 20a7f030ef fix: remove internet wait loop, retry abra install 300 times 2025-09-17 16:49:03 +02:00
libretech 70551d1e75 fix: remove network-online dependency from abra installation service 2025-09-17 16:07:24 +02:00
libretech d0f9117515 docs: improve slides reference with descriptive sentence 2025-09-17 11:16:14 +02:00
libretech b8fb20b4e4 docs: add reference to workshop slides 2025-09-17 11:05:54 +02:00
libretech cf60dbcfb8 docs: add documentation section and update recipes file location 2025-09-17 10:51:01 +02:00
libretech 112b896e61 feat: enhance abra installation with proper verification and user commands
- Replace incorrect file-based abra verification with functional testing
- Add network connectivity monitoring to abra installer service
- Implement retry logic with proper error handling
- Add user-friendly 'install' command for manual abra repair
- Update documentation to include install command and troubleshooting
- Fix false positive detection in abra installation verification

The enhanced service now:
- Uses 'sudo abra --version' for reliable verification
- Waits for internet connectivity before attempting installation
- Retries up to 3 times with proper backoff
- Provides clear success/failure reporting
- Includes automatic service restart on failure

User can now run 'install' command as fallback when abra installation fails.
2025-09-17 09:20:17 +02:00
libretech 4dacf94c67 refactor: replace WiFi service with declarative NetworkManager
- Remove unnecessary systemd.services.workshop-wifi-setup service
- Remove environment.etc."NetworkManager/workshop-wifi.env" file
- Add declarative networking.networkmanager.ensureProfiles configuration
- Remove redundant WiFi packages (wpa_supplicant, wirelesstools, iw)
- Update documentation to reflect automatic WiFi connection
- Clean up bash script references to old services

This simplifies the configuration and makes WiFi connection automatic on boot.
2025-09-17 08:57:19 +02:00
libretech 4cf1a3a715 remove: disable chromium completely and delete firefox default browser service 2025-09-16 22:29:48 +02:00
libretech 7f4a87b194 fix: remove undefined serverList variable from bash completion 2025-09-16 19:09:21 +02:00
libretech d4f9e9c37d docs: update readme title and description 2025-09-16 19:04:03 +02:00
libretech eaf7667728 refactor: clean up workshop for Science in the City event
- Update workshop name from 'CODE CRISPIES' to 'SCIENCE IN THE CITY'
- Remove all Hetzner cloud deployment references and commands
- Focus documentation on local USB/VM workshop environment
- Remove cloud server connection functionality
- Update WiFi credentials for workshop network
- Clean up AGENTS.md to reflect local-only development workflow
- Remove misleading cloud infrastructure references
- Update help commands and learning flow for local practice only

This commit prepares the workshop materials for the Science in the City event,
focusing exclusively on local Co-op Cloud deployment practice without cloud
infrastructure dependencies.
2025-09-16 19:02:03 +02:00
libretech c996924055 fix: update workshop WiFi credentials to match documentation
- Update SSID from 'ziegel' to 'CODE_CRISPIES'
- Update password to 'scienceinthecity2025'
- Update connection check in WiFi setup service
- Sync with USB_BOOT_INSTRUCTIONS.md documentation
2025-09-16 18:58:14 +02:00
libretech fe21611678 fix: restore workshop WiFi connection setup service
- Add back the missing workshop-wifi-setup systemd service
- Service creates and connects to 'ziegel' WiFi network automatically
- Fixes missing WiFi connection that was present in main branch
- Provides fallback hotspot connectivity for workshop environment
2025-09-16 18:56:01 +02:00
libretech 4087350bdb feat: increase memory of qemu usb test 2025-09-16 18:53:41 +02:00
8 changed files with 271 additions and 220 deletions

No files matched your search

+13 -13
View File
@@ -6,8 +6,8 @@ This file provides guidelines for AI coding agents operating within this reposit
- **Build**: `make usb-build` (Builds the NixOS workshop ISO) - **Build**: `make usb-build` (Builds the NixOS workshop ISO)
- **Local VM**: `make vm` (Starts local VM that simulates USB environment) - **Local VM**: `make vm` (Starts local VM that simulates USB environment)
- **Test**: `make status-cloud` (Health checks for cloud infrastructure) - **Test**: `make usb-test` (Test USB environment in QEMU)
- **Deploy**: `make deploy-cloud` (Deploys 15 VMs to Hetzner Cloud) - **Deploy**: `make usb-build` (Build workshop USB ISO)
- **Format**: `make format` (Format Nix files) - **Format**: `make format` (Format Nix files)
## Code Style Guidelines ## Code Style Guidelines
@@ -27,32 +27,32 @@ This file provides guidelines for AI coding agents operating within this reposit
## Container Architecture ## Container Architecture
- **Local VM**: Provides infrastructure to deploy up to 15 containers on demand (matching production count) - **Local VM**: Provides self-contained workshop environment
- **Container Names**: hopper, curie, lovelace, noether, hamilton, franklin, johnson, clarke, goldberg, liskov, wing, rosen, shaw, karp, rich - **Container Names**: workshop-local (single container environment)
- **Networking**: Private networking with NAT for local development - **Networking**: Local networking with DNS resolution
- **DNS**: Local `.local` domain resolution for testing - **DNS**: `*.workshop.local` domain resolution for testing
## Available Scripts ## Available Scripts
- `connect <name>` - SSH into specific container - `setup` - Initialize local workshop environment
- `containers` - List all containers with IPs - `deploy <recipe>` - Deploy Co-op Cloud applications
- `logs` - Show container setup logs - `browser [app]` - Open applications in Firefox
- `recipes` - Display available Co-op Cloud recipes - `recipes` - Display available Co-op Cloud recipes
- `help` - Show command help - `help` - Show command help
## Development Workflow ## Development Workflow
1. Use `make vm-run` for local development 1. Use `make vm` for local development testing
2. Test with all 15 containers to match production 2. Test workshop environment with `make usb-test`
3. Use `make usb-build` for workshop USB drives (outputs to ./build/iso/) 3. Use `make usb-build` for workshop USB drives (outputs to ./build/iso/)
4. Deploy to cloud with `make deploy-cloud` 4. Focus on local deployment and learning
## General Guidelines ## General Guidelines
- Keep code concise and readable - Keep code concise and readable
- Prefer declarative over imperative approaches - Prefer declarative over imperative approaches
- Document complex logic with comments - Document complex logic with comments
- Test locally before cloud deployment - Test locally in VM before USB deployment
- Maintain feature parity between USB/VM environments where possible - Maintain feature parity between USB/VM environments where possible
- **ALWAYS check package existence on search.nixos.org before adding new packages** - **ALWAYS check package existence on search.nixos.org before adding new packages**
+1 -1
View File
@@ -65,7 +65,7 @@ usb-test: usb-build
@echo "🧪 Testing USB environment in QEMU..." @echo "🧪 Testing USB environment in QEMU..."
nix develop --command qemu-system-x86_64 \ nix develop --command qemu-system-x86_64 \
-cdrom $(ISO_FILE) \ -cdrom $(ISO_FILE) \
-m 2048 \ -m 4096 \
-enable-kvm \ -enable-kvm \
-netdev user,id=net0 \ -netdev user,id=net0 \
-device virtio-net,netdev=net0 \ -device virtio-net,netdev=net0 \
+41 -23
View File
@@ -1,6 +1,8 @@
# 🚀 DIGITAL INDEPENDENCE DAY Workshop Infrastructure # 🚀 Digital Independence Day Workshop
Single-participant learning environments with local practice and cloud deployment capabilities. 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
@@ -12,9 +14,8 @@ make vm
make usb-build make usb-build
make usb-flash USB_DEVICE=/dev/sdX make usb-flash USB_DEVICE=/dev/sdX
# 3. Deploy cloud infrastructure # 3. Test your USB build
export HCLOUD_TOKEN="your_token" make usb-test
make deploy-cloud
``` ```
## 🎯 Learning Flow ## 🎯 Learning Flow
@@ -27,12 +28,10 @@ deploy wordpress # Deploy locally
browser wordpress # Open directly in Firefox browser wordpress # Open directly in Firefox
``` ```
### Cloud Deployment ### Local Practice Only
```bash ```bash
connect hopper # SSH to cloud server # Focus on local development and testing
# Same abra commands work here # All deployment happens locally on your USB/VM
abra app new wordpress -S --domain=blog.hopper.codecrispi.es
abra app deploy blog.hopper.codecrispi.es
``` ```
## 🗃️ Architecture ## 🗃️ Architecture
@@ -41,17 +40,18 @@ abra app deploy blog.hopper.codecrispi.es
- **USB Boot**: Bootable NixOS with Docker + abra for hands-on learning - **USB Boot**: Bootable NixOS with Docker + abra for hands-on learning
- **Local VM**: Identical environment for development/testing - **Local VM**: Identical environment for development/testing
- **Cloud Servers**: 15 production servers (hopper, curie, lovelace, etc.) - **Local Environment**: Self-contained workshop environment
- **Wildcard DNS**: `*.workshop.local` resolves to `127.0.0.1` via dnsmasq - **Wildcard DNS**: `*.workshop.local` resolves to `127.0.0.1` via dnsmasq
## 💾 USB Environment ## 💾 USB Environment
Pre-configured with: Pre-configured with:
- **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)
- Terminal-first interface (`desktop` command for GUI) - Terminal-first interface (`desktop` command for GUI)
- Helper commands: `recipes`, `deploy`, `connect`, `browser`, `help` - Helper commands: `recipes`, `deploy`, `browser`, `help`
- Tab completion for all commands - Tab completion for all commands
Build and flash: Build and flash:
@@ -60,14 +60,13 @@ make usb-build
make usb-flash USB_DEVICE=/dev/sdb make usb-flash USB_DEVICE=/dev/sdb
``` ```
## 🌐 Cloud Deployment ## 🧪 Testing & Validation
Creates 15 Hetzner VMs at `{name}.codecrispi.es`: Test your workshop environment:
```bash ```bash
export HCLOUD_TOKEN="your_token" make usb-test # Test ISO in QEMU
make deploy-cloud make status-local # Check local services
make status-cloud # Check health
``` ```
## 🖥️ Local Development ## 🖥️ Local Development
@@ -86,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)
@@ -131,7 +132,8 @@ Based on Co-op Cloud with quality scoring:
- `recipes` - Show complete Co-op Cloud catalog - `recipes` - Show complete Co-op Cloud catalog
- `deploy <app>` - Deploy locally with tab completion - `deploy <app>` - Deploy locally with tab completion
- `browser [app]` - Launch Firefox [to specific app] - `browser [app]` - Launch Firefox [to specific app]
- `connect <server>` - SSH to cloud server with tab completion - `install` - Repair abra installation if needed
- `desktop` - Start GUI session - `desktop` - Start GUI session
- `help` - Show all commands and debug info - `help` - Show all commands and debug info
@@ -146,15 +148,20 @@ browser # Opens Firefox with blank page
# Use tab completion # Use tab completion
deploy <TAB> # Shows all available recipes deploy <TAB> # Shows all available recipes
connect <TAB> # Shows all available servers browser <TAB> # Shows deployed applications
``` ```
## 🔧 Prerequisites ## 🔧 Prerequisites
- Nix with flakes enabled - Nix with flakes enabled
- SSH key at `~/.ssh/id_ed25519.pub`
- HCLOUD_TOKEN for cloud deployment
- 2GB+ RAM for VM testing - 2GB+ RAM for VM testing
- USB drive (8GB+) for workshop distribution
- 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
@@ -170,16 +177,27 @@ make opencode # Start opencode in dev shell
```bash ```bash
make clean # Clean build artifacts (./build/ and ./result/) make clean # Clean build artifacts (./build/ and ./result/)
make destroy-cloud # Cloud infrastructure
``` ```
## 🔍 Troubleshooting ## 🔍 Troubleshooting
```bash ```bash
# Check WiFi connection (should connect automatically)
nmcli connection show --active
# Check abra installation
sudo abra --version
# Repair abra installation
install
# Check abra service status
sudo systemctl status workshop-abra-install
# Check DNS resolution # Check DNS resolution
dig @127.0.0.1 test.workshop.local dig @127.0.0.1 test.workshop.local
# Check running services # Check running services
docker service ls docker service ls
# Check DNS service # Check DNS service
+168 -141
View File
@@ -1,9 +1,7 @@
{ {
pkgs, pkgs,
lib ? pkgs.lib, lib ? pkgs.lib,
cloudServerNames,
isLiveIso ? false, isLiveIso ? false,
...
}: }:
let let
@@ -246,6 +244,51 @@ isoConfig
enable = true; enable = true;
wifi.backend = "wpa_supplicant"; # Standard backend for live ISOs wifi.backend = "wpa_supplicant"; # Standard backend for live ISOs
dns = "none"; # We use dnsmasq dns = "none"; # We use dnsmasq
ensureProfiles = {
profiles = {
"CODE_CRISPIES" = {
connection = {
id = "CODE_CRISPIES";
type = "wifi";
autoconnect = true;
};
wifi = {
mode = "infrastructure";
ssid = "CODE_CRISPIES";
};
wifi-security = {
key-mgmt = "wpa-psk";
psk = "scienceinthecity2025";
};
ipv4 = {
method = "auto";
};
ipv6 = {
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";
};
};
};
};
}; };
hostName = if isLiveIso then "workshop-live" else "workshop-vm"; hostName = if isLiveIso then "workshop-live" else "workshop-vm";
hosts."127.0.0.1" = [ hosts."127.0.0.1" = [
@@ -256,15 +299,6 @@ isoConfig
firewall.enable = false; # Workshop environment firewall.enable = false; # Workshop environment
}; };
# WiFi credentials file
environment.etc."NetworkManager/workshop-wifi.env" = {
text = ''
WORKSHOP_SSID="ziegel"
WORKSHOP_PSK="1234567890"
'';
mode = "0600";
};
# DNS Configuration - Wildcard *.workshop.local -> 127.0.0.1 # DNS Configuration - Wildcard *.workshop.local -> 127.0.0.1
services.dnsmasq = { services.dnsmasq = {
enable = true; enable = true;
@@ -338,26 +372,26 @@ isoConfig
chown workshop:workshop $AUTH_KEYS_FILE chown workshop:workshop $AUTH_KEYS_FILE
chmod 600 $AUTH_KEYS_FILE chmod 600 $AUTH_KEYS_FILE
''; '';
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
User = "root"; User = "root";
RemainAfterExit = true; RemainAfterExit = true;
}; };
}; };
# Build timestamp service # Build timestamp service
systemd.services.workshop-build-info = { systemd.services.workshop-build-info = {
description = "Write build timestamp to /etc/workshop-build-info"; description = "Write build timestamp to /etc/workshop-build-info";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
script = '' script = ''
echo "$(date '+%Y-%m-%d %H:%M:%S')" > /etc/workshop-build-info echo "$(date '+%Y-%m-%d %H:%M:%S')" > /etc/workshop-build-info
''; '';
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
User = "root"; User = "root";
RemainAfterExit = true; RemainAfterExit = true;
}; };
}; };
services.getty.autologinUser = "workshop"; services.getty.autologinUser = "workshop";
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
@@ -370,9 +404,6 @@ isoConfig
networkmanager networkmanager
networkmanagerapplet # Network Manager GUI for GNOME networkmanagerapplet # Network Manager GUI for GNOME
gnome-control-center # GNOME Settings (includes network panel) gnome-control-center # GNOME Settings (includes network panel)
wpa_supplicant # Standard WiFi supplicant
wirelesstools # Standard WiFi tools
iw # Modern WiFi tools
docker docker
docker-compose docker-compose
gnome-terminal gnome-terminal
@@ -386,7 +417,7 @@ isoConfig
gnutar gnutar
openssl # Add this for certificate generation openssl # Add this for certificate generation
# Additional font packages for QEMU # Additional font packages for QEMU
chromium # Add Chromium browser #chromium # Add Chromium browser
firefox firefox
dejavu_fonts dejavu_fonts
liberation_ttf liberation_ttf
@@ -478,12 +509,11 @@ isoConfig
}; };
}; };
# Abra Installation Service (System-wide) # Abra Installation Service (System-wide) with Enhanced Verification
systemd.services.workshop-abra-install = { systemd.services.workshop-abra-install = {
description = "Install abra CLI system-wide"; description = "Install abra CLI system-wide with retry logic and proper verification";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "workshop-system-setup.service" ]; after = [ "workshop-system-setup.service" ];
wants = [ "workshop-system-setup.service" ];
path = with pkgs; [ path = with pkgs; [
bash bash
wget wget
@@ -498,37 +528,43 @@ isoConfig
]; ];
script = '' script = ''
# Set proper environment # Plain abra installation
export TERM=xterm-256color export TERM=xterm-256color
export HOME=/root export HOME=/root
# Check if abra is already installed # Check if abra is already properly installed
if [ -x "/root/.local/bin/abra" ]; then if sudo abra --version >/dev/null 2>&1; then
echo "✅ abra already installed" echo "✅ abra already installed and functional"
/root/.local/bin/abra --version
exit 0 exit 0
fi fi
echo "🚀 Installing abra system-wide..." echo "🚀 Installing abra system-wide..."
# Install to /usr/local/bin (default behavior) # Plain installation
curl -fsSL https://install.abra.coopcloud.tech | bash curl -fsSL https://install.abra.coopcloud.tech | bash
# Add to bashrc only once # Verify installation
if ! grep -q "/root/.local/bin" /root/.bashrc 2>/dev/null; then if sudo abra --version >/dev/null 2>&1; then
echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.bashrc echo "✅ abra installed successfully"
echo "✅ Added /root/.local/bin to PATH in /root/.bashrc"
fi
# Verify # Add to bashrc only once
if [ -x "/root/.local/bin/abra" ]; then if ! grep -q "/root/.local/bin" /root/.bashrc 2>/dev/null; then
echo "✅ abra installed to /root/.local/bin/abra" echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.bashrc
echo "✅ Added /root/.local/bin to PATH in /root/.bashrc"
fi
exit 0
else
echo "❌ abra installation failed"
exit 1
fi fi
''; '';
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
RemainAfterExit = true; RemainAfterExit = true;
Restart = "on-failure";
RestartSec = "30s";
User = "root"; User = "root";
Environment = [ Environment = [
"TERM=xterm-256color" "TERM=xterm-256color"
@@ -537,40 +573,14 @@ isoConfig
}; };
}; };
# Set Firefox as default browser
systemd.services.workshop-set-default-browser = {
description = "Set Firefox as the default browser for workshop user";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
path = with pkgs; [
xdg-utils
coreutils
su
];
script = ''
# Set Firefox as default browser for workshop user
su - workshop -c "xdg-settings set default-web-browser firefox.desktop"
# Also set MIME types for HTML files
su - workshop -c "xdg-mime default firefox.desktop text/html"
su - workshop -c "xdg-mime default firefox.desktop x-scheme-handler/http"
su - workshop -c "xdg-mime default firefox.desktop x-scheme-handler/https"
'';
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
User = "root";
};
};
# Enhanced Bash Configuration with All Features # Enhanced Bash Configuration with All Features
programs.bash.interactiveShellInit = programs.bash.interactiveShellInit =
let let
recipeList = builtins.concatStringsSep " " allRecipes; recipeList = builtins.concatStringsSep " " allRecipes;
serverList = builtins.concatStringsSep " " cloudServerNames;
in in
'' ''
# Workshop Environment Welcome # Workshop Environment Welcome
echo "🚀 CODE CRISPIES Workshop Environment" echo "🚀 SCIENCE IN THE CITY Workshop Environment"
echo "Mode: Local Development (Offline Co-op Cloud)" echo "Mode: Local Development (Offline Co-op Cloud)"
echo "" echo ""
@@ -599,14 +609,14 @@ isoConfig
export PATH="$PATH:/root/.local/bin" export PATH="$PATH:/root/.local/bin"
fi fi
# Check abra installation # Check abra installation
if sudo abra >/dev/null 2>&1; then if sudo abra >/dev/null 2>&1; then
echo "✅ abra ready: $(sudo which abra)" echo "✅ abra ready: $(sudo which abra)"
source <(sudo abra autocomplete bash) 2>/dev/null || true source <(sudo abra autocomplete bash) 2>/dev/null || true
echo "✅ abra autocomplete enabled" echo "✅ abra autocomplete enabled"
else else
echo "⚠️ abra not found! Check: systemctl status workshop-abra-install" echo "⚠️ abra not found! Install with: curl -fsSL https://install.abra.coopcloud.tech | bash"
fi fi
# Build info # Build info
echo "✅ Workshop ISO - NixOS $(nixos-version) - Built: $(cat /etc/workshop-build-info 2>/dev/null || echo 'unknown')" echo "✅ Workshop ISO - NixOS $(nixos-version) - Built: $(cat /etc/workshop-build-info 2>/dev/null || echo 'unknown')"
@@ -623,13 +633,9 @@ isoConfig
COMPREPLY=($(compgen -W "${recipeList}" -- "$cur")) COMPREPLY=($(compgen -W "${recipeList}" -- "$cur"))
return 0 return 0
;; ;;
connect)
COMPREPLY=($(compgen -W "${serverList}" -- "$cur"))
return 0
;;
esac esac
} }
complete -F _workshop_completion deploy browser connect abra complete -F _workshop_completion deploy browser abra
# Core Workshop Functions # Core Workshop Functions
setup() { setup() {
@@ -674,14 +680,14 @@ isoConfig
echo " Current groups: $(id -nG)" echo " Current groups: $(id -nG)"
fi fi
# Check if abra is available via sudo # Check if abra is available via sudo
if sudo abra --version >/dev/null 2>&1; then if sudo abra --version >/dev/null 2>&1; then
echo "✅ abra available via sudo: $(sudo which abra)" echo "✅ abra available via sudo: $(sudo which abra)"
else else
echo "❌ abra not available via sudo" echo "❌ abra not available via sudo"
echo " Check: systemctl status workshop-abra-install" echo " Check: which abra && abra --version"
return 1 return 1
fi fi
# Check abra server configuration # Check abra server configuration
if sudo abra server ls 2>/dev/null | grep -q "default"; then if sudo abra server ls 2>/dev/null | grep -q "default"; then
@@ -1170,13 +1176,9 @@ isoConfig
} }
connect() { connect() {
if [[ -z "$1" ]]; then echo "🔌 SSH connection helper (workshop environment)"
echo "Usage: connect <name>" echo "Usage: ssh -o StrictHostKeyChecking=no user@host"
echo "Available: ${serverList}" echo "Note: This workshop focuses on local development only"
return 1
fi
echo "🔌 Connecting to $1.codecrispi.es..."
ssh -o StrictHostKeyChecking=no workshop@$1.codecrispi.es
} }
browser() { browser() {
@@ -1195,9 +1197,34 @@ isoConfig
echo "❌ No GUI session. Run 'desktop' first" echo "❌ No GUI session. Run 'desktop' first"
echo "🌐 Target was: $target_url" echo "🌐 Target was: $target_url"
fi fi
} }
recipes() { install() {
echo "🔄 Checking and repairing abra installation..."
# Check if abra is already installed
if sudo abra --version >/dev/null 2>&1; then
echo "✅ abra is already installed and functional"
return 0
fi
echo "🔄 Restarting abra installation service..."
sudo systemctl restart workshop-abra-install
# Wait for service to complete
sleep 5
# Check if installation succeeded
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() {
echo "📚 Complete Co-op Cloud Recipe Catalog:" echo "📚 Complete Co-op Cloud Recipe Catalog:"
echo "" echo ""
echo "⭐ Tier 1 - Production Ready: gitea mealie nextcloud" echo "⭐ Tier 1 - Production Ready: gitea mealie nextcloud"
@@ -1258,35 +1285,35 @@ isoConfig
echo " 4. Use 'browser <app>' to access deployed services" echo " 4. Use 'browser <app>' to access deployed services"
} }
help() { help() {
echo "🚀 CODE CRISPIES Workshop Commands:" echo "🚀 SCIENCE IN THE CITY Workshop Commands:"
echo "" echo ""
echo "🏠 Local Development:" echo "🏠 Local Development:"
echo " setup - Setup local proxy (REQUIRED FIRST!)" echo " setup - Setup local proxy (REQUIRED FIRST!)"
echo " recipes - Show all available apps" echo " recipes - Show all available apps"
echo " deploy <recipe> - Deploy app locally" echo " deploy <recipe> - Deploy app locally"
echo " browser [recipe] - Launch browser [to app]" echo " browser [recipe] - Launch browser [to app]"
echo " desktop - Start GUI session" echo " desktop - Start GUI session"
echo " sudo abra - Run abra CLI directly as root" echo " sudo abra - Run abra CLI directly as root"
echo "" echo ""
echo "🌐 Network:" echo "🌐 Network:"
echo " network_help - Network configuration guide" echo " network_help - Network configuration guide"
echo "" echo ""
echo "☁️ Cloud Access:" echo "🔧 Workshop Tools:"
echo " connect <name> - SSH to cloud server" echo " connect - SSH connection helper"
echo " Available: ${serverList}" echo " help - Show this help message"
echo "" echo ""
echo "🔍 Debug:" echo "🔍 Debug:"
echo " docker service ls - List running services" echo " docker service ls - List running services"
echo " systemctl status dnsmasq - Check DNS" echo " systemctl status dnsmasq - Check DNS"
echo " systemctl status workshop-abra-install - Check abra installation" echo " systemctl status workshop-abra-install - Check abra installation"
echo "" echo ""
echo "📚 Learning Flow:" echo "📚 Learning Flow:"
echo " 1. setup" echo " 1. setup"
echo " 2. deploy wordpress" echo " 2. deploy wordpress"
echo " 3. browser wordpress" echo " 3. browser wordpress"
echo " 4. connect hopper" echo " 4. explore workshop environment"
} }
''; '';
programs.firefox = { programs.firefox = {
@@ -1361,9 +1388,9 @@ isoConfig
# Essential GNOME services for network integration # Essential GNOME services for network integration
services.gnome = { services.gnome = {
glib-networking.enable = true; # Critical for NetworkManager integration glib-networking.enable = true; # Critical for NetworkManager integration
gnome-settings-daemon.enable = true; # Handles GNOME settings gnome-settings-daemon.enable = true; # Handles GNOME settings
gnome-keyring.enable = true; # Optional but good practice gnome-keyring.enable = true; # Optional but good practice
}; };
# Exclude unnecessary GNOME packages # Exclude unnecessary GNOME packages
+29 -15
View File
@@ -79,11 +79,15 @@ echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
## Workshop-Specific Network Setup ## Workshop-Specific Network Setup
### Connect to Workshop WiFi ### Workshop WiFi (Automatic)
The workshop environment automatically connects to the "CODE_CRISPIES" WiFi network using declarative NetworkManager configuration. No manual setup is required.
If you need to connect to a different network:
```bash ```bash
# Connect to workshop hotspot (if available) # Connect to workshop hotspot (if available)
nmcli device wifi connect "ziegel" password "1234567890" nmcli device wifi connect "CODE_CRISPIES" password "scienceinthecity2025"
``` ```
### Configure Local DNS Resolution ### Configure Local DNS Resolution
@@ -101,22 +105,29 @@ nslookup traefik.workshop.local 127.0.0.1
When internet is not available during workshop setup: When internet is not available during workshop setup:
1. **Configure Network Manually** 1. **Network Connects Automatically**
```bash ```bash
# Use one of the methods above to get network connectivity # WiFi connects automatically to "CODE_CRISPIES" on boot
nmcli device wifi connect "YourNetwork" password "YourPassword" # Check connection: nmcli connection show --active
``` ```
2. **Skip Online Dependencies** 2. **Skip Online Dependencies**
```bash ```bash
# The setup script will work offline once network is configured # The setup script will work offline once network is configured
setup setup
``` ```
3. **Manual abra Installation** (if needed) 3. **Manual abra Installation** (if needed)
```bash ```bash
# Download abra binary manually on another machine and transfer via USB # Use the install command (preferred)
# Or use a local package repository install
# Or manually restart the service
sudo systemctl restart workshop-abra-install
# Check installation status
sudo systemctl status workshop-abra-install
sudo abra --version
``` ```
4. **Deploy Local Services** 4. **Deploy Local Services**
@@ -219,11 +230,14 @@ ping 8.8.8.8
# Test DNS # Test DNS
nslookup google.com nslookup google.com
# Test workshop services # Test abra installation
curl http://traefik.workshop.local sudo abra --version
# Test abra connectivity # Test abra connectivity
sudo abra server ls sudo abra server ls
# Test workshop services
curl http://traefik.workshop.local
``` ```
## Getting Help ## Getting Help
+2
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) |
+16 -7
View File
@@ -2,8 +2,7 @@
### Quick Reference Card ### Quick Reference Card
**Your assigned server:** `__________.codecrispi.es` **Workshop WiFi:** `CODE_CRISPIES` / Password: `scienceinthecity2025`
**Workshop WiFi:** `CODE_CRISPIES_GUEST` / Password: `workshop2024`
--- ---
@@ -72,12 +71,16 @@
## Getting Started Commands ## Getting Started Commands
```bash ```bash
# Connect to your assigned server # WiFi connects automatically to CODE_CRISPIES or APSFreeWiFi - no manual setup needed!
connect hopper # Set up your local environment
setup
# See available app recipes # See available app recipes
recipes recipes
# If abra installation failed (rare case)
install
# Get help # Get help
help help
``` ```
@@ -117,5 +120,11 @@ 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**
→ Try different WiFi network → WiFi should connect automatically to "CODE_CRISPIES" or "APSFreeWiFi"
→ Use mobile hotspot as backup → If connecting to APSFreeWiFi, complete browser login when prompted
→ If not, use mobile hotspot as backup
→ Check: nmcli connection show --active
**Abra not working**
→ Run: install
→ Check: sudo systemctl status workshop-abra-install
+1 -20
View File
@@ -19,32 +19,13 @@
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
# Server names for cloud connections
cloudServerNames = [
"hopper"
"curie"
"lovelace"
"noether"
"hamilton"
"franklin"
"johnson"
"clarke"
"goldberg"
"liskov"
"wing"
"rosen"
"shaw"
"karp"
"rich"
];
# Common configuration # Common configuration
commonConfig = commonConfig =
{ {
isLiveIso ? false, isLiveIso ? false,
}: }:
import ./common.nix { import ./common.nix {
inherit pkgs cloudServerNames isLiveIso; inherit pkgs isLiveIso;
}; };
in in
{ {