apatel762 / home-infra

A repository containing all of the setup for my home infra (e.g. my laptop & soon, my server)
GNU Affero General Public License v3.0
0 stars 0 forks source link

Make the first-time SSH hardening easier to use (and rename it...) #130

Open apatel762 opened 1 year ago

apatel762 commented 1 year ago

Renaming it, because in addition to hardening SSH, this will create an admin user on your machine (SSH will be locked down such that it will only work for that user).

Re: easier to use - it should be a general role which can be re-used for all groups in the inventory (the user should supply a group name when they want to use the role). The manual changes that are required before running the role should also be easier to do (separate the ansible user into a variable file or something).

Maybe add some arg parsing to the bash script, like this: https://stackoverflow.com/a/33826763

deploy.sh:

#!/bin/bash

while [[ "$#" -gt 0 ]]; do
    case $1 in
        -t|--target) target="$2"; shift ;;
        -u|--uglify) uglify=1 ;;
        *) echo "Unknown parameter passed: $1"; exit 1 ;;
    esac
    shift
done

echo "Where to deploy: $target"
echo "Should uglify  : $uglify"

Usage:

./deploy.sh -t dev -u

# OR:

./deploy.sh --target dev --uglify