{"id":22091969,"url":"https://github.com/j-p-d-e-v/rustack-launcher","last_synced_at":"2025-06-21T22:04:34.920Z","repository":{"id":239526263,"uuid":"798044023","full_name":"j-p-d-e-v/rustack-launcher","owner":"j-p-d-e-v","description":"A Rust library for developing application launchers. It uses a single TOML configuration file to automatically transform it into .env and YAML files. This library also allows you to easily switch between Docker Compose and Podman Compose.","archived":false,"fork":false,"pushed_at":"2024-05-17T12:42:05.000Z","size":69,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-21T22:04:27.784Z","etag":null,"topics":["app","configgenerator","docker","docker-compose","env","jpdev","launcher","personalproject","podman","podman-compose","rust","serde","serde-yaml","yaml"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/j-p-d-e-v.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-05-09T01:32:45.000Z","updated_at":"2024-12-30T22:29:39.000Z","dependencies_parsed_at":"2024-11-15T00:27:38.394Z","dependency_job_id":"16c43ad7-5161-4bff-9468-1ef4ef3a0d0f","html_url":"https://github.com/j-p-d-e-v/rustack-launcher","commit_stats":null,"previous_names":["j-p-d-e-v/rustack-launcher"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/j-p-d-e-v/rustack-launcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-p-d-e-v%2Frustack-launcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-p-d-e-v%2Frustack-launcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-p-d-e-v%2Frustack-launcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-p-d-e-v%2Frustack-launcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j-p-d-e-v","download_url":"https://codeload.github.com/j-p-d-e-v/rustack-launcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-p-d-e-v%2Frustack-launcher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261200387,"owners_count":23123947,"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":["app","configgenerator","docker","docker-compose","env","jpdev","launcher","personalproject","podman","podman-compose","rust","serde","serde-yaml","yaml"],"created_at":"2024-12-01T03:07:51.760Z","updated_at":"2025-06-21T22:04:29.905Z","avatar_url":"https://github.com/j-p-d-e-v.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ruStack Launcher\nA Rust library for developing application launchers. It uses a single TOML configuration file to automatically transform it into .env and YAML files. This library also allows you to easily switch between Docker Compose and Podman Compose.\n\n```\nNOTE: This is a personal project created for practicing Rust development. Feel free to modify this library as you see fit.\n```\n\nCrate: https://crates.io/crates/rustack-launcher\n\n## Configuration File\n\nThe launcher takes a configuration using TOML. See [TOML](https://toml.io/en/) for the guidelines.\n\n## Tables\n\n### [settings]\nProvides insights into the launcher functionalities alongside frequently used configuration values.\n\nProperties:\n\n| Property           | Usage Example                                       |\n|--------------------|-----------------------------------------------------|\n| name               | Name of the application or stack (\"Hello There\")    |\n| description        | Description of the launcher (\"MyAppStack launcher.\")|\n| author             | Author or creator of the launcher. Example: JP Mateo   |\n| base_dir           | Base directory for the launcher (\"/mydirectory\")   |\n| deploy_dir         | Directory where deployment artifacts are stored (\"deploy\") |\n| services_dir       | Directory containing service configurations (\"services\") |\n| compose_executable | Executable used for Docker Compose. Values: \"docker-compose\", \"podman-compose\" |\n| compose_file       | The compose file name used for deployment. Example: myapp-compose.yaml |\n| compose_detached   | Whether to run Docker Compose in detached mode (true) |\n\nExample:\n```yaml\n[settings]\nname = \"Hello There\"\ndescription = \"MyAppStack launcher.\"\nauthor = \"JP Mateo\"\nbase_dir = \"/mydirectory\"\ndeploy_dir = \"deploy\"\nservices_dir = \"services\"\ncompose_executable = \"docker-compose\"\ncompose_file = \"docker-compose-test.yaml\"\ncompose_detached = true\n```\n\n### [[services]]\n Comprises a list or array of services, structured in a format compatible with Docker Compose services. For further details, refer to: [Docker Compose Services Documentation](https://docs.docker.com/compose/compose-file/05-services/)\n\n| Property     | Description                                                           | Example                                    |\n|--------------|-----------------------------------------------------------------------|--------------------------------------------|\n| hostname     | Hostname of the service                                               | \"db\"                                       |\n| image        | Docker image to use for the service                                   | \"postgres\"                                 |\n| ports        | Ports to expose (host:container)                                      | [\"5432:5432\"]                              |\n| environment  | Environment variables to set inside the container                     | { POSTGRES_USER = \"admin\", ... }           |\n| env_file     | Path to the environment file to load variables from                    | [\"database\"]                               |\n| networks     | Networks the service is connected to                                   | [\"mynetwork\"]                              |\n| volumes      | Volumes to mount (kind, source, target)                               | [{ kind = \"bind\", source = ..., target = ... }] |\n| depends_on   | Services this service depends on                                       | [\"myserviceapp\"]                           |\n| restart      | Restart policy for the service                                         | \"always\"                                   |\n| tty          | Allocate a pseudo-TTY                                                  | true                                       |\n\nExample:\n```toml\n[[services]]\n#This is the app service.\nhostname = \"db\"\nimage = \"postgres\"\nports = [\n    \"5432:5432\"\n]\nenvironment = { POSTGRES_USER = \"admin\", POSTGRES_PASSWORD = \"admin123\",  PGDATA=\"/var/lib/postgresql/data/pgdata\" }\nenv_file = [\n    \"database\",\n]\nnetworks = [\n    \"mynetwork\"\n]\nvolumes = [\n    { kind = \"bind\", source = \"/Users/jpmateo/Codes/rust/rustack-launcher/tests/testapp/data\", target = \"/var/lib/postgresql/data/pgdata\"}\n]\ndepends_on = [\n    \"myserviceapp\"\n]\nrestart = \"always\"\ntty = true\n```\n\n### [[networks]]\nConsists of a list or array of networks, formatted in accordance with Docker Compose network specifications. For additional guidance, please consult: [Docker Compose Network Documentation](https://docs.docker.com/compose/compose-file/06-networks/)\n\n| Property | Description                                     | Example                                 |\n|----------|-------------------------------------------------|-----------------------------------------|\n| name     | Name of the network                             | \"mynetwork2\"                            |\n| driver   | Network driver: See. https://docs.docker.com/network/drivers/                                  | \"bridge\"                                |\n| labels   | Labels associated with the network (key-value)  | { \"my.network.label.1\" = ..., ... }    |\n| external   | Set to true if the network is external. Default: false  | external = false    |\n\nExample:\n```yaml\n[[networks]]\nname = \"mynetwork2\"\ndriver = \"bridge\"\nexternal = false\nlabels = { \"my.network.label.1\" = \"This is a network label 1.\", \"my.network.label.2\" = \"This is a network label 2.\" }\n```\n\n\n### [[volumes]]\nComprises a list or array of volumes, structured in a format compatible with Docker Compose volume specifications. For further information, refer to: [Docker Compose Volume Documentation](https://docs.docker.com/compose/compose-file/07-volumes/)\n| Property    | Description                                                               | Example                                   | serde(default) |\n|-------------|---------------------------------------------------------------------------|-------------------------------------------|----------------|\n| name        | Name of the volume                                                        | \"testvolumes\"                             |                |\n| driver      | Volume driver. See: https://docs.docker.com/compose/compose-file/07-volumes/#driver                                                             | \"nfs\"                                     |                |\n| driver_opts | Options for the volume driver (name, value). See: https://docs.docker.com/compose/compose-file/07-volumes/#driver_opts                               | [{ name = \"type\", value = \"nfs\" }, ... ] |                |\n| external    | Indicates whether the volume is external. Default: false                                  | false                                     |                |\n| labels      | Labels associated with the volume (key-value)                             | { \"my.volume.label1\" = ..., ... }        |                |\nExample:\n```yaml\n[[volumes]]\nname = \"testvolumes\"\ndriver = \"nfs\"\ndriver_opts = [\n    { name = \"type\", value = \"nfs\" },\n    { name = \"o\", value = \"addr=10.40.0.199,nolock,soft,rw\" },\n    { name = \"device\", value = \":/docker/example\" },\n]\nexternal = false\nlabels = { \"my.volume.label1\" = \"This is a volume label 1.\", \"my.volume.label2\" = \"This is a volume label 2.\" }\n```\n\n### [[repositories]]\n This encompasses a list or array of repositories that require pulling from the version control system.\n| Property     | Description                                       | Example                                                | serde(default) |\n|--------------|---------------------------------------------------|--------------------------------------------------------|----------------|\n| service      | Service associated with the repository           | \"app\"                                                  |                |\n| mount_target | Target directory for mounting the repository      | \"/var/db\"                                              |                |\n| name         | Name of the repository                            | \"execism-diffie-hellman\"                              |                |\n| url          | URL of the repository                            | \"https://github.com/j-p-d-e-v/execism-diffie-hellman\" |                |\n| branch       | Branch of the repository to use                   | \"master\"                                               |                |\n| clone        | Indicates whether to clone the repository        | false                                                  |                |\n\n```\nNote: I did not include the authentication method. It is generally better to establish a connection between your machine/server and the desired Git server before proceeding.\n```\n\nExample:\n```yaml\n[[repositories]]\nservice = \"app\"\nmount_target = \"/var/db\"\nname = \"execism-diffie-hellman\"\nurl = \"https://github.com/j-p-d-e-v/execism-diffie-hellman\"\nbranch = \"master\"\nclone = false\n```\n\n## Using Docker-Compose\nPre-requisites:\n1. Docker Engine must be installed in your system. See: https://docs.docker.com/\n2. Docker-Compose must be installed your system: See: https://docs.docker.com/compose/install/podman-compose\n```yaml\n    //Load the toml configuration file.\n    let config = Config::load(\"config-test-docker.toml\".to_string());\n\n    let deploy_dir: String = format!(\"{}/{}\",config.settings.base_dir,\u0026config.settings.deploy_dir);\n    config.validate();\n    let env_file_paths: Vec\u003cString\u003e = EnvironmentFile::generate(\u0026config.env_files,\u0026deploy_dir);\n    let compose: Compose = Compose::new(config);\n    compose.up();\n    compose.down();\n```\n\n## Using Podman-Compose\n\nPre-requisites:\n1. Podman must be installed in your system. See: https://podman.io/\n2. Podman-Compose must be installed your system: See: https://github.com/containers/podman-compose\n\nExample:\n```yaml\n    let config = Config::load(\"config-test-podman.toml\".to_string());\n    let deploy_dir: String = format!(\"{}/{}\",config.settings.base_dir,\u0026config.settings.deploy_dir);\n    config.validate();\n    let env_file_paths: Vec\u003cString\u003e = EnvironmentFile::generate(\u0026config.env_files,\u0026deploy_dir);\n    let compose: Compose = Compose::new(config);\n    compose.up();\n    compose.down();\n```\n\n## Unit Testing\n```\ncargo test -- --test-threads 1 --nocapture\n```\n\n## Developer\n- JP Mateo","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-p-d-e-v%2Frustack-launcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj-p-d-e-v%2Frustack-launcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-p-d-e-v%2Frustack-launcher/lists"}