Skip to content

Commit 8e520ee

Browse files
authored
Merge branch 'main' into ClearlyClaire-fixes-uri-text-pattern-ops
2 parents 0c07990 + c0b3dcc commit 8e520ee

File tree

198 files changed

+2978
-525
lines changed

Some content is hidden

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

198 files changed

+2978
-525
lines changed

.codeclimate.yml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ checks:
1414
enabled: false
1515
nested-control-flow:
1616
enabled: false
17+
parameter-lists:
18+
enabled: false
1719
return-statements:
1820
enabled: false
1921
similar-code:

.env.production.sample

+14
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,17 @@ S3_BUCKET=files.example.com
5858
AWS_ACCESS_KEY_ID=
5959
AWS_SECRET_ACCESS_KEY=
6060
S3_ALIAS_HOST=files.example.com
61+
62+
# Custom settings
63+
# ---------------
64+
# Various ways to customize Mastodon's behavior
65+
# ---------------
66+
67+
# Maximum allowed character count
68+
MAX_TOOT_CHARS=500
69+
70+
# Maximum allowed poll options
71+
#MAX_POLL_OPTIONS=4
72+
73+
# Maximum allowed poll option characters
74+
#MAX_POLL_OPTION_CHARS=50

.github/ISSUE_TEMPLATE/config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
blank_issues_enabled: false
21
contact_links:
32
- name: Mastodon Meta Discussion Board
43
url: https://discourse.joinmastodon.org/

.github/dependabot.yml

-22
This file was deleted.

Dockerfile

+40-43
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ FROM ubuntu:20.04 as build-dep
33
# Use bash for the shell
44
SHELL ["/bin/bash", "-c"]
55

