diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 98ddc09..cb0badd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,7 @@ - MSVC toolchain for Rust **Linux:** -- podman-compose +- podman compose ### Quick Setup diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 8c7326f..2c4b13a 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -44,7 +44,7 @@ cp compose/.env.production.example compose/.env.production # 4. Deploy cd compose -podman-compose --env-file .env.production -f production.yml up -d +podman compose --env-file .env.production -f production.yml up -d # 5. Access at http://localhost:4321 ``` @@ -57,7 +57,7 @@ cp compose/.env.demo.example compose/.env.demo # 2. Deploy cd compose -podman-compose --env-file .env.demo -f demo.yml up -d +podman compose --env-file .env.demo -f demo.yml up -d # 3. Access at http://localhost:4322 ``` @@ -105,8 +105,8 @@ To reset the demo to a clean state: ./scripts/demo-reset.sh # Or manually: -podman-compose --env-file compose/.env.demo -f compose/demo.yml down -v -podman-compose --env-file compose/.env.demo -f compose/demo.yml up -d +podman compose --env-file compose/.env.demo -f compose/demo.yml down -v +podman compose --env-file compose/.env.demo -f compose/demo.yml up -d ``` ## Configuration Reference @@ -141,7 +141,7 @@ For local development without containers: ```bash # 1. Start only the database -podman-compose -f compose/dev.yml up -d +podman compose -f compose/dev.yml up -d # 2. Configure backend environment cp backend/.env.example backend/.env @@ -159,10 +159,10 @@ npm run dev ```bash # View all logs -podman-compose --env-file compose/.env.demo -f compose/demo.yml logs -f +podman compose --env-file compose/.env.demo -f compose/demo.yml logs -f # View specific service -podman-compose --env-file compose/.env.demo -f compose/demo.yml logs -f backend +podman compose --env-file compose/.env.demo -f compose/demo.yml logs -f backend # Check health curl http://localhost:3001/health @@ -173,10 +173,10 @@ curl http://localhost:3001/health ### Database connection issues ```bash # Check if postgres is running -podman-compose --env-file compose/.env.demo -f compose/demo.yml ps +podman compose --env-file compose/.env.demo -f compose/demo.yml ps # View postgres logs -podman-compose --env-file compose/.env.demo -f compose/demo.yml logs postgres +podman compose --env-file compose/.env.demo -f compose/demo.yml logs postgres ``` ### Migration failures @@ -194,6 +194,6 @@ SELECT * FROM _sqlx_migrations; ### Reset everything ```bash # Nuclear option - removes all data and volumes -podman-compose --env-file compose/.env.demo -f compose/demo.yml down -v -podman-compose --env-file compose/.env.demo -f compose/demo.yml up -d +podman compose --env-file compose/.env.demo -f compose/demo.yml down -v +podman compose --env-file compose/.env.demo -f compose/demo.yml up -d ``` diff --git a/README.md b/README.md index 4794cfa..10ba570 100644 --- a/README.md +++ b/README.md @@ -1,157 +1,157 @@ -# Likwid - Modular Governance Platform - -## Composable Governance Infrastructure - -A modular toolkit for deliberation, voting, delegation, moderation, and plugins — configure what you need per community. - -Likwid is an open-source platform for participatory governance. Assemble decision-making workflows from modular building blocks: deliberation, voting methods, delegation, moderation, and plugins. - -> *"We are citizens of the 21st century, but we rely on institutions designed in the 19th century, through means designed in the 13th century. The problem is not democracy, it's the interface."* - -## Philosophy - -Likwid implements a set of principles for **modular governance infrastructure**: - -- **Information must be understandable**, not just available -- **Listening matters more than speaking** — structured deliberation over flame wars -- **Voting should express nuance** — from simple approval to Schulze and quadratic methods -- **Delegation should be fluid** — trust networks that adapt in real-time -- **Governance should be composable** — workflows assembled from modules, not imposed - -## Features - -### Deliberative Democracy - -- **Inform → Discuss → Decide** workflow for proposals -- Resource libraries for informed participation -- Optional facilitator role on proposals -- "Read before discuss" requirements -- Comment reactions for quality signals (agree/disagree/insightful/constructive/off-topic) - -### Advanced Voting Methods - -- **Approval Voting** — vote for multiple options -- **Ranked Choice** — order preferences -- **Schulze Method** — Condorcet-consistent pairwise comparison -- **STAR Voting** — score + automatic runoff -- **Quadratic Voting** — express intensity of preference - -### Liquid Delegation - -- Delegate your vote globally or within a community -- Real-time transparency: see how delegates vote -- Revoke delegation instantly -- Transitive delegation chains -- Delegation analytics and trust networks - -### Modular Plugin System - -- WASM-based sandboxed plugins -- Per-community plugin configuration -- Hook-based architecture (actions/filters) -- Built-in and third-party plugins -- Admin policy for signed/unsigned plugins - -### Governance Infrastructure - -- Multi-community platform support -- Granular admin controls (platform mode, registration, moderation) -- Tamper-evident public moderation ledger -- Role-based access (admin, moderator, facilitator, member) - -## Tech Stack - -| Layer | Technology | -| --- | --- | -| **Backend** | Rust (Axum 0.8, Tokio, SQLx) | -| **Frontend** | Astro + TypeScript | -| **Database** | PostgreSQL 16 | -| **Plugins** | WebAssembly (wasmtime) | -| **Containers** | Podman (rootless) | - -## Quick Start - -### Prerequisites - -**Windows:** - -- Windows 10/11 with WSL2 -- Podman Desktop (WSL2 backend) -- Rust (rustup, MSVC toolchain) -- Node.js LTS - -**Linux:** - -- Podman + podman-compose -- Rust (rustup) -- Node.js LTS - -### Development - -```powershell -# 1. Clone and configure -git clone https://codeberg.org/likwid/likwid.git -cd likwid -$env:JWT_SECRET="dev_secret_change_me" - -# 2. Start everything (database + backend + frontend) -.\scripts\dev-start.ps1 - -# 3. Stop everything -.\scripts\dev-stop.ps1 -``` - -The platform will be available at: - -- **Frontend**: -- **Backend API**: -- **Setup Wizard**: (first run) - -### First Run - -1. Navigate to `/register` to create the first user (automatically becomes admin) -2. Complete platform setup at `/setup` -3. Configure instance settings at `/admin/settings` -4. Create your first community - -## Project Structure - -```text -likwid/ -├── backend/ # Rust backend -│ ├── src/ -│ │ ├── api/ # REST endpoints -│ │ ├── auth/ # JWT authentication -│ │ ├── models/ # Database models -│ │ └── plugins/ # Plugin system (WASM + builtins) -│ └── migrations/ # SQL migrations -├── frontend/ # Astro frontend -│ ├── src/ -│ │ ├── pages/ # Routes -│ │ ├── layouts/ # Page layouts -│ │ └── components/ # UI components -├── compose/ # Podman compose files -├── scripts/ # Dev scripts (cross-platform) -└── docu_dev/ # Design documents -``` - -### Core Principles - -1. **Be considerate** — Your work affects others -2. **Be respectful** — Assume good intentions -3. **Be collaborative** — Work transparently -4. **Be pragmatic** — Results over debates -5. **Find a third way** — Seek solutions that satisfy everyone - -## License - -EUPL-1.2 - -## Acknowledgments - -Inspired by: - -- [Pol.is](https://pol.is/) — Opinion mapping -- [Decidim](https://decidim.org/) — Participatory democracy -- [LiquidFeedback](https://liquidfeedback.org/) — Liquid democracy -- [Equal Vote Coalition](https://www.equal.vote/) — STAR Voting +# Likwid - Modular Governance Platform + +## Composable Governance Infrastructure + +A modular toolkit for deliberation, voting, delegation, moderation, and plugins — configure what you need per community. + +Likwid is an open-source platform for participatory governance. Assemble decision-making workflows from modular building blocks: deliberation, voting methods, delegation, moderation, and plugins. + +> *"We are citizens of the 21st century, but we rely on institutions designed in the 19th century, through means designed in the 13th century. The problem is not democracy, it's the interface."* + +## Philosophy + +Likwid implements a set of principles for **modular governance infrastructure**: + +- **Information must be understandable**, not just available +- **Listening matters more than speaking** — structured deliberation over flame wars +- **Voting should express nuance** — from simple approval to Schulze and quadratic methods +- **Delegation should be fluid** — trust networks that adapt in real-time +- **Governance should be composable** — workflows assembled from modules, not imposed + +## Features + +### Deliberative Democracy + +- **Inform → Discuss → Decide** workflow for proposals +- Resource libraries for informed participation +- Optional facilitator role on proposals +- "Read before discuss" requirements +- Comment reactions for quality signals (agree/disagree/insightful/constructive/off-topic) + +### Advanced Voting Methods + +- **Approval Voting** — vote for multiple options +- **Ranked Choice** — order preferences +- **Schulze Method** — Condorcet-consistent pairwise comparison +- **STAR Voting** — score + automatic runoff +- **Quadratic Voting** — express intensity of preference + +### Liquid Delegation + +- Delegate your vote globally or within a community +- Real-time transparency: see how delegates vote +- Revoke delegation instantly +- Transitive delegation chains +- Delegation analytics and trust networks + +### Modular Plugin System + +- WASM-based sandboxed plugins +- Per-community plugin configuration +- Hook-based architecture (actions/filters) +- Built-in and third-party plugins +- Admin policy for signed/unsigned plugins + +### Governance Infrastructure + +- Multi-community platform support +- Granular admin controls (platform mode, registration, moderation) +- Tamper-evident public moderation ledger +- Role-based access (admin, moderator, facilitator, member) + +## Tech Stack + +| Layer | Technology | +| --- | --- | +| **Backend** | Rust (Axum 0.8, Tokio, SQLx) | +| **Frontend** | Astro + TypeScript | +| **Database** | PostgreSQL 16 | +| **Plugins** | WebAssembly (wasmtime) | +| **Containers** | Podman (rootless) | + +## Quick Start + +### Prerequisites + +**Windows:** + +- Windows 10/11 with WSL2 +- Podman Desktop (WSL2 backend) +- Rust (rustup, MSVC toolchain) +- Node.js LTS + +**Linux:** + +- Podman + podman compose +- Rust (rustup) +- Node.js LTS + +### Development + +```powershell +# 1. Clone and configure +git clone https://codeberg.org/likwid/likwid.git +cd likwid +$env:JWT_SECRET="dev_secret_change_me" + +# 2. Start everything (database + backend + frontend) +.\scripts\dev-start.ps1 + +# 3. Stop everything +.\scripts\dev-stop.ps1 +``` + +The platform will be available at: + +- **Frontend**: +- **Backend API**: +- **Setup Wizard**: (first run) + +### First Run + +1. Navigate to `/register` to create the first user (automatically becomes admin) +2. Complete platform setup at `/setup` +3. Configure instance settings at `/admin/settings` +4. Create your first community + +## Project Structure + +```text +likwid/ +├── backend/ # Rust backend +│ ├── src/ +│ │ ├── api/ # REST endpoints +│ │ ├── auth/ # JWT authentication +│ │ ├── models/ # Database models +│ │ └── plugins/ # Plugin system (WASM + builtins) +│ └── migrations/ # SQL migrations +├── frontend/ # Astro frontend +│ ├── src/ +│ │ ├── pages/ # Routes +│ │ ├── layouts/ # Page layouts +│ │ └── components/ # UI components +├── compose/ # Podman compose files +├── scripts/ # Dev scripts (cross-platform) +└── docu_dev/ # Design documents +``` + +### Core Principles + +1. **Be considerate** — Your work affects others +2. **Be respectful** — Assume good intentions +3. **Be collaborative** — Work transparently +4. **Be pragmatic** — Results over debates +5. **Find a third way** — Seek solutions that satisfy everyone + +## License + +EUPL-1.2 + +## Acknowledgments + +Inspired by: + +- [Pol.is](https://pol.is/) — Opinion mapping +- [Decidim](https://decidim.org/) — Participatory democracy +- [LiquidFeedback](https://liquidfeedback.org/) — Liquid democracy +- [Equal Vote Coalition](https://www.equal.vote/) — STAR Voting diff --git a/WORKFLOW.md b/WORKFLOW.md index 7b8c95b..e9df3c6 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -66,7 +66,7 @@ sqlx migrate run --source migrations_demo ```bash # Uses separate database on port 5433, backend on 3001, frontend on 4322 cp compose/.env.demo.example compose/.env.demo -podman-compose --env-file compose/.env.demo -f compose/demo.yml up -d +podman compose --env-file compose/.env.demo -f compose/demo.yml up -d ``` ### For real users (Production) @@ -76,7 +76,7 @@ cp compose/.env.production.example compose/.env.production # Edit with secure passwords and your domain # 2. Deploy -podman-compose --env-file compose/.env.production -f compose/production.yml up -d +podman compose --env-file compose/.env.production -f compose/production.yml up -d ``` ## Common Tasks diff --git a/compose/demo.yml b/compose/demo.yml index 2acff72..b0b7243 100644 --- a/compose/demo.yml +++ b/compose/demo.yml @@ -1,6 +1,6 @@ # Demo deployment - includes demo users, seed data, and restricted actions -# Usage: podman-compose --env-file compose/.env.demo -f compose/demo.yml up -d -# Reset: podman-compose --env-file compose/.env.demo -f compose/demo.yml down -v; podman-compose --env-file compose/.env.demo -f compose/demo.yml up -d +# Usage: podman compose --env-file compose/.env.demo -f compose/demo.yml up -d +# Reset: podman compose --env-file compose/.env.demo -f compose/demo.yml down -v; podman compose --env-file compose/.env.demo -f compose/demo.yml up -d services: postgres: diff --git a/compose/production.yml b/compose/production.yml index 1489bce..e80ab02 100644 --- a/compose/production.yml +++ b/compose/production.yml @@ -1,61 +1,61 @@ -# Production deployment - clean instance without demo data -# Usage: podman-compose -f compose/production.yml up -d - -services: - postgres: - image: postgres:16 - container_name: likwid-prod-db - restart: unless-stopped - ports: - - "${DB_PORT:-5432}:5432" - environment: - POSTGRES_USER: ${POSTGRES_USER:-likwid} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - POSTGRES_DB: ${POSTGRES_DB:-likwid_prod} - volumes: - - likwid_prod_data:/var/lib/postgresql/data - healthcheck: - test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-likwid}"] - interval: 10s - timeout: 5s - retries: 5 - - backend: - build: - context: ../backend - dockerfile: Dockerfile - args: - INCLUDE_DEMO_SEED: "false" - container_name: likwid-prod-backend - restart: unless-stopped - ports: - - "${BACKEND_PORT:-3000}:3000" - environment: - DATABASE_URL: postgres://${POSTGRES_USER:-likwid}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-likwid_prod} - JWT_SECRET: ${JWT_SECRET} - SERVER_HOST: 0.0.0.0 - SERVER_PORT: 3000 - DEMO_MODE: "false" - RUST_LOG: info - depends_on: - postgres: - condition: service_healthy - - frontend: - build: - context: ../frontend - dockerfile: Dockerfile - args: - API_BASE: ${API_BASE:-http://localhost:3000} - container_name: likwid-prod-frontend - restart: unless-stopped - ports: - - "${FRONTEND_PORT:-4321}:4321" - environment: - INTERNAL_API_BASE: http://backend:3000 - API_BASE: ${API_BASE:-http://localhost:3000} - depends_on: - - backend - -volumes: - likwid_prod_data: +# Production deployment - clean instance without demo data +# Usage: podman compose -f compose/production.yml up -d + +services: + postgres: + image: postgres:16 + container_name: likwid-prod-db + restart: unless-stopped + ports: + - "${DB_PORT:-5432}:5432" + environment: + POSTGRES_USER: ${POSTGRES_USER:-likwid} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: ${POSTGRES_DB:-likwid_prod} + volumes: + - likwid_prod_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-likwid}"] + interval: 10s + timeout: 5s + retries: 5 + + backend: + build: + context: ../backend + dockerfile: Dockerfile + args: + INCLUDE_DEMO_SEED: "false" + container_name: likwid-prod-backend + restart: unless-stopped + ports: + - "${BACKEND_PORT:-3000}:3000" + environment: + DATABASE_URL: postgres://${POSTGRES_USER:-likwid}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-likwid_prod} + JWT_SECRET: ${JWT_SECRET} + SERVER_HOST: 0.0.0.0 + SERVER_PORT: 3000 + DEMO_MODE: "false" + RUST_LOG: info + depends_on: + postgres: + condition: service_healthy + + frontend: + build: + context: ../frontend + dockerfile: Dockerfile + args: + API_BASE: ${API_BASE:-http://localhost:3000} + container_name: likwid-prod-frontend + restart: unless-stopped + ports: + - "${FRONTEND_PORT:-4321}:4321" + environment: + INTERNAL_API_BASE: http://backend:3000 + API_BASE: ${API_BASE:-http://localhost:3000} + depends_on: + - backend + +volumes: + likwid_prod_data: diff --git a/docs/admin/backup.md b/docs/admin/backup.md index e7c4ba6..1f7db55 100644 --- a/docs/admin/backup.md +++ b/docs/admin/backup.md @@ -49,7 +49,7 @@ find "$BACKUP_DIR" -name "*.dump.gz" -mtime +$RETENTION_DAYS -delete ### Containerized Backup ```bash -# If using podman-compose +# If using podman compose podman exec likwid-prod-db pg_dump -U likwid likwid_prod > backup.sql ``` diff --git a/docs/admin/configuration.md b/docs/admin/configuration.md index 6232bc1..ae0c8d4 100644 --- a/docs/admin/configuration.md +++ b/docs/admin/configuration.md @@ -37,7 +37,7 @@ Managed via the Admin panel or API: - **Instance Name** - Display name for your Likwid instance - **Instance Description** - Brief description - **Registration** - Open, invite-only, or closed -- **Email Verification** - Required or optional +- **Approval workflows** - Registration and community creation can be open, invite-only, or require admin approval ### Features diff --git a/docs/admin/installation.md b/docs/admin/installation.md index 9253c6b..b6b0891 100644 --- a/docs/admin/installation.md +++ b/docs/admin/installation.md @@ -34,7 +34,7 @@ Required settings: ```bash cd compose -podman-compose --env-file .env.production -f production.yml up -d +podman compose --env-file .env.production -f production.yml up -d ``` ### 4. Access diff --git a/docs/user/getting-started.md b/docs/user/getting-started.md index f01294f..6a8af09 100644 --- a/docs/user/getting-started.md +++ b/docs/user/getting-started.md @@ -11,7 +11,7 @@ Likwid is a modular governance platform for distributed organizations. This guid - Email address - Display name (shown to others) - Password -4. Verify your email if required by the instance +4. If registration requires approval, your account will be pending until an admin approves it ## Exploring Without an Account diff --git a/scripts/demo-reset.ps1 b/scripts/demo-reset.ps1 index 32d3e09..dab90ce 100644 --- a/scripts/demo-reset.ps1 +++ b/scripts/demo-reset.ps1 @@ -29,10 +29,10 @@ if (Test-Path $envFile) { } Write-Host "`n[1/3] Stopping demo containers and removing volumes..." -ForegroundColor Yellow -podman-compose @composeArgs down --remove-orphans -v +podman compose @composeArgs down --remove-orphans -v Write-Host "`n[2/3] Starting fresh demo instance..." -ForegroundColor Yellow -podman-compose @composeArgs up -d +podman compose @composeArgs up -d Write-Host "`n[3/3] Waiting for services to be ready..." -ForegroundColor Yellow Start-Sleep -Seconds 10 @@ -63,4 +63,4 @@ while ($retry -lt $maxRetries) { Write-Host "`nWarning: Backend health check timed out. Check logs with:" -ForegroundColor Yellow $composeArgsText = ($composeArgs -join ' ') -Write-Host " podman-compose $composeArgsText logs backend" +Write-Host " podman compose $composeArgsText logs backend" diff --git a/scripts/demo-reset.sh b/scripts/demo-reset.sh index a778bb4..6e19f13 100644 --- a/scripts/demo-reset.sh +++ b/scripts/demo-reset.sh @@ -26,10 +26,10 @@ if [ "$1" != "--force" ] && [ "$1" != "-f" ]; then fi echo -e "\n[1/3] Stopping demo containers and removing volumes..." -podman-compose "${COMPOSE_ARGS[@]}" down --remove-orphans -v || docker-compose "${COMPOSE_ARGS[@]}" down --remove-orphans -v +podman compose "${COMPOSE_ARGS[@]}" down --remove-orphans -v || podman-compose "${COMPOSE_ARGS[@]}" down --remove-orphans -v || docker-compose "${COMPOSE_ARGS[@]}" down --remove-orphans -v echo -e "\n[2/3] Starting fresh demo instance..." -podman-compose "${COMPOSE_ARGS[@]}" up -d || docker-compose "${COMPOSE_ARGS[@]}" up -d +podman compose "${COMPOSE_ARGS[@]}" up -d || podman-compose "${COMPOSE_ARGS[@]}" up -d || docker-compose "${COMPOSE_ARGS[@]}" up -d echo -e "\n[3/3] Waiting for services to be ready..." sleep 5 @@ -54,5 +54,5 @@ while [ $retry -lt $max_retries ]; do done echo -e "\nWarning: Backend health check timed out. Check logs with:" -echo " podman-compose ${COMPOSE_ARGS[*]} logs backend" +echo " podman compose ${COMPOSE_ARGS[*]} logs backend" echo " docker-compose ${COMPOSE_ARGS[*]} logs backend" diff --git a/scripts/dev-start.ps1 b/scripts/dev-start.ps1 index e270e42..3e8a728 100644 --- a/scripts/dev-start.ps1 +++ b/scripts/dev-start.ps1 @@ -27,19 +27,19 @@ function Invoke-Compose { [Parameter(Mandatory=$true)][string[]]$Args ) - $podmanCompose = Get-Command podman-compose -ErrorAction SilentlyContinue - if ($podmanCompose) { - $null = & podman-compose @Args - return $LASTEXITCODE - } - $podman = Get-Command podman -ErrorAction SilentlyContinue if ($podman) { $null = & podman compose @Args return $LASTEXITCODE } - throw 'Neither podman-compose nor podman was found in PATH.' + $podmanCompose = Get-Command podman-compose -ErrorAction SilentlyContinue + if ($podmanCompose) { + $null = & podman-compose @Args + return $LASTEXITCODE + } + + throw 'Neither podman nor podman-compose was found in PATH.' } function Get-CommandLine { diff --git a/scripts/dev-start.sh b/scripts/dev-start.sh index cf24765..1f9482a 100644 --- a/scripts/dev-start.sh +++ b/scripts/dev-start.sh @@ -30,7 +30,7 @@ fi # Start PostgreSQL echo "Starting PostgreSQL..." -podman-compose -f "$ROOT_DIR/compose/dev.yml" up -d 2>/dev/null || true +podman compose -f "$ROOT_DIR/compose/dev.yml" up -d 2>/dev/null || podman-compose -f "$ROOT_DIR/compose/dev.yml" up -d 2>/dev/null || true # Wait for PostgreSQL echo "Waiting for PostgreSQL..." diff --git a/scripts/dev-stop.ps1 b/scripts/dev-stop.ps1 index a399468..d337ad2 100644 --- a/scripts/dev-stop.ps1 +++ b/scripts/dev-stop.ps1 @@ -19,19 +19,19 @@ function Invoke-Compose { [Parameter(Mandatory=$true)][string[]]$Args ) - $podmanCompose = Get-Command podman-compose -ErrorAction SilentlyContinue - if ($podmanCompose) { - $null = & podman-compose @Args - return $LASTEXITCODE - } - $podman = Get-Command podman -ErrorAction SilentlyContinue if ($podman) { $null = & podman compose @Args return $LASTEXITCODE } - throw 'Neither podman-compose nor podman was found in PATH.' + $podmanCompose = Get-Command podman-compose -ErrorAction SilentlyContinue + if ($podmanCompose) { + $null = & podman-compose @Args + return $LASTEXITCODE + } + + throw 'Neither podman nor podman-compose was found in PATH.' } function Get-CommandLine { diff --git a/scripts/dev-stop.sh b/scripts/dev-stop.sh index 71a9e24..3c76edb 100644 --- a/scripts/dev-stop.sh +++ b/scripts/dev-stop.sh @@ -48,7 +48,7 @@ pkill -f "astro dev" 2>/dev/null || true # Stop PostgreSQL if requested if [ "$STOP_DB" = "--all" ] || [ "$STOP_DB" = "-a" ]; then echo "Stopping PostgreSQL..." - podman-compose -f "$ROOT_DIR/compose/dev.yml" down 2>/dev/null || true + podman compose -f "$ROOT_DIR/compose/dev.yml" down 2>/dev/null || podman-compose -f "$ROOT_DIR/compose/dev.yml" down 2>/dev/null || true fi echo "Done." diff --git a/scripts/dev.ps1 b/scripts/dev.ps1 index b484339..66ad7da 100644 --- a/scripts/dev.ps1 +++ b/scripts/dev.ps1 @@ -1 +1,4 @@ -podman-compose -f compose/dev.yml up +podman compose -f compose/dev.yml up +if ($LASTEXITCODE -ne 0) { + podman-compose -f compose/dev.yml up +} diff --git a/scripts/dev.sh b/scripts/dev.sh index 90466bd..db3b9cc 100644 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -1,2 +1,2 @@ #!/bin/sh -podman-compose -f compose/dev.yml up +podman compose -f compose/dev.yml up || podman-compose -f compose/dev.yml up diff --git a/scripts/post-reboot-setup.ps1 b/scripts/post-reboot-setup.ps1 index 64fcbca..c445529 100644 --- a/scripts/post-reboot-setup.ps1 +++ b/scripts/post-reboot-setup.ps1 @@ -5,7 +5,7 @@ Write-Host "=== Likwid Post-Reboot Setup ===" -ForegroundColor Cyan # Step 1: Verify WSL2 is working Write-Host "`n[1/4] Checking WSL2 status..." -ForegroundColor Yellow -$wslStatus = wsl --status 2>&1 +wsl --status 2>&1 | Out-Null if ($LASTEXITCODE -ne 0) { Write-Host "WSL2 is not ready. Please ensure virtualization is enabled in BIOS." -ForegroundColor Red Write-Host "Run 'wsl --install --no-distribution' as administrator if needed." -ForegroundColor Red @@ -35,7 +35,7 @@ wsl --set-default openSUSE-Tumbleweed # Step 4: Configure Podman in WSL2 Write-Host "`n[4/4] Configuring Podman in openSUSE Tumbleweed..." -ForegroundColor Yellow wsl -d openSUSE-Tumbleweed -e bash -c " - echo 'Installing Podman and podman-compose...' + echo 'Installing Podman and compose support (use: podman compose)' sudo zypper refresh sudo zypper install -y podman podman-compose @@ -44,7 +44,7 @@ wsl -d openSUSE-Tumbleweed -e bash -c " echo 'Verifying installation...' podman --version - podman-compose --version + podman compose --help >/dev/null 2>&1 || true " Write-Host "`n=== Setup Complete ===" -ForegroundColor Cyan diff --git a/scripts/prepare-production.ps1 b/scripts/prepare-production.ps1 index f5c0da7..abeca77 100644 --- a/scripts/prepare-production.ps1 +++ b/scripts/prepare-production.ps1 @@ -28,4 +28,4 @@ if (Test-Path $demoMigration) { Write-Host "`n=== Production Preparation Complete ===" -ForegroundColor Green Write-Host "`nNext steps:" Write-Host " 1. Configure compose/.env.production" -Write-Host " 2. Run: podman-compose -f compose/production.yml up -d" +Write-Host " 2. Run: podman compose -f compose/production.yml up -d"