Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,25 @@ jobs:
- name: Build assets
run: mix assets.setup && mix assets.deploy

# The release image for ops/compose.yml, only for main and only when the
# other jobs pass. Watchtower on the server pulls :latest at night.
# The release image for ops/compose.yml; Watchtower on the server pulls :latest
# at night. Only main writes the layer cache, so pull requests do not evict it.
image:
needs: [test, assets]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
# One build per ref at a time, so an older build cannot push :latest over a newer one.
concurrency: image-${{ github.ref }}
permissions:
contents: read
packages: write
env:
PUBLISH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v7

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

- uses: docker/login-action@v4
- if: env.PUBLISH == 'true'
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -134,8 +138,8 @@ jobs:
with:
context: .
platforms: linux/amd64
push: true
push: ${{ env.PUBLISH == 'true' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: ${{ env.PUBLISH == 'true' && 'type=gha,mode=max' || '' }}
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# syntax=docker/dockerfile:1
#
# Release image of the CMS. CI builds it on main and pushes it to
# ghcr.io/feather-page/cms; it runs with docker compose (ops/compose.yml).
# Release image of the CMS. CI builds it for pull requests and main, and pushes
# it from main to ghcr.io/feather-page/cms; it runs with docker compose
# (ops/compose.yml).
#
# Volume: /data (SQLite database, image storage and build output).
# The container migrates the database on start (bin/server).
Expand Down
8 changes: 7 additions & 1 deletion lib/feather/fediverse/mention.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ defmodule Feather.Fediverse.Mention do
field :visibility, Ecto.Enum, values: [:public, :followers, :direct]
field :content, Feather.Encrypted.Binary, redact: true
field :summary, Feather.Encrypted.Binary, redact: true
field :attachments, Feather.Encrypted.List, default: [], redact: true

# No default dump at compile time: that needs the key, which a release reads at runtime.
field :attachments, Feather.Encrypted.List,
default: [],
skip_default_validation: true,
redact: true

field :named_accounts, {:array, :string}, default: []
field :published_at, :utc_datetime_usec
field :read_at, :utc_datetime_usec
Expand Down
8 changes: 7 additions & 1 deletion lib/feather/fediverse/timeline_post.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ defmodule Feather.Fediverse.TimelinePost do
field :name, Feather.Encrypted.Binary, redact: true
field :content, Feather.Encrypted.Binary, redact: true
field :summary, Feather.Encrypted.Binary, redact: true
field :attachments, Feather.Encrypted.List, default: [], redact: true

# No default dump at compile time: that needs the key, which a release reads at runtime.
field :attachments, Feather.Encrypted.List,
default: [],
skip_default_validation: true,
redact: true

field :named_accounts, {:array, :string}, default: []
field :published_at, :utc_datetime_usec

Expand Down
Loading