Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/.devcontainer/chrome/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "chrome",
"version": "1.0.0",
"name": "Chrome",
"description": "Install Google Chrome web browser.",
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers/features/git"
]
}
47 changes: 47 additions & 0 deletions .github/.devcontainer/chrome/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

set -e

export DEBIAN_FRONTEND=noninteractive

USERNAME=${USERNAME:-${_REMOTE_USER:-"automatic"}}

VERSION=${VERSION:-"22"}

if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi

arch="$(dpkg --print-architecture)"
if [ "${arch}" != "amd64" ] && [ "${arch}" != "arm64" ]; then
echo "Architecture ${arch} unsupported"
exit 2
fi

# Determine the appropriate non-root user
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do
if id -u "${CURRENT_USER}" >/dev/null 2>&1; then
USERNAME=${CURRENT_USER}
break
fi
done
if [ "${USERNAME}" = "" ]; then
USERNAME=root
fi
elif [ "${USERNAME}" = "none" ] || ! id -u "${USERNAME}" >/dev/null 2>&1; then
USERNAME=root
fi

install_chrome() {
local arch="$(dpkg --print-architecture)"
check_packages wget gnupg
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=${arch}] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google.list
check_packages google-chrome-stable
}

apt-get clean && rm -rf /var/lib/apt/lists/*
19 changes: 19 additions & 0 deletions .github/.devcontainer/decktape/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "decktape",
"version": "1.0.0",
"name": "decktape",
"description": "Install decktape, a tool for generating PDFs from web pages.",
"options": {
"node": {
"default": "22",
"description": "Select the Node version to install.",
"proposals": ["22"],
"type": "string"
}
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers/features/git",
"./chrome"
]
}
42 changes: 42 additions & 0 deletions .github/.devcontainer/decktape/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

set -e

export DEBIAN_FRONTEND=noninteractive

USERNAME=${USERNAME:-${_REMOTE_USER:-"automatic"}}

VERSION=${VERSION:-"22"}

if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi

# Determine the appropriate non-root user
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do
if id -u "${CURRENT_USER}" >/dev/null 2>&1; then
USERNAME=${CURRENT_USER}
break
fi
done
if [ "${USERNAME}" = "" ]; then
USERNAME=root
fi
elif [ "${USERNAME}" = "none" ] || ! id -u "${USERNAME}" >/dev/null 2>&1; then
USERNAME=root
fi

install_decktape() {
local version=$1
local url="https://deb.nodesource.com/setup_${version}.x "
check_packages curl ca-certificates
curl --proto '=https' --tlsv1.2 -LsSf ${url} | sudo -E bash -
check_packages nodejs
npm install -g decktape
}

apt-get clean && rm -rf /var/lib/apt/lists/*
4 changes: 4 additions & 0 deletions .github/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
"./uv": {
"version": "latest"
},
"./chrome": {},
"./decktape": {
"node": "22"
},
"ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {
"version": "${localEnv:QUARTO_VERSION}",
"installTinyTex": "true",
Expand Down