Skip to content

Commit f27e805

Browse files
authored
Merge pull request #2138 from kedamaDQ/foresdon-v4.3.0
Foresdon v4.3.0
2 parents e03d08d + 8148415 commit f27e805

File tree

3,652 files changed

+144941
-81574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,652 files changed

+144941
-81574
lines changed

Diff for: .browserslistrc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[production]
22
defaults
3-
not IE 11
3+
> 0.2%
4+
firefox >= 78
5+
ios >= 15.6
46
not dead
7+
not OperaMini all
58

69
[development]
710
supports es6-module

Diff for: .devcontainer/Dockerfile

+13-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# For details, see https://github.com/devcontainers/images/tree/main/src/ruby
2-
FROM mcr.microsoft.com/devcontainers/ruby:1-3.2-bullseye
2+
FROM mcr.microsoft.com/devcontainers/ruby:1-3.3-bookworm
33

4-
# Install Rails
5-
# RUN gem install rails webdrivers
4+
# Install node version from .nvmrc
5+
WORKDIR /app
6+
COPY .nvmrc .
7+
RUN /bin/bash --login -i -c "nvm install"
68

7-
ARG NODE_VERSION="16"
8-
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"
9+
# Install additional OS packages
10+
RUN apt-get update && \
11+
export DEBIAN_FRONTEND=noninteractive && \
12+
apt-get -y install --no-install-recommends libicu-dev libidn11-dev ffmpeg imagemagick libvips42 libpam-dev
913

10-
# [Optional] Uncomment this section to install additional OS packages.
11-
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
12-
&& apt-get -y install --no-install-recommends libicu-dev libidn11-dev ffmpeg imagemagick libpam-dev
14+
# Disable download prompt for Corepack
15+
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
1316

14-
# [Optional] Uncomment this line to install additional gems.
15-
RUN gem install foreman
16-
17-
# [Optional] Uncomment this line to install global node packages.
18-
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g yarn" 2>&1
19-
20-
COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
17+
# Move welcome message to where VS Code expects it
18+
COPY .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt

Diff for: .devcontainer/codespaces/devcontainer.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Mastodon on GitHub Codespaces",
3-
"dockerComposeFile": "../docker-compose.yml",
3+
"dockerComposeFile": "../compose.yaml",
44
"service": "app",
55
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
66

@@ -23,6 +23,8 @@
2323
}
2424
},
2525

26+
"remoteUser": "root",
27+
2628
"otherPortsAttributes": {
2729
"onAutoForward": "silent"
2830
},
@@ -37,7 +39,7 @@
3739
},
3840

3941
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
40-
"postCreateCommand": ".devcontainer/post-create.sh",
42+
"postCreateCommand": "bin/setup",
4143
"waitFor": "postCreateCommand",
4244

4345
"customizations": {

Diff for: .devcontainer/compose.yaml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
services:
2+
app:
3+
working_dir: /workspaces/mastodon/
4+
build:
5+
context: ..
6+
dockerfile: .devcontainer/Dockerfile
7+
volumes:
8+
- ..:/workspaces/mastodon:cached
9+
environment:
10+
RAILS_ENV: development
11+
NODE_ENV: development
12+
BIND: 0.0.0.0
13+
REDIS_HOST: redis
14+
REDIS_PORT: '6379'
15+
DB_HOST: db
16+
DB_USER: postgres
17+
DB_PASS: postgres
18+
DB_PORT: '5432'
19+
ES_ENABLED: 'true'
20+
ES_HOST: es
21+
ES_PORT: '9200'
22+
LIBRE_TRANSLATE_ENDPOINT: http://libretranslate:5000
23+
# Overrides default command so things don't shut down after the process ends.
24+
command: sleep infinity
25+
ports:
26+
- '127.0.0.1:3000:3000'
27+
- '127.0.0.1:3035:3035'
28+
- '127.0.0.1:4000:4000'
29+
networks:
30+
- external_network
31+
- internal_network
32+
33+
db:
34+
image: postgres:14-alpine
35+
restart: unless-stopped
36+
volumes:
37+
- postgres-data:/var/lib/postgresql/data
38+
environment:
39+
POSTGRES_USER: postgres
40+
POSTGRES_DB: postgres
41+
POSTGRES_PASSWORD: postgres
42+
POSTGRES_HOST_AUTH_METHOD: trust
43+
networks:
44+
- internal_network
45+
46+
redis:
47+
image: redis:7-alpine
48+
restart: unless-stopped
49+
volumes:
50+
- redis-data:/data
51+
networks:
52+
- internal_network
53+
54+
es:
55+
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
56+
restart: unless-stopped
57+
environment:
58+
ES_JAVA_OPTS: -Xms512m -Xmx512m
59+
cluster.name: es-mastodon
60+
discovery.type: single-node
61+
bootstrap.memory_lock: 'true'
62+
volumes:
63+
- es-data:/usr/share/elasticsearch/data
64+
networks:
65+
- internal_network
66+
ulimits:
67+
memlock:
68+
soft: -1
69+
hard: -1
70+
71+
libretranslate:
72+
image: libretranslate/libretranslate:v1.6.1
73+
restart: unless-stopped
74+
volumes:
75+
- lt-data:/home/libretranslate/.local
76+
networks:
77+
- external_network
78+
- internal_network
79+
80+
volumes:
81+
postgres-data:
82+
redis-data:
83+
es-data:
84+
lt-data:
85+
86+
networks:
87+
external_network:
88+
internal_network:
89+
internal: true

Diff for: .devcontainer/devcontainer.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Mastodon on local machine",
3-
"dockerComposeFile": "docker-compose.yml",
3+
"dockerComposeFile": "compose.yaml",
44
"service": "app",
55
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
66

@@ -23,12 +23,14 @@
2323
}
2424
},
2525

