Compare commits
20
Commits
4dd8ae874a
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
684f6b1a54 | ||
|
|
b3ec5886e3 | ||
|
|
2dd66df5c4 | ||
|
|
f70ba8ae25 | ||
|
|
5477f97f5d | ||
|
|
fa5b134600 | ||
|
|
20a7f030ef | ||
|
|
70551d1e75 | ||
|
|
d0f9117515 | ||
|
|
b8fb20b4e4 | ||
|
|
cf60dbcfb8 | ||
|
|
112b896e61 | ||
|
|
4dacf94c67 | ||
|
|
4cf1a3a715 | ||
|
|
7f4a87b194 | ||
|
|
d4f9e9c37d | ||
|
|
eaf7667728 | ||
|
|
c996924055 | ||
|
|
fe21611678 | ||
|
|
4087350bdb |
No files matched your search
@@ -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)
|
||||
- **Local VM**: `make vm` (Starts local VM that simulates USB environment)
|
||||
- **Test**: `make status-cloud` (Health checks for cloud infrastructure)
|
||||
- **Deploy**: `make deploy-cloud` (Deploys 15 VMs to Hetzner Cloud)
|
||||
- **Test**: `make usb-test` (Test USB environment in QEMU)
|
||||
- **Deploy**: `make usb-build` (Build workshop USB ISO)
|
||||
- **Format**: `make format` (Format Nix files)
|
||||
|
||||
## Code Style Guidelines
|
||||
@@ -27,32 +27,32 @@ This file provides guidelines for AI coding agents operating within this reposit
|
||||
|
||||
## Container Architecture
|
||||
|
||||
- **Local VM**: Provides infrastructure to deploy up to 15 containers on demand (matching production count)
|
||||
- **Container Names**: hopper, curie, lovelace, noether, hamilton, franklin, johnson, clarke, goldberg, liskov, wing, rosen, shaw, karp, rich
|
||||
- **Networking**: Private networking with NAT for local development
|
||||
- **DNS**: Local `.local` domain resolution for testing
|
||||
- **Local VM**: Provides self-contained workshop environment
|
||||
- **Container Names**: workshop-local (single container environment)
|
||||
- **Networking**: Local networking with DNS resolution
|
||||
- **DNS**: `*.workshop.local` domain resolution for testing
|
||||
|
||||
## Available Scripts
|
||||
|
||||
- `connect <name>` - SSH into specific container
|
||||
- `containers` - List all containers with IPs
|
||||
- `logs` - Show container setup logs
|
||||
- `setup` - Initialize local workshop environment
|
||||
- `deploy <recipe>` - Deploy Co-op Cloud applications
|
||||
- `browser [app]` - Open applications in Firefox
|
||||
- `recipes` - Display available Co-op Cloud recipes
|
||||
- `help` - Show command help
|
||||
|
||||
## Development Workflow
|
||||
|
||||
1. Use `make vm-run` for local development
|
||||
2. Test with all 15 containers to match production
|
||||
1. Use `make vm` for local development testing
|
||||
2. Test workshop environment with `make usb-test`
|
||||
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
|
||||
|
||||
- Keep code concise and readable
|
||||
- Prefer declarative over imperative approaches
|
||||
- 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
|
||||
- **ALWAYS check package existence on search.nixos.org before adding new packages**
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ usb-test: usb-build
|
||||
@echo "🧪 Testing USB environment in QEMU..."
|
||||
nix develop --command qemu-system-x86_64 \
|
||||
-cdrom $(ISO_FILE) \
|
||||
-m 2048 \
|
||||
-m 4096 \
|
||||
-enable-kvm \
|
||||
-netdev user,id=net0 \
|
||||
-device virtio-net,netdev=net0 \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -12,9 +14,8 @@ make vm
|
||||
make usb-build
|
||||
make usb-flash USB_DEVICE=/dev/sdX
|
||||
|
||||
# 3. Deploy cloud infrastructure
|
||||
export HCLOUD_TOKEN="your_token"
|
||||
make deploy-cloud
|
||||
# 3. Test your USB build
|
||||
make usb-test
|
||||
```
|
||||
|
||||
## 🎯 Learning Flow
|
||||
@@ -27,12 +28,10 @@ deploy wordpress # Deploy locally
|
||||
browser wordpress # Open directly in Firefox
|
||||
```
|
||||
|
||||
### Cloud Deployment
|
||||
### Local Practice Only
|
||||
```bash
|
||||
connect hopper # SSH to cloud server
|
||||
# Same abra commands work here
|
||||
abra app new wordpress -S --domain=blog.hopper.codecrispi.es
|
||||
abra app deploy blog.hopper.codecrispi.es
|
||||
# Focus on local development and testing
|
||||
# All deployment happens locally on your USB/VM
|
||||
```
|
||||
|
||||
## 🗃️ Architecture
|
||||
@@ -41,17 +40,18 @@ abra app deploy blog.hopper.codecrispi.es
|
||||
|
||||
- **USB Boot**: Bootable NixOS with Docker + abra for hands-on learning
|
||||
- **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
|
||||
|
||||
## 💾 USB Environment
|
||||
|
||||
Pre-configured with:
|
||||
- **Automatic WiFi connection** to workshop network (CODE_CRISPIES) or public cafe WiFi (APSFreeWiFi)
|
||||
- Docker Swarm + abra installation
|
||||
- SSH client for cloud access
|
||||
- Wildcard DNS resolution (dnsmasq)
|
||||
- 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
|
||||
|
||||
Build and flash:
|
||||
@@ -60,14 +60,13 @@ make usb-build
|
||||
make usb-flash USB_DEVICE=/dev/sdb
|
||||
```
|
||||
|
||||
## 🌐 Cloud Deployment
|
||||
## 🧪 Testing & Validation
|
||||
|
||||
Creates 15 Hetzner VMs at `{name}.codecrispi.es`:
|
||||
Test your workshop environment:
|
||||
|
||||
```bash
|
||||
export HCLOUD_TOKEN="your_token"
|
||||
make deploy-cloud
|
||||
make status-cloud # Check health
|
||||
make usb-test # Test ISO in QEMU
|
||||
make status-local # Check local services
|
||||
```
|
||||
|
||||
## 🖥️ Local Development
|
||||
@@ -86,6 +85,8 @@ The VM simulates the USB experience with identical configuration and commands.
|
||||
|
||||
## 📚 Complete Recipe Catalog
|
||||
|
||||
For the complete list of all recipes, see [RECIPES.md](docs/RECIPES.md)
|
||||
|
||||
Based on Co-op Cloud with quality scoring:
|
||||
|
||||
### ⭐ 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
|
||||
- `deploy <app>` - Deploy locally with tab completion
|
||||
- `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
|
||||
- `help` - Show all commands and debug info
|
||||
|
||||
@@ -146,15 +148,20 @@ browser # Opens Firefox with blank page
|
||||
|
||||
# Use tab completion
|
||||
deploy <TAB> # Shows all available recipes
|
||||
connect <TAB> # Shows all available servers
|
||||
browser <TAB> # Shows deployed applications
|
||||
```
|
||||
|
||||
## 🔧 Prerequisites
|
||||
|
||||
- Nix with flakes enabled
|
||||
- SSH key at `~/.ssh/id_ed25519.pub`
|
||||
- HCLOUD_TOKEN for cloud deployment
|
||||
- 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
|
||||
|
||||
@@ -170,16 +177,27 @@ make opencode # Start opencode in dev shell
|
||||
|
||||
```bash
|
||||
make clean # Clean build artifacts (./build/ and ./result/)
|
||||
make destroy-cloud # Cloud infrastructure
|
||||
```
|
||||
|
||||
## 🔍 Troubleshooting
|
||||
|
||||
```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
|
||||
dig @127.0.0.1 test.workshop.local
|
||||
|
||||
# Check running services
|
||||
# Check running services
|
||||
docker service ls
|
||||
|
||||
# Check DNS service
|
||||
|
||||
+168
-141
@@ -1,9 +1,7 @@
|
||||
{
|
||||
pkgs,
|
||||
lib ? pkgs.lib,
|
||||
cloudServerNames,
|
||||
isLiveIso ? false,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -246,6 +244,51 @@ isoConfig
|
||||
enable = true;
|
||||
wifi.backend = "wpa_supplicant"; # Standard backend for live ISOs
|
||||
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";
|
||||
hosts."127.0.0.1" = [
|
||||
@@ -256,15 +299,6 @@ isoConfig
|
||||
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
|
||||
services.dnsmasq = {
|
||||
enable = true;
|
||||
@@ -338,26 +372,26 @@ isoConfig
|
||||
chown workshop:workshop $AUTH_KEYS_FILE
|
||||
chmod 600 $AUTH_KEYS_FILE
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
};
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Build timestamp service
|
||||
systemd.services.workshop-build-info = {
|
||||
description = "Write build timestamp to /etc/workshop-build-info";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
script = ''
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S')" > /etc/workshop-build-info
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
};
|
||||
# Build timestamp service
|
||||
systemd.services.workshop-build-info = {
|
||||
description = "Write build timestamp to /etc/workshop-build-info";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
script = ''
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S')" > /etc/workshop-build-info
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.getty.autologinUser = "workshop";
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
@@ -370,9 +404,6 @@ isoConfig
|
||||
networkmanager
|
||||
networkmanagerapplet # Network Manager GUI for GNOME
|
||||
gnome-control-center # GNOME Settings (includes network panel)
|
||||
wpa_supplicant # Standard WiFi supplicant
|
||||
wirelesstools # Standard WiFi tools
|
||||
iw # Modern WiFi tools
|
||||
docker
|
||||
docker-compose
|
||||
gnome-terminal
|
||||
@@ -386,7 +417,7 @@ isoConfig
|
||||
gnutar
|
||||
openssl # Add this for certificate generation
|
||||
# Additional font packages for QEMU
|
||||
chromium # Add Chromium browser
|
||||
#chromium # Add Chromium browser
|
||||
firefox
|
||||
dejavu_fonts
|
||||
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 = {
|
||||
description = "Install abra CLI system-wide";
|
||||
description = "Install abra CLI system-wide with retry logic and proper verification";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "workshop-system-setup.service" ];
|
||||
wants = [ "workshop-system-setup.service" ];
|
||||
path = with pkgs; [
|
||||
bash
|
||||
wget
|
||||
@@ -498,37 +528,43 @@ isoConfig
|
||||
];
|
||||
|
||||
script = ''
|
||||
# Set proper environment
|
||||
# Plain abra installation
|
||||
export TERM=xterm-256color
|
||||
export HOME=/root
|
||||
|
||||
# Check if abra is already installed
|
||||
if [ -x "/root/.local/bin/abra" ]; then
|
||||
echo "✅ abra already installed"
|
||||
/root/.local/bin/abra --version
|
||||
# Check if abra is already properly installed
|
||||
if sudo abra --version >/dev/null 2>&1; then
|
||||
echo "✅ abra already installed and functional"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "🚀 Installing abra system-wide..."
|
||||
|
||||
# Install to /usr/local/bin (default behavior)
|
||||
# Plain installation
|
||||
curl -fsSL https://install.abra.coopcloud.tech | bash
|
||||
|
||||
# Add to bashrc only once
|
||||
if ! grep -q "/root/.local/bin" /root/.bashrc 2>/dev/null; then
|
||||
echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.bashrc
|
||||
echo "✅ Added /root/.local/bin to PATH in /root/.bashrc"
|
||||
fi
|
||||
# Verify installation
|
||||
if sudo abra --version >/dev/null 2>&1; then
|
||||
echo "✅ abra installed successfully"
|
||||
|
||||
# Verify
|
||||
if [ -x "/root/.local/bin/abra" ]; then
|
||||
echo "✅ abra installed to /root/.local/bin/abra"
|
||||
# Add to bashrc only once
|
||||
if ! grep -q "/root/.local/bin" /root/.bashrc 2>/dev/null; then
|
||||
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
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
Restart = "on-failure";
|
||||
RestartSec = "30s";
|
||||
User = "root";
|
||||
Environment = [
|
||||
"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
|
||||
programs.bash.interactiveShellInit =
|
||||
let
|
||||
recipeList = builtins.concatStringsSep " " allRecipes;
|
||||
serverList = builtins.concatStringsSep " " cloudServerNames;
|
||||
in
|
||||
''
|
||||
# Workshop Environment Welcome
|
||||
echo "🚀 CODE CRISPIES Workshop Environment"
|
||||
echo "🚀 SCIENCE IN THE CITY Workshop Environment"
|
||||
echo "Mode: Local Development (Offline Co-op Cloud)"
|
||||
echo ""
|
||||
|
||||
@@ -599,14 +609,14 @@ isoConfig
|
||||
export PATH="$PATH:/root/.local/bin"
|
||||
fi
|
||||
|
||||
# Check abra installation
|
||||
if sudo abra >/dev/null 2>&1; then
|
||||
echo "✅ abra ready: $(sudo which abra)"
|
||||
source <(sudo abra autocomplete bash) 2>/dev/null || true
|
||||
echo "✅ abra autocomplete enabled"
|
||||
else
|
||||
echo "⚠️ abra not found! Check: systemctl status workshop-abra-install"
|
||||
fi
|
||||
# Check abra installation
|
||||
if sudo abra >/dev/null 2>&1; then
|
||||
echo "✅ abra ready: $(sudo which abra)"
|
||||
source <(sudo abra autocomplete bash) 2>/dev/null || true
|
||||
echo "✅ abra autocomplete enabled"
|
||||
else
|
||||
echo "⚠️ abra not found! Install with: curl -fsSL https://install.abra.coopcloud.tech | bash"
|
||||
fi
|
||||
|
||||
# Build info
|
||||
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"))
|
||||
return 0
|
||||
;;
|
||||
connect)
|
||||
COMPREPLY=($(compgen -W "${serverList}" -- "$cur"))
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
complete -F _workshop_completion deploy browser connect abra
|
||||
complete -F _workshop_completion deploy browser abra
|
||||
|
||||
# Core Workshop Functions
|
||||
setup() {
|
||||
@@ -674,14 +680,14 @@ isoConfig
|
||||
echo " Current groups: $(id -nG)"
|
||||
fi
|
||||
|
||||
# Check if abra is available via sudo
|
||||
if sudo abra --version >/dev/null 2>&1; then
|
||||
echo "✅ abra available via sudo: $(sudo which abra)"
|
||||
else
|
||||
echo "❌ abra not available via sudo"
|
||||
echo " Check: systemctl status workshop-abra-install"
|
||||
return 1
|
||||
fi
|
||||
# Check if abra is available via sudo
|
||||
if sudo abra --version >/dev/null 2>&1; then
|
||||
echo "✅ abra available via sudo: $(sudo which abra)"
|
||||
else
|
||||
echo "❌ abra not available via sudo"
|
||||
echo " Check: which abra && abra --version"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check abra server configuration
|
||||
if sudo abra server ls 2>/dev/null | grep -q "default"; then
|
||||
@@ -1170,13 +1176,9 @@ isoConfig
|
||||
}
|
||||
|
||||
connect() {
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Usage: connect <name>"
|
||||
echo "Available: ${serverList}"
|
||||
return 1
|
||||
fi
|
||||
echo "🔌 Connecting to $1.codecrispi.es..."
|
||||
ssh -o StrictHostKeyChecking=no workshop@$1.codecrispi.es
|
||||
echo "🔌 SSH connection helper (workshop environment)"
|
||||
echo "Usage: ssh -o StrictHostKeyChecking=no user@host"
|
||||
echo "Note: This workshop focuses on local development only"
|
||||
}
|
||||
|
||||
browser() {
|
||||
@@ -1195,9 +1197,34 @@ isoConfig
|
||||
echo "❌ No GUI session. Run 'desktop' first"
|
||||
echo "🌐 Target was: $target_url"
|
||||
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 ""
|
||||
echo "⭐ Tier 1 - Production Ready: gitea mealie nextcloud"
|
||||
@@ -1258,35 +1285,35 @@ isoConfig
|
||||
echo " 4. Use 'browser <app>' to access deployed services"
|
||||
}
|
||||
|
||||
help() {
|
||||
echo "🚀 CODE CRISPIES Workshop Commands:"
|
||||
echo ""
|
||||
echo "🏠 Local Development:"
|
||||
echo " setup - Setup local proxy (REQUIRED FIRST!)"
|
||||
echo " recipes - Show all available apps"
|
||||
echo " deploy <recipe> - Deploy app locally"
|
||||
echo " browser [recipe] - Launch browser [to app]"
|
||||
echo " desktop - Start GUI session"
|
||||
echo " sudo abra - Run abra CLI directly as root"
|
||||
echo ""
|
||||
echo "🌐 Network:"
|
||||
echo " network_help - Network configuration guide"
|
||||
echo ""
|
||||
echo "☁️ Cloud Access:"
|
||||
echo " connect <name> - SSH to cloud server"
|
||||
echo " Available: ${serverList}"
|
||||
echo ""
|
||||
echo "🔍 Debug:"
|
||||
echo " docker service ls - List running services"
|
||||
echo " systemctl status dnsmasq - Check DNS"
|
||||
echo " systemctl status workshop-abra-install - Check abra installation"
|
||||
echo ""
|
||||
echo "📚 Learning Flow:"
|
||||
echo " 1. setup"
|
||||
echo " 2. deploy wordpress"
|
||||
echo " 3. browser wordpress"
|
||||
echo " 4. connect hopper"
|
||||
}
|
||||
help() {
|
||||
echo "🚀 SCIENCE IN THE CITY Workshop Commands:"
|
||||
echo ""
|
||||
echo "🏠 Local Development:"
|
||||
echo " setup - Setup local proxy (REQUIRED FIRST!)"
|
||||
echo " recipes - Show all available apps"
|
||||
echo " deploy <recipe> - Deploy app locally"
|
||||
echo " browser [recipe] - Launch browser [to app]"
|
||||
echo " desktop - Start GUI session"
|
||||
echo " sudo abra - Run abra CLI directly as root"
|
||||
echo ""
|
||||
echo "🌐 Network:"
|
||||
echo " network_help - Network configuration guide"
|
||||
echo ""
|
||||
echo "🔧 Workshop Tools:"
|
||||
echo " connect - SSH connection helper"
|
||||
echo " help - Show this help message"
|
||||
echo ""
|
||||
echo "🔍 Debug:"
|
||||
echo " docker service ls - List running services"
|
||||
echo " systemctl status dnsmasq - Check DNS"
|
||||
echo " systemctl status workshop-abra-install - Check abra installation"
|
||||
echo ""
|
||||
echo "📚 Learning Flow:"
|
||||
echo " 1. setup"
|
||||
echo " 2. deploy wordpress"
|
||||
echo " 3. browser wordpress"
|
||||
echo " 4. explore workshop environment"
|
||||
}
|
||||
'';
|
||||
|
||||
programs.firefox = {
|
||||
@@ -1361,9 +1388,9 @@ isoConfig
|
||||
|
||||
# Essential GNOME services for network integration
|
||||
services.gnome = {
|
||||
glib-networking.enable = true; # Critical for NetworkManager integration
|
||||
gnome-settings-daemon.enable = true; # Handles GNOME settings
|
||||
gnome-keyring.enable = true; # Optional but good practice
|
||||
glib-networking.enable = true; # Critical for NetworkManager integration
|
||||
gnome-settings-daemon.enable = true; # Handles GNOME settings
|
||||
gnome-keyring.enable = true; # Optional but good practice
|
||||
};
|
||||
|
||||
# Exclude unnecessary GNOME packages
|
||||
|
||||
@@ -79,11 +79,15 @@ echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
|
||||
|
||||
## 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
|
||||
# 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
|
||||
@@ -101,22 +105,29 @@ nslookup traefik.workshop.local 127.0.0.1
|
||||
|
||||
When internet is not available during workshop setup:
|
||||
|
||||
1. **Configure Network Manually**
|
||||
```bash
|
||||
# Use one of the methods above to get network connectivity
|
||||
nmcli device wifi connect "YourNetwork" password "YourPassword"
|
||||
```
|
||||
1. **Network Connects Automatically**
|
||||
```bash
|
||||
# WiFi connects automatically to "CODE_CRISPIES" on boot
|
||||
# Check connection: nmcli connection show --active
|
||||
```
|
||||
|
||||
2. **Skip Online Dependencies**
|
||||
```bash
|
||||
# The setup script will work offline once network is configured
|
||||
setup
|
||||
```
|
||||
```bash
|
||||
# The setup script will work offline once network is configured
|
||||
setup
|
||||
```
|
||||
|
||||
3. **Manual abra Installation** (if needed)
|
||||
```bash
|
||||
# Download abra binary manually on another machine and transfer via USB
|
||||
# Or use a local package repository
|
||||
# Use the install command (preferred)
|
||||
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**
|
||||
@@ -219,11 +230,14 @@ ping 8.8.8.8
|
||||
# Test DNS
|
||||
nslookup google.com
|
||||
|
||||
# Test workshop services
|
||||
curl http://traefik.workshop.local
|
||||
# Test abra installation
|
||||
sudo abra --version
|
||||
|
||||
# Test abra connectivity
|
||||
sudo abra server ls
|
||||
|
||||
# Test workshop services
|
||||
curl http://traefik.workshop.local
|
||||
```
|
||||
|
||||
## Getting Help
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
| 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) |
|
||||
| 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) |
|
||||
| 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) |
|
||||
@@ -115,6 +116,7 @@
|
||||
| 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) |
|
||||
| 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) |
|
||||
| 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) |
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
### Quick Reference Card
|
||||
|
||||
**Your assigned server:** `__________.codecrispi.es`
|
||||
**Workshop WiFi:** `CODE_CRISPIES_GUEST` / Password: `workshop2024`
|
||||
**Workshop WiFi:** `CODE_CRISPIES` / Password: `scienceinthecity2025`
|
||||
|
||||
---
|
||||
|
||||
@@ -72,12 +71,16 @@
|
||||
## Getting Started Commands
|
||||
|
||||
```bash
|
||||
# Connect to your assigned server
|
||||
connect hopper
|
||||
# WiFi connects automatically to CODE_CRISPIES or APSFreeWiFi - no manual setup needed!
|
||||
# Set up your local environment
|
||||
setup
|
||||
|
||||
# See available app recipes
|
||||
# See available app recipes
|
||||
recipes
|
||||
|
||||
# If abra installation failed (rare case)
|
||||
install
|
||||
|
||||
# Get help
|
||||
help
|
||||
```
|
||||
@@ -117,5 +120,11 @@ Name: Android, Password: (ask facilitator)
|
||||
→ Note: Terminal no longer auto-starts to prevent boot hangs
|
||||
|
||||
**Can't connect to internet**
|
||||
→ Try different WiFi network
|
||||
→ Use mobile hotspot as backup
|
||||
→ 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
|
||||
→ Check: nmcli connection show --active
|
||||
|
||||
**Abra not working**
|
||||
→ Run: install
|
||||
→ Check: sudo systemctl status workshop-abra-install
|
||||
@@ -19,32 +19,13 @@
|
||||
system = "x86_64-linux";
|
||||
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
|
||||
commonConfig =
|
||||
{
|
||||
isLiveIso ? false,
|
||||
}:
|
||||
import ./common.nix {
|
||||
inherit pkgs cloudServerNames isLiveIso;
|
||||
inherit pkgs isLiveIso;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user