6+
# Install build stage deps
7+
RUN echo "Etc/UTC" > /etc/localtime && \
8+
apt-get update && \
9+
apt-get install -y --no-install-recommends \
10+
bison build-essential ca-certificates wget python git \
11+
libyaml-dev libgdbm-dev libreadline-dev libjemalloc-dev \
12+
libicu-dev libidn11-dev libpq-dev \
13+
libprotobuf-dev protobuf-compiler shared-mime-info \
14+
libncurses5-dev libffi-dev zlib1g-dev libssl-dev && \
15+
rm -rf /var/lib/apt/lists/*
16+
17+
ENV PATH="/opt/ruby/bin:/opt/node/bin:/opt/mastodon/bin:${PATH}"
18+
619
# Install Node v14 (LTS)
720
ENV NODE_VER="14.17.6"
821
RUN ARCH= && \
@@ -15,23 +28,15 @@ RUN ARCH= && \
1528
armhf) ARCH='armv7l';; \
1629
i386) ARCH='x86';; \
1730
*) echo "unsupported architecture"; exit 1 ;; \
18-
esac && \
19-
echo "Etc/UTC" > /etc/localtime && \
20-
apt-get update && \
21-
apt-get install -y --no-install-recommends ca-certificates wget python && \
22-
cd ~ && \
31+
esac && cd ~ && \
2332
wget -q https://nodejs.org/download/release/v$NODE_VER/node-v$NODE_VER-linux-$ARCH.tar.gz && \
2433
tar xf node-v$NODE_VER-linux-$ARCH.tar.gz && \
2534
rm node-v$NODE_VER-linux-$ARCH.tar.gz && \
2635
mv node-v$NODE_VER-linux-$ARCH /opt/node
2736

2837
# Install Ruby
2938
ENV RUBY_VER="2.7.4"
30-
RUN apt-get update && \
31-
apt-get install -y --no-install-recommends build-essential \
32-
bison libyaml-dev libgdbm-dev libreadline-dev libjemalloc-dev \
33-
libncurses5-dev libffi-dev zlib1g-dev libssl-dev && \
34-
cd ~ && \
39+
RUN cd ~ && \
3540
wget https://cache.ruby-lang.org/pub/ruby/${RUBY_VER%.*}/ruby-$RUBY_VER.tar.gz && \
3641
tar xf ruby-$RUBY_VER.tar.gz && \
3742
cd ruby-$RUBY_VER && \
@@ -43,56 +48,53 @@ RUN apt-get update && \
4348
make install && \
4449
rm -rf ../ruby-$RUBY_VER.tar.gz ../ruby-$RUBY_VER
4550

46-
ENV PATH="${PATH}:/opt/ruby/bin:/opt/node/bin"
47-
4851
RUN npm install -g yarn && \
49-
gem install bundler && \
50-
apt-get update && \
51-
apt-get install -y --no-install-recommends git libicu-dev libidn11-dev \
52-
libpq-dev libprotobuf-dev protobuf-compiler shared-mime-info
52+
gem install bundler
5353

5454
COPY Gemfile* package.json yarn.lock /opt/mastodon/
55-
5655
RUN cd /opt/mastodon && \
5756
bundle config set deployment 'true' && \
5857
bundle config set without 'development test' && \
58+
bundle config set silence_root_warning true && \
5959
bundle install -j"$(nproc)" && \
6060
yarn install --pure-lockfile
6161

62-
FROM ubuntu:20.04
62+
COPY . /opt/mastodon/
63+
RUN cd /opt/mastodon && \
64+
RAILS_ENV=production OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder \
65+
rails assets:precompile && \
66+
yarn cache clean && \
67+
rm -rf tmp
6368

64-
# Copy over all the langs needed for runtime
65-
COPY --from=build-dep /opt/node /opt/node
66-
COPY --from=build-dep /opt/ruby /opt/ruby
69+
# Build runtime stage
70+
FROM ubuntu:20.04
6771

6872
# Add more PATHs to the PATH
69-
ENV PATH="${PATH}:/opt/ruby/bin:/opt/node/bin:/opt/mastodon/bin"
73+
ENV PATH="/opt/ruby/bin:/opt/node/bin:/opt/mastodon/bin:${PATH}"
7074

71-
# Create the mastodon user
72-
ARG UID=991
73-
ARG GID=991
75+
# Use bash for the shell
7476
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
75-
RUN apt-get update && \
76-
echo "Etc/UTC" > /etc/localtime && \
77-
apt-get install -y --no-install-recommends whois wget && \
78-
addgroup --gid $GID mastodon && \
79-
useradd -m -u $UID -g $GID -d /opt/mastodon mastodon && \
80-
echo "mastodon:$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 24 | mkpasswd -s -m sha-256)" | chpasswd && \
81-
rm -rf /var/lib/apt/lists/*
8277

83-
# Install mastodon runtime deps
84-
RUN apt-get update && \
85-
apt-get -y --no-install-recommends install \
78+
# Setup mastodon runtime deps & configs
79+
ARG UID=991
80+
ARG GID=991
81+
RUN echo "Etc/UTC" > /etc/localtime && \
82+
apt-get update && \
83+
apt-get install -y --no-install-recommends whois wget \
8684
libssl1.1 libpq5 imagemagick ffmpeg libjemalloc2 \
8785
libicu66 libprotobuf17 libidn11 libyaml-0-2 \
88-
file ca-certificates tzdata libreadline8 gcc tini && \
86+
file ca-certificates tzdata libreadline8 tini && \
87+
addgroup --gid $GID mastodon && \
88+
useradd -m -u $UID -g $GID -d /opt/mastodon mastodon && \
8989
ln -s /opt/mastodon /mastodon && \
90-
gem install bundler && \
90+
echo "mastodon:$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 24 | mkpasswd -s -m sha-256)" | chpasswd && \
9191
rm -rf /var/cache && \
9292
rm -rf /var/lib/apt/lists/*
9393

94+
# Copy over all the langs needed for runtime
95+
COPY --from=build-dep /opt/node /opt/node
96+
COPY --from=build-dep /opt/ruby /opt/ruby
9497
# Copy over mastodon source, and dependencies from building, and set permissions
95-
COPY --chown=mastodon:mastodon . /opt/mastodon
9698
COPY --from=build-dep --chown=mastodon:mastodon /opt/mastodon /opt/mastodon
9799

98100
# Run mastodon services in prod mode
@@ -106,11 +108,6 @@ ENV BIND="0.0.0.0"
106108
# Set the run user
107109
USER mastodon
108110

109-
# Precompile assets
110-
RUN cd ~ && \
111-
OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile && \
112-
yarn cache clean
113-
114111
# Set the work dir and the container entry point
115112
WORKDIR /opt/mastodon
116113
ENTRYPOINT ["/usr/bin/tini", "--"]

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ end
4141
gem 'net-ldap', '~> 0.17'
4242
gem 'omniauth-cas', '~> 2.0'
4343
gem 'omniauth-saml', '~> 1.10'
44+
gem 'gitlab-omniauth-openid-connect', '~>0.5.0', require: 'omniauth_openid_connect'
4445
gem 'omniauth', '~> 1.9'
4546
gem 'omniauth-rails_csrf_protection', '~> 0.1'
4647

Gemfile.lock

+41
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ GEM
6868
zeitwerk (~> 2.3)
6969
addressable (2.8.0)
7070
public_suffix (>= 2.0.2, < 5.0)
71+
aes_key_wrap (1.1.0)
7172
airbrussh (1.4.0)
7273
sshkit (>= 1.6.1, != 1.7.0)
7374
android_key_attestation (0.3.0)
@@ -77,6 +78,7 @@ GEM
7778
ast (2.4.2)
7879
attr_encrypted (3.1.0)
7980
encryptor (~> 3.0.0)
81+
attr_required (1.0.1)
8082
awrence (1.1.1)
8183
aws-eventstream (1.2.0)
8284
aws-partitions (1.496.0)
@@ -243,6 +245,10 @@ GEM
243245
fuubar (2.5.1)
244246
rspec-core (~> 3.0)
245247
ruby-progressbar (~> 1.4)
248+
gitlab-omniauth-openid-connect (0.5.0)
249+
addressable (~> 2.7)
250+
omniauth (~> 1.9)
251+
openid_connect (~> 1.2)
246252
globalid (0.5.2)
247253
activesupport (>= 5.0)
248254
hamlit (2.13.0)
@@ -271,6 +277,7 @@ GEM
271277
domain_name (~> 0.5)
272278
http-form_data (2.3.0)
273279
http_accept_language (2.1.1)
280+
httpclient (2.8.3)
274281
httplog (1.5.0)
275282
rack (>= 1.0)
276283
rainbow (>= 2.0.0)
@@ -292,6 +299,10 @@ GEM
292299
jmespath (1.4.0)
293300
json (2.5.1)
294301
json-canonicalization (0.2.1)
302+
json-jwt (1.13.0)
303+
activesupport (>= 4.2)
304+
aes_key_wrap
305+
bindata
295306
json-ld (3.1.9)
296307
htmlentities (~> 4.3)
297308
json-canonicalization (~> 0.2)
@@ -387,6 +398,16 @@ GEM
387398
omniauth-saml (1.10.3)
388399
omniauth (~> 1.3, >= 1.3.2)
389400
ruby-saml (~> 1.9)
401+
openid_connect (1.2.0)
402+
activemodel
403+
attr_required (>= 1.0.0)
404+
json-jwt (>= 1.5.0)
405+
rack-oauth2 (>= 1.6.1)
406+
swd (>= 1.0.0)
407+
tzinfo
408+
validate_email
409+
validate_url
410+
webfinger (>= 1.0.1)
390411
openssl (2.2.0)
391412
openssl-signature_algorithm (0.4.0)
392413
orm_adapter (0.5.0)
@@ -438,6 +459,12 @@ GEM
438459
rack (>= 1.0, < 3)
439460
rack-cors (1.1.1)
440461
rack (>= 2.0.0)
462+
rack-oauth2 (1.16.0)
463+
activesupport
464+
attr_required
465+
httpclient
466+
json-jwt (>= 1.11.0)
467+
rack (>= 2.1.0)
441468
rack-proxy (0.7.0)
442469
rack
443470
rack-test (1.1.0)
@@ -598,6 +625,10 @@ GEM
598625
stoplight (2.2.1)
599626
strong_migrations (0.7.8)
600627
activerecord (>= 5)
628+
swd (1.2.0)
629+
activesupport (>= 3)
630+
attr_required (>= 0.0.5)
631+
httpclient (>= 2.4)
601632
temple (0.8.2)
602633
terminal-table (3.0.0)
603634
unicode-display_width (~> 1.1, >= 1.1.1)
@@ -632,6 +663,12 @@ GEM
632663
unf_ext (0.0.7.7)
633664
unicode-display_width (1.7.0)
634665
uniform_notifier (1.14.2)
666+
validate_email (0.1.6)
667+
activemodel (>= 3.0)
668+
mail (>= 2.2.5)
669+
validate_url (1.0.13)
670+
activemodel (>= 3.0.0)
671+
public_suffix
635672
warden (1.2.9)
636673
rack (>= 2.0.9)
637674
webauthn (3.0.0.alpha1)
@@ -644,6 +681,9 @@ GEM
644681
safety_net_attestation (~> 0.4.0)
645682
securecompare (~> 1.0)
646683
tpm-key_attestation (~> 0.9.0)
684+
webfinger (1.1.0)
685+
activesupport
686+
httpclient (>= 2.4)
647687
webmock (3.14.0)
648688
addressable (>= 2.8.0)
649689
crack (>= 0.3.2)
@@ -708,6 +748,7 @@ DEPENDENCIES
708748
fog-core (<= 2.1.0)
709749
fog-openstack (~> 0.3)
710750
fuubar (~> 2.5)
751+
gitlab-omniauth-openid-connect (~> 0.5.0)
711752
hamlit-rails (~> 0.2)
712753
hiredis (~> 0.6)
713754
htmlentities (~> 4.3)

README.md

+39-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,40 @@
1+
# C4Social fork of Mastodon
2+
3+
[![GitHub release](https://c4social.org/assets/no-releases-for-c4.svg)][releases]
4+
[![Build Status](https://img.shields.io/circleci/project/github/c4social/mastodon.svg)][circleci]
5+
[![Code Climate](https://img.shields.io/codeclimate/maintainability/c4social/mastodon.svg)][code_climate]
6+
[![Docker Pulls](https://img.shields.io/docker/pulls/dsterry/mastodon.svg)][docker]
7+
8+
[releases]: https://github.com/c4social/mastodon/releases
9+
[circleci]: https://circleci.com/gh/c4social/mastodon
10+
[code_climate]: https://codeclimate.com/github/c4social/mastodon
11+
[docker]: https://hub.docker.com/r/dsterry/mastodon/
12+
13+
This is a dynamic version of Mastodon which was forked in August of 2021.
14+
15+
|For everyone|Instance administrators|Contributors (all skill levels)|
16+
|:----:|:----:|:----:|
17+
| Try it at https://c4.social | Install your own from https://github.com/C4Social/mastodon | Report an issue, submit code or docs, or solve a problem at the [Issue tracker](https://github.com/C4Social/mastodon/issues) |
18+
19+
20+
Learn more at [C4Social.org](https://c4social.org)
21+
22+
----
23+
124
![Mastodon](https://i.imgur.com/NhZc40l.png)
225
========
326

4-
[![GitHub release](https://img.shields.io/github/release/mastodon/mastodon.svg)][releases]
5-
[![Build Status](https://img.shields.io/circleci/project/github/mastodon/mastodon.svg)][circleci]
6-
[![Code Climate](https://img.shields.io/codeclimate/maintainability/mastodon/mastodon.svg)][code_climate]
7-
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/mastodon/localized.svg)][crowdin]
8-
[![Docker Pulls](https://img.shields.io/docker/pulls/tootsuite/mastodon.svg)][docker]
27+
[![GitHub release](https://img.shields.io/github/release/mastodon/mastodon.svg)][releases2]
28+
[![Build Status](https://img.shields.io/circleci/project/github/mastodon/mastodon.svg)][circleci2]
29+
[![Code Climate](https://img.shields.io/codeclimate/maintainability/mastodon/mastodon.svg)][code_climate2]
30+
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/mastodon/localized.svg)][crowdin2]
31+
[![Docker Pulls](https://img.shields.io/docker/pulls/tootsuite/mastodon.svg)][docker2]
932

10-
[releases]: https://github.com/mastodon/mastodon/releases
11-
[circleci]: https://circleci.com/gh/mastodon/mastodon
12-
[code_climate]: https://codeclimate.com/github/mastodon/mastodon
13-
[crowdin]: https://crowdin.com/project/mastodon
14-
[docker]: https://hub.docker.com/r/tootsuite/mastodon/
33+
[releases2]: https://github.com/mastodon/mastodon/releases
34+
[circleci2]: https://circleci.com/gh/mastodon/mastodon
35+
[code_climate2]: https://codeclimate.com/github/mastodon/mastodon
36+
[crowdin2]: https://crowdin.com/project/mastodon
37+
[docker2]: https://hub.docker.com/r/tootsuite/mastodon/
1538

1639
Mastodon is a **free, open-source social network server** based on ActivityPub where users can follow friends and discover new ones. On Mastodon, users can publish anything they want: links, pictures, text, video. All Mastodon servers are interoperable as a federated network (users on one server can seamlessly communicate with users from another one, including non-Mastodon software that implements ActivityPub)!
1740

@@ -74,7 +97,12 @@ Mastodon acts as an OAuth2 provider so 3rd party apps can use the REST and Strea
7497

7598
The repository includes deployment configurations for **Docker and docker-compose**, but also a few specific platforms like **Heroku**, **Scalingo**, and **Nanobox**. The [**stand-alone** installation guide](https://docs.joinmastodon.org/admin/install/) is available in the documentation.
7699

77-
A **Vagrant** configuration is included for development purposes.
100+
A **Vagrant** configuration is included for development purposes. To use it, complete following steps:
101+
102+
- Install Vagrant and Virtualbox
103+
- Run `vagrant up`
104+
- Run `vagrant ssh -c "cd /vagrant && foreman start"`
105+
- Open `http://mastodon.local` in your browser
78106

79107
## Contributing
80108

0 commit comments

Comments
 (0)