26+
"remoteUser": "root",
27+
2628
"otherPortsAttributes": {
2729
"onAutoForward": "silent"
2830
},
2931

3032
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
31-
"postCreateCommand": ".devcontainer/post-create.sh",
33+
"postCreateCommand": "bin/setup",
3234
"waitFor": "postCreateCommand",
3335

3436
"customizations": {

Diff for: .devcontainer/docker-compose.yml

-90
This file was deleted.

Diff for: .devcontainer/post-create.sh

-26
This file was deleted.

Diff for: .devcontainer/welcome-message.txt

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
👋 Welcome to "Mastodon" in GitHub Codespaces!
1+
👋 Welcome to your Mastodon Dev Container!
22

3-
🛠️ Your environment is fully setup with all the required software.
3+
🛠️ Your environment is fully setup with all the required software.
44

5-
🔍 To explore VS Code to its fullest, search using the Command Palette (Cmd/Ctrl + Shift + P or F1).
6-
7-
📝 Edit away, run your app as usual, and we'll automatically make it available for you to access.
5+
💥 Run `bin/dev` to start the application processes.
86

7+
🥼 Run `RAILS_ENV=test bin/rails assets:precompile && RAILS_ENV=test bin/rspec` to run the test suite.

Diff for: .dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
public/system
99
public/assets
1010
public/packs
11+
public/packs-test
1112
node_modules
1213
neo4j
1314
vendor/bundle

Diff for: .env.development

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Required by ActiveRecord encryption feature
2+
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=fkSxKD2bF396kdQbrP1EJ7WbU7ZgNokR
3+
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=r0hvVmzBVsjxC7AMlwhOzmtc36ZCOS1E
4+
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=PhdFyyfy5xJ7WVd2lWBpcPScRQHzRTNr

Diff for: .env.production.sample

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This is a sample configuration file. You can generate your configuration
2-
# with the `rake mastodon:setup` interactive setup wizard, but to customize
2+
# with the `bundle exec rails mastodon:setup` interactive setup wizard, but to customize
33
# your setup even further, you'll need to edit it manually. This sample does
44
# not demonstrate all available configuration options. Please look at
55
# https://docs.joinmastodon.org/admin/config/ for the full documentation.
@@ -40,14 +40,14 @@ ES_PASS=password
4040

4141
# Secrets
4242
# -------
43-
# Make sure to use `rake secret` to generate secrets
43+
# Make sure to use `bundle exec rails secret` to generate secrets
4444
# -------
4545
SECRET_KEY_BASE=
4646
OTP_SECRET=
4747

4848
# Web Push
4949
# --------
50-
# Generate with `rake mastodon:webpush:generate_vapid_key`
50+
# Generate with `bundle exec rails mastodon:webpush:generate_vapid_key`
5151
# --------
5252
VAPID_PRIVATE_KEY=
5353
VAPID_PUBLIC_KEY=

Diff for: .env.test

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
# Node.js
2-
NODE_ENV=tests
1+
# In test, compile the NodeJS code as if we are in production
2+
NODE_ENV=production
33
# Federation
44
LOCAL_DOMAIN=cb6e6126.ngrok.io
55
LOCAL_HTTPS=true
6+
7+
# Secret values required by ActiveRecord encryption feature
8+
# Use `bin/rails db:encryption:init` to generate fresh secrets
9+
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=test_determinist_key_DO_NOT_USE_IN_PRODUCTION
10+
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=test_salt_DO_NOT_USE_IN_PRODUCTION
11+
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=test_primary_key_DO_NOT_USE_IN_PRODUCTION

0 commit comments

Comments
 (0)