# airgapper **Repository Path**: mirrors_mattermost/airgapper ## Basic Information - **Project Name**: airgapper - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-05-23 - **Last Updated**: 2026-03-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Mattermost Air-Gapper A tool for creating air-gapped installation media for Mattermost Server. ## Overview Mattermost Air-Gapper is a utility that helps prepare installation media (ISO or USB drive) for deploying Mattermost in air-gapped environments without internet access. It downloads all necessary components and packages them in a format that can be transported to and used in isolated environments. ## Features - Downloads Mattermost Enterprise Edition binaries - Fetches required Docker images (PostgreSQL, MinIO, NGINX) - Downloads needed snap packages (Docker) - Bundles configuration files and installation scripts - Creates an ISO image that can be burned to DVD or written to USB ## Prerequisites ### For creating the installation media - Linux system with internet access - Go 1.20 or higher installed - Docker installed and running - At least 2GB of free disk space ### For the target air-gapped server - Ubuntu 22.04 LTS (recommended) - At least 4GB RAM (8GB recommended) - At least 50GB of available disk space - No internet connection required ## Installation 1. Clone the repository: ``` git clone https://github.com/jespino/airgapper.git cd airgapper ``` 2. Build the application: ``` go build -o airgapper ``` ## Creating Installation Media ### Step 1: Download all required components First, run the following commands to fetch all necessary components: ``` # Download the latest Mattermost Enterprise Edition binary ./airgapper fetch-mattermost-binary # Download Docker images ./airgapper fetch-docker-images # Download the Docker snap package ./airgapper fetch-snap-packages # Copy configuration files and installation scripts ./airgapper copy-static-files ``` Optional parameters: - Use `--esr` with `fetch-mattermost-binary` to get the Extended Support Release - Use `--images` with `fetch-docker-images` to specify which images to download - Use `--tag` with `fetch-docker-images` to specify image versions ### Step 2: Create an ISO image To create an ISO image containing all downloaded files, run: ``` ./airgapper create-iso ``` This will create a file named `mattermost-airgap.iso` in the current directory. If you need to overwrite an existing ISO file, use the `-f` flag: ``` ./airgapper create-iso -f ``` ### Step 3: Write to USB drive (alternative to ISO) Alternatively, you can copy the contents of the `device` directory to a USB drive: ``` # Replace /dev/sdX with your actual USB device sudo mkfs.ext4 /dev/sdX sudo mount /dev/sdX /mnt sudo cp -r device/* /mnt/ sudo umount /mnt ``` ## Using the Installation Media ### Option 1: Using the ISO file 1. Burn the ISO file to a DVD or use a tool like Ventoy to create bootable USB 2. Mount the media on the target air-gapped server: ``` sudo mkdir -p /mnt/mattermost sudo mount -o loop mattermost-airgap.iso /mnt/mattermost ``` 3. Copy all files to a directory on the server: ``` sudo mkdir -p /tmp/mattermost-install sudo cp -r /mnt/mattermost/* /tmp/mattermost-install/ cd /tmp/mattermost-install ``` ### Option 2: Using a USB drive 1. Insert the USB drive into the air-gapped server 2. Mount the drive: ``` sudo mkdir -p /mnt/usb sudo mount /dev/sdX /mnt/usb # Replace /dev/sdX with the actual device ``` 3. Copy all files to a directory on the server: ``` sudo mkdir -p /tmp/mattermost-install sudo cp -r /mnt/usb/* /tmp/mattermost-install/ cd /tmp/mattermost-install ``` ### Installing Mattermost Once you have copied the files, you can run the included installation script: ``` sudo bash script.sh ``` This script will: 1. Install the Docker packages 2. Load the Docker images 3. Configure the necessary directories and permissions 4. Extract and set up Mattermost 5. Configure the NGINX web server 6. Create and start all required services After installation, you'll need to: 1. Adjust the `/opt/mattermost/config/config.json` file with your specific settings 2. Start the Mattermost service: `sudo systemctl start mattermost` 3. Access Mattermost through your browser at `http://SERVER_IP` or `https://SERVER_IP` if SSL is configured ## Manual Installation Steps If you prefer not to use the script, you can follow these steps manually: 1. Install Docker packages: ``` sudo dpkg -i jammy/*.deb ``` 2. Load the Docker images: ``` sudo docker load -i docker-images/postgres-latest.tar sudo docker load -i docker-images/minio-latest.tar sudo docker load -i docker-images/nginx-latest.tar sudo docker tag postgres:13 sudo docker tag minio/minio:latest sudo docker tag nginx:latest ``` 3. Prepare directories: ``` sudo mkdir -p /opt/mattermost-nginx/config sudo mkdir -p /opt/mattermost-nginx/ssl sudo mkdir -p /opt/mattermost-minio sudo mkdir -p /opt/mattermost-postgres ``` 4. Copy configuration files: ``` sudo cp config/nginx.conf /opt/mattermost-nginx/config/default.conf ``` 5. Start Docker containers: ``` sudo docker run --restart always -d --name mattermost-postgres \ -v /opt/mattermost-postgres:/var/lib/postgresql/data \ -p 5432:5432 \ -e POSTGRES_USER=mmuser \ -e POSTGRES_PASSWORD=Password123! \ -e POSTGRES_DB=mattermost \ postgres:13 sudo docker run --restart always -d --name mattermost-minio \ -v /opt/mattermost-minio:/data \ -p 9000:9000 \ -e "MINIO_ACCESS_KEY=minioaccesskey" \ -e "MINIO_SECRET_KEY=miniosecretkey" \ minio/minio:latest server /data sudo docker run --restart always -d --name mattermost-nginx \ -v /opt/mattermost-nginx/config:/etc/nginx/conf.d \ -v /opt/mattermost-nginx/ssl:/etc/nginx/ssl \ --network host \ -p 80:80 -p 443:443 \ nginx:latest ``` 6. Setup Mattermost: ``` sudo useradd --system --user-group mattermost sudo tar -xzf mattermost/mattermost-*.tgz -C /opt sudo mkdir -p /opt/mattermost/data sudo chown -R mattermost:mattermost /opt/mattermost sudo cp config/mattermost.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable mattermost ``` 7. Update Mattermost configuration in `/opt/mattermost/config/config.json` with proper database and storage settings 8. Start Mattermost: ``` sudo systemctl start mattermost ``` ## Troubleshooting If you encounter issues during installation or operation: 1. Check Docker container status: ``` sudo docker ps -a ``` 2. View Docker container logs: ``` sudo docker logs mattermost-postgres sudo docker logs mattermost-minio sudo docker logs mattermost-nginx ``` 3. Check Mattermost logs: ``` sudo journalctl -u mattermost ``` 4. Verify file permissions: ``` sudo ls -la /opt/mattermost ``` ## License This project is licensed under the MIT License - see the LICENSE file for details.