{"id":15718465,"url":"https://github.com/justintime50/srvinfra","last_synced_at":"2025-05-13T02:26:26.436Z","repository":{"id":111477384,"uuid":"415500805","full_name":"Justintime50/srvinfra","owner":"Justintime50","description":"srvinfra is a tool to deploy, update, and maintain services and websites on a server hosted by Docker.","archived":false,"fork":false,"pushed_at":"2024-02-15T18:28:22.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-02T03:11:46.071Z","etag":null,"topics":["database","deploy","docker","hosted","infra","maintain","server","service","sql","srv","srvinfra","update","website"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Justintime50.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-10-10T06:05:53.000Z","updated_at":"2024-05-29T06:49:44.131Z","dependencies_parsed_at":"2023-12-07T18:27:10.689Z","dependency_job_id":"4a2c8a72-65b7-4160-9e32-3f96eb6039be","html_url":"https://github.com/Justintime50/srvinfra","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justintime50%2Fsrvinfra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justintime50%2Fsrvinfra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justintime50%2Fsrvinfra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justintime50%2Fsrvinfra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Justintime50","download_url":"https://codeload.github.com/Justintime50/srvinfra/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253858506,"owners_count":21974934,"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","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":["database","deploy","docker","hosted","infra","maintain","server","service","sql","srv","srvinfra","update","website"],"created_at":"2024-10-03T21:53:08.309Z","updated_at":"2025-05-13T02:26:26.222Z","avatar_url":"https://github.com/Justintime50.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# srvinfra\n\n`srvinfra` is a tool to deploy, update, and maintain Docker projects hosted on a server.\n\n[![Build](https://github.com/Justintime50/srvinfra/workflows/build/badge.svg)](https://github.com/Justintime50/srvinfra/actions)\n[![Version](https://img.shields.io/github/v/tag/justintime50/srvinfra)](https://github.com/justintime50/srvinfra/releases)\n[![Licence](https://img.shields.io/github/license/justintime50/srvinfra)](LICENSE)\n\n\u003cimg src=\"https://raw.githubusercontent.com/justintime50/assets/main/src/srvinfra/showcase.png\" alt=\"Showcase\"\u003e\n\n\u003c/div\u003e\n\nI store all my Docker services in the same place and have similar commands to update and deploy them but found myself needing to constantly navigate all over the filesystem to run Docker commands. With `srvinfra`, I can deploy and manage my services with ease from anywhere using a unified CLI syntax.\n\n`srvinfra` will stash any local changes of a project, pull down new changes via `git`, then deploy the service via Docker. For services that have a production configuration, it will need to be titled `docker-compose-prod.yaml` and have a normal `docker-compose.yaml` file as well. Either `.yml` or `.yaml` extensions are supported. When a service does not have a production configuration, `srvinfra` will deploy using the base config.\n\n## Install\n\n```bash\n# Setup the tap\nbrew tap justintime50/formulas\n\n# Install srvinfra\nbrew install srvinfra\n```\n\n**NOTE:** `srvinfra` assumes `Docker Compose v2` is installed.\n\nOnce you have `srvinfra` installed, you'll need to setup an environment variable:\n\n```bash\necho 'export SRVINFRA_SERVICES_DIR=path/to/dir' \u003e\u003e ~/.zshrc\n```\n\nYou can change the database executable used from `mysql` to `mariadb` by setting it via the `SRVINFRA_DATABASE_EXECUTABLE` env var:\n\n```bash\necho 'export SRVINFRA_DATABASE_EXECUTABLE=mariadb' \u003e\u003e ~/.zshrc\n```\n\n## Usage\n\n\u003e NOTE: You may need to quote `ROOT_PASSWORD` in the commands below.\n\n```bash\n# Deploy a service (relative from $SRVINFRA_SERVICES_DIR), subdirectories are possible\nsrvinfra deploy justintime50/justinpaulhammond\nsrvinfra deploy justintime50/server-infra/plex\n\n# Deploy all services (great for server cold-start)\nsrvinfra deploy_all\n\n# Decrypt a compressed SQL backup file\n# The BACKUP_SECRET is assumed to be the same as the database ROOT_PASSWORD\nsrvinfra decrypt_database_backup PATH_TO_SQL_FILE BACKUP_SECRET\n\n# Export a SQL database from a Docker container, unencrypted and uncompressed\n# Default PATH_TO_SQL_FILE: './database.sql'\nsrvinfra export_database DATABASE_CONTAINER_NAME ROOT_PASSWORD DATABASE_NAME PATH_TO_SQL_FILE\n\n# Export a compressed SQL database from a Docker container and encrypt the backup (recommended)\n# Default PATH_TO_SQL_FILE: './database.enc.gz'\nsrvinfra export_database_secure DATABASE_CONTAINER_NAME ROOT_PASSWORD DATABASE_NAME PATH_TO_SQL_FILE\n\n# Import a SQL database to a Docker container\n# NOTE: This can be used to run any arbitrary SQL commands from a file, not just importing a previously exported file\nsrvinfra import_database DATABASE_CONTAINER_NAME ROOT_PASSWORD DATABASE_NAME PATH_TO_SQL_FILE\n\n# Import an encrypted \u0026 compressed SQL database to a Docker container (command combines `decrypt_database_backup` and `import_database` commands)\n# ROOT_PASSWORD is assumed to be the same as the database root password\nsrvinfra import_encrypted_database DATABASE_CONTAINER_NAME ROOT_PASSWORD DATABASE_NAME PATH_TO_SQL_FILE\n\n# Get the status of a Docker container by name\nsrvinfra status justinpaulhammond\n\n# Update a service\nsrvinfra update justintime50/server-infra/plex\n\n# Update all services\nsrvinfra update_all\n\n# View all available commands\nsrvinfra help\n```\n\n## Development\n\n```bash\n# Lint the project\nshellcheck src/srvinfra.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustintime50%2Fsrvinfra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustintime50%2Fsrvinfra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustintime50%2Fsrvinfra/lists"}