{"id":34837023,"url":"https://github.com/modelingevolution/autoupdater","last_synced_at":"2026-05-21T13:02:33.336Z","repository":{"id":303278723,"uuid":"1014909748","full_name":"modelingevolution/autoupdater","owner":"modelingevolution","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-27T08:19:20.000Z","size":427,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-29T14:42:11.544Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/modelingevolution.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-06T16:38:48.000Z","updated_at":"2025-11-27T08:19:24.000Z","dependencies_parsed_at":"2025-07-06T19:36:26.705Z","dependency_job_id":"4c0f3e56-0b02-4d4a-8084-74f28b1a67fa","html_url":"https://github.com/modelingevolution/autoupdater","commit_stats":null,"previous_names":["modelingevolution/autoupdater"],"tags_count":61,"template":false,"template_full_name":null,"purl":"pkg:github/modelingevolution/autoupdater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modelingevolution%2Fautoupdater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modelingevolution%2Fautoupdater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modelingevolution%2Fautoupdater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modelingevolution%2Fautoupdater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modelingevolution","download_url":"https://codeload.github.com/modelingevolution/autoupdater/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modelingevolution%2Fautoupdater/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28032370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-25T16:06:47.749Z","updated_at":"2025-12-25T16:08:18.039Z","avatar_url":"https://github.com/modelingevolution.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ModelingEvolution.AutoUpdater\n\n[![CI](https://github.com/modelingevolution/autoupdater/actions/workflows/ci.yml/badge.svg)](https://github.com/modelingevolution/autoupdater/actions/workflows/ci.yml)\n[![Docker](https://github.com/modelingevolution/autoupdater/actions/workflows/docker.yml/badge.svg)](https://github.com/modelingevolution/autoupdater/actions/workflows/docker.yml)\n[![Test Results](https://github.com/modelingevolution/autoupdater/actions/workflows/test-results.yml/badge.svg)](https://github.com/modelingevolution/autoupdater/actions/workflows/test-results.yml)\n[![Docker Hub](https://img.shields.io/docker/v/modelingevolution/autoupdater?label=Docker%20Hub)](https://hub.docker.com/r/modelingevolution/autoupdater)\n\nA Docker-based auto-updater for containerized applications with Git-based version management and SSH deployment.\n\n## Production Deployment\n\n```bash\nwget https://raw.githubusercontent.com/modelingevolution/autoupdater-compose/main/installation.sh\nsudo ./installation.sh rocket-welder https://github.com/modelingevolution/rocketwelder-compose.git POC-400\n```\n\nSee [autoupdater-compose](https://github.com/modelingevolution/autoupdater-compose) for production setup.\n\n## 📊 Test Results and Coverage\n\nView the latest test results and coverage reports at: [https://modelingevolution.github.io/autoupdater/](https://modelingevolution.github.io/autoupdater/)\n\n## Features\n\n- **Git-based Configuration Management**: Track deployment versions using Git tags\n- **Docker Integration**: Seamless integration with Docker and Docker Compose\n- **SSH Remote Updates**: Execute updates on remote systems via SSH\n- **Version Management**: Automatic version detection and upgrade availability checking\n- **Flexible Authentication**: Support for Docker registry authentication\n- **Blazor UI**: Web-based management interface for monitoring and controlling updates\n- **Runtime Configuration**: Edit Docker authentication and other settings through the web interface\n- **Version Tracking**: Assembly version information with git commit hash displayed in the web interface\n- **Background Services**: Hosted services for continuous monitoring and updating\n\n## 🚀 Quick Start (Empty Project)\n\n### Method 1: Using the Startup Script (Recommended)\n```bash\n# Clone the repository\ngit clone https://github.com/modelingevolution/autoupdater.git\ncd autoupdater\n\n# Run the startup script (automatically sets up everything)\n./start.sh\n```\n\n### Method 2: Manual Docker Compose\n```bash\n# Set required environment variable\nexport SSH_USER=deploy\n\n# Create minimal configuration\ncp appsettings.example.json appsettings.json\n\n# Start the services\ndocker-compose up --build\n```\n\n### Method 3: Using .env File\n```bash\n# Copy example environment file\ncp .env.example .env\n\n# Edit .env file with your settings\nnano .env\n\n# Start the services\ndocker-compose up --build\n```\n\n**🎉 The AutoUpdater will be available at: http://localhost:8080**\n\n## Installation\n\n### Docker Image\n```bash\ndocker pull modelingevolution/autoupdater:latest\n```\n\n## Configuration\n\n### Docker Compose\n\n```yaml\nversion: '3.8'\nservices:\n  autoupdater:\n    image: modelingevolution/autoupdater:latest\n    ports:\n      - \"8080:8080\"\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock\n      - ./data:/data\n      - ./appsettings.json:/app/appsettings.json:ro  # Configuration mapping\n      - /var/docker/data/autoupdater/appsettings.runtime.json:/app/appsettings.runtime.json  # Runtime configuration\n    environment:\n      - SshUser=deploy\n      - SshAuthMethod=PrivateKey\n      - SshKeyPath=/data/ssh/id_rsa\n```\n\n### Configuration\n\nThe AutoUpdater configuration is mapped through Docker Compose. Create an `appsettings.json` file in the root directory (not in the data folder).\n\n### Runtime Configuration\n\nThe AutoUpdater supports runtime configuration changes through the web interface. Settings like Docker authentication can be modified per package and are stored in `appsettings.runtime.json`. This file should be mapped to a persistent volume to survive container restarts.\n\n#### Docker Authentication Management\n\nDocker authentication can be configured and edited through the web interface:\n\n1. **Access the Packages page** in the AutoUpdater web interface\n2. **Click the \"Edit Auth\" button** for any package to open the authentication dialog\n3. **Enter Docker authentication** in the format `username:password` (will be automatically base64-encoded)\n4. **Save changes** to update the runtime configuration immediately\n5. **Reset to default** to remove custom authentication for a package\n\nThe authentication dialog supports multi-line input for complex authentication strings and provides real-time validation.\n\n#### Version Information\n\nThe AutoUpdater displays version information in the bottom left of the navigation menu:\n\n- **Development builds**: Shows `v1.0.0+dev` for local development\n- **CI/CD builds**: Shows `v1.0.0 (abcd123)` with git commit hash for deployed versions\n- **Version tracking**: Automatically embedded during Docker build process using assembly attributes\n\nThe version information helps identify which build is currently running and provides traceability back to the source code commit.\n\n#### Installation Script (install.sh)\n\nThe install.sh script should be created in the deployment repository and should:\n\n1. Create the required directory structure for persistent data\n2. Set up the runtime configuration file mapping\n3. Execute all up*.sh migration scripts in order\n4. Start the AutoUpdater service\n\nExample install.sh structure:\n```bash\n#!/bin/bash\n\n# Create data directory for persistent storage\nmkdir -p /var/docker/data/autoupdater\n\n# Create runtime configuration file if it doesn't exist\ntouch /var/docker/data/autoupdater/appsettings.runtime.json\n\n# Set proper permissions\nchmod 644 /var/docker/data/autoupdater/appsettings.runtime.json\n\n# Execute all migration scripts in order\nfor script in up-*.sh; do\n    if [ -f \"$script\" ]; then\n        echo \"Executing $script...\"\n        bash \"$script\"\n    fi\ndone\n\n# Start AutoUpdater services\ndocker-compose up -d\n```\n\n#### Runtime Configuration Structure\n\nRuntime configuration is automatically managed through the web interface. The structure is:\n```json\n{\n  \"DockerAuth\": {\n    \"package-name\": \"base64-encoded-auth-string\"\n  }\n}\n```\n\n**Note**: Docker authentication should be entered in the web interface as `username:password` format - the system automatically handles base64 encoding and storage in the runtime configuration file. \n\n#### Configuration Structure\n\nThe configuration supports two package arrays:\n- **StdPackages**: Contains the autoupdater itself and system-critical packages\n- **Packages**: Contains application packages to be managed\n\nThis separation ensures the autoupdater can update itself independently from the applications it manages.\n\n#### Production Configuration\n\nFor production deployments, use `appsettings.Production.json`:\n\n```json\n{\n  \"SshUser\": \"deploy\",\n  \"SshAuthMethod\": \"PrivateKey\",\n  \"SshKeyPath\": \"/data/ssh/id_rsa\",\n  \"StdPackages\": [\n    {\n      \"RepositoryLocation\": \"/data/repositories/autoupdater-compose\",\n      \"RepositoryUrl\": \"https://github.com/modelingevolution/autoupdater-compose.git\",\n      \"DockerComposeDirectory\": \"./\"\n    }\n  ],\n  \"Packages\": [\n    {\n      \"RepositoryLocation\": \"/data/repositories/your-app-compose\",\n      \"RepositoryUrl\": \"https://github.com/your-org/your-app-compose.git\",\n      \"DockerComposeDirectory\": \"./\"\n    }\n  ]\n}\n```\n\nThe default configuration monitors the AutoUpdater itself for updates, ensuring the updater stays up-to-date automatically.\n\n#### SSH Key Authentication (Default)\n\nFor enhanced security, use SSH key-based authentication:\n\n```json\n{\n  \"SshUser\": \"deploy\",\n  \"SshAuthMethod\": \"PrivateKey\",\n  \"SshKeyPath\": \"/data/ssh/id_rsa\",\n  \"Packages\": [\n    {\n      \"RepositoryLocation\": \"/data/repos/example-app\",\n      \"RepositoryUrl\": \"https://github.com/your-org/example-app.git\",\n      \"DockerComposeDirectory\": \"./\",\n      \"DockerAuth\": \"base64-encoded-username:password\",\n      \"DockerRegistryUrl\": \"https://index.docker.io/v1/\"\n    }\n  ]\n}\n```\n\n#### Password Authentication (Not Recommended)\n\n```json\n{\n  \"SshUser\": \"your-ssh-user\",\n  \"SshPwd\": \"your-ssh-password\",\n  \"SshAuthMethod\": \"Password\",\n  \"Packages\": [\n    {\n      \"RepositoryLocation\": \"/path/to/local/repo\",\n      \"RepositoryUrl\": \"https://github.com/your-org/your-repo.git\",\n      \"DockerComposeDirectory\": \"./\",\n      \"DockerAuth\": \"base64-encoded-username:password\",\n      \"DockerRegistryUrl\": \"https://myregistry.example.com\"\n    }\n  ]\n}\n```\n\n## SSH Key Setup\n\n### Automated Setup (Recommended)\n\nUse the provided installation script to automatically set up SSH keys:\n\n```bash\n# Download and run the installation script\n./install-ssh-keys.sh --user deploy --hosts \"192.168.1.100,192.168.1.101\"\n\n# With custom key path and passphrase protection\n./install-ssh-keys.sh --user deploy --hosts \"server1,server2\" --key-path ./custom/ssh --passphrase\n\n# Test configuration without making changes\n./install-ssh-keys.sh --user deploy --hosts \"server1\" --test-only\n```\n\nThe script will:\n1. Generate SSH key pair (RSA 4096-bit by default)\n2. Install public key on target hosts\n3. Test SSH connectivity\n4. Update AutoUpdater configuration\n5. Provide setup verification\n\n### Manual Setup\n\nIf you prefer manual setup:\n\n1. **Generate SSH key pair:**\n   ```bash\n   mkdir -p ./data/ssh\n   ssh-keygen -t rsa -b 4096 -f ./data/ssh/id_rsa -C \"autoupdater@$(hostname)\"\n   chmod 600 ./data/ssh/id_rsa\n   chmod 644 ./data/ssh/id_rsa.pub\n   ```\n\n2. **Install public key on target hosts:**\n   ```bash\n   ssh-copy-id -i ./data/ssh/id_rsa.pub deploy@your-host\n   ```\n\n3. **Test SSH connectivity:**\n   ```bash\n   ssh -i ./data/ssh/id_rsa deploy@your-host \"echo 'SSH key authentication successful'\"\n   ```\n\n4. **Update configuration:**\n   ```json\n   {\n     \"SshUser\": \"deploy\",\n     \"SshAuthMethod\": \"PrivateKey\",\n     \"SshKeyPath\": \"/data/ssh/id_rsa\"\n   }\n   ```\n\n### Docker Volume Mounting\n\nEnsure SSH keys are accessible in the container:\n\n```yaml\nversion: '3.8'\nservices:\n  autoupdater:\n    image: modelingevolution/autoupdater:latest\n    ports:\n      - \"8080:8080\"\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock\n      - ./data:/data\n      - ./data/ssh:/data/ssh:ro  # Mount SSH keys read-only\n    environment:\n      - SshUser=deploy\n      - SshAuthMethod=PrivateKey\n      - SshKeyPath=/data/ssh/id_rsa\n```\n\n### SSH Authentication Methods\n\n| Method | Configuration | Use Case |\n|--------|---------------|----------|\n| `Password` | `SshUser` + `SshPwd` | Not recommended, less secure |\n| `PrivateKey` | `SshUser` + `SshKeyPath` | Default, most secure |\n| `PrivateKeyWithPassphrase` | `SshUser` + `SshKeyPath` + `SshKeyPassphrase` | Enhanced security with passphrase |\n| `KeyWithPasswordFallback` | All of the above | Transition period, tries key first |\n\n## Architecture\n\nThe AutoUpdater monitors Git repositories for new tagged versions and automatically updates Docker Compose deployments on remote systems via SSH.\n\n### Key Components\n\n- **UpdateHost**: Main hosted service managing Docker container updates\n- **UpdateProcessManager**: Orchestrates updates across multiple packages\n- **DockerComposeConfiguration**: Represents deployable packages with Git version control\n- **GitTagVersion**: Version management using Git tags\n\n## Custom Docker Registries\n\nThe AutoUpdater supports authentication with any Docker registry:\n\n### Configuration Examples\n\n**Docker Hub (default)**:\n```json\n{\n  \"DockerAuth\": \"base64-encoded-username:password\"\n}\n```\n\n**Private Registry**:\n```json\n{\n  \"DockerAuth\": \"base64-encoded-username:password\",\n  \"DockerRegistryUrl\": \"https://myregistry.example.com\"\n}\n```\n\n**Google Container Registry**:\n```json\n{\n  \"DockerAuth\": \"base64-encoded-_json_key:service-account-json\",\n  \"DockerRegistryUrl\": \"https://gcr.io\"\n}\n```\n\n**Amazon ECR**:\n```json\n{\n  \"DockerAuth\": \"base64-encoded-AWS:token\",\n  \"DockerRegistryUrl\": \"https://123456789.dkr.ecr.us-east-1.amazonaws.com\"\n}\n```\n\n### Programmatic Configuration\n\n```csharp\nvar config = new DockerComposeConfiguration\n{\n    RepositoryLocation = \"/path/to/repo\",\n    RepositoryUrl = \"https://github.com/org/repo.git\",\n    DockerAuth = Convert.ToBase64String(\n        Encoding.UTF8.GetBytes(\"username:password\")),\n    DockerRegistryUrl = \"https://myregistry.example.com\"\n};\n```\n\n## Development\n\n### Prerequisites\n- .NET 9.0 SDK\n- Docker Desktop\n- Git\n\n### Building\n```bash\ndotnet build\ndotnet test\n```\n\n### Running locally\n```bash\ndocker compose up\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodelingevolution%2Fautoupdater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodelingevolution%2Fautoupdater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodelingevolution%2Fautoupdater/lists"}