{"id":13550150,"url":"https://github.com/pch/welder","last_synced_at":"2025-04-12T19:45:40.408Z","repository":{"id":138105750,"uuid":"93509103","full_name":"pch/welder","owner":"pch","description":"👨‍🏭Set up your Linux server with plain shell scripts","archived":false,"fork":false,"pushed_at":"2021-09-18T14:01:34.000Z","size":681,"stargazers_count":1174,"open_issues_count":0,"forks_count":32,"subscribers_count":37,"default_branch":"main","last_synced_at":"2024-10-30T00:33:33.473Z","etag":null,"topics":["bash","linux-server","server","server-setup","shell"],"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/pch.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":"2017-06-06T11:07:11.000Z","updated_at":"2024-10-25T22:57:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"363ad4bb-23a8-461d-8d80-6e8e00bd9b60","html_url":"https://github.com/pch/welder","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/pch%2Fwelder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pch%2Fwelder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pch%2Fwelder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pch%2Fwelder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pch","download_url":"https://codeload.github.com/pch/welder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625491,"owners_count":21135513,"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":["bash","linux-server","server","server-setup","shell"],"created_at":"2024-08-01T12:01:29.510Z","updated_at":"2025-04-12T19:45:40.376Z","avatar_url":"https://github.com/pch.png","language":"Shell","readme":"# 👨‍🏭 Welder\n\nWelder allows you to set up a Linux server with plain shell scripts.\n\nI wrote it out of frustration with Ansible. Ansible is an amazing and powerful\ntool, but for my needs it's just too much. 90% of the time all I need is to\nbe able to run a shell script on the server, without extra dependencies.\n\nIn most basic terms, that's what welder does.\n\nBut there's some more.\n\n**⚠️ NOTE**: if you're looking for the previous version of welder, you'll\n[find it here](https://github.com/pch/welder/tree/classic).\n\n## Features\n\n- set up your server with a single command (`welder run \u003cplaybook\u003e \u003cserver\u003e`)\n- run a set of organized reusable shell scripts\n- use simple template syntax (`{{ VAR_NAME }}`) to substitute config variables\n\n### Directory structure\n\nAn example directory structure:\n\n```sh\n├── playbook.conf\n├── config.conf\n├── firewall\n│   ├── files\n│   │   └── rules.v4\n│   └── firewall.sh\n├── nginx\n│   └── nginx.sh\n├── system\n│   ├── files\n│   │   ├── 10periodic\n│   │   ├── 50unattended-upgrades\n│   │   └── ssh_key\n│   └── system.sh\n└── website\n    ├── files\n    │   └── site.conf.template\n    └── website.sh\n```\n\n### Playbook\n\nPlaybook is just a list of modules to execute. Example:\n\n```sh\n# playbook.conf\n\nsystem\nfirewall\nnginx\nwebsite\n```\n\n### Config\n\nConfig file:\n\n```sh\nSITE_DOMAIN = \"example.com\"\nSITE_DIR = \"/var/www\"\n```\n\nYou can reference config variables in your scripts like this:\n\n```sh\n#!/bin/sh\nset -xeu\n\n. ./config.conf\n\necho $SITE_DOMAIN\n```\n\n### Templates\n\nWelder offers simple `sed`-based templates that interpolate variables in double brackets\nwith values defined in config.\n\n```lua\n# website/files/nginx-site.conf.template\n\nserver {\n    listen 80;\n\n    server_name {{ SITE_DOMAIN }};\n    root {{ SITE_DIR }}/current/public;\n}\n```\n\n## Usage\n\nRun the playbook with the following command:\n\n```sh\nwelder run playbook.conf user@example.com\n```\n\n### How it works\n\nWelder goes through the modules defined in `playbook.conf`, copies them to a\ncache directory, compiles config files and templates, `rsync`s the directory to\nthe server. Then it runs the `setup` script that invokes all `*.sh` files\nwithin the playbook (all scripts will be called with `sudo`).\n\n### Example setup script\n\n```sh\n# nginx/nginx.sh\n\n# NOTE: sudo isn't necessary because the whole script will be\n#       invoked as `sudo nginx/nginx.sh`\n\nset -xeu # 'u' will give you warnings on unbound config variables\n\nadd-apt-repository -y ppa:nginx/stable\nsapt-get update \u0026\u0026 apt-get install -y nginx\n\nservice nginx start\n\ncp files/nginx.conf /etc/nginx/nginx.conf\n\n# Disable default site\nif [ -f /etc/nginx/sites-enabled/default ]; then\n  rm /etc/nginx/sites-enabled/default\nfi\n\nservice nginx restart\n```\n\n## Installation\n\nThe only dependency required by welder is `rsync` (which should be\npre-installed on your system in most cases).\n\n1. Check out welder into `~/.welder` (or whatever location you prefer):\n\n   ```sh\n   $ git clone https://github.com/pch/welder.git ~/.welder\n   ```\n\n2. Add `~/.welder/bin` to your `$PATH` for access to the `welder`\n   command-line utility.\n\n   ```sh\n   $ echo 'export PATH=\"$PATH:$HOME/.welder/bin\"' \u003e\u003e ~/.bash_profile\n   ```\n\n   **Ubuntu Desktop note**: Modify your `~/.bashrc` instead of `~/.bash_profile`.\n\n   **Zsh note**: Modify your `~/.zshrc` file instead of `~/.bash_profile`.\n\n3. Restart your shell so that PATH changes take effect. (Opening a new\n   terminal tab will usually do it.) Now check if welder was set up:\n\n   ```sh\n   $  which welder\n   /Users/my-user/Code/welder/bin/welder\n   ```\n\n## Caveats\n\nSince welder allows you to run **anything** on the server, you should use it\nwith caution. It won't protect you from screw-ups, like\n`rm -rf \"/$undefined_variable\"`.\n\nUse at your own risk.\n\n## Alternatives\n\nThere's an [alternative version](https://gitlab.com/welder-cm/welder) of welder\n(the classic version), re-implemented in Python by\n[@thomas-mc-work](https://github.com/thomas-mc-work).\n","funding_links":[],"categories":["Shell","📦 Legacy \u0026 Inactive Projects","DevOps Utilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpch%2Fwelder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpch%2Fwelder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpch%2Fwelder/lists"}