From 6c5e3197e25f8402ed9b7d3e94caf2ad70485c82 Mon Sep 17 00:00:00 2001 From: kawaiipunk Date: Thu, 29 Oct 2026 14:53:27 +0000 Subject: [PATCH 1/4] feat: add Docker Compose development environment --- .dockerignore | 14 +++++++++ .gitignore | 2 ++ _config.docker.yml | 2 ++ _config.yml | 15 ++++++++++ compose.podman.yaml | 15 ++++++++++ compose.yaml | 66 +++++++++++++++++++++++++++++++++++++++++++ docker/dev/Dockerfile | 42 +++++++++++++++++++++++++++ docker/dev/Gemfile | 11 ++++++++ docker/dev/setup.sh | 37 ++++++++++++++++++++++++ 9 files changed, 204 insertions(+) create mode 100644 .dockerignore create mode 100644 _config.docker.yml create mode 100644 compose.podman.yaml create mode 100644 compose.yaml create mode 100644 docker/dev/Dockerfile create mode 100644 docker/dev/Gemfile create mode 100755 docker/dev/setup.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..047f6f6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +.git +.gitignore +_site +node_modules +vendor +.bundle +.jekyll-cache +.sass-cache +.task +public +assets/fonts +assets/js +README.markdown +compose.podman.yaml diff --git a/.gitignore b/.gitignore index 8ee6b71..fdbd816 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ _site _posts _data/activity_pub.yml .env +privkey.pem +pack.js .bundle/ .jekyll-cache/ .sass-cache/ diff --git a/_config.docker.yml b/_config.docker.yml new file mode 100644 index 0000000..bb93afe --- /dev/null +++ b/_config.docker.yml @@ -0,0 +1,2 @@ +url: "http://localhost:4000" +hostname: "localhost:4000" diff --git a/_config.yml b/_config.yml index 059996c..92452b0 100644 --- a/_config.yml +++ b/_config.yml @@ -78,3 +78,18 @@ url: https://coopcloud.testing.sutty.nl brotli: quality: 9 name: coopcloud.testing +exclude: +- .bundle +- .jekyll-cache +- .sass-cache +- .task +- Dockerfile +- Gemfile +- Gemfile.lock +- README.markdown +- compose.podman.yaml +- compose.yaml +- docker +- gemfiles +- node_modules +- vendor diff --git a/compose.podman.yaml b/compose.podman.yaml new file mode 100644 index 0000000..34e0f10 --- /dev/null +++ b/compose.podman.yaml @@ -0,0 +1,15 @@ +# Podman-only override. +# +# Rootless Podman maps container root to a subordinate UID, so the bind-mounted +# source is not writable by the default container user. Keep the host UID and +# GID inside the container instead: +# +# podman-compose -f compose.yaml -f compose.podman.yaml up --build +# +services: + setup: + userns_mode: keep-id + jekyll: + userns_mode: keep-id + js: + userns_mode: keep-id diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..a44190c --- /dev/null +++ b/compose.yaml @@ -0,0 +1,66 @@ +name: coopcloud-website + +x-app: &app + build: + context: . + dockerfile: docker/dev/Dockerfile + image: coopcloud-website-dev + working_dir: /srv/site + volumes: + - .:/srv/site:z + - bundle:/srv/site/vendor/bundle + - node_modules:/srv/site/node_modules + environment: + BUNDLE_APP_CONFIG: /srv/site/.bundle + BUNDLE_GEMFILE: /srv/site/docker/dev/Gemfile + BUNDLE_PATH: /srv/site/vendor/bundle + GEMS_SOURCE: https://rubygems.org + HAINISH: "" + HOME: /tmp + JEKYLL_ENV: development + +services: + setup: + <<: *app + command: ["sh", "/srv/site/docker/dev/setup.sh"] + restart: "no" + + jekyll: + <<: *app + command: + - bundle + - exec + - jekyll + - serve + - --host + - 0.0.0.0 + - --port + - "4000" + - --livereload + - --watch + - --config + - _config.yml,_config.docker.yml + depends_on: + setup: + condition: service_completed_successfully + ports: + - "4000:4000" + - "35729:35729" + + js: + <<: *app + command: + - pnpm + - exec + - esbuild + - _packs/entry.js + - --bundle + - --outfile=pack.js + - --watch + depends_on: + setup: + condition: service_completed_successfully + +volumes: + bundle: + node_modules: diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile new file mode 100644 index 0000000..5e0a2a0 --- /dev/null +++ b/docker/dev/Dockerfile @@ -0,0 +1,42 @@ +# syntax=docker/dockerfile:1 +FROM docker.io/library/ruby:3.1.5-alpine3.18 + +RUN apk add --no-cache \ + bash \ + brotli-dev \ + build-base \ + ca-certificates \ + curl \ + file \ + file-dev \ + git \ + git-lfs \ + nodejs \ + npm \ + openssl \ + py3-pip \ + python3 \ + tini \ + vips-dev \ + && npm install -g pnpm@9 \ + && python3 -m pip install --no-cache-dir fonttools \ + && gem install bundler --version 2.6.9 --no-document \ + && rm -rf /var/cache/apk/* + +WORKDIR /srv/site + +# Keep UIDs aligned with the common host UID so bind-mounted files and +# dependency volumes remain writable. +RUN addgroup -g 1000 app \ + && adduser -D -u 1000 -G app app \ + && mkdir -p /srv/site/vendor/bundle /srv/site/node_modules \ + && chown -R 1000:1000 /srv/site + +ENV HOME=/tmp \ + BUNDLE_APP_CONFIG=/srv/site/.bundle \ + BUNDLE_PATH=/srv/site/vendor/bundle + +USER app + +ENTRYPOINT ["/sbin/tini", "--"] +CMD ["sh"] diff --git a/docker/dev/Gemfile b/docker/dev/Gemfile new file mode 100644 index 0000000..d671ed5 --- /dev/null +++ b/docker/dev/Gemfile @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +# Development-only Gemfile. +# +# The production lockfile is built against the private Sutty gem source and +# pinned to musl-native gems such as ruby-brs. That source is not reachable +# from outside Sutty, so the Docker environment resolves the same dependencies +# from rubygems.org into its own lockfile. +ENV['GEMS_SOURCE'] = 'https://rubygems.org' + +eval_gemfile File.expand_path('../../Gemfile', __dir__) diff --git a/docker/dev/setup.sh b/docker/dev/setup.sh new file mode 100755 index 0000000..9b8dc16 --- /dev/null +++ b/docker/dev/setup.sh @@ -0,0 +1,37 @@ +#!/bin/sh +set -eu + +ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd) +cd "$ROOT" + +export BUNDLE_GEMFILE="$ROOT/docker/dev/Gemfile" +export GEMS_SOURCE=https://rubygems.org + +if [ ! -f _bin/pagefind ] || head -c 128 _bin/pagefind | grep -q 'git-lfs.github.com'; then + echo "error: LFS assets are missing. Run 'git lfs pull' on the host." >&2 + exit 1 +fi + +if head -c 128 assets/fonts/inter/v18/UcCm3FwrK3iLTcvnUwAT9nA2.woff2 2>/dev/null | grep -q 'git-lfs.github.com'; then + echo "error: LFS font assets are pointers. Run 'git lfs pull' on the host." >&2 + exit 1 +fi + +echo "==> Installing Ruby gems" +bundle check || bundle install + +echo "==> Installing Node modules" +pnpm install --frozen-lockfile + +if [ ! -f privkey.pem ]; then + echo "==> Generating a development ActivityPub key" + openssl genrsa -out privkey.pem 2048 + chmod 600 privkey.pem +fi + +if [ ! -f assets/fonts/forkawesome-webfont.woff2 ]; then + echo "==> Generating the Fork Awesome subset" + ./_bin/subset_fork_awesome.sh || echo "warning: could not generate Fork Awesome subset" >&2 +fi + +echo "==> Setup complete" -- 2.54.0 From c8247df11bcb373d377c9df731e09c78496b7d6a Mon Sep 17 00:00:00 2001 From: kawaiipunk Date: Thu, 29 Oct 2026 15:49:17 +0000 Subject: [PATCH 2/4] fix: complete Docker Compose development environment --- .gitignore | 1 + README.markdown | 100 ++++++++++++ _config.docker.yml | 20 +++ _config.yml | 2 + compose.yaml | 4 +- docker/dev/Dockerfile | 4 +- docker/dev/Gemfile.lock | 332 ++++++++++++++++++++++++++++++++++++++++ docker/dev/setup.sh | 7 +- 8 files changed, 466 insertions(+), 4 deletions(-) create mode 100644 docker/dev/Gemfile.lock diff --git a/.gitignore b/.gitignore index fdbd816..a8b34af 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ _data/activity_pub.yml privkey.pem pack.js .bundle/ +.pnpm-store/ .jekyll-cache/ .sass-cache/ .task/ diff --git a/README.markdown b/README.markdown index dbd1d2b..cec6fbf 100644 --- a/README.markdown +++ b/README.markdown @@ -3,3 +3,103 @@ Re-escritura de [sutty-base-jekyll-theme](https://0xacab.org/sutty/jekyll/sutty-base-jekyll-theme) con soporte para Bootstrap 5. + +## Docker development + +This repository includes a Docker Compose environment for local development. +It builds and serves the site locally; it does **not** deploy anything. The +site is still deployed by Sutty. + +### Requirements + +- Docker with Compose v2, or Podman with `podman-compose` +- Git LFS +- Enough disk space for the image, gems, and Node modules (roughly 2 GB) + +The first run is slow because it installs gems, compiles native extensions, and +builds the site. + +### Start + +```sh +git lfs pull +docker compose up --build +``` + +Open . + +Live reload is available on port `35729`. + +With rootless Podman: + +```sh +podman-compose -f compose.yaml -f compose.podman.yaml up --build +``` + +### Services + +| Service | Purpose | +| --- | --- | +| `setup` | Installs gems and Node modules, generates a dev key and font, builds the site | +| `jekyll` | Runs `jekyll serve` with live reload on port 4000 | +| `js` | Runs esbuild in watch mode and writes `pack.js` | + +The `setup` service must finish before `jekyll` and `js` start. + +### Common commands + +```sh +docker compose logs -f # follow logs +docker compose down # stop, keep dependency volumes +docker compose down -v # stop and reset gems/node_modules/site volumes +docker compose run --rm setup # reinstall after Gemfile or pnpm-lock changes +``` + +One-off build: + +```sh +docker compose run --rm jekyll \ + bundle exec jekyll build --config _config.yml,_config.docker.yml +``` + +### Ruby dependencies + +The production `Gemfile.lock` is tied to `gems.sutty.nl` and musl-native gems +that are not published on rubygems.org. The Docker environment therefore uses a +separate development Gemfile and lockfile: + +```text +docker/dev/Gemfile +docker/dev/Gemfile.lock +``` + +These resolve the same dependencies from rubygems.org. They are only for local +development; production and Sutty continue to use the root `Gemfile.lock`. + +Some gem versions may differ from production because not every locked version +exists on rubygems.org. + +### LFS assets + +Fonts, images, the compiled JavaScript bundle, and `_bin/pagefind` are tracked by +Git LFS. The setup service stops with an error if they are still pointer files: + +```sh +git lfs install +git lfs pull +``` + +### Generated files + +The development environment may create: + +- `privkey.pem` — disposable ActivityPub key, ignored by git +- `pack.js` — development JavaScript bundle, ignored by git +- `_data/activity_pub.yml` — ActivityPub state, ignored by git +- `assets/fonts/forkawesome-webfont.woff2` — generated icon subset +- `_site` — kept in a Docker volume + +The Fork Awesome subset is generated from `_data/fa.yml`. It is intentionally not +part of this development change; commit it separately when fixing the production +font 404. + diff --git a/_config.docker.yml b/_config.docker.yml index bb93afe..86f604b 100644 --- a/_config.docker.yml +++ b/_config.docker.yml @@ -1,2 +1,22 @@ url: "http://localhost:4000" hostname: "localhost:4000" +# Jekyll replaces arrays when merging configs, so this repeats the main +# exclude list and adds development-only paths. +exclude: + - .bundle + - .jekyll-cache + - .pnpm-store + - .sass-cache + - .task + - Dockerfile + - Gemfile + - Gemfile.lock + - README.markdown + - _data/activity_pub.yml + - compose.podman.yaml + - compose.yaml + - docker + - gemfiles + - node_modules + - privkey.pem + - vendor diff --git a/_config.yml b/_config.yml index 92452b0..d77c8bf 100644 --- a/_config.yml +++ b/_config.yml @@ -81,6 +81,7 @@ name: coopcloud.testing exclude: - .bundle - .jekyll-cache +- .pnpm-store - .sass-cache - .task - Dockerfile @@ -92,4 +93,5 @@ exclude: - docker - gemfiles - node_modules +- privkey.pem - vendor diff --git a/compose.yaml b/compose.yaml index a44190c..2cd50b4 100644 --- a/compose.yaml +++ b/compose.yaml @@ -10,6 +10,7 @@ x-app: &app - .:/srv/site:z - bundle:/srv/site/vendor/bundle - node_modules:/srv/site/node_modules + - site:/srv/site/_site environment: BUNDLE_APP_CONFIG: /srv/site/.bundle BUNDLE_GEMFILE: /srv/site/docker/dev/Gemfile @@ -56,7 +57,7 @@ services: - _packs/entry.js - --bundle - --outfile=pack.js - - --watch + - --watch=forever depends_on: setup: condition: service_completed_successfully @@ -64,3 +65,4 @@ services: volumes: bundle: node_modules: + site: diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index 5e0a2a0..c2e8edb 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -19,7 +19,7 @@ RUN apk add --no-cache \ tini \ vips-dev \ && npm install -g pnpm@9 \ - && python3 -m pip install --no-cache-dir fonttools \ + && python3 -m pip install --no-cache-dir fonttools brotli \ && gem install bundler --version 2.6.9 --no-document \ && rm -rf /var/cache/apk/* @@ -29,7 +29,7 @@ WORKDIR /srv/site # dependency volumes remain writable. RUN addgroup -g 1000 app \ && adduser -D -u 1000 -G app app \ - && mkdir -p /srv/site/vendor/bundle /srv/site/node_modules \ + && mkdir -p /srv/site/_site /srv/site/vendor/bundle /srv/site/node_modules \ && chown -R 1000:1000 /srv/site ENV HOME=/tmp \ diff --git a/docker/dev/Gemfile.lock b/docker/dev/Gemfile.lock new file mode 100644 index 0000000..fb79cef --- /dev/null +++ b/docker/dev/Gemfile.lock @@ -0,0 +1,332 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) + adsp (1.0.10) + ansi (1.6.0) + ast (2.4.3) + base64 (0.3.0) + bigdecimal (3.1.9) + brotli (0.9.2) + climate_control (1.2.0) + coderay (1.1.3) + colorator (1.1.0) + concurrent-ruby (1.3.8) + crass (1.0.8) + csv (3.3.7) + distributed-press-api-client (0.5.4) + addressable (~> 2.3, >= 2.3.0) + climate_control + dry-schema + httparty (~> 0.18) + httparty-cache (~> 0.0.6) + json (~> 2.1, >= 2.1.0) + jwt (~> 2.6.0) + nokogiri (~> 1.16) + dry-configurable (1.3.0) + dry-core (~> 1.1) + zeitwerk (~> 2.6) + dry-core (1.1.0) + concurrent-ruby (~> 1.0) + logger + zeitwerk (~> 2.6) + dry-inflector (1.2.0) + dry-initializer (3.2.0) + dry-logic (1.6.0) + bigdecimal + concurrent-ruby (~> 1.0) + dry-core (~> 1.1) + zeitwerk (~> 2.6) + dry-schema (1.14.1) + concurrent-ruby (~> 1.0) + dry-configurable (~> 1.0, >= 1.0.1) + dry-core (~> 1.1) + dry-initializer (~> 3.2) + dry-logic (~> 1.5) + dry-types (~> 1.8) + zeitwerk (~> 2.6) + dry-types (1.8.3) + bigdecimal (~> 3.0) + concurrent-ruby (~> 1.0) + dry-core (~> 1.0) + dry-inflector (~> 1.0) + dry-logic (~> 1.4) + zeitwerk (~> 2.6) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + eventmachine (1.2.7) + faraday (1.10.6) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.1) + faraday-excon (1.1.0) + faraday-http-cache (2.5.1) + faraday (>= 0.8) + faraday-httpclient (1.0.1) + faraday-multipart (1.2.0) + multipart-post (~> 2.0) + faraday-net_http (1.0.2) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.4) + faraday_middleware (1.2.1) + faraday (~> 1.0) + fast_blank (1.0.1) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-darwin) + ffi (1.17.4-x86_64-linux-musl) + forwardable-extended (2.6.0) + google-protobuf (4.35.1-arm64-darwin) + bigdecimal + rake (~> 13.3) + google-protobuf (4.35.1-x86_64-darwin) + bigdecimal + rake (~> 13.3) + google-protobuf (4.35.1-x86_64-linux-musl) + bigdecimal + rake (~> 13.3) + http_parser.rb (0.8.1) + httparty (0.24.3) + csv + mini_mime (>= 1.0.0) + multi_xml (>= 0.5.2) + httparty-cache (0.0.6) + httparty (~> 0.18) + i18n (1.15.2) + concurrent-ruby (~> 1.0) + io-console (0.9.5) + jekyll (4.4.1) + addressable (~> 2.4) + base64 (~> 0.2) + colorator (~> 1.0) + csv (~> 3.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) + jekyll-watch (~> 2.0) + json (~> 2.6) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (~> 0.3, >= 0.3.6) + pathutil (~> 0.9) + rouge (>= 3.0, < 5.0) + safe_yaml (~> 1.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-activity-pub (0.3.6) + distributed-press-api-client (~> 0.5.0) + jekyll (~> 4) + marcel (~> 1) + jekyll-brotli (2.4.1) + brotli (~> 0.2) + jekyll (>= 3.0, < 5.0) + jekyll-data (1.1.1) + jekyll (>= 3.3, < 5.0.0) + jekyll-drafts-as-metadata (0.0.6) + jekyll (>= 3.8, < 5) + jekyll-embed-urls (0.6.6) + faraday (~> 1.3) + faraday-http-cache (~> 2.2) + faraday_middleware (~> 1) + jekyll (~> 4) + loofah (~> 2.9) + ogp (~> 0.5.0, < 0.6) + ruby-oembed (>= 0.16.0) + url-privacy (~> 0.1.1) + jekyll-gzip (2.5.1) + jekyll (>= 3.0, < 5.0) + jekyll-hardlinks (0.2.0) + jekyll (~> 4) + jekyll-ignore-layouts (0.1.2) + jekyll (~> 4) + jekyll-images (0.4.7) + jekyll (~> 4) + ruby-filemagic (~> 0.7) + ruby-vips (~> 2) + jekyll-include-cache (0.3.1) + jekyll (>= 3.7, < 5.0) + jekyll-linked-posts (0.6.0) + jekyll (~> 4) + jekyll-locales (0.3.0) + jekyll-logger-tap (0.2.0) + jekyll (~> 4.2) + jekyll-nokogiri (0.1.0) + jekyll + nokogiri + jekyll-order (0.1.7) + jekyll-raw-html-converter (0.0.1) + jekyll (~> 4) + jekyll-relative-urls (0.0.7) + jekyll (~> 4) + jekyll-sass-converter (3.1.0) + sass-embedded (~> 1.75) + jekyll-seo-tag (2.9.1) + jekyll (>= 3.8, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + json (2.21.2) + jwt (2.6.0) + kramdown (2.5.2) + rexml (>= 3.4.4) + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + language_server-protocol (3.17.0.6) + liquid (4.0.4) + listen (3.10.1) + logger + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) + loofah (2.25.2) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + marcel (1.2.1) + mercenary (0.4.0) + method_source (1.1.0) + mini_mime (1.1.5) + multi_xml (0.7.1) + bigdecimal (~> 3.1) + multipart-post (2.4.1) + nokogiri (1.18.10-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-musl) + racc (~> 1.4) + oga (3.5) + ast + ruby-ll (~> 2.2) + ogp (0.5.0) + oga (~> 3.3) + parallel (1.28.0) + parser (3.3.13.0) + ast (~> 2.4.1) + racc + pathutil (0.16.2) + forwardable-extended (~> 2.6) + prism (1.9.0) + prometheus_exporter (2.2.0) + webrick + pry (0.16.1) + coderay (~> 1.1) + method_source (~> 1.0) + reline (>= 0.6.0) + public_suffix (6.0.2) + racc (1.8.1) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rainbow (3.1.1) + rake (13.4.2) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + regexp_parser (2.13.1) + reline (0.7.0) + io-console (~> 0.5) + rexml (3.4.4) + rouge (4.7.0) + rubocop (1.57.2) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.28.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.50.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-jekyll (0.14.0) + rubocop (~> 1.57.0) + rubocop-performance (~> 1.2) + rubocop-performance (1.23.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-brs (1.3.3) + adsp (~> 1.0) + ruby-filemagic (0.7.3) + ruby-ll (2.2.0) + ansi + ast + ruby-oembed (0.18.1) + ruby-progressbar (1.13.0) + ruby-vips (2.3.0) + ffi (~> 1.12) + logger + ruby2_keywords (0.0.5) + safe_yaml (1.0.5) + sass-embedded (1.83.4) + google-protobuf (~> 4.29) + rake (>= 13) + sass-embedded (1.83.4-arm64-darwin) + google-protobuf (~> 4.29) + sass-embedded (1.83.4-x86_64-darwin) + google-protobuf (~> 4.29) + sutty-liquid (0.13.3) + fast_blank (~> 1.0) + jekyll (~> 4) + loofah + rails-html-sanitizer (~> 1.6.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.6.0) + url-privacy (0.1.2) + webrick (1.9.2) + zeitwerk (2.6.18) + +PLATFORMS + arm64-darwin + x86_64-darwin + x86_64-linux-musl + +DEPENDENCIES + bigdecimal (= 3.1.9) + jekyll (~> 4.4.0) + jekyll-activity-pub (~> 0.3.0) + jekyll-brotli + jekyll-data + jekyll-drafts-as-metadata + jekyll-embed-urls + jekyll-gzip + jekyll-hardlinks + jekyll-ignore-layouts + jekyll-images + jekyll-include-cache + jekyll-linked-posts + jekyll-locales + jekyll-logger-tap + jekyll-nokogiri + jekyll-order + jekyll-raw-html-converter + jekyll-relative-urls + jekyll-seo-tag + jekyll-sitemap + prometheus_exporter + pry + rubocop-jekyll + ruby-brs + sass-embedded (~> 1.83.0) + sutty-liquid + +BUNDLED WITH + 2.6.9 diff --git a/docker/dev/setup.sh b/docker/dev/setup.sh index 9b8dc16..8f2c33e 100755 --- a/docker/dev/setup.sh +++ b/docker/dev/setup.sh @@ -21,7 +21,7 @@ echo "==> Installing Ruby gems" bundle check || bundle install echo "==> Installing Node modules" -pnpm install --frozen-lockfile +pnpm install --frozen-lockfile --store-dir=/tmp/pnpm-store if [ ! -f privkey.pem ]; then echo "==> Generating a development ActivityPub key" @@ -34,4 +34,9 @@ if [ ! -f assets/fonts/forkawesome-webfont.woff2 ]; then ./_bin/subset_fork_awesome.sh || echo "warning: could not generate Fork Awesome subset" >&2 fi +# Build before starting the server so Pagefind's output is present when +# Jekyll creates its static-file list. +echo "==> Building the site" +bundle exec jekyll build --config _config.yml,_config.docker.yml + echo "==> Setup complete" -- 2.54.0 From f379eb4c56c4899eb66871083e5ce1ad00c54fe6 Mon Sep 17 00:00:00 2001 From: kawaiipunk Date: Thu, 29 Oct 2026 16:19:41 +0000 Subject: [PATCH 3/4] docs: simplify README and document Docker development --- README.markdown | 123 ++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 62 deletions(-) diff --git a/README.markdown b/README.markdown index cec6fbf..fb5e8cb 100644 --- a/README.markdown +++ b/README.markdown @@ -1,34 +1,44 @@ -# Sutty Base Bootstrap 5 +# Co-op Cloud Website -Re-escritura de -[sutty-base-jekyll-theme](https://0xacab.org/sutty/jekyll/sutty-base-jekyll-theme) -con soporte para Bootstrap 5. +Jekyll site and theme for the **Co-op Cloud Federation**, based on +[Sutty Base Bootstrap 5](https://0xacab.org/sutty/jekyll/sutty-base-jekyll-theme). -## Docker development +- Testing site: +- Deployment: **Sutty** +- Local development: **Docker Compose** -This repository includes a Docker Compose environment for local development. -It builds and serves the site locally; it does **not** deploy anything. The -site is still deployed by Sutty. +## What is in this repository -### Requirements +This repository contains both the theme and the site content: + +- **Jekyll 4.4** with **Bootstrap 5** +- English content in `_en/` and Spanish content in `_es/` (only English is + currently enabled) +- Page layouts in `_layouts/` and reusable components in `_includes/` +- Custom plugins in `_plugins/`, including generated recipe and taxonomy pages +- Static search with **Pagefind** +- **ActivityPub** support through `jekyll-activity-pub` +- JavaScript built with **esbuild**, Stimulus, and Turbo + +Content is normally written in the Sutty CMS, which commits to this repository. + +## Run locally with Docker + +Requirements: - Docker with Compose v2, or Podman with `podman-compose` - Git LFS -- Enough disk space for the image, gems, and Node modules (roughly 2 GB) - -The first run is slow because it installs gems, compiles native extensions, and -builds the site. - -### Start ```sh +git lfs install git lfs pull docker compose up --build ``` Open . -Live reload is available on port `35729`. +The first run takes a few minutes because it installs gems, compiles native +extensions, and builds the site. With rootless Podman: @@ -36,23 +46,15 @@ With rootless Podman: podman-compose -f compose.yaml -f compose.podman.yaml up --build ``` -### Services +Docker is for local development only. It does **not** deploy the site. -| Service | Purpose | -| --- | --- | -| `setup` | Installs gems and Node modules, generates a dev key and font, builds the site | -| `jekyll` | Runs `jekyll serve` with live reload on port 4000 | -| `js` | Runs esbuild in watch mode and writes `pack.js` | - -The `setup` service must finish before `jekyll` and `js` start. - -### Common commands +## Common commands ```sh -docker compose logs -f # follow logs -docker compose down # stop, keep dependency volumes -docker compose down -v # stop and reset gems/node_modules/site volumes -docker compose run --rm setup # reinstall after Gemfile or pnpm-lock changes +docker compose logs -f # follow logs +docker compose down # stop +docker compose down -v # stop and reset dependencies +docker compose run --rm setup # reinstall after dependency changes ``` One-off build: @@ -62,44 +64,41 @@ docker compose run --rm jekyll \ bundle exec jekyll build --config _config.yml,_config.docker.yml ``` -### Ruby dependencies - -The production `Gemfile.lock` is tied to `gems.sutty.nl` and musl-native gems -that are not published on rubygems.org. The Docker environment therefore uses a -separate development Gemfile and lockfile: +## Repository layout ```text -docker/dev/Gemfile -docker/dev/Gemfile.lock +_en/, _es/ Site content +_data/ CMS schemas, translations, recipe data +_layouts/ Page templates +_includes/ Reusable Liquid components +_plugins/ Custom Jekyll plugins +_sass/, assets/ Styles, fonts, and JavaScript +docker/dev/ Docker image, setup script, and dev Gemfile +compose.yaml Local development environment +_config.yml Jekyll configuration ``` -These resolve the same dependencies from rubygems.org. They are only for local -development; production and Sutty continue to use the root `Gemfile.lock`. +## Notes -Some gem versions may differ from production because not every locked version -exists on rubygems.org. +- The production `Gemfile.lock` uses Sutty's gem server and musl-native gems + that are not available on rubygems.org. The Docker setup therefore uses a + separate `docker/dev/Gemfile` and lockfile. Some versions may differ from + production. +- Fonts, images, `assets/js/pack.*`, and `_bin/pagefind` are stored with Git + LFS. The site will not build correctly without `git lfs pull`. +- The setup service generates `privkey.pem`, `pack.js`, and the Fork Awesome + font subset. Do not commit `privkey.pem`. +- Change `pack.js` only through the `js` service; edit sources in `_packs/`. -### LFS assets +## Troubleshooting -Fonts, images, the compiled JavaScript bundle, and `_bin/pagefind` are tracked by -Git LFS. The setup service stops with an error if they are still pointer files: +- **LFS error during setup:** run `git lfs pull`. +- **Connection refused from another machine:** the server listens on + `0.0.0.0:4000`; allow TCP ports `4000` and `35729` in the host firewall. +- **Port already in use:** change the host ports in `compose.yaml`. +- **Broken dependency state:** run `docker compose down -v` and start again. -```sh -git lfs install -git lfs pull -``` - -### Generated files - -The development environment may create: - -- `privkey.pem` — disposable ActivityPub key, ignored by git -- `pack.js` — development JavaScript bundle, ignored by git -- `_data/activity_pub.yml` — ActivityPub state, ignored by git -- `assets/fonts/forkawesome-webfont.woff2` — generated icon subset -- `_site` — kept in a Docker volume - -The Fork Awesome subset is generated from `_data/fa.yml`. It is intentionally not -part of this development change; commit it separately when fixing the production -font 404. +## License +The theme is distributed under the Anti-Fascist MIT License. See +[`LICENSE.txt`](LICENSE.txt). -- 2.54.0 From 550862ec7dbb9da0157c0241cec5959cce72610c Mon Sep 17 00:00:00 2001 From: kawaiipunk Date: Thu, 29 Oct 2026 16:23:54 +0000 Subject: [PATCH 4/4] fix: add Fork Awesome subset font --- README.markdown | 6 ++++-- assets/fonts/forkawesome-webfont.woff2 | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 assets/fonts/forkawesome-webfont.woff2 diff --git a/README.markdown b/README.markdown index fb5e8cb..1fa178c 100644 --- a/README.markdown +++ b/README.markdown @@ -86,8 +86,10 @@ _config.yml Jekyll configuration production. - Fonts, images, `assets/js/pack.*`, and `_bin/pagefind` are stored with Git LFS. The site will not build correctly without `git lfs pull`. -- The setup service generates `privkey.pem`, `pack.js`, and the Fork Awesome - font subset. Do not commit `privkey.pem`. +- The setup service generates `privkey.pem` and `pack.js`. Do not commit + `privkey.pem`. +- The Fork Awesome subset is committed. Regenerate it with + `./_bin/subset_fork_awesome.sh` after changing `_data/fa.yml`, then commit it. - Change `pack.js` only through the `js` service; edit sources in `_packs/`. ## Troubleshooting diff --git a/assets/fonts/forkawesome-webfont.woff2 b/assets/fonts/forkawesome-webfont.woff2 new file mode 100644 index 0000000..3e536bf --- /dev/null +++ b/assets/fonts/forkawesome-webfont.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bfeab291982ae425d92b0fc1b4d39bb0ded8827c95b3387d4a28dd6381c8e5a +size 712 -- 2.54.0