Browse Source
There were quite a couple of conflicts, they were resolved in the
following manner:
- Translations: Moved to "publish" as translation, aligns with other
languages
- Options: `trends_as_landing_page` is kept false
- UI: clicking the display name opens the original profile
Potential problems:
1. Not all translations for mails and stuff are prefixed with
`%{title}`, some are, some are hardcoded to `Mastodon`.
lets-bump-hometown-to-mastodon-4.2
760 changed files with 45999 additions and 16147 deletions
@ -0,0 +1,21 @@
|
||||
#!/bin/bash |
||||
|
||||
set -e # Fail the whole script on first error |
||||
|
||||
# Fetch Ruby gem dependencies |
||||
bundle install --path vendor/bundle --with='development test' |
||||
|
||||
# Fetch Javascript dependencies |
||||
yarn install |
||||
|
||||
# Make Gemfile.lock pristine again |
||||
git checkout -- Gemfile.lock |
||||
|
||||
# [re]create, migrate, and seed the test database |
||||
RAILS_ENV=test ./bin/rails db:setup |
||||
|
||||
# Precompile assets for development |
||||
RAILS_ENV=development ./bin/rails assets:precompile |
||||
|
||||
# Precompile assets for test |
||||
RAILS_ENV=test NODE_ENV=tests ./bin/rails assets:precompile |
||||
@ -0,0 +1,38 @@
|
||||
name: JSON Linting |
||||
on: |
||||
push: |
||||
branches-ignore: |
||||
- 'dependabot/**' |
||||
paths: |
||||
- 'package.json' |
||||
- 'yarn.lock' |
||||
- '.prettier*' |
||||
- '**/*.json' |
||||
- '.github/workflows/lint-json.yml' |
||||
|
||||
pull_request: |
||||
paths: |
||||
- 'package.json' |
||||
- 'yarn.lock' |
||||
- '.prettier*' |
||||
- '**/*.json' |
||||
- '.github/workflows/lint-json.yml' |
||||
|
||||
jobs: |
||||
lint: |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Clone repository |
||||
uses: actions/checkout@v3 |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v3 |
||||
with: |
||||
cache: yarn |
||||
|
||||
- name: Install all yarn packages |
||||
run: yarn --frozen-lockfile |
||||
|
||||
- name: Prettier |
||||
run: yarn prettier --check "**/*.json" |
||||
@ -0,0 +1,40 @@
|
||||
name: YML Linting |
||||
on: |
||||
push: |
||||
branches-ignore: |
||||
- 'dependabot/**' |
||||
paths: |
||||
- 'package.json' |
||||
- 'yarn.lock' |
||||
- '.prettier*' |
||||
- '**/*.yaml' |
||||
- '**/*.yml' |
||||
- '.github/workflows/lint-yml.yml' |
||||
|
||||
pull_request: |
||||
paths: |
||||
- 'package.json' |
||||
- 'yarn.lock' |
||||
- '.prettier*' |
||||
- '**/*.yaml' |
||||
- '**/*.yml' |
||||
- '.github/workflows/lint-yml.yml' |
||||
|
||||
jobs: |
||||
lint: |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Clone repository |
||||
uses: actions/checkout@v3 |
||||
|
||||
- name: Set up Node.js |
||||
uses: actions/setup-node@v3 |
||||
with: |
||||
cache: yarn |
||||
|
||||
- name: Install all yarn packages |
||||
run: yarn --frozen-lockfile |
||||
|
||||
- name: Prettier |
||||
run: yarn prettier --check "**/*.{yml,yaml}" |
||||
@ -0,0 +1,17 @@
|
||||
name: PR Needs Rebase |
||||
|
||||
on: |
||||
push: |
||||
pull_request_target: |
||||
types: [synchronize] |
||||
|
||||
jobs: |
||||
label-rebase-needed: |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Check for merge conflicts |
||||
uses: eps1lon/actions-label-merge-conflict@releases/2.x |
||||
with: |
||||
dirtyLabel: 'rebase needed :construction:' |
||||
repoToken: '${{ secrets.GITHUB_TOKEN }}' |
||||
commentOnDirty: This pull request has merge conflicts that must be resolved before it can be merged. |
||||
@ -1,138 +0,0 @@
|
||||
# This is a GitHub workflow defining a set of jobs with a set of steps. |
||||
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions |
||||
# |
||||
name: Test chart |
||||
|
||||
on: |
||||
pull_request: |
||||
paths: |
||||
- "chart/**" |
||||
- "!**.md" |
||||
- ".github/workflows/test-chart.yml" |
||||
push: |
||||
paths: |
||||
- "chart/**" |
||||
- "!**.md" |
||||
- ".github/workflows/test-chart.yml" |
||||
branches-ignore: |
||||
- "dependabot/**" |
||||
workflow_dispatch: |
||||
|
||||
permissions: |
||||
contents: read |
||||
|
||||
defaults: |
||||
run: |
||||
working-directory: chart |
||||
|
||||
jobs: |
||||
lint-templates: |
||||
runs-on: ubuntu-22.04 |
||||
|
||||
steps: |
||||
- uses: actions/checkout@v3 |
||||
- uses: actions/setup-python@v4 |
||||
with: |
||||
python-version: "3.x" |
||||
|
||||
- name: Install dependencies (yamllint) |
||||
run: pip install yamllint |
||||
|
||||
- run: helm dependency update |
||||
|
||||
- name: helm lint |
||||
run: | |
||||
helm lint . \ |
||||
--values dev-values.yaml |
||||
|
||||
- name: helm template |
||||
run: | |
||||
helm template . \ |
||||
--values dev-values.yaml \ |
||||
--output-dir rendered-templates |
||||
|
||||
- name: yamllint (only on templates we manage) |
||||
run: | |
||||
rm -rf rendered-templates/mastodon/charts |
||||
|
||||
yamllint rendered-templates \ |
||||
--config-data "{rules: {indentation: {spaces: 2}, line-length: disable}}" |
||||
|
||||
# This job helps us validate that rendered templates are valid k8s resources |
||||
# against a k8s api-server, via "helm template --validate", but also that a |
||||
# basic configuration can be used to successfully startup mastodon. |
||||
# |
||||
test-install: |
||||
runs-on: ubuntu-22.04 |
||||
timeout-minutes: 15 |
||||
|
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
include: |
||||
# k3s-channel reference: https://update.k3s.io/v1-release/channels |
||||
- k3s-channel: latest |
||||
- k3s-channel: stable |
||||
|
||||
# This represents the oldest configuration we test against. |
||||
# |
||||
# The k8s version chosen is based on the oldest still supported k8s |
||||
# version among two managed k8s services, GKE, EKS. |
||||
# - GKE: https://endoflife.date/google-kubernetes-engine |
||||
# - EKS: https://endoflife.date/amazon-eks |
||||
# |
||||
# The helm client's version can influence what helper functions is |
||||
# available for use in the templates, currently we need v3.6.0 or |
||||
# higher. |
||||
# |
||||
- k3s-channel: v1.21 |
||||
helm-version: v3.6.0 |
||||
|
||||
steps: |
||||
- uses: actions/checkout@v3 |
||||
|
||||
# This action starts a k8s cluster with NetworkPolicy enforcement and |
||||
# installs both kubectl and helm. |
||||
# |
||||
# ref: https://github.com/jupyterhub/action-k3s-helm#readme |
||||
# |
||||
- uses: jupyterhub/action-k3s-helm@v3 |
||||
with: |
||||
k3s-channel: ${{ matrix.k3s-channel }} |
||||
helm-version: ${{ matrix.helm-version }} |
||||
metrics-enabled: false |
||||
traefik-enabled: false |
||||
docker-enabled: false |
||||
|
||||
- run: helm dependency update |
||||
|
||||
# Validate rendered helm templates against the k8s api-server |
||||
- name: helm template --validate |
||||
run: | |
||||
helm template --validate mastodon . \ |
||||
--values dev-values.yaml |
||||
|
||||
- name: helm install |
||||
run: | |
||||
helm install mastodon . \ |
||||
--values dev-values.yaml \ |
||||
--timeout 10m |
||||
|
||||
# This actions provides a report about the state of the k8s cluster, |
||||
# providing logs etc on anything that has failed and workloads marked as |
||||
# important. |
||||
# |
||||
# ref: https://github.com/jupyterhub/action-k8s-namespace-report#readme |
||||
# |
||||
- name: Kubernetes namespace report |
||||
uses: jupyterhub/action-k8s-namespace-report@v1 |
||||
if: always() |
||||
with: |
||||
important-workloads: >- |
||||
deploy/mastodon-sidekiq |
||||
deploy/mastodon-streaming |
||||
deploy/mastodon-web |
||||
job/mastodon-assets-precompile |
||||
job/mastodon-chewy-upgrade |
||||
job/mastodon-create-admin |
||||
job/mastodon-db-migrate |
||||
@ -1,122 +1,99 @@
|
||||
FROM ubuntu:20.04 as build-dep |
||||
|
||||
# Use bash for the shell |
||||
SHELL ["/bin/bash", "-c"] |
||||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections |
||||
|
||||
# Install Node v16 (LTS) |
||||
ENV NODE_VER="16.17.1" |
||||
RUN ARCH= && \ |
||||
dpkgArch="$(dpkg --print-architecture)" && \ |
||||
case "${dpkgArch##*-}" in \ |
||||
amd64) ARCH='x64';; \ |
||||
ppc64el) ARCH='ppc64le';; \ |
||||
s390x) ARCH='s390x';; \ |
||||
arm64) ARCH='arm64';; \ |
||||
armhf) ARCH='armv7l';; \ |
||||
i386) ARCH='x86';; \ |
||||
*) echo "unsupported architecture"; exit 1 ;; \ |
||||
esac && \ |
||||
echo "Etc/UTC" > /etc/localtime && \ |
||||
apt-get update && \ |
||||
apt-get -yq dist-upgrade && \ |
||||
apt-get install -y --no-install-recommends ca-certificates wget python3 apt-utils && \ |
||||
cd ~ && \ |
||||
wget -q https://nodejs.org/download/release/v$NODE_VER/node-v$NODE_VER-linux-$ARCH.tar.gz && \ |
||||
tar xf node-v$NODE_VER-linux-$ARCH.tar.gz && \ |
||||
rm node-v$NODE_VER-linux-$ARCH.tar.gz && \ |
||||
mv node-v$NODE_VER-linux-$ARCH /opt/node |
||||
|
||||
# Install Ruby 3.0 |
||||
ENV RUBY_VER="3.0.6" |
||||
RUN apt-get update && \ |
||||
apt-get install -y --no-install-recommends build-essential \ |
||||
bison libyaml-dev libgdbm-dev libreadline-dev libjemalloc-dev \ |
||||
libncurses5-dev libffi-dev zlib1g-dev libssl-dev && \ |
||||
cd ~ && \ |
||||
wget https://cache.ruby-lang.org/pub/ruby/${RUBY_VER%.*}/ruby-$RUBY_VER.tar.gz && \ |
||||
tar xf ruby-$RUBY_VER.tar.gz && \ |
||||
cd ruby-$RUBY_VER && \ |
||||
./configure --prefix=/opt/ruby \ |
||||
--with-jemalloc \ |
||||
--with-shared \ |
||||
--disable-install-doc && \ |
||||
make -j"$(nproc)" > /dev/null && \ |
||||
make install && \ |
||||
rm -rf ../ruby-$RUBY_VER.tar.gz ../ruby-$RUBY_VER |
||||
|
||||
ENV PATH="${PATH}:/opt/ruby/bin:/opt/node/bin" |
||||
|
||||
RUN npm install -g npm@9 && \ |
||||
npm install -g yarn && \ |
||||
gem install bundler && \ |
||||
apt-get update && \ |
||||
apt-get install -y --no-install-recommends git libicu-dev libidn11-dev \ |
||||
libpq-dev shared-mime-info |
||||
# syntax=docker/dockerfile:1.4 |
||||
# This needs to be bullseye-slim because the Ruby image is built on bullseye-slim |
||||
ARG NODE_VERSION="16.18.1-bullseye-slim" |
||||
|
||||
COPY Gemfile* package.json yarn.lock /opt/mastodon/ |
||||
FROM ghcr.io/moritzheiber/ruby-jemalloc:3.0.4-slim as ruby |
||||
FROM node:${NODE_VERSION} as build |
||||
|
||||
RUN cd /opt/mastodon && \ |
||||
bundle config set --local deployment 'true' && \ |
||||
bundle config set --local without 'development test' && \ |
||||
bundle config set silence_root_warning true && \ |
||||
bundle install -j"$(nproc)" && \ |
||||
yarn install --pure-lockfile |
||||
COPY --link --from=ruby /opt/ruby /opt/ruby |
||||
|
||||
FROM ubuntu:20.04 |
||||
ENV DEBIAN_FRONTEND="noninteractive" \ |
||||
PATH="${PATH}:/opt/ruby/bin" |
||||
|
||||
# Copy over all the langs needed for runtime |
||||
COPY --from=build-dep /opt/node /opt/node |
||||
COPY --from=build-dep /opt/ruby /opt/ruby |
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
||||
|
||||
# Add more PATHs to the PATH |
||||
ENV PATH="${PATH}:/opt/ruby/bin:/opt/node/bin:/opt/mastodon/bin" |
||||
WORKDIR /opt/mastodon |
||||
COPY Gemfile* package.json yarn.lock /opt/mastodon/ |
||||
|
||||
# Create the mastodon user |
||||
ARG UID=991 |
||||
ARG GID=991 |
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
||||
# hadolint ignore=DL3008 |
||||
RUN apt-get update && \ |
||||
echo "Etc/UTC" > /etc/localtime && \ |
||||
apt-get install -y --no-install-recommends whois wget && \ |
||||
addgroup --gid $GID mastodon && \ |
||||
useradd -m -u $UID -g $GID -d /opt/mastodon mastodon && \ |
||||
echo "mastodon:$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 24 | mkpasswd -s -m sha-256)" | chpasswd && \ |
||||
rm -rf /var/lib/apt/lists/* |
||||
|
||||
# Install mastodon runtime deps |
||||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections |
||||
apt-get install -y --no-install-recommends build-essential \ |
||||
ca-certificates \ |
||||
git \ |
||||
libicu-dev \ |
||||
libidn11-dev \ |
||||
libpq-dev \ |
||||
libjemalloc-dev \ |
||||
zlib1g-dev \ |
||||
libgdbm-dev \ |
||||
libgmp-dev \ |
||||
libssl-dev \ |
||||
libyaml-0-2 \ |
||||
ca-certificates \ |
||||
libreadline8 \ |
||||
python3 \ |
||||
shared-mime-info && \ |
||||
bundle config set --local deployment 'true' && \ |
||||
bundle config set --local without 'development test' && \ |
||||
bundle config set silence_root_warning true && \ |
||||
bundle install -j"$(nproc)" && \ |
||||
yarn install --pure-lockfile --network-timeout 600000 |
||||
|
||||
FROM node:${NODE_VERSION} |
||||
|
||||
ARG UID="991" |
||||
ARG GID="991" |
||||
|
||||
COPY --link --from=ruby /opt/ruby /opt/ruby |
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
||||
|
||||
ENV DEBIAN_FRONTEND="noninteractive" \ |
||||
PATH="${PATH}:/opt/ruby/bin:/opt/mastodon/bin" |
||||
|
||||
# Ignoreing these here since we don't want to pin any versions and the Debian image removes apt-get content after use |
||||
# hadolint ignore=DL3008,DL3009 |
||||
RUN apt-get update && \ |
||||
apt-get -y --no-install-recommends install \ |
||||
libssl1.1 libpq5 imagemagick ffmpeg libjemalloc2 \ |
||||
libicu66 libidn11 libyaml-0-2 \ |
||||
file ca-certificates tzdata libreadline8 gcc tini apt-utils && \ |
||||
ln -s /opt/mastodon /mastodon && \ |
||||
gem install bundler && \ |
||||
rm -rf /var/cache && \ |
||||
rm -rf /var/lib/apt/lists/* |
||||
|
||||
# Copy over mastodon source, and dependencies from building, and set permissions |
||||
COPY --chown=mastodon:mastodon . /opt/mastodon |
||||
COPY --from=build-dep --chown=mastodon:mastodon /opt/mastodon /opt/mastodon |
||||
echo "Etc/UTC" > /etc/localtime && \ |
||||
groupadd -g "${GID}" mastodon && \ |
||||
useradd -l -u "$UID" -g "${GID}" -m -d /opt/mastodon mastodon && \ |
||||
apt-get -y --no-install-recommends install whois \ |
||||
wget \ |
||||
procps \ |
||||
libssl1.1 \ |
||||
libpq5 \ |
||||
imagemagick \ |
||||
ffmpeg \ |
||||
libjemalloc2 \ |
||||
libicu67 \ |
||||
libidn11 \ |
||||
libyaml-0-2 \ |
||||
file \ |
||||
ca-certificates \ |
||||
tzdata \ |
||||
libreadline8 \ |
||||
tini && \ |
||||
ln -s /opt/mastodon /mastodon |
||||
|
||||
# Note: no, cleaning here since Debian does this automatically |
||||
# See the file /etc/apt/apt.conf.d/docker-clean within the Docker image's filesystem |
||||
|
||||
# Run mastodon services in prod mode |
||||
ENV RAILS_ENV="production" |
||||
ENV NODE_ENV="production" |
||||
COPY --chown=mastodon:mastodon . /opt/mastodon |
||||
COPY --chown=mastodon:mastodon --from=build /opt/mastodon /opt/mastodon |
||||
|
||||
# Tell rails to serve static files |
||||
ENV RAILS_SERVE_STATIC_FILES="true" |
||||
ENV BIND="0.0.0.0" |
||||
ENV RAILS_ENV="production" \ |
||||
NODE_ENV="production" \ |
||||
RAILS_SERVE_STATIC_FILES="true" \ |
||||
BIND="0.0.0.0" |
||||
|
||||
# Set the run user |
||||
USER mastodon |
||||
WORKDIR /opt/mastodon |
||||
|
||||
# Precompile assets |
||||
RUN cd ~ && \ |
||||
OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile && \ |
||||
yarn cache clean |
||||
RUN OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile && \ |
||||
yarn cache clean |
||||
|
||||
# Set the work dir and the container entry point |
||||
WORKDIR /opt/mastodon |
||||
ENTRYPOINT ["/usr/bin/tini", "--"] |
||||
EXPOSE 3000 4000 |
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue