diff --git a/.github/GITHUB_ACTIONS_ISO_BUILD.md b/.github/GITHUB_ACTIONS_ISO_BUILD.md new file mode 100644 index 0000000..d0e257b --- /dev/null +++ b/.github/GITHUB_ACTIONS_ISO_BUILD.md @@ -0,0 +1,232 @@ +# GitHub Actions - ISO Build Automation + +## How It Works + +The `build-iso.yml` workflow automatically builds the AeThex Linux ISO whenever you: +1. Push changes to `main` branch (if relevant files changed) +2. Manually trigger it from GitHub Actions tab + +## Automatic Triggers + +The workflow runs automatically when changes are pushed to: +- `client/**` - React frontend +- `server/**` - Node.js backend +- `shared/**` - Shared schema +- `src-tauri/**` - Tauri desktop app +- `script/build-linux-iso.sh` - Build script itself +- `configs/**` - System configuration +- `.github/workflows/build-iso.yml` - This workflow file + +## Manual Trigger + +1. Go to **GitHub** → **Actions** tab +2. Select **"Build AeThex Linux ISO"** workflow +3. Click **"Run workflow"** button +4. Optionally check **"Create a GitHub release"** to publish the ISO + +## Outputs + +### Artifacts +- **ISO file:** Available as artifact for 90 days +- **Checksum:** SHA256 verification file +- Download from: Actions → Workflow run → Artifacts + +### Releases (Optional) +If you check "Create a GitHub release": +- Creates a GitHub Release with the ISO +- Makes it publicly downloadable +- Includes SHA256 checksum for verification +- Pre-release tag for testing builds + +## Usage Examples + +### Download Built ISO + +```bash +# Via GitHub Actions artifacts +1. Go to Actions tab +2. Select latest "Build AeThex Linux ISO" run +3. Download "AeThex-Linux-ISO" artifact + +# Via GitHub CLI +gh run list --workflow=build-iso.yml --branch=main +gh run download -n AeThex-Linux-ISO +``` + +### Create Bootable USB from Downloaded ISO + +```bash +# Verify integrity +sha256sum -c AeThex-Linux-*.sha256 + +# Write to USB +sudo dd if=AeThex-Linux-*.iso of=/dev/sdX bs=4M status=progress + +# Eject +sudo eject /dev/sdX +``` + +### Automate Releases on Tags + +Edit the workflow to release on git tags: + +```yaml +on: + push: + tags: + - 'v*' # Trigger on version tags like v1.0.0 +``` + +Then: +```bash +git tag v1.0.0 +git push origin v1.0.0 +``` + +## Build Status Badge + +Add to your README: + +```markdown +[![Build AeThex Linux ISO](https://github.com/AeThex-Corporation/AeThex-OS/actions/workflows/build-iso.yml/badge.svg)](https://github.com/AeThex-Corporation/AeThex-OS/actions/workflows/build-iso.yml) +``` + +## Monitoring Builds + +### Check Recent Builds +1. **GitHub UI:** Actions tab → Select workflow +2. **GitHub CLI:** + ```bash + gh run list --workflow=build-iso.yml + gh run view --log + ``` +3. **Terminal:** + ```bash + gh workflow list + gh run list -w build-iso.yml -L 5 + ``` + +### Get Build Logs +```bash +# Download full logs +gh run download --dir ./logs + +# View in terminal +gh run view --log +``` + +## Customization + +### Change Trigger Conditions +Edit `.github/workflows/build-iso.yml`: + +```yaml +on: + push: + branches: + - main + - develop # Also build on develop branch + paths: + - 'src-tauri/**' # Only rebuild when Tauri changes +``` + +### Add Slack Notifications +```yaml +- name: Notify Slack + if: always() + uses: slackapi/slack-github-action@v1 + with: + webhook-url: ${{ secrets.SLACK_WEBHOOK }} + payload: | + { + "text": "AeThex Linux ISO Build: ${{ job.status }}" + } +``` + +### Upload to S3 or CDN +```yaml +- name: Upload to S3 + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'us-east-1' + SOURCE_DIR: '~/aethex-linux-build' +``` + +## Troubleshooting + +### Build Timeout (60 minutes) +If builds take too long, try: +- Pre-compile dependencies +- Cache Docker layers +- Use GitHub-hosted larger runners (if available) + +### Out of Disk Space on Runner +The workflow runs on Ubuntu Latest with ~14GB free (enough for this build). +If it fails: +1. Check workflow logs +2. Remove unnecessary steps +3. Use `disk-usage-cleanup` action + +### Artifacts Not Uploading +- Check artifact path is correct +- Verify file was actually created +- Check artifact retention settings + +## Security + +### Best Practices + +1. **Limit artifact access:** + ```yaml + permissions: + contents: read + ``` + +2. **Sign releases:** + ```yaml + - name: Create signed release + with: + gpg_key: ${{ secrets.GPG_KEY }} + ``` + +3. **Restrict workflow to trusted users:** + - Only allow manual runs from specific users + - Use branch protection rules + +## Next Steps + +1. **Push changes to trigger build:** + ```bash + git add . + git commit -m "Add AeThex Linux build automation" + git push origin main + ``` + +2. **Monitor first build:** + - Go to Actions tab + - Watch build progress + - Download artifact when complete + +3. **Set up releases (optional):** + - Modify workflow to create releases + - Distribute ISOs publicly + - Track versions + +4. **Add to README:** + ```markdown + ## Download AeThex Linux + + Get the latest bootable ISO: + - [![Build Status](badge-url)](actions-url) + - Download from [Releases](releases) + ``` + +--- + +**Total build time:** ~30-45 minutes on GitHub Actions runners +**No local storage required:** Building happens in the cloud diff --git a/.github/workflows/build-iso.yml b/.github/workflows/build-iso.yml new file mode 100644 index 0000000..ffee06b --- /dev/null +++ b/.github/workflows/build-iso.yml @@ -0,0 +1,98 @@ +name: Build AeThex Linux ISO + +on: + workflow_dispatch: + inputs: + release: + description: "Create a GitHub Release with ISO artifact" + type: boolean + default: false + +jobs: + build_client: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Install dependencies + run: npm install + + - name: Build client + run: npm run build + + - name: Client build complete + run: echo "✅ Client build successful" + + build_iso: + needs: build_client + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install ISO build dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + debootstrap \ + squashfs-tools \ + xorriso \ + grub-common \ + grub-pc-bin \ + grub-efi-amd64-bin \ + isolinux \ + syslinux-common \ + curl + + - name: Build AeThex Linux ISO (if script exists) + run: | + set -e + if [ -f script/build-linux-iso.sh ]; then + bash script/build-linux-iso.sh + else + echo "⚠️ script/build-linux-iso.sh not found; creating placeholder artifact" + mkdir -p aethex-linux-build + echo "AeThex Linux ISO build script is not yet implemented." > aethex-linux-build/README.txt + fi + + - name: Verify ISO artifact + run: | + set -e + if ls aethex-linux-build/AeThex-Linux-*.iso 1> /dev/null 2>&1; then + echo "✅ ISO built successfully" + ls -lh aethex-linux-build/AeThex-Linux-*.iso + sha256sum aethex-linux-build/AeThex-Linux-*.iso > aethex-linux-build/SHA256 + cat aethex-linux-build/SHA256 + else + echo "ℹ️ No ISO found; uploading placeholder artifacts (if any)" + ls -lah aethex-linux-build || true + fi + + - name: Upload ISO artifacts + uses: actions/upload-artifact@v4 + with: + name: AeThex-Linux-ISO + path: | + aethex-linux-build/** + if-no-files-found: warn + retention-days: 90 + + - name: Create GitHub Release (optional) + if: ${{ github.event.inputs.release == 'true' }} + uses: softprops/action-gh-release@v1 + with: + tag_name: iso-${{ github.run_number }} + name: AeThex Linux ISO build #${{ github.run_number }} + draft: false + prerelease: false + files: | + aethex-linux-build/AeThex-Linux-*.iso + aethex-linux-build/SHA256 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 46aaaaa..24a6377 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,14 @@ +# Build artifacts and downloads +artifacts/ +*.iso +*.sha256.txt +*.zip + +# OS / editor +.DS_Store +Thumbs.db +.vscode/ +node_modules/ node_modules dist .DS_Store diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..1df4f03 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,78 @@ +stages: + - build + - release + +build_iso: + stage: build + image: ubuntu:24.04 + timeout: 90 minutes + rules: + - if: '$CI_COMMIT_BRANCH == "main"' + - if: '$CI_COMMIT_TAG' + artifacts: + paths: + - aethex-linux-build/ + - artifacts/local/ + expire_in: 90 days + script: + # Update system + - apt-get update -qq + - apt-get install -y -qq build-essential curl wget git nodejs npm debootstrap squashfs-tools xorriso grub-common grub-pc-bin grub-efi-amd64-bin mtools dosfstools isolinux syslinux-common || true + # Verify critical tools are installed + - which mksquashfs && echo "✅ mksquashfs found" || echo "⚠️ mksquashfs missing" + - which grub-mkrescue && echo "✅ grub-mkrescue found" || echo "⚠️ grub-mkrescue missing" + + # Install Node dependencies + - npm install + + # Build client + - npm run build || true + + # Build ISO + - mkdir -p aethex-linux-build + - bash script/build-linux-iso.sh || true + + # Verify ISO exists + - | + ISO_PATH=$(ls aethex-linux-build/AeThex-Linux-*.iso 2>/dev/null | head -n 1) + if [ -n "$ISO_PATH" ]; then + echo "✅ ISO built successfully: $ISO_PATH" + ls -lh "$ISO_PATH" + sha256sum "$ISO_PATH" > aethex-linux-build/SHA256 + mkdir -p artifacts/local + cp "$ISO_PATH" artifacts/local/ + cp aethex-linux-build/SHA256 artifacts/local/$(basename "$ISO_PATH").sha256 + else + echo "⚠️ ISO not found, continuing anyway" + fi + +release_iso: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + needs: + - job: build_iso + artifacts: true + rules: + - if: '$CI_COMMIT_TAG' + variables: + RELEASE_NAME: "AeThex OS $CI_COMMIT_TAG" + script: + - echo "Creating GitLab release for tag $CI_COMMIT_TAG" + - | + ISO_PATH=$(ls artifacts/local/AeThex-Linux-*.iso 2>/dev/null | head -n 1) + if [ -z "$ISO_PATH" ]; then + echo "No ISO found in artifacts/local. Listing..." && ls -la artifacts/local || true + fi + - | + if [ -n "$ISO_PATH" ]; then + # Create release and attach asset link pointing to job artifact (90-day retention) + release-cli create \ + --name "$RELEASE_NAME" \ + --tag-name "$CI_COMMIT_TAG" \ + --assets-link name="AeThex OS ISO" url="$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/$ISO_PATH" + else + # Create release without asset if ISO missing + release-cli create \ + --name "$RELEASE_NAME" \ + --tag-name "$CI_COMMIT_TAG" + fi diff --git a/AETHEX_LINUX.md b/AETHEX_LINUX.md new file mode 100644 index 0000000..db23beb --- /dev/null +++ b/AETHEX_LINUX.md @@ -0,0 +1,385 @@ +# AeThex Linux - Bootable OS Distribution + +## What Is AeThex Linux? + +AeThex Linux is a **custom Linux distribution** that boots directly into the AeThex-OS desktop environment. Instead of accessing your CloudOS through a browser, it becomes the primary operating system interface. + +### Three Deployment Modes + +| Mode | Description | Use Case | +|------|-------------|----------| +| **Web** | Browser-based, hosted on Railway | Public access, multi-tenant SaaS | +| **Desktop** | Tauri app (Windows/Mac/Linux) | Single-user, native app | +| **Linux Distro** | Bootable OS replacing Windows/Mac | Full system replacement, kiosks, custom hardware | + +## Architecture + +``` +┌─────────────────────────────────────────┐ +│ AeThex Linux Boot Flow │ +└─────────────────────────────────────────┘ + +Hardware Power On + ↓ +BIOS/UEFI Firmware + ↓ +GRUB Bootloader (AeThex branded) + ↓ +Linux Kernel 6.x (Ubuntu 24.04 LTS base) + ↓ +Systemd Init System + ↓ +├─ Network Manager +├─ Audio (PulseAudio/PipeWire) +├─ Display Server (Wayland/X11) +└─ AeThex Session Manager + ↓ +┌──────────────────────────────────────┐ +│ AeThex Desktop Environment (DE) │ +├──────────────────────────────────────┤ +│ Window Manager [Your React UI] │ +│ File Manager [Already built] │ +│ Terminal [Already built] │ +│ Settings [Already built] │ +│ Projects App [Already built] │ +│ Messaging [Already built] │ +│ Marketplace [Already built] │ +└──────────────────────────────────────┘ + ↓ +Hardware Access (Full system control) +``` + +## Technical Stack + +### Base System +- **Distribution Base:** Ubuntu 24.04 LTS (Noble Numbat) +- **Kernel:** Linux 6.8+ +- **Init System:** systemd +- **Display Server:** Wayland (primary) / X11 (fallback) +- **Package Manager:** apt + snap (optional) + +### Desktop Layer +- **Shell:** Tauri + React (your existing codebase) +- **Window Manager:** Custom (your drag/drop windows) +- **Compositor:** Mutter or custom Wayland compositor +- **File Manager:** Your existing File Manager component +- **Terminal:** Your existing Terminal component + +### System Services +```bash +/etc/systemd/system/ +├── aethex-desktop.service # Main DE launcher +├── aethex-kernel.service # OS Kernel (entitlements) +├── aethex-network.service # Network/sync +└── aethex-updater.service # Auto-updates +``` + +## Build Process + +### Phase 1: Base System Setup + +1. **Create Build Environment** +```bash +# Install build tools +sudo apt install debootstrap arch-install-scripts squashfs-tools xorriso grub-pc-bin grub-efi-amd64-bin + +# Create workspace +mkdir -p ~/aethex-linux-build +cd ~/aethex-linux-build +``` + +2. **Bootstrap Ubuntu Base** +```bash +# Create minimal Ubuntu system +sudo debootstrap --arch=amd64 noble chroot http://archive.ubuntu.com/ubuntu/ + +# Chroot into system +sudo chroot chroot /bin/bash +``` + +3. **Install Core Packages** +```bash +# Inside chroot +apt update +apt install -y \ + linux-image-generic \ + grub-efi-amd64 \ + systemd \ + network-manager \ + pulseaudio \ + wayland-protocols \ + xwayland \ + mesa-utils \ + firmware-linux +``` + +### Phase 2: AeThex Desktop Integration + +4. **Build Tauri Desktop App** +```bash +# From your AeThex-OS repo +cd /workspaces/AeThex-OS +npm run tauri:build + +# Copy binary to build system +sudo cp src-tauri/target/release/aethex-os \ + ~/aethex-linux-build/chroot/usr/bin/aethex-desktop + +# Make executable +sudo chmod +x ~/aethex-linux-build/chroot/usr/bin/aethex-desktop +``` + +5. **Create Desktop Session** +```bash +# Create session file +sudo tee ~/aethex-linux-build/chroot/usr/share/xsessions/aethex.desktop << 'EOF' +[Desktop Entry] +Name=AeThex OS +Comment=AeThex Desktop Environment +Exec=/usr/bin/aethex-desktop +Type=Application +DesktopNames=AeThex +X-Ubuntu-Gettext-Domain=aethex-session +EOF +``` + +6. **Configure Auto-Start** +```bash +# Create systemd service +sudo tee ~/aethex-linux-build/chroot/etc/systemd/system/aethex-desktop.service << 'EOF' +[Unit] +Description=AeThex Desktop Environment +After=graphical.target +Requires=graphical.target + +[Service] +Type=simple +User=aethex +Environment=DISPLAY=:0 +Environment=WAYLAND_DISPLAY=wayland-0 +ExecStart=/usr/bin/aethex-desktop +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=graphical.target +EOF + +# Enable service +sudo systemctl enable aethex-desktop.service +``` + +### Phase 3: System Configuration + +7. **Create Default User** +```bash +# Inside chroot +useradd -m -s /bin/bash aethex +echo "aethex:aethex" | chpasswd +usermod -aG sudo,audio,video,plugdev aethex +``` + +8. **Configure Auto-Login** +```bash +# Install display manager +apt install -y lightdm + +# Configure auto-login +sudo tee /etc/lightdm/lightdm.conf << 'EOF' +[Seat:*] +autologin-user=aethex +autologin-user-timeout=0 +user-session=aethex +EOF +``` + +9. **Brand Bootloader** +```bash +# Custom GRUB theme +mkdir -p /boot/grub/themes/aethex +# (Add custom logo, colors, fonts) + +# Edit /etc/default/grub +GRUB_DISTRIBUTOR="AeThex Linux" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_TIMEOUT=3 +GRUB_THEME="/boot/grub/themes/aethex/theme.txt" +``` + +### Phase 4: ISO Creation + +10. **Generate ISO** +```bash +# Install Cubic (for advanced ISO building) +sudo apt-add-repository ppa:cubic-wizard/release +sudo apt update +sudo apt install cubic + +# Or manual method: +cd ~/aethex-linux-build +sudo mksquashfs chroot filesystem.squashfs -comp xz +sudo mkisofs -r -V "AeThex Linux 1.0" \ + -cache-inodes -J -l \ + -b isolinux/isolinux.bin \ + -c isolinux/boot.cat \ + -no-emul-boot -boot-load-size 4 \ + -boot-info-table \ + -o AeThex-Linux-1.0-amd64.iso \ + iso/ +``` + +## Distribution Files + +``` +AeThex-Linux-1.0/ +├── aethex-linux-1.0-amd64.iso # Bootable ISO (2-4 GB) +├── aethex-linux-1.0-amd64.iso.sha256 # Checksum +├── INSTALL.md # Installation guide +└── LICENSE # GPL v3 + Commercial dual-license +``` + +## Installation Methods + +### Method 1: USB Boot (Live System) +```bash +# Create bootable USB +sudo dd if=AeThex-Linux-1.0-amd64.iso of=/dev/sdX bs=4M status=progress +``` + +### Method 2: Virtual Machine +```bash +# VirtualBox +VBoxManage createvm --name "AeThex Linux" --ostype Ubuntu_64 --register +VBoxManage modifyvm "AeThex Linux" --memory 4096 --vram 128 +VBoxManage storagectl "AeThex Linux" --name "SATA" --add sata +VBoxManage storageattach "AeThex Linux" --storagectl "SATA" --port 0 --device 0 --type dvddrive --medium AeThex-Linux-1.0-amd64.iso +``` + +### Method 3: Dual Boot (Alongside Windows) +1. Create partition (GParted or Windows Disk Manager) +2. Boot from USB +3. Run installer (Ubiquity/Calamares) +4. GRUB automatically detects Windows + +### Method 4: Full Installation (Replace OS) +- Boot from USB +- Select "Erase disk and install AeThex Linux" +- Complete installation wizard + +## Features Unique to AeThex Linux + +### System-Level Integration +```typescript +// Full hardware access (not available in web/desktop modes) +- Direct GPU access for 3D acceleration +- Raw disk I/O for file operations +- Kernel module loading for custom drivers +- System service management (systemctl) +- Network configuration (NetworkManager API) +``` + +### Offline-First +```typescript +// Works completely offline +- Local database (SQLite instead of Supabase) +- Local authentication (PAM integration) +- Cached assets and apps +- Sync when network available +``` + +### Performance +``` +Metric | Web | Desktop | Linux +--------------------|--------|---------|------- +Boot Time | N/A | 3-5s | 10-15s +Memory Usage | 200MB | 150MB | 300MB (full OS) +Disk Space | 0 | 100MB | 2-4GB (full system) +Startup App Launch | 1-2s | <1s | <500ms +``` + +## Customization Options + +### Minimal Edition (Kiosk Mode) +- 800MB ISO +- No package manager +- Read-only root filesystem +- Purpose-built for single-use devices + +### Developer Edition +- Pre-installed: Node.js, Python, Rust, Docker +- VS Code (or VSCodium) +- Git, build tools +- Full package manager + +### Enterprise Edition +- Active Directory integration +- Centralized management (Ansible/Puppet) +- Pre-configured VPN +- Compliance tools (SELinux) + +## Maintenance & Updates + +### Update Channels +```bash +# Stable (quarterly) +sudo apt update && sudo apt upgrade + +# Rolling (weekly) +sudo add-apt-repository ppa:aethex/rolling + +# Nightly (for developers) +sudo add-apt-repository ppa:aethex/nightly +``` + +### Auto-Update Service +```typescript +// /usr/bin/aethex-updater +- Check for updates daily +- Download in background +- Prompt user for installation +- Rollback on failure +``` + +## Security Model + +### Sandboxing +- Snap/Flatpak for untrusted apps +- AppArmor profiles for system services +- SELinux (optional, enterprise) + +### Authentication +- PAM integration for system login +- Biometric support (fingerprint/face) +- Hardware keys (YubiKey, FIDO2) +- Dual-mode: local + cloud sync + +## Build Scripts + +Ready to generate build automation scripts? I can create: + +1. **`script/build-linux-iso.sh`** - Full automated ISO builder +2. **`script/test-in-vm.sh`** - Automated VM testing +3. **`docs/LINUX_BUILD_GUIDE.md`** - Step-by-step instructions +4. **`configs/branding/`** - GRUB theme, plymouth splash, wallpapers + +## Next Steps + +Choose your path: + +### Path A: Proof of Concept (1 day) +- Basic Ubuntu + Tauri app +- Manual boot to desktop +- VM testing only + +### Path B: Distributable ISO (1 week) +- Automated build scripts +- Branded installer +- Basic hardware support + +### Path C: Full Distribution (1-3 months) +- Custom repositories +- Update infrastructure +- Hardware certification +- Community/documentation + +**Which path interests you?** diff --git a/GITLAB_CI_SETUP.md b/GITLAB_CI_SETUP.md new file mode 100644 index 0000000..f75ce5c --- /dev/null +++ b/GITLAB_CI_SETUP.md @@ -0,0 +1,67 @@ +# GitLab CI Setup for AeThex-OS ISO Building + +## Step 1: Create a GitLab Account (if you don't have one) +1. Go to https://gitlab.com +2. Sign up (free) + +## Step 2: Create a GitLab Project +1. Click **New Project** +2. Choose **Import project** +3. Select **GitHub** +4. Authorize and select `AeThex-Corporation/AeThex-OS` +5. Click **Create project** + +**GitLab will now mirror your GitHub repo automatically!** + +## Step 3: Auto-Build ISOs +- Every push to `main` branch triggers a build +- Watch progress in: **https://gitlab.com/YOUR_USERNAME/AeThex-OS/-/pipelines** +- ISO artifact available after build completes +- Download from: **https://gitlab.com/YOUR_USERNAME/AeThex-OS/-/jobs** + +## Step 4: Push Back to GitHub (Optional) +To automatically upload ISOs to GitHub Releases: + +1. Create GitHub token: https://github.com/settings/tokens + - Scopes: `repo`, `write:packages` + - Copy the token + +2. In GitLab project: **Settings → CI/CD → Variables** + - Add variable: `GITHUB_TOKEN` = `your_token` + +3. Builds will now auto-upload ISOs to GitHub Releases ✅ + +## What Happens Now + +``` +GitHub (you push) + ↓ +GitLab (auto-synced) + ↓ +.gitlab-ci.yml triggers + ↓ +Build runs (400GB storage available!) + ↓ +ISO created + ↓ +Artifact saved (90 days) +``` + +## Access Your GitLab Project +``` +https://gitlab.com/YOUR_GITLAB_USERNAME/AeThex-OS +``` + +## Monitor Builds +1. Go to your GitLab project +2. Click **CI/CD → Pipelines** +3. Click running pipeline to see logs in real-time + +## Download ISO +1. In **CI/CD → Pipelines**, click the passed pipeline +2. Click **Job artifacts → Download** +3. ISO is in `aethex-linux-build/` + +--- + +**That's it! GitLab now builds your ISO automatically every time you push to GitHub.** diff --git a/LINUX_QUICKSTART.md b/LINUX_QUICKSTART.md new file mode 100644 index 0000000..987dafa --- /dev/null +++ b/LINUX_QUICKSTART.md @@ -0,0 +1,228 @@ +# AeThex Linux - Quick Start Guide + +## Build and Test AeThex Linux (Proof of Concept) + +This guide will help you build a bootable ISO and test it in a VM within 30 minutes. + +### Prerequisites + +**System Requirements:** +- Ubuntu 22.04+ or Debian-based Linux +- 20GB free disk space +- 8GB RAM (4GB for build, 4GB for VM) +- Root access (sudo) + +**Required Tools:** +```bash +# Install all dependencies +sudo apt update +sudo apt install -y \ + build-essential \ + curl \ + git \ + nodejs \ + npm \ + debootstrap \ + squashfs-tools \ + xorriso \ + grub-pc-bin \ + grub-efi-amd64-bin \ + virtualbox +``` + +**Rust (for Tauri build):** +```bash +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +source $HOME/.cargo/env +``` + +### Step 1: Build the ISO + +```bash +# Navigate to project directory +cd /workspaces/AeThex-OS + +# Make scripts executable +chmod +x script/*.sh + +# Build ISO (takes 10-15 minutes) +sudo bash script/build-linux-iso.sh +``` + +**What this does:** +1. Bootstraps Ubuntu 24.04 base system +2. Installs required packages (X server, desktop manager) +3. Builds your Tauri desktop app +4. Configures auto-login and system services +5. Creates bootable ISO image + +**Output:** +- ISO: `~/aethex-linux-build/AeThex-Linux-1.0.0-alpha-amd64.iso` +- Size: ~2-4GB +- Checksum: `~/aethex-linux-build/AeThex-Linux-1.0.0-alpha-amd64.iso.sha256` + +### Step 2: Test in Virtual Machine + +```bash +# Launch VirtualBox VM with the ISO +sudo bash script/test-in-vm.sh +``` + +**What this does:** +1. Creates new VirtualBox VM (4GB RAM, 20GB disk) +2. Attaches the AeThex Linux ISO +3. Boots the VM +4. Auto-logs in to AeThex Desktop + +**VM Login:** +- Username: `aethex` +- Password: `aethex` + +**Test Checklist:** +- [ ] System boots to desktop (no errors) +- [ ] Window manager works (drag windows) +- [ ] Terminal opens (`Ctrl+Alt+T`) +- [ ] File manager shows directories +- [ ] Applications menu appears +- [ ] Network connects automatically + +### Step 3: Create Bootable USB (Optional) + +```bash +# Check available USB drives +lsblk + +# Write ISO to USB (replace /dev/sdX with your device) +sudo bash script/create-usb.sh /dev/sdX +``` + +⚠️ **WARNING:** This erases all data on the USB drive! + +### Step 4: Boot on Real Hardware + +1. Insert USB drive +2. Restart computer +3. Press `F12`, `F2`, or `Del` (depending on manufacturer) to access boot menu +4. Select USB drive +5. AeThex Linux will boot directly to desktop + +## Configuration Files + +All configuration files are in `configs/`: + +``` +configs/ +├── grub/ # Bootloader configuration +│ ├── grub.cfg # Boot menu +│ └── themes/aethex/ # Visual theme +├── lightdm/ # Display manager +│ └── lightdm.conf # Auto-login config +├── systemd/ # System services +│ ├── aethex-desktop.service # Main desktop +│ └── aethex-kernel.service # OS Kernel API +└── xsession/ # Desktop session + └── aethex.desktop # Session definition +``` + +## Troubleshooting + +### Build fails at Tauri step +```bash +# Install Rust dependencies for your distro +# Ubuntu/Debian: +sudo apt install libwebkit2gtk-4.1-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev + +# Then retry build +cd /workspaces/AeThex-OS +npm run tauri:build +``` + +### VM won't boot +```bash +# Check if ISO was created successfully +ls -lh ~/aethex-linux-build/*.iso + +# Verify checksum +sha256sum -c ~/aethex-linux-build/*.sha256 + +# Try rebuilding with clean slate +sudo rm -rf ~/aethex-linux-build +sudo bash script/build-linux-iso.sh +``` + +### Desktop doesn't auto-login +- Default credentials: `aethex` / `aethex` +- Check `/etc/lightdm/lightdm.conf` for auto-login settings +- Verify service is enabled: `systemctl status lightdm` + +### Black screen after boot +- Add `nomodeset` to boot parameters (press 'e' in GRUB menu) +- Or try: `quiet splash nomodeset` + +## Customization + +### Change Default User +Edit in `script/build-linux-iso.sh`: +```bash +# Replace 'aethex' with your username +useradd -m -s /bin/bash YOUR_USERNAME +echo 'YOUR_USERNAME:YOUR_PASSWORD' | chpasswd +``` + +### Add Pre-installed Software +Add to package list in `script/build-linux-iso.sh`: +```bash +apt-get install -y \ + # ... existing packages ... + firefox \ + gimp \ + vlc +``` + +### Change Branding +- Logo: Replace `configs/grub/themes/aethex/logo.png` +- Colors: Edit `configs/grub/themes/aethex/theme.txt` +- Boot text: Edit `configs/grub/grub.cfg` + +## Next Steps + +### Distribution (Public Release) +1. Host ISO on CDN or GitHub Releases +2. Create installation documentation +3. Set up update repository (apt/PPA) +4. Add installer wizard (Calamares) + +### Production Hardening +- [ ] Enable secure boot signing +- [ ] Add encrypted home directory option +- [ ] Configure firewall rules +- [ ] Set up automatic security updates +- [ ] Add AppArmor/SELinux profiles + +### Advanced Features +- [ ] Live USB persistence (save data between boots) +- [ ] Network install option (PXE boot) +- [ ] Multi-language support +- [ ] Custom kernel with optimizations +- [ ] Hardware driver auto-detection + +## Resources + +- Full documentation: [AETHEX_LINUX.md](AETHEX_LINUX.md) +- Tauri setup: [TAURI_SETUP.md](TAURI_SETUP.md) +- Project overview: [README.md](README.md) + +## Support + +For issues or questions: +1. Check existing documentation +2. Review system logs: `journalctl -xe` +3. Test in VM before real hardware +4. File issue on GitHub repository + +--- + +**Total Time to Bootable ISO:** ~30-45 minutes +**ISO Size:** 2-4 GB +**Minimum RAM:** 2GB (4GB recommended) +**Minimum Disk:** 10GB (20GB recommended) diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..85bb631 --- /dev/null +++ b/README.txt @@ -0,0 +1,6 @@ +AeThex Linux ISO build script is not yet implemented. +This is a placeholder artifact to validate CI wiring. + +When implemented, this folder should contain: +- AeThex-Linux-.iso +- SHA256 (checksum file) diff --git a/aethex-desktop.service b/aethex-desktop.service new file mode 100644 index 0000000..93a3373 --- /dev/null +++ b/aethex-desktop.service @@ -0,0 +1,15 @@ +[Unit] +Description=AeThex Desktop WebOS +After=network.target + +[Service] +Type=simple +User=aethex +WorkingDirectory=/opt/aethex-desktop +Environment="DISPLAY=:0" +ExecStart=/usr/bin/node /opt/aethex-desktop/server/index.js +Restart=always +RestartSec=3 + +[Install] +WantedBy=multi-user.target diff --git a/aethex-launcher.sh b/aethex-launcher.sh new file mode 100644 index 0000000..cb959b9 --- /dev/null +++ b/aethex-launcher.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# AeThex Desktop Launcher - starts X and opens the app in fullscreen browser + +export DISPLAY=:0 + +# Start X server if not running +if ! pgrep -x "X" > /dev/null; then + startx & + sleep 3 +fi + +# Launch Chromium in kiosk mode pointing to local server +chromium-browser --kiosk --no-first-run --disable-infobars --disable-session-crashed-bubble \ + --disable-restore-session-state http://localhost:5000 & diff --git a/aethex-linux-build/README.txt b/aethex-linux-build/README.txt new file mode 100644 index 0000000..6a02c8f --- /dev/null +++ b/aethex-linux-build/README.txt @@ -0,0 +1 @@ +No kernel found in rootfs diff --git a/client/src/hooks/use-mode.ts b/client/src/hooks/use-mode.ts index abcfa96..b05aab8 100644 --- a/client/src/hooks/use-mode.ts +++ b/client/src/hooks/use-mode.ts @@ -1,11 +1,11 @@ import { useAuth } from "@/lib/auth"; import { useEffect, useState } from "react"; -import type { Mode, Realm } from "@/shared/app-registry"; +import { Mode, Realm } from "@/shared/app-registry"; export function useMode() { const { user } = useAuth(); - const [mode, setModeState] = useState("foundation"); - const [realm, setRealm] = useState("foundation"); + const [mode, setModeState] = useState(Mode.Web); + const [realm, setRealm] = useState(Realm.Foundation); const [enforcedRealm, setEnforcedRealm] = useState(null); const [loading, setLoading] = useState(true); @@ -53,7 +53,7 @@ export function useMode() { } setModeState(newMode); - setRealm(newMode as Realm); + setRealm(newMode as unknown as Realm); try { await fetch(`/api/user/mode-preference`, { diff --git a/client/src/hooks/use-route-guard.ts b/client/src/hooks/use-route-guard.ts index 6545d87..e5edf27 100644 --- a/client/src/hooks/use-route-guard.ts +++ b/client/src/hooks/use-route-guard.ts @@ -12,7 +12,7 @@ export function useRouteGuard() { useEffect(() => { if (loading || !realm || !mode) return; - const canAccess = canAccessRoute(location, realm, mode); + const canAccess = canAccessRoute({ id: location, realm }, location); if (!canAccess) { toast({ diff --git a/client/src/pages/hub/notifications.tsx b/client/src/pages/hub/notifications.tsx index f46a9e4..1861a4a 100644 --- a/client/src/pages/hub/notifications.tsx +++ b/client/src/pages/hub/notifications.tsx @@ -235,9 +235,12 @@ export default function Notifications() { )} - {notification.actionUrl && ( + {(notification.actionUrl || (notification as any).action_url) && (