Skip to content

Commit c355e17

Browse files
authored
Merge pull request #11687 from neinteractiveliterature/spring-cleaning-2026
Spring cleaning 2026: remove unused dependencies and reduce Docker image size
2 parents 4ff44d4 + 21f851a commit c355e17

14 files changed

Lines changed: 41 additions & 6662 deletions

.github/workflows/release.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ jobs:
5353
node-version: ${{ steps.node-version.outputs.node-version }}
5454
- name: yarn install
5555
run: yarn install
56-
- name: Deploy to Cloudflare
57-
run: yarn run wrangler:deploy
58-
env:
59-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
60-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
6156
notify-slack:
6257
runs-on: ubuntu-latest
6358
needs:

Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ ENV REVISION ${REVISION}
6565

6666
USER root
6767
# iproute2, curl: generally useful network utilities that don't take much space
68-
# python3, xz-utils: node dependencies
6968
# libvips43, poppler-utils: activestorage dependencies
7069
# libjemalloc2: more efficient memory allocation in Ruby and Node
7170
# shared-mime-info: Rails dependency
7271
# libpq5: pg gem dependency
73-
RUN apt-get update && apt-get install -y --no-install-recommends iproute2 curl python3 libvips42 poppler-utils xz-utils libjemalloc2 shared-mime-info libpq5 gosu && rm -rf /var/lib/apt/lists/*
72+
# xz-utils: installed temporarily to extract the node tarball, then removed
73+
RUN apt-get update \
74+
&& apt-get install -y --no-install-recommends iproute2 curl libvips42 poppler-utils xz-utils libjemalloc2 shared-mime-info libpq5 gosu \
75+
&& mkdir /opt/node \
76+
&& cd /opt/node \
77+
&& curl https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-$(echo ${TARGETARCH} | sed 's/amd64/x64/').tar.xz | tar xJ --strip-components=1 \
78+
&& rm -rf /opt/node/include /opt/node/lib/node_modules \
79+
&& apt-get purge -y xz-utils \
80+
&& apt-get autoremove -y \
81+
&& rm -rf /var/lib/apt/lists/*
7482
RUN useradd -ms $(which bash) www
75-
RUN mkdir /opt/node && \
76-
cd /opt/node && \
77-
curl https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-$(echo ${TARGETARCH} | sed 's/amd64/x64/').tar.xz | tar xJ --strip-components=1
7883
ENV PATH="/opt/node/bin:$PATH"
7984

80-
# Set up flyctl
81-
RUN curl -L https://fly.io/install.sh | sh
82-
ENV FLYCTL_INSTALL="/root/.fly"
83-
ENV PATH="$FLYCTL_INSTALL/bin:$PATH"
84-
8585
# Set up chamber for SSM-based secrets management
8686
RUN curl -fL "https://github.com/segmentio/chamber/releases/download/v${CHAMBER_VERSION}/chamber-v${CHAMBER_VERSION}-linux-${TARGETARCH}" \
8787
-o /usr/local/bin/chamber \

Gemfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,6 @@ gem "rollbar"
114114
# Reduces boot times through caching; required in config/boot.rb
115115
gem "bootsnap", ">= 1.1.0", require: false
116116

117-
# Production profiling
118-
group :skylight do
119-
gem "rbtrace"
120-
gem "skylight"
121-
gem "webrick" # we don't actually use it, but Skylight needs it on boot
122-
end
123-
124117
group :development do
125118
gem "rack-mini-profiler", require: false
126119

Gemfile.lock

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ GEM
415415
bigdecimal (>= 3.0)
416416
ostruct (>= 0.2)
417417
openssl (4.0.2)
418-
optimist (3.1.0)
419418
orm_adapter (0.5.0)
420419
ostruct (0.6.3)
421420
parallel (2.1.0)
@@ -511,10 +510,6 @@ GEM
511510
rbs (3.10.4)
512511
logger
513512
tsort
514-
rbtrace (0.5.3)
515-
ffi (>= 1.0.6)
516-
msgpack (>= 0.4.3)
517-
optimist (>= 3.0.0)
518513
rbtree (0.4.6)
519514
rdoc (7.2.0)
520515
erb
@@ -603,8 +598,6 @@ GEM
603598
simplecov-html (0.13.2)
604599
simplecov_json_formatter (0.1.4)
605600
simpleidn (0.2.3)
606-
skylight (7.1.1)
607-
activesupport (>= 7.2.0)
608601
slop (3.6.0)
609602
sorted_set (1.1.0)
610603
rbtree
@@ -751,7 +744,6 @@ DEPENDENCIES
751744
rack-mini-profiler
752745
rails (= 8.1.3)
753746
rails-controller-testing
754-
rbtrace
755747
readline (~> 0.0.4)
756748
recaptcha
757749
redcarpet
@@ -770,7 +762,6 @@ DEPENDENCIES
770762
shoryuken
771763
simplecov
772764
simplecov-cobertura
773-
skylight
774765
sprockets-rails
775766
stackprof
776767
stripe
@@ -780,7 +771,6 @@ DEPENDENCIES
780771
twilio-ruby (~> 7.10.0)
781772
typeprof
782773
tzinfo-data
783-
webrick
784774
will_paginate
785775
with_advisory_lock
786776
yard

bin/entrypoint.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ if [ -n "$CHAMBER_SERVICE" ]; then
2222
exit 1
2323
fi
2424
# The endpoint may return {"token":"..."} JSON or a raw token string.
25-
OIDC_TOKEN=$(echo "$OIDC_RESPONSE" | python3 -c "
26-
import sys, json
27-
data = sys.stdin.read().strip()
28-
try:
29-
print(json.loads(data)['token'], end='')
30-
except (json.JSONDecodeError, KeyError):
31-
print(data, end='')
25+
OIDC_TOKEN=$(echo "$OIDC_RESPONSE" | node -e "
26+
let data = '';
27+
process.stdin.on('data', chunk => data += chunk);
28+
process.stdin.on('end', () => {
29+
data = data.trim();
30+
try {
31+
const parsed = JSON.parse(data);
32+
process.stdout.write(parsed.token !== undefined ? String(parsed.token) : data);
33+
} catch (e) {
34+
process.stdout.write(data);
35+
}
36+
});
3237
") || {
3338
echo "ERROR: Failed to extract OIDC token. Response was: $OIDC_RESPONSE" >&2
3439
exit 1

cloudflare/.dev.vars

Lines changed: 0 additions & 1 deletion
This file was deleted.

cloudflare/intercode-email-forwarder.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

cloudflare/tsconfig.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)