{"id":22428306,"url":"https://github.com/momsfriendlydevco/init","last_synced_at":"2026-03-14T18:03:35.435Z","repository":{"id":30285331,"uuid":"33836909","full_name":"MomsFriendlyDevCo/Init","owner":"MomsFriendlyDevCo","description":"A collection of setup scripts to deploy a Linux environment","archived":false,"fork":false,"pushed_at":"2024-11-27T01:24:29.000Z","size":320,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-04T03:42:44.468Z","etag":null,"topics":[],"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/MomsFriendlyDevCo.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":"2015-04-12T22:43:53.000Z","updated_at":"2024-11-27T01:24:33.000Z","dependencies_parsed_at":"2024-02-27T00:39:50.047Z","dependency_job_id":"1c24fa46-fa6c-446a-8e25-8dbdbac29ef1","html_url":"https://github.com/MomsFriendlyDevCo/Init","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2FInit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2FInit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2FInit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2FInit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MomsFriendlyDevCo","download_url":"https://codeload.github.com/MomsFriendlyDevCo/Init/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228363964,"owners_count":17908319,"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":[],"created_at":"2024-12-05T20:14:22.651Z","updated_at":"2026-03-14T18:03:35.374Z","avatar_url":"https://github.com/MomsFriendlyDevCo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"MomsFriendlyDevCo Init Scripts\n==============================\nA collection of setup scripts to deploy a Linux environment.\n\n\nQuick start guide\n-----------------\nClone the repo and run one of the `ROLE-*` scripts to setup a server matching that profile.\n\nFor example if you want a Node web server run:\n\n\t# Make sure Git is installed\n\tsudo apt install -y git\n\n\t# Clone everything\n\tgit clone https://github.com/MomsFriendlyDevCo/Init.git\n\tcd Init\n\n\t# Install the required ROLE\n\t./ROLE-server-node\n\n\nCherry-picking guide\n--------------------\nEach script is designed to be run as a non-root user (escapting to sudo when needed).\n\nThese scripts follow the sequence '\u003crun order\u003e-\u003citem\u003e' where the number dictates the order they should be run.\n\nYou can queue up multiple scripts on the command line, picking the items you require.\n\nFor example to install NodeJS, Python and Ruby you could run:\n\n\t./020-node \u0026\u0026 ./020-python \u0026\u0026 ./020-ruby\n\n\nRules\n=====\nEach action script (i.e. any script matching `???-*`) must follow the following:\n\nEach script _must_:\n\n* Include a Bash hashbang (i.e. `#!/bin/bash`) as the first line and be executable\n* Include documentation in the header\n* Import the common library via `source common` somewhere in its header (NOTE: any script in `./utils/` needs to use `[ -z \"$INIT_READY\" ] \u0026\u0026 source common` as the current directory may not be the same as `$INIT_HOME`\n* Fail gracefully and not stop application flow unless a critical failure has occured\n* Be runnable multiple times - this is to support future upgrades. A script must be capable of being run again at some future date with no side effects\n\n\nEach script _should_:\n\n* Use `INIT status \u003ctext\u003e` or `INIT skip \u003ctext\u003e` as a reporting mechanism instead of plain `echo`\n* Require little to no interaction past the initial execution\n\n\nGeneral Syntax\n==============\nThis package comes complete with various helper functions which are all called with the `init` syntax.\n\nAll commans in this set `exit 0` (i.e. no failures). Any that returns a boolean will either return the string `0` or `1` and should be queried in Bash with equality:\n\n```bash\nif [ `INIT apt-has foo bar baz` == 1 ]; then\n\techo \"Foo, Bar + Baz are all installed\"\nelse\n\techo \"Foo, Bar + Baz are all missing!\"\nfi\n```\n\n\n|-------------------|------------------------------------------------|--------|----------------------------------------------------------------------------------------------------|\n| Category          | Command                                        | Flags? | Description                                                                                        |\n|-------------------|------------------------------------------------|--------|----------------------------------------------------------------------------------------------------|\n| User input        | `INIT ask -p \u003cmessage\u003e -v \u003cvar\u003e -d \u003cdefault\u003e`  | Yes    | Prompt the user for various inputs using the `profile` file for defaults                           |\n| Status Output     | `INIT fixme \u003cmessage\u003e`                         |        | Mark that a script needs attention on the next clean system install                                |\n|                   | `INIT skip \u003cmessage\u003e`                          |        | Same as `INIT status` but display that the operation was skipped                                   |\n|                   | `INIT status \u003cmessage\u003e`                        |        | Display a status message                                                                           |\n| Change directory  | `INIT go-init`                                 |        | Change back to the base Init directory, should be called last on any script which changes anything |\n|                   | `INIT go-src [sub-dir]`                        |        | Change to the $INIT_SRC directory (+ optional sub-dir), creating it/them if they dont exist        |\n| Config            | `INIT config-set \u003cfile\u003e \u003ckey\u003e \u003cval\u003e`           |        | Set an INI file setting, creating it if not already present                                        |\n| Misc              | `INIT noop`                                    |        | Do nothing, intends to make if-then-else blocks more readable - like Pythons 'pass'                |\n| Packages / Apt    | `INIT apt-has \u003cpkgs...\u003e`                       |        | Query if all packages are installed                                                                |\n|                   | `INIT apt-install \u003cpkgs...\u003e`                   | Yes    | Install Apt packages                                                                               |\n|                   | `INIT apt-install-github-release \u003cowner/repo\u003e` | Yes    | Download + install the latest version of a .DEB packages from a GitHub Repo                        |\n|                   | `INIT apt-install-url \u003cURLs...\u003e`               |        | Download .DEB packages from the given URLs and install them                                        |\n|                   | `INIT apt-remove \u003cpkgs...\u003e`                    | Yes    | Remove all specified packages                                                                      |\n|                   | `INIT apt-update`                              |        | Force update apt, even if its not required                                                         |\n| Packages / Cargo  | `INIT cargo-install \u003cpkgs...\u003e`                 |        | Install various Rust / Cargo packages                                                              |\n| Packages / NPM    | `INIT npm-install \u003cpkgs...\u003e`                   |        | Install various Node / NPM packages                                                                |\n| Packages / Pip    | `INIT pip-install \u003cpkgs...\u003e`                   |        | Install various Python3 + Pip packages                                                             |\n| Packages / Snap   | `INIT snap-install \u003cpkgs...\u003e`                  |        | Install various Snap packages                                                                      |\n| Packages / Source | `INIT bin-download-run \u003curl\u003e`                  |        | Download a binary URL and run the results                                                          |\n|                   | `INIT file-download-url \u003curls..\u003e`              | Yes    | Download one or more URLs into the current directory                                               |\n|                   | `INIT source-clone \u003calias\u003e \u003cgit-url\u003e`          |        | Clone / update a Git-Url into `~/src/$ALIAS` and change to that directory                          |\n| Files             | `INIT file-grep-matches \u003cfile\u003e \u003cgrep\u003e`         |        | Return `1` if the given file path contains the given Grep expression                               |\n|                   | `INIT file-set \u003cfile\u003e \u003c\u003cHEREDOC`               | Yes    | Output contents of HEREDOC into a file                                                             |\n| System querying   | `INIT bin-available \u003cbins...\u003e`                 |        | Return `1` if a all listed Binaries are available and within the PATH                              |\n|                   | `INIT bin-grep-matches \u003ccmd\u003e \u003cgrep\u003e`           |        | Run a program and return `1` if it matches the specified grep expresison                           |\n|                   | `INIT service-available \u003cservice\u003e`             |        | Return `1` if the given service is available (even if disabled)                                    |\n|                   | `INIT tmux-connect \u003csession\u003e`                  |        | Connect to an existing TMUX session by name - or create it if missing                              |\n| Init core         | `INIT run \u003cunit\u003e`                              |        | Run one internal Init setup script                                                                 |\n|-------------------|------------------------------------------------|--------|----------------------------------------------------------------------------------------------------|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlydevco%2Finit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomsfriendlydevco%2Finit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlydevco%2Finit/lists"}