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
aptdependencies 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 unboundSecuring servers is currently outside the scope of this file and documentation for this project.
-
- Elivate to
rootlevel 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_AdminNote, those that have cloned previously will need to
git submodule update --init --recursive --remote --mergeto download submodule source code.
-
makeif this is a fresh server...
make install-dependencies
make install- b ... or update via related
makecommands if this server is not so fresh...
make update
make install-
a For each group/domain run the
jekyll_dnsconf.shscript, for each user run thejekyll_usermod.shscript, and for each repository of each user run thejekyll_wwwconf.shscript. -
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
doneThe above will allow
git pushes by a user to their owngit-shell-commandsdirectory, except forBillwho'll have scripts copied over but not setup withGittracking; 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
doneNote
entrand other file system monitoring APIs maybe more efficient than what the above is doing.
-
- Notify
Git/Jekyllusers that server is ready to utilizegit-shell-commandswithin their respective home directories
- Notify
-
- If not using a
cronjob to keep web server configurations updated then use thejekyll_wwwconf.shscript's--clobberappendorremoveoptions for the desired results against a given--repo
- If not using a
-
.githubcontains templates for GitHub interactions such as openingIssues -
git_shell_commands/containsGit/Jekyllclient scripts that may be copied or linked via usingjekyll_usermod.shscript -
make_scriptlets/contains scripts used byMakefileformake installandmake updatecommands; hintmake listlists availablemakeoptions -
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), andinstallsthe 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-commandscripts, intended to simplify some of the repetitively redundant tasks involved withGitandJekylldevelopment - and initializes user named repo much like what GitHub makes available.
-
jekyll_dnsconf.sh, addsArecords for interface, group/domain, and TLD (Top Level Domain), currently wired for Unbound DNS (Domain Name Server); note, someusage exampleshave 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 examplesfor examples of usage