Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
336d7a5
first dockerization iteration
Jun 13, 2025
22bf421
add multistage build and non-essential files to .dockerignore
Jul 14, 2025
9c3e106
remove duplicate docs, specify image, and add non-relevant files to .…
Jul 14, 2025
77a13b9
add builder stage and rework directory structure
Oct 1, 2025
6d1d309
whitespace change
Oct 1, 2025
e9b94d1
restrict perms for public
Oct 1, 2025
9354ee5
WIP: update css for alert-warning class, comment out empty classes
nrsa222 Oct 21, 2025
ba60623
fix wrong root
Oct 31, 2025
17919d7
add rector changes
Oct 31, 2025
37f8a49
add configurations for rector and phpunit
Oct 31, 2025
20d1bb1
add small test
Oct 31, 2025
5c38278
add phpunit output to .gitignore
Oct 31, 2025
9329dfd
add deps
Oct 31, 2025
0d56a4d
add CI stage
Oct 31, 2025
00e2b53
add ci skipping linting
Nov 3, 2025
5b35d15
add ghcr publishing
Nov 3, 2025
4aab8fe
set up CODEOWNERS file
nrsa222 Nov 3, 2025
bb01a98
Merge pull request #14 from uklibraries/13-set-up-codeowners-file
nrsa222 Nov 3, 2025
17a4d69
Merge branch 'dev' into 8-insufficient-contrast-on-advance-note
nrsa222 Nov 3, 2025
4bb9067
fix pointing to wrong package URL
Nov 3, 2025
96bcce2
fix ci running twice, fix no publishing
Nov 6, 2025
1e68ea0
Merge pull request #11 from uklibraries/ci-publish
Nealium104 Nov 7, 2025
1e748c2
fix syntax error
Nov 7, 2025
469c4a1
Merge pull request #15 from uklibraries/ci-publish
Nealium104 Nov 7, 2025
6895e00
fix prod-builder overwriting /vendor during build
Nov 7, 2025
bfa3a1b
Merge pull request #16 from uklibraries/ci-publish
Nealium104 Nov 7, 2025
8840405
Merge branch 'dev' into 8-insufficient-contrast-on-advance-note
nrsa222 Nov 7, 2025
d35937f
WIP: update text color for advance note; change link color for .alert…
nrsa222 Nov 10, 2025
3b15699
WIP: update html for better ux
nrsa222 Nov 10, 2025
d43d42c
WIP: update html and css
nrsa222 Nov 10, 2025
877982d
WIP: css and html changes for clarity
nrsa222 Nov 10, 2025
070d827
WIP: add styling for underline link
nrsa222 Nov 11, 2025
e557058
switch app to mount at /opt/findingaid
Nov 14, 2025
0e07706
separate compose files per env with a base
Nov 14, 2025
f285495
fix missing test project files
Nov 14, 2025
4b2207b
Merge pull request #18 from uklibraries/fix-build
Nealium104 Nov 14, 2025
1b604ba
Merge branch 'dev' into 8-insufficient-contrast-on-advance-note
nrsa222 Nov 24, 2025
af19e15
increase font weight on underline-link
nrsa222 Nov 24, 2025
3fd90ba
cleanup css file
nrsa222 Nov 24, 2025
c322fec
update html element to include lang attribute
nrsa222 Nov 24, 2025
d2951d6
Merge pull request #19 from uklibraries/8-insufficient-contrast-on-ad…
nrsa222 Dec 8, 2025
ae20302
Merge pull request #21 from uklibraries/20-html-element-must-have-a-l…
nrsa222 Dec 8, 2025
cf17d68
fix errors printing in production
Jan 8, 2026
af4bb58
fix hardcoded paths
Jan 8, 2026
595f95f
Fix 8.2 deprecation. Eliminate dynamic properties.
Jan 8, 2026
03bb0f9
Merge pull request #29 from uklibraries/prod-fixes
Nealium104 Jan 13, 2026
ca61d32
add MLEs findingaid cache regen with redacted URLs
Jan 14, 2026
5847991
add necessary deps for findingaid cache regen
Jan 15, 2026
40ea3ee
remove duplicate code
Jan 15, 2026
b641246
make arks file ephemeral. Add some additional logging. Fail early.
Jan 15, 2026
0ab9d5d
update documentation
Jan 15, 2026
4832767
use docker's dns settings to target this instance's web service
Jan 15, 2026
11bd926
add symlinks to make command invocation easier
Jan 15, 2026
88ff7c5
Change command feedback to be more clear on step
Jan 15, 2026
e1f0b20
clarity and ensure all regeneration files are executable
Jan 16, 2026
5c50a39
get rid of deps not needed
Jan 16, 2026
fff1d49
Merge pull request #30 from uklibraries/prod-fixes
Nealium104 Jan 16, 2026
6754143
change ci to run on main
Jan 16, 2026
59ae80a
Merge pull request #31 from uklibraries/ci-branch-fix
Nealium104 Jan 16, 2026
3f8af60
fix conflict
Jan 16, 2026
dc7920c
fix merge. Restore component rewrite and update hours to 10-4
Jan 20, 2026
5676e66
change text
nrsa222 Jan 20, 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
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.git
.gitignore
.env
nginx
nginx/*
xml
xml/*
dockerfile
docker-compose.yml
README.md
LICENSE.txt
public/cache
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code owners
/.github/CODEOWNERS @uklibraries/euk
* @uklibraries/euk
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI
on:
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
env:
COMPOSE_FILE: docker-compose.yml:docker-compose.ci.override.yml
COMPOSE_PROJECT_NAME: ci-${{ github.job }}-${{ github.run_id }}
steps:
- uses: actions/checkout@v4

- name: Build services
run: docker compose build

- name: Show service logs if failed
if: failure()
run: docker compose logs

- name: Container runs
run: docker compose run --rm --no-deps -T findingaid php -v

- name: Teardown
if: always()
run: docker compose down -v --remove-orphans

lint:
needs: build
runs-on: ubuntu-latest
# TODO: Fix the linting errors
# Report the failure, but don't stop the job
continue-on-error: true
env:
COMPOSE_FILE: docker-compose.yml:docker-compose.ci.override.yml
COMPOSE_PROJECT_NAME: ci-${{ github.job }}-${{ github.run_id }}
steps:
- uses: actions/checkout@v4

- name: Build services
run: docker compose build

- name: Show service logs if failed
if: failure()
run: docker compose logs

- name: Run linting inside app container
run: docker compose run --rm -T findingaid /opt/findingaid/vendor/bin/phpcs -w --exclude=Generic.Files.LineLength --standard=PSR12 /opt/findingaid/tests /opt/findingaid/app

- name: Teardown
if: always()
run: docker compose down -v --remove-orphans

unit-test:
needs: build
runs-on: ubuntu-latest
env:
COMPOSE_FILE: docker-compose.yml:docker-compose.ci.override.yml
COMPOSE_PROJECT_NAME: ci-${{ github.job }}-${{ github.run_id }}
steps:
- uses: actions/checkout@v4

- name: Build services
run: docker compose build

- name: Start services
run: docker compose up -d findingaid

- name: Show service logs if failed
if: failure()
run: docker compose logs

- name: Run tests inside app container
run: docker compose run --rm -T findingaid /opt/findingaid/vendor/bin/phpunit -c /opt/findingaid/phpunit.xml /opt/findingaid/tests

- name: Teardown
if: always()
run: docker compose down -v --remove-orphans
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish release
on:
push:
branches: [ main ]

permissions:
contents: read
packages: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}

- uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry (ghcr)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/findingaid:${{ github.sha }}
labels: |
org.opencontainers.image.revision=${{ github.sha }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ misc/
public/minimal*
public/cache
is_prod
.phpunit.result.cache
106 changes: 106 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
FROM alpine:3.20 AS jsmin

RUN apk add --no-cache \
git \
gcc \
libc-dev

RUN git clone https://github.com/douglascrockford/JSMin /tmp/jsmin && \
gcc /tmp/jsmin/jsmin.c -o /usr/bin/jsmin && \
rm -rf /tmp/jsmin

FROM php:8.3-fpm-alpine AS development

# add other deps for dev here
RUN apk add --no-cache \
libzip-dev \
bash

COPY --from=composer:2.8 /usr/bin/composer /usr/bin/composer
COPY --from=jsmin /usr/bin/jsmin /usr/bin/jsmin
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

WORKDIR /opt/findingaid

COPY ./composer.json .
COPY ./composer.lock .

RUN composer install --no-interaction

COPY /exe ./exe

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
EXPOSE 9000
CMD ["php-fpm", "-F"]

FROM php:8.3-fpm-alpine AS prod-builder

RUN apk add --no-cache bash

COPY --from=composer:2.8 /usr/bin/composer /usr/bin/composer
COPY --from=jsmin /usr/bin/jsmin /usr/bin/jsmin

WORKDIR /composer

COPY ./composer.json .
COPY ./composer.lock .

RUN composer install --no-interaction --no-dev

FROM php:8.3-fpm-alpine AS ci

RUN apk add --no-cache \
libzip-dev \
bash

WORKDIR /app

COPY --from=jsmin /usr/bin/jsmin /usr/bin/jsmin
COPY --from=development /opt/findingaid/vendor /opt/findingaid/vendor
COPY ./phpunit.xml /opt/findingaid/phpunit.xml
COPY /app .

COPY exe/build.sh /opt/findingaid/exe/build.sh
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
EXPOSE 9000
CMD ["php-fpm", "-F"]

FROM php:8.3-fpm-alpine AS production

RUN apk add --no-cache \
libzip-dev \
bash \
jq \
curl

COPY --from=jsmin /usr/bin/jsmin /usr/bin/jsmin
COPY --from=prod-builder /composer/vendor /opt/findingaid/vendor
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

WORKDIR /opt/findingaid

COPY ./app ./app
COPY ./public ./public
COPY ./exe ./exe

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

RUN ./exe/build.sh

RUN chmod +x /opt/findingaid/exe/findingaid-cache-regen/fa-regen \
/opt/findingaid/exe/findingaid-cache-regen/fa-full-regen \
/opt/findingaid/exe/findingaid-cache-regen/fetch-ead-arks && \
ln -s /opt/findingaid/exe/findingaid-cache-regen/fa-regen /usr/local/bin/fa-regen && \
ln -s /opt/findingaid/exe/findingaid-cache-regen/fa-full-regen /usr/local/bin/fa-full-regen && \
ln -s /opt/findingaid/exe/findingaid-cache-regen/fetch-ead-arks /usr/local/bin/fetch-ead-arks

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
EXPOSE 9000
CMD ["php-fpm", "-F"]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ commands might require you to become root.
ln -s /path/to/findingaid/public ./findingaid
```

Installation with Docker
------------------------
If your usecase is development, the docker-compose.yml file will start an NGINX container with the appropriate volumes for development.

Once your findingaids are installed, use `docker compose up` to start your development environment.

Copyright
---------

Expand Down
57 changes: 47 additions & 10 deletions app/assets/css/extra.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.fa-toc {
}

.fa-request.fa-requestable-toc {
display: block;
margin: 0 auto;
Expand All @@ -10,9 +7,6 @@
float: right;
}

.fa-request-summary {
}

.fa-request-summary-note {
font-style: italic;
}
Expand Down Expand Up @@ -123,10 +117,6 @@ label {
height: 80vh;
}

.alert-warning {
color: #654f2a;
}

.alert-harmful {
background: #b1c9e8;
color: #282828;
Expand All @@ -146,3 +136,50 @@ label {
.green-alert-text {
color: #246024;
}

/* UK LIMESTONE STYLES */
/* styling to match Limestone's Underline Link */
a.underline-link {
color:#000000;
background-attachment: scroll;
background-image: linear-gradient(to top,rgba(161,211,237,0.4) 0,rgba(161,211,237,0.4) 0.5em,transparent 0.5em,transparent 110%),linear-gradient(to top,rgba(0,51,160,0.4) 0,rgba(0,51,160,0.4) 2px,transparent 2px,transparent 100%);
background-repeat: no-repeat;
background-position: 0 0.5em, 0 0;
position: relative;
transition: 0.2s background-position ease-out;
font-weight: 400;
z-index: 1;
text-decoration: none;
}

