Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
54aea75
[F] Replace sidekiq and zhong with good_job
Jun 3, 2025
bba7826
[F] Convert cron scheduler from zhong to good_job
Jun 3, 2025
a7d3bf8
[F] Update queues
Jun 4, 2025
9d6b135
[B] Fix minutes in some time schedules
Oct 1, 2025
111e230
[C] Temporarily remove metadown gem
timfrazee Oct 13, 2025
ddd7951
[C] Replace Bitnami Redis in docker-compose; support REDIS_URL
timfrazee Oct 13, 2025
fd66215
[C] Add basic prod API Dockerfile
timfrazee Oct 13, 2025
bcfefdc
[C] Add basic prod client Dockerfile; fix starting client in docker
timfrazee Oct 13, 2025
37ef697
[C] Temporarily remove rate limit exception for client
timfrazee Oct 13, 2025
7693c4c
[E] Make db thread pool configurable
timfrazee Oct 13, 2025
90ad9db
[B] Require tus/s3 in storage/factory
timfrazee Oct 13, 2025
3170024
[C] Whitelist DO internal IP ranges in Rack Attack
timfrazee Oct 15, 2025
17e2315
[E] Improve S3 support
timfrazee Oct 15, 2025
0ecef1b
[C] Add necessary middleware for Good Job dashboard
timfrazee Oct 15, 2025
c8d5f5d
[F] Basic CLI tool for migration setup
timfrazee Oct 15, 2025
f73d6e7
[B] Fix ingestion sources not rerouting properly
Oct 16, 2025
bb20c6d
[C] Restore metadown
timfrazee Oct 31, 2025
7bde2b4
[B] Fix secret key base lookup
timfrazee Oct 31, 2025
bb20a5c
[F] Add health check controller and route
timfrazee Nov 6, 2025
d2ba28a
[B] Fix text section search index job failing on new app migration
timfrazee Nov 6, 2025
d8c2a82
[F] Log exceptions when rendering 500 API response
timfrazee Jan 6, 2026
6af1a2b
[B] Fix JWT generation without secrets file
timfrazee Jan 6, 2026
048b635
[E] Remove asset host defaulting to S3 endpoint
timfrazee Jan 6, 2026
5dfa940
[B] Fix http-proxy-middleware by adding changeOrigin option
zdavis Jan 8, 2026
1e04d14
[C] Lint
timfrazee Jan 8, 2026
1eccb07
[F] Add release Rake task
timfrazee Jan 28, 2026
0408036
[C] Bundle binstubs
timfrazee Jan 28, 2026
86fb189
[B] Fix error in fetching Shrine model properties for upgrade task
timfrazee Jan 28, 2026
c012da4
[F] Remove Redis dependency
timfrazee Feb 9, 2026
a3a8ccb
[B] Fix CI
timfrazee Feb 9, 2026
878cc73
[C] Lint
timfrazee Feb 10, 2026
7d1b2f6
[B] Fix Lockbox key generation in CI tests
timfrazee Feb 10, 2026
c9e5f87
[E] Refactor statistics to use Rails cache
timfrazee Feb 17, 2026
ed776d6
[C] Regenerate structure.sql
timfrazee Feb 17, 2026
e5aa4d3
[B] Fix Good Job concurrency key generation for ProcessAttachmentJob
timfrazee Feb 23, 2026
240ae2b
[F] Add Docker build and release CI
timfrazee Mar 10, 2026
c762947
[C] Apply dependency security patches
timfrazee Mar 10, 2026
bc06faf
[F] Add optional override env var for Lockbox master key
timfrazee Mar 12, 2026
4e02c32
[C] Duplicate healthcheck endpoint to api namespace
timfrazee Mar 18, 2026
30da775
[B] Update rate limiting to use remote IP instead of request IP
timfrazee Mar 18, 2026
71d5f04
[C] Lint
timfrazee Mar 18, 2026
841dd77
[C] Update expected rate limited code in specs
timfrazee Mar 18, 2026
fa66122
[F] Add ability to define request header to use as rate limiting key
timfrazee Mar 19, 2026
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
11 changes: 3 additions & 8 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:

env:
BROWSERSLIST_IGNORE_OLD_DATA: beQuiet
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/manifold_test"
DISABLE_SPRING: yes
PATH: /usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/local/sbin
RAILS_ENV: test
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/manifold_test"
CACHE_DATABASE_URL: "postgres://postgres:postgres@localhost:5432/manifold_cache_test"

