diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..c5e4341d1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "name": "choosealicense.com", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", + "remoteEnv": { + "PATH": "/home/vscode/.rbenv/shims:/home/vscode/.rbenv/bin:${containerEnv:PATH}" + }, + "postCreateCommand": "bash .devcontainer/post-create.sh" +} \ No newline at end of file diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100755 index 000000000..f69fd6aa3 --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +set -euo pipefail + +for cmd in curl git sed; do + if ! command -v "${cmd}" >/dev/null 2>&1; then + echo "${cmd} is required for .devcontainer/post-create.sh" + exit 1 + fi +done + +if command -v apt-get >/dev/null 2>&1; then + packages=( + build-essential + cmake + pkg-config + libffi-dev + libyaml-dev + libssl-dev + zlib1g-dev + libreadline-dev + libgdbm-dev + libncurses-dev + libssh2-1-dev + ) + + missing_packages=() + for package in "${packages[@]}"; do + if ! dpkg-query -W -f='${Status}' "${package}" 2>/dev/null | grep -q 'install ok installed'; then + missing_packages+=("${package}") + fi + done + + if [[ ${#missing_packages[@]} -gt 0 ]]; then + echo "Installing Ruby build dependencies: ${missing_packages[*]}" + if command -v sudo >/dev/null 2>&1; then + sudo apt-get update + sudo apt-get install -y "${missing_packages[@]}" + else + apt-get update + apt-get install -y "${missing_packages[@]}" + fi + fi +fi + +echo "Initializing/updating git submodules" +git submodule update --init --recursive + +versions_json="$(curl -fsSL https://pages.github.com/versions.json)" || { + echo "Failed to fetch https://pages.github.com/versions.json" + exit 1 +} + +pages_ruby_version="$( + printf '%s' "${versions_json}" | + sed -n 's/.*"ruby"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | + head -n 1 +)" + +echo "GitHub Pages Ruby version: ${pages_ruby_version}" + +if [[ -z "${pages_ruby_version}" ]]; then + echo "Could not determine Ruby version from https://pages.github.com/versions.json" + exit 1 +fi + +if [[ ! -d "$HOME/.rbenv" ]]; then + git clone --depth 1 https://github.com/rbenv/rbenv.git "$HOME/.rbenv" +fi + +if [[ ! -d "$HOME/.rbenv/plugins/ruby-build" ]]; then + mkdir -p "$HOME/.rbenv/plugins" + git clone --depth 1 https://github.com/rbenv/ruby-build.git "$HOME/.rbenv/plugins/ruby-build" +fi + +export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH" +eval "$(rbenv init - bash)" + +rbenv install -s "${pages_ruby_version}" +rbenv global "${pages_ruby_version}" +rbenv rehash + +for profile in "$HOME/.bashrc" "$HOME/.zshrc"; do + if [[ -f "$profile" ]] && ! grep -q 'rbenv init - bash' "$profile"; then + { + echo + echo '# Load rbenv' + echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' + echo 'eval "$(rbenv init - bash)"' + } >> "$profile" + fi +done + +gem install bundler --no-document +rbenv rehash +mkdir -p "$HOME/.local/bin" +ln -sf "$HOME/.rbenv/shims/bundle" "$HOME/.local/bin/bundle" +bundle install \ No newline at end of file diff --git a/_licenses/gpl-2.0.txt b/_licenses/gpl-2.0.txt index 79acf5cb7..0d0a17a00 100644 --- a/_licenses/gpl-2.0.txt +++ b/_licenses/gpl-2.0.txt @@ -12,9 +12,9 @@ how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of note: The Free Software Foundation recommends taking the additional step of adding a boilerplate notice to the top of each file. The boilerplate can be found at the end of the license. using: - AliSQL: https://github.com/alibaba/AliSQL/blob/master/COPYING Discourse: https://github.com/discourse/discourse/blob/master/LICENSE.txt Jellyfin: https://github.com/jellyfin/jellyfin/blob/master/LICENSE + OBS Studio: https://github.com/obsproject/obs-studio/blob/master/COPYING permissions: - commercial-use diff --git a/_licenses/gpl-3.0.txt b/_licenses/gpl-3.0.txt index 0fb3da36c..62baf3c10 100644 --- a/_licenses/gpl-3.0.txt +++ b/_licenses/gpl-3.0.txt @@ -15,7 +15,7 @@ note: The Free Software Foundation recommends taking the additional step of addi using: Ansible: https://github.com/ansible/ansible/blob/devel/COPYING Bash: https://git.savannah.gnu.org/cgit/bash.git/tree/COPYING - GIMP: https://git.gnome.org/browse/gimp/tree/COPYING + uBlock Origin: https://github.com/gorhill/uBlock/blob/master/LICENSE.txt permissions: - commercial-use