a:hover.underline-link {
color:#0033A0;
background-position: 0 0, 1000px 2px;
}

/* styling to match central webcom's in-page alert*/
.in-page-alert {
background-color: #EFF4FD;
border-left: 7px solid #1E8AFF;
padding: 1rem;
align-items: center;
color:#000000
}
.in-page-alert h2 {
text-transform: uppercase;
font-size: 1.75rem;
font-weight: 900;
margin-top: 0;
color: #0033A0;
line-height: 1.2;
}
.in-page-alert h3 {
text-transform: uppercase;
font-size: 1.5rem;
font-weight: 500;
margin-bottom: 5px;
margin-top: 10px;
color: #0033A0;
line-height: 1.2;

}
16 changes: 8 additions & 8 deletions app/config/config.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?php
class Config
{
private $config = array();
private $repo = array();
private $config = [];
private $repo = [];
private $nonuk = null;

public function __construct()
{
$config_file = implode(DIRECTORY_SEPARATOR, array(
$config_file = implode(DIRECTORY_SEPARATOR, [
APP,
'config',
'config.json',
));
]);
if (file_exists($config_file)) {
$this->config = json_decode(file_get_contents($config_file), true);
}
$repo_file = implode(DIRECTORY_SEPARATOR, array(
$repo_file = implode(DIRECTORY_SEPARATOR, [
APP,
'config',
'repo.json',
));
]);
if (file_exists($repo_file)) {
$this->repo = json_decode(file_get_contents($repo_file), true);
}
Expand Down Expand Up @@ -48,11 +48,11 @@ public function get_repo($key)
public function get_nonuk($key)
{
if (!isset($this->nonuk)) {
$nonuk_config_file = implode(DIRECTORY_SEPARATOR, array(
$nonuk_config_file = implode(DIRECTORY_SEPARATOR, [
APP,
'config',
'nonuk-metadata.json',
));
]);
if (file_exists($nonuk_config_file)) {
$this->nonuk = json_decode(file_get_contents($nonuk_config_file), true);
}
Expand Down
Loading
Loading