jobs:
client-lint:
Expand Down Expand Up @@ -59,14 +60,8 @@ jobs:
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: manifold_test
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

redis:
image: redis:6.2.7-alpine
ports: ["6379:6379"]
options: --entrypoint redis-server

steps:
- name: "Checkout code"
uses: actions/checkout@v3
Expand All @@ -82,7 +77,7 @@ jobs:

- name: "Setup test database"
working-directory: "./api"
run: bin/rails db:setup
run: bin/rails db:test:prepare

- name: "Run API specs"
working-directory: "./api"
Expand Down
113 changes: 113 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: "Build & Push Docker"

on:
push:
branches:
- next # Next, tags as "next"
- master # Edge, tags as "edge"
- release # Production, tags as "latest"

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

env:
GHCR_REGISTRY: ghcr.io
GHCR_IMAGE_NAME: ${{ github.repository }}
MANAGED_REGISTRY: registry.digitalocean.com
MANAGED_IMAGE_NAME: manifold/manifold

jobs:
build-api:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login DOCR
uses: docker/login-action@v4
with:
registry: ${{ env.MANAGED_REGISTRY }}
username: docr
password: ${{ secrets.DOCR_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }}-api
${{ env.MANAGED_REGISTRY }}/${{ env.MANAGED_IMAGE_NAME }}-api
tags: |
type=raw,value=latest,enable=${{ github.ref_name == 'release' }}
type=raw,value=edge,enable={{ is_default_branch }}
type=ref,event=branch
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker
id: push
uses: docker/build-push-action@v5
with:
context: ./api
target: production
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args:
"RAILS_ENV=production"

build-client:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login DOCR
uses: docker/login-action@v4
with:
registry: ${{ env.MANAGED_REGISTRY }}
username: docr
password: ${{ secrets.DOCR_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }}-client
${{ env.MANAGED_REGISTRY }}/${{ env.MANAGED_IMAGE_NAME }}-client
tags: |
type=raw,value=latest,enable=${{ github.ref_name == 'release' }}
type=raw,value=edge,enable={{ is_default_branch }}
type=ref,event=branch
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker
id: push
uses: docker/build-push-action@v5
with:
context: ./client
target: production
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args:
"RAILS_ENV=production"
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Production Release

on:
workflow_dispatch:

jobs:
build:
name: Update Release Branch
runs-on: ubuntu-latest
steps:
- name: "checkout release-candidate"
uses: actions/checkout@v4
with:
ref: release

