means that tests defined within the travis.yml
configuration file either passed or failed as of .
Collection of Bash scripts for Jekyll and Git server administration and interaction via ssh
or git
command-line tools.
Unless otherwise stated both documentation and Bash scripts are shared under (version
3
) by default, a full copy of which is available undermaster:LICENSE
provides rendered documentation for this project; the source code modifications and raw doc-files of which can be found under the gh-pages
branch
. Installation
, and Update
instructions are currently featured along with usage examples for Administrators
and Git
/Jekyll
clients.
, however, please review GitHub's Fork
help page, and the Contributing
collection of this project for set-up and styling tips. Oh and don't forget to add yourself to the Contributors collection before first Pull Request.
Consider checking Supporting Options for methods of encouraging projects like these.
-
Ruby version >= 2.1 for; Jekyll version 3.8.5, and Bundler version 1.17.3
-
Bash version >= 4 for;
local -n _ref_one="${1}"
and other fanciness at the shell level -
Debian based Linux or the knowhow to install
apt
dependencies via another package manager
The following should be preformed on a private server, VPS, RPi, etc...
-
- Install DNS and Web Server compatible with this project...
sudo apt-get install nginx unbound
Securing servers is currently outside the scope of this file and documentation for this project.
-
- Elivate to
root
level permissions and clone within a directory for source installed tools...
- Elivate to
sudo su -
cd /usr/local/etc
git clone --recurse-submodules git@github.com:S0AndS0/Jekyll_Admin.git
cd Jekyll_Admin
Note, those that have cloned previously will need to
git submodule update --init --recursive --remote --merge
to download submodule source code.
-
make
if this is a fresh server...
make install-dependencies
make install
- b ... or update via related
make
commands if this server is not so fresh...
make update
make install
-
a For each group/domain run the
jekyll_dnsconf.sh
script, for each user run thejekyll_usermod.sh
script, and for each repository of each user run thejekyll_wwwconf.sh
script. -
b Organize the list of users based off their shared group within some kind of data structure (in this case an associative array) and loop over it while utilizing project scripts to set-up things...
#!/usr/bin/env bash
declare -A _grouped_users=(
['admins']='Joan:Liz'
['devs']='Bill:Ted'
)
_key_dir="${HOME}/git_public_keys"
for _domain in "${!_grouped_users[@]}"; do
for _user in ${_grouped_users[${_domain}]//:/ }; do
_usermod_args=(
'--user' "${_user}"
'--group' "${_domain}"
'--ssh-pub-key' "${_key_dir}/${_user,,}.pub"
)
case "${_domain}" in
'admins')
_usermod_args+=('--git-shell-copy-or-link' 'pushable')
;;
*)
if [[ "${_user,,}" != 'bill' ]]; then
_usermod_args+=('--git-shell-copy-or-link' 'pushable')
fi
;;
esac
jekyll_usermod.sh "${_usermod_args[@]}"
jekyll_wwwconf.sh --user "${_user}"\
--domain "${_domain}"\
--tld 'lan'\
--repo "${_user}"\
--server 'nginx'\
--clobber 'force'
done
if ! [ -f "/etc/unbound/unbound.conf.d/${_domain}.lan.conf" ]; then
jekyll_dnsconf.sh --server 'unbound'\
--interface 'eth0'\
--domain "${_domain}"\
--tld 'lan'
fi
done
The above will allow
git push
es by a user to their owngit-shell-commands
directory, except forBill
who'll have scripts copied over but not setup withGit
tracking; for reasons.
... and perhaps write a cron job script for occasionally adding configuration blocks as repositories are built into pages...
#!/usr/bin/env bash
_home_base='/srv'
declare -A _grouped_users=(
['admins']='Joan:Liz'
['devs']='Bill:Ted'
)
_wwwconf_args_base=(
'--clobber' 'update'
'--interface' 'eth0'
'--server' 'nginx'
'--tld' 'lan'
)
for _domain in "${!_grouped_users[@]}"; do
for _user in ${_grouped_users[${_domain}]//:/ }; do
_www_dir="${_home_base}/${_user}/www"
[[ -d "${_www_dir}" ]] || continue
for _srv_dir in "${_www_dir}/"*; do
jekyll_wwwconf.sh ${_wwwconf_args_base[*]}\
--user "${_user}"\
--domain "${_domain}"
done
done
done
Note
entr
and other file system monitoring APIs maybe more efficient than what the above is doing.
-
- Notify
Git
/Jekyll
users that server is ready to utilizegit-shell-commands
within their respective home directories
- Notify
-
- If not using a
cron
job to keep web server configurations updated then use thejekyll_wwwconf.sh
script's--clobber
append
orremove
options for the desired results against a given--repo
- If not using a
-
.github
contains templates for GitHub interactions such as openingIssues
-
git_shell_commands/
containsGit
/Jekyll
client scripts that may be copied or linked via usingjekyll_usermod.sh
script -
make_scriptlets/
contains scripts used byMakefile
formake install
andmake update
commands; hintmake list
lists availablemake
options -
shared_functions/
contains functions shared between scripts within root of project directory
-
jekyll_usermod.sh
, adds new user, with ssh-pub-key (git-shell access only), andinstalls
the following to the home directory of the new user;Jekyll
, for translating MarkDown to HTML (HyperText Markup Language), just to list one of many things thatJekyll
'll do- copy or link selected
git-shell-command
scripts, intended to simplify some of the repetitively redundant tasks involved withGit
andJekyll
development - and initializes user named repo much like what GitHub makes available.
-
jekyll_dnsconf.sh
, addsA
records for interface, group/domain, and TLD (Top Level Domain), currently wired for Unbound DNS (Domain Name Server); note, someusage examples
have been published for this script -
jekyll_wwwconf.sh
, adds {sub-}domain names to web server for given user/repo, currently wired for Nginx Web Server, check the publishedusage examples
for examples of usage