For higher productivity with bosh ssh.
The dotfiles-boshrelease lets you set up a cozy terminal environment within BOSH VMs. It sets up not only root user, but also vcap user, temporary bosh_<random> users, and you own users (shrc.extra_users).
With dotfiles, life is much easier when doing dev & ops on BOSH based infrastructures.
This boshrelease is inspired by root-env. However, unlike root-env which downloads a tarball daily to the /root dir, dotfiles-boshrelease uses only local files.
It's more secure (no root executable script from internet); All changes to VMs are visible in properties; Changes take place explicitly (only when you do the bosh deploy); And it's easy to uninstall - simply remove shrc job from manifest, and your admin environment is (almost) clean again.
In manifest file, add dotfiles to releases. In template, add shrc job.
Deploy the shrc job in a template, then find the amazing changes with bosh ssh.
You can also check jobs/shrc/spec to tune properties as you like.
You can inject your own startup commands using shrc.extra_commands (all VMs) and shrc.extra_role_commands (role based commands). The executing order is dotfiles/shrc -> extra_commands -> extra_role_commands.
On the other hand, you can just fork and modify this project, then use bosh to create, upload and deploy your own release.
- Bosh will re-dploy a VM if any of the templated files is changed. Since
dotfilesare installed on every VMs usually, changing shrc properties (should happen very rarely though) or updating release version triggers FULL re-deployment. shrc.extra_role_commandsshould be set as job properties, rather than globally, to avoid FULL re-deployment on changing.shrcis bound toroot,vcapandbosh_$TEMPaccount. Means that when you su toroot,extra_commandswill be executed automatically with root priviledge. The extra commands are executed withset -eufor your flight safety. Don't shoot your feet.
- inputrc:
- Enable word jump (alt + Left/Right);
- Enable history search (alt + Up/Down; alt + p/n; PageUp/PageDown)
- Completion-ignore-case on
- shrc:
- Frequently used dirs: link to $HOME (vcap, packages, jobs, sys/log, etc..)
- PS1: Meaningful and colorful PS1. You can set your favorite PS1 color in spec.
Dotfilesdisables the Stemcell(3306+) built-in PS1 by default. You can re-enable it by settingshrc.disable_stemcell_prompttofalsein the manifest. - packages bins: add packages/*/bin to PATH.
- extra_users:
- Set
shrc.extra_usersproperty to let dotfiles create admin account and inject public key for you. Note that there is a sanity check when creating account. If user'snameandpublic_keyfailed to pass the check, they will be ignored. For more details, checkbin/add-users.erb. - CAVEAT: $HOME/.ssh/authorized_keys are removed on start before injecting the new keys for all users created by dotfiles.
- extrarc:
- You can inject commands from manifest with
shrc.extra_commandsproperty. However be careful not to crash your machine ^_^ - You can inject commands based on VM role using
shrc.extra_role_commands.
- shrc/userbin:
- ack
- (home made) link-apps: link warden container directories to $HOME/app.
- (home made) wwsh: a shortcut to wsh into warden containers.
- (home made) haste: a hastebin client, is convenient when you have a internal hastebin server.
- completion:
- monit completion
- wwsh completion
- set-ps1
- A small function
set-ps1helps you to set informative prompt. By default it puts information such asspec.deployment,job_name/index,ipon PS1. - You can also easily customize your prompt with
set-ps1. Checkset-ps1 -hfor details.
For some reason, by default the bash in stemcell doesnot recognize .profile or .bash_profile, and it will only read the already existed .bashrc. Therefore this release use .bash_aliases to trigger customized shrc script.
- Inspired by root-env
- ack
- monit.complete is taken from linsong/my_bash
- haste bash client are modified from haste-client
Weichu Liu (Rakuten, Inc.)