Skip to content

sdavids/sdavids.de-homepage

Repository files navigation

sdavids.de Homepage

$ cd hp
$ npm install --no-ignore-scripts
$ cd hp
$ node --run build

hp/dist

ℹ️
.../sdavids.de-homepage/hp/node_modules/.bin/lightningcss: line 1: This: command not found

This build relies on esbuild and lightningcss.

You either need to not ignore the pre- or post-scripts when installing this project’s dependencies:

$ cd hp
$ rm -rf node_modules
$ npm install --no-ignore-scripts

Or invoke esbuild’s and lightningcss' post-install scripts explicitly:

$ cd hp
$ node node_modules/esbuild/install.js
$ node node_modules/lightningcss-cli/postinstall.js
$ cd hp
$ node --run format
$ cd hp
$ node --run lint
$ cd hp
$ node --run test
ℹ️

Ensure Playwright has been installed.

Start a development server; in a new shell:

$ cd hp
$ npm run e2e

Start a development server; in a new shell:

$ cd hp
$ npm run e2e:trace

Start a development server; in a new shell:

$ cd hp
$ npm run e2e:ui
$ cd hp
$ node --run cert:ca:create
$ node --run cert:create

Ensure that you have modified your DNS settings to include httpd.internal.

$ cd httpd
$ scripts/docker_build.sh
$ cd hp
$ node --run docker:httpd:start:with-build
$ cd hp
$ node --run docker:httpd:start
$ cd hp
$ node --run docker:httpd:stop

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

$ git config set 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.x!

Install easyrsa.

Warning

Unfortunately, homebrew provides easy-rsa version 3.2.x .

$ 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
$ rm ~/Downloads/easy-rsa.tgz
$ cp hp
$ npx playwright install --with-deps --no-shell
ℹ️

You can delete all downloaded binaries via:

$ npx playwright uninstall --all