Skip to content

Latest commit

 

History

History
496 lines (365 loc) · 8.81 KB

README.adoc

File metadata and controls

496 lines (365 loc) · 8.81 KB

sdavids.de Homepage

$ cd hp
$ npm install --no-ignore-scripts
$ cd hp
$ npm run format
$ cd hp
$ npm run lint
$ cd hp
$ npm run cert:ca:create
$ npm run cert:create
$ cd httpd
$ scripts/docker_build.sh
$ cd hp
$ npm run docker:httpd:start:with-build
$ cd hp
$ npm run docker:httpd:stop

We abide by the Contributor Covenant, Version 2.1 and ask that you do as well.

For more information, please see Code of Conduct.

After initializing this repository you need to configure the ignore-revs-file:

$ git config blame.ignoreRevsFile .git-blame-ignore-revs

Add httpd.internal to your /etc/hosts:

/etc/hosts
127.0.0.1       localhost httpd.internal
::1             localhost httpd.internal
ℹ️

If you want to change this entry you need to also change:

httpd/httpd.conf
ServerName httpd.internal:80
httpd/httpd-ssl.conf
ServerName httpd.internal:443
hp/scripts/docker_httpd_start.sh
readonly host_name='httpd.internal'
hp/package.json
"scripts": {
…
    "cert:copy": "scripts/copy_ca_based_cert.sh certs httpd.internal",
    "cert:create": "scripts/create_ca_based_cert.sh certs 30 httpd.internal",
    "cert:delete": "scripts/delete_ca_based_cert.sh certs httpd.internal",
    "cert:renew": "scripts/renew_ca_based_cert.sh certs 30 httpd.internal",
    "cert:verify": "scripts/verify_ca_based_cert.sh certs 30 httpd.internal",
…
  },
…

Install fnm or NVM.

ℹ️

This repository uses husky for Git hooks.

More information: Husky - Command not found

~/.zprofile
if command -v fnm >/dev/null 2>&1; then
  eval "$(fnm env --use-on-cd)"
fi
~/.config/husky/init.sh
#!/usr/bin/env sh

# vim:ft=zsh

# shellcheck shell=sh disable=SC1091

set -eu

[ -e /etc/zshenv ] && . /etc/zshenv
[ -e "${ZDOTDIR:=${HOME}}/.zshenv" ] && . "${ZDOTDIR:=${HOME}}/.zshenv"
[ -e /etc/zprofile ] && . /etc/zprofile
[ -e "${ZDOTDIR:=${HOME}}/.zprofile" ] && . "${ZDOTDIR:=${HOME}}/.zprofile"
[ -e /etc/zlogin ] && . /etc/zlogin
[ -e "${ZDOTDIR:=${HOME}}/.zlogin" ] && . "${ZDOTDIR:=${HOME}}/.zlogin"
~/.zshrc
export NVM_DIR="${HOME}/.nvm"

[ -s "${NVM_DIR}/nvm.sh" ] && . "${NVM_DIR}/nvm.sh"
[ -s "${NVM_DIR}/bash_completion" ] && . "${NVM_DIR}/bash_completion"

if command -v nvm >/dev/null 2>&1; then
  autoload -U add-zsh-hook
  load-nvmrc() {
    local nvmrc_path="$(nvm_find_nvmrc)"
    if [ -n "${nvmrc_path}" ]; then
      local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
      if [ "${nvmrc_node_version}" = "N/A" ]; then
        nvm install
      elif [ "${nvmrc_node_version}" != "$(nvm version)" ]; then
        nvm use
      fi
    elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
      echo 'Reverting to nvm default version'
      nvm use default
    fi
  }

  add-zsh-hook chpwd load-nvmrc
  load-nvmrc
fi
~/.config/husky/init.sh
#!/usr/bin/env sh

# vim:ft=zsh

# shellcheck shell=sh disable=SC1091

set -eu

[ -e /etc/zshenv ] && . /etc/zshenv
[ -e "${ZDOTDIR:=${HOME}}/.zshenv" ] && . "${ZDOTDIR:=${HOME}}/.zshenv"
[ -e /etc/zprofile ] && . /etc/zprofile
[ -e "${ZDOTDIR:=${HOME}}/.zprofile" ] && . "${ZDOTDIR:=${HOME}}/.zprofile"
[ -e /etc/zlogin ] && . /etc/zlogin
[ -e "${ZDOTDIR:=${HOME}}/.zlogin" ] && . "${ZDOTDIR:=${HOME}}/.zlogin"

export NVM_DIR="${HOME}/.nvm"

if [ -f "${NVM_DIR}/nvm.sh" ]; then
  . "${NVM_DIR}/nvm.sh"

  if [ -f '.nvmrc' ]; then
    nvm use
  fi
fi
$ cd hp
$ node --run cert:ca:create
$ node --run cert:create
$ cd hp
$ node --run cert:copy
$ sudo apt-get install jq
$ brew install jq
$ sudo apt-get install brotli
$ brew install brotli
$ sudo apt-get install zstd
$ brew install zstd
$ sudo apt-get install shellcheck
$ brew install shellcheck
$ sudo apt-get install shfmt
$ brew install shfmt
$ sudo apt-get install yamllint
$ brew install yamllint

Install hadolint.

$ brew install hadolint
$ sudo apt-get install gpg

Install GPG Suite.

Ensure that you install version 3.1.7 and not 3.2.0!

Version 3.2.0 is an incompatible development snapshot release.

Install easyrsa.

Warning

Unfortunately, homebrew provides easy-rsa version 3.2.0 at this point in time (August 2024).

$ curl -L https://github.com/OpenVPN/easy-rsa/releases/download/v3.1.7/EasyRSA-3.1.7.tgz -o ~/Downloads/easy-rsa.tgz
$ tar -xzf ~/Downloads/easy-rsa.tgz -C ~/.local/share
$ mv  ~/.local/share/EasyRSA-3.1.7 ~/.local/share/easyrsa
$ ln -s ~/.local/share/easyrsa/easyrsa ~/.local/bin/easyrsa