- name: "Push release changes"
env:
GH_TOKEN: ${{ github.token }}
run: |
git fetch
git reset --hard origin/master
git push --force origin release
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ backup-local*.tar
/docker/minio/client/*
!/docker/minio/client/.keep
!/docker/minio/client/initialize.sh

CLAUDE.md
2 changes: 2 additions & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ backup*

/config/*.local.yml
/config/credentials/local.*

.env
69 changes: 69 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
FROM ruby:3.2-bullseye AS base

RUN mkdir -pv /bundle/bin

ENV BUNDLE_PATH=/bundle \
BUNDLE_BIN=/bundle/bin \
GEM_HOME=/bundle \
RACK_ENV=development \
RAILS_ENV=development \
RAILS_LOG_TO_STDOUT=true \
RAILS_SERVE_STATIC_FILES=true \
RAILS_MIN_THREADS=16 \
RAILS_MAX_THREADS=16 \
WORKER_COUNT=0

COPY docker/install_node_16.sh /usr/local/src/install_node_16.sh

RUN bash /usr/local/src/install_node_16.sh

RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
build-essential \
ca-certificates \
curl \
ghostscript \
gnupg gnupg2 \
imagemagick \
libglib2.0-0 libglib2.0-dev \
libicu-dev \
libjemalloc2 \
libpoppler-glib8 \
librsvg2-bin \
libsndfile1-dev \
libvips \
libvips-dev \
mediainfo \
nodejs \
postgresql-common \
pandoc

RUN DEBIAN_FRONTEND=noninteractive /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y

RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends postgresql-client-13

RUN npm install -g mammoth@^1.4.16 wscat@^6.0.1

RUN sed -i '/<policy domain="coder" rights="none" pattern="PDF" \/>/d' /etc/ImageMagick-6/policy.xml

COPY ./ /srv/app/

WORKDIR /srv/app
COPY Gemfile /srv/app/Gemfile
COPY Gemfile.lock /srv/app/Gemfile.lock

COPY docker/entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]

ENV MAMMOTH_PATH=/usr/bin/mammoth
ENV PATH="${BUNDLE_BIN}:${PATH}"
ENV LD_PRELOAD=libjemalloc.so.2

RUN bundle install

CMD ["bin/puma", "-C", "config/puma.rb"]

# There are currently no differences between dev and prod Dockerfiles, but these are here to provide parity with the client Dockerfile
FROM base AS development

FROM base AS production
16 changes: 6 additions & 10 deletions api/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ gem "aasm", "~> 4.0"
gem "absolute_time", "~> 1.0.0"
gem "active_interaction", "~> 4.0"
gem "activejob-retry", "~> 0.4"
gem "activejob-traffic_control", "~>0.1.0"
gem "activejob-uniqueness", "~> 0.2.4"
gem "activerecord-import", "~> 1.4.1"
gem "active_record_upsert", "~> 0.11.1"
gem "acts_as_list", "~> 1.2.4"
Expand All @@ -29,6 +27,7 @@ gem "cleanroom"
gem "closure_tree", "~> 7.0"
# Until Rails 7.1
gem "composite_primary_keys", "~> 14.0.10"
gem "connection_pool"
gem "crass", "~> 1.0.5"
gem "csl-styles", "~> 1.0"
gem "cssbeautify"
Expand All @@ -55,6 +54,7 @@ gem "fast_jsonapi", git: "https://github.com/ManifoldScholar/fast_jsonapi.git",
gem "filesize", "~> 0.1"
gem "format_engine", "~> 0.7.7"
gem "friendly_id", "~> 5.0"
gem "solid_cache", "~> 0.7"
gem "fuzzy_match", "~> 2.1.0"
gem "geocoder", "1.8.2"
gem "gepub", "~> 1.0.4"
Expand All @@ -64,7 +64,7 @@ gem "hashie", "~> 3.0"
gem "has_scope", "~> 0.8.1"
gem "httparty", "~> 0.21.0"
gem "image_processing", "~> 1.12"
gem "job-iteration", "~> 1.10.0"
gem "job-iteration", "~> 1.11.0"
gem "jsonb_accessor", "~> 1.0"
gem "jwt", "~> 1.5"
gem "kaminari", "~> 1.2"
Expand All @@ -80,7 +80,7 @@ gem "namae", "~>1.0"
gem "naught", "~> 1.0"
gem "net-sftp", "~> 2.1.2"
gem "net-ssh", "~> 5.2.0"
gem "nokogiri", "~> 1.15.4"
gem "nokogiri", "~> 1.19.1"
gem "oauth2", "~> 1.3"
gem "oj", "~> 3.16"
gem "omniauth", "~> 2.1.3"
Expand All @@ -104,17 +104,13 @@ gem "rack-cors", "~> 1.0"
gem "rails", "~> 7.0"
gem "rainbow", "~> 3.0"
gem "redcarpet", "~> 3.5"
gem "redis", "~> 4.5"
gem "redis-namespace", "~> 1.0"
gem "redis-objects", "~> 1.4"
gem "rolify", "~> 5.1"
gem "rubyzip", "~> 2.3.1"
gem "scanf", "~> 1.0.0"
gem "scenic", "~> 1.4"
gem "shrine", "~> 3.5.0"
gem "shrine-google_cloud_storage", "~> 3.3"
gem "shrine-tus", "~> 2.0"
gem "sidekiq", "< 6"
gem "signet", "~> 0.10"
gem "sinatra", "~>2.2"
gem "sixarm_ruby_unaccent", "~> 1.2.2"
Expand All @@ -134,7 +130,6 @@ gem "validates_email_format_of", "~> 1.0"
gem "validate_url", "~> 1.0"
gem "with_advisory_lock", "~> 4.0"
gem "zaru", "~> 1.0.0"
gem "zhong", "~> 0.3"

group :development, :test do
gem "pry-byebug"
Expand Down Expand Up @@ -170,7 +165,8 @@ end

group :test do
gem "database_cleaner-active_record", "~> 2.1.0"
gem "database_cleaner-redis", "~> 2.0"
gem "test-prof", "~> 1.0"
gem "with_model", "~> 2.1"
end

gem "good_job", "~> 3.99"
Loading
Loading