Thanks to visit codestin.com
Credit goes to github.com

Skip to content

runag/sopka

Repository files navigation

RΓΉnagfile to configure a workstation

🧑 A script to deploy a workstation.

  • It could be run on a freshly installed Linux or MacOS.
  • It installs and configures software, credentials, and backups.
  • It is idempotent, it could be run multiple times to produce up-to date configuration.

I have made some effort to ensure that this script does not contain personal identifiable information. All such information is stored in the pass database, which is imported from external media when deploying a workstation.

There is a library, πŸ’œ RΓΉnag, that allows the code here to be declarative and concise.

Deploy workstation on Linux

bash <(wget -qO- https://raw.githubusercontent.com/runag/runag/main/deploy.sh) add runag/workstation-runagfile run

Offline install

# create offline install
mkdir runag-offline-install && cd runag-offline-install
runag offline_install::create_or_update

# perform offline install from the runag-offline-install directory
bash deploy-offline.sh

Deploy workstation on Linux in KVM (useful for testing)

On host machine

This step will copy your ~/.password-store and ~/.gnupg keys to ~/.runag/.virt-deploy-keys directory, and after consecutive steps your keys will be accessible from the guest machine. Please make sure you understand implications of that.

mkdir ~/.runag/.virt-deploy-keys
runag workstation::linux::deploy_virt_keys

In virt-manager

  1. Enable shared memory

  2. Create Filesystem

Driver: virtiofs
Source path: ~/.runag # replace ~ with absolute path!
Target path: runag

On guest machine

sudo mount -m -t virtiofs runag ~/.runag
~/.runag/bin/runag

Modify /etc/fstab if you want to keep .runag mount after reboot

# /etc/fstab

# replace ~ with absolute path!
runag  ~/.runag  virtiofs  defaults  0  0

Deploy on MacOS

bash <(curl -Ssf https://raw.githubusercontent.com/runag/runag/main/deploy.sh) add runag/workstation-runagfile

Password Store

backup
β”œβ”€β”€ passwords
β”‚   └── workstation
β”œβ”€β”€ remotes
β”‚   └── sftp
β”‚       └── backup-server
β”‚           β”œβ”€β”€ config
β”‚           β”œβ”€β”€ config.linux
β”‚           β”œβ”€β”€ id_ed25519
β”‚           β”œβ”€β”€ id_ed25519.pub
β”‚           └── known_hosts
└── repositories
    └── workstation

identity/my
β”œβ”€β”€ git
β”‚   β”œβ”€β”€ signing-key
β”‚   β”œβ”€β”€ user-email
β”‚   └── user-name
β”œβ”€β”€ github
β”‚   β”œβ”€β”€ personal-access-token
β”‚   └── username
β”œβ”€β”€ npm
β”‚   └── access-token
β”œβ”€β”€ rubygems
β”‚   └── credentials
β”œβ”€β”€ ssh
β”‚   β”œβ”€β”€ config
β”‚   β”œβ”€β”€ id_ed25519
β”‚   └── id_ed25519.pub
β”œβ”€β”€ sublime-merge
β”‚   └── license
β”œβ”€β”€ sublime-text
β”‚   └── license
β”œβ”€β”€ tailscale
β”‚   └── authkey
└── wifi
    └── home
        β”œβ”€β”€ password
        └── ssid

Generate and save SSH key to the password store

# Fill this
ssh_keyfile="id_ed25519"
ssh_comment=""
ssh_passphrase=""
pass_path="identity/my/ssh"

ssh-keygen -t ed25519 -C "${ssh_comment}" -f "${ssh_keyfile}" -N "${ssh_passphrase}"

{ echo "${ssh_passphrase}"; cat "${ssh_keyfile}"; } | pass insert --multiline "${pass_path}/${ssh_keyfile}"
pass insert --multiline "${pass_path}/${ssh_keyfile}.pub" <"${ssh_keyfile}.pub"

If you fork this

You may wish to change some paths:

  1. This README file, runag/workstation-runagfile and maybe runag/runag if you forked it as well.

License

Apache License, Version 2.0.

Contributing

Please check CONTRIBUTING file for details.

About

🚞 A script to deploy a workstation

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages