mirror of
https://git.cloudron.io/cloudron/mastodon-app.git
synced 2024-06-02 13:29:40 +00:00
Compare commits
63 commits
Author | SHA1 | Date | |
---|---|---|---|
95403b326b | |||
870718ad69 | |||
95c055755e | |||
f22270c707 | |||
de786e59ed | |||
0c77e8c32a | |||
6fa11cf195 | |||
b72b058f5e | |||
77f9fa9a63 | |||
56bcb395dc | |||
a24ad995de | |||
f8c84b6ef5 | |||
a08af787d7 | |||
e556c856f1 | |||
25292a86b4 | |||
146b5ac17e | |||
fdc4e20c77 | |||
886f27ec9a | |||
941292bf52 | |||
b4f7038f79 | |||
b77a74978c | |||
816ac7c8ba | |||
31ab0ce6c5 | |||
6d274756a3 | |||
246c44e1c3 | |||
46cf00f343 | |||
2938d2cc2f | |||
1814d12d23 | |||
0e6a4c6ec3 | |||
4036cfa1a7 | |||
27d68b5c35 | |||
7439769e52 | |||
2a87a826c4 | |||
dd4bf3e639 | |||
f7d9238818 | |||
be85153324 | |||
5cdb738996 | |||
0ccd723d02 | |||
a24af7b9e1 | |||
b1a3f751f8 | |||
bd313d9eee | |||
464f74713d | |||
7834da2da1 | |||
55d80d433d | |||
83e912931b | |||
0f61e3c04e | |||
aea9602460 | |||
9ad54e9d7c | |||
cea9af6011 | |||
db96875255 | |||
56896d2d63 | |||
6b25821972 | |||
5a079c338c | |||
f01e2215b0 | |||
2878641da2 | |||
064dd101f3 | |||
53ac4525b0 | |||
9962369a21 | |||
90b0f3dd95 | |||
cef9a1bdbd | |||
4b80104980 | |||
549c36e136 | |||
cae51adfbb |
185
CHANGELOG
185
CHANGELOG
|
@ -294,3 +294,188 @@
|
|||
[1.11.2]
|
||||
* Update nginx config
|
||||
|
||||
[1.11.3]
|
||||
* Update Mastodon to 4.1.2
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.1.2)
|
||||
* Fix crash in tootctl commands making use of parallelization when Elasticsearch is enabled (ClearlyClaire, ClearlyClaire)
|
||||
* Fix crash in db:setup when Elasticsearch is enabled (rrgeorge)
|
||||
* Fix user archive takeout when using OpenStack Swift or S3 providers with no ACL support (ClearlyClaire)
|
||||
* Fix invalid/expired invites being processed on sign-up (ClearlyClaire)
|
||||
* Update Ruby to 3.0.6 due to ReDoS vulnerabilities (saizai)
|
||||
* Fix unescaped user input in LDAP query (ClearlyClaire)
|
||||
|
||||
[1.11.4]
|
||||
* Allow to customize cache retention days
|
||||
* Cleanup accounts cache
|
||||
|
||||
[1.11.5]
|
||||
* Update Mastodon to 4.1.3
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.1.3)
|
||||
* fixing multiple critical security issues (CVE-2023-36460, CVE-2023-36459)
|
||||
* Change OpenGraph-based embeds to allow fullscreen (ClearlyClaire)
|
||||
* Change AccessTokensVacuum to also delete expired tokens (ClearlyClaire)
|
||||
* Change profile updates to be sent to recently-mentioned servers (ClearlyClaire)
|
||||
* Change automatic post deletion thresholds and load detection (ClearlyClaire)
|
||||
|
||||
[1.11.6]
|
||||
* Update Mastodon to 4.1.4
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.1.4)
|
||||
* Fix branding:generate_app_icons failing because of disallowed ICO coder (ClearlyClaire)
|
||||
* Fix crash in admin interface when viewing a remote user with verified links (ClearlyClaire)
|
||||
* Fix processing of media files with unusual names (ClearlyClaire)
|
||||
|
||||
[1.11.7]
|
||||
* Update Mastodon to 4.1.5
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.1.5)
|
||||
* Add check preventing Sidekiq workers from running with Makara configured (ClearlyClaire)
|
||||
* Change request timeout handling to use a longer deadline (ClearlyClaire)
|
||||
* Fix moderation interface for remote instances with a .zip TLD (ClearlyClaire)
|
||||
* Fix remote accounts being possibly persisted to database with incomplete protocol values (ClearlyClaire)
|
||||
* Fix trending publishers table not rendering correctly on narrow screens (vmstan)
|
||||
* Fix CSP headers being unintentionally wide (ClearlyClaire)
|
||||
|
||||
[1.11.8]
|
||||
* Update Mastodon to 4.1.6
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.1.6)
|
||||
* Fix memory leak in streaming server (ThisIsMissEm)
|
||||
* Fix wrong filters sometimes applying in streaming (ClearlyClaire, ThisIsMissEm, renchap)
|
||||
* Fix incorrect connect timeout in outgoing requests (ClearlyClaire)
|
||||
|
||||
[1.11.9]
|
||||
* Update Mastodon to 4.1.7
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.1.7)
|
||||
* Change remote report processing to accept reports with long comments, but truncate them (ThisIsMissEm)
|
||||
* Fix blocking subdomains of an already-blocked domain (ClearlyClaire)
|
||||
* Fix /api/v1/timelines/tag/:hashtag allowing for unauthenticated access when public preview is disabled (danielmbrasil)
|
||||
* Fix inefficiencies in PlainTextFormatter (ClearlyClaire)
|
||||
|
||||
[1.11.10]
|
||||
* Update Mastodon to 4.1.8
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.1.8)
|
||||
* This release is an important security release fixing major security issues (CVE-2023-42451, CVE-2023-42452).
|
||||
* Fix post edits not being forwarded as expected (ClearlyClaire)
|
||||
* Fix moderator rights inconsistencies (ClearlyClaire)
|
||||
* Fix crash when encountering invalid URL (ClearlyClaire)
|
||||
* Fix cached posts including stale stats (ClearlyClaire)
|
||||
|
||||
[1.11.11]
|
||||
* Update Mastodon to 4.1.9
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.1.9)
|
||||
* Fix post translation erroring out (ClearlyClaire)
|
||||
* Fix post edits not being forwarded as expected (ClearlyClaire)
|
||||
* Fix moderator rights inconsistencies (ClearlyClaire)
|
||||
* Fix crash when encountering invalid URL (ClearlyClaire)
|
||||
* Fix cached posts including stale stats (ClearlyClaire)
|
||||
* Fix uploading of video files for which ffprobe reports 0/0 average framerate (NicolaiSoeborg)
|
||||
* Fix unexpected audio stream transcoding when uploaded video is eligible to passthrough (yufushiro)
|
||||
* Fix missing HTML sanitization in translation API (CVE-2023-42452, GHSA-2693-xr3m-jhqr)
|
||||
* Fix incorrect domain name normalization (CVE-2023-42451, GHSA-v3xf-c9qf-j667)
|
||||
|
||||
[1.12.0]
|
||||
* Update Mastodon to 4.2.0
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.2.0)
|
||||
* Add “Privacy and reach” tab in profile settings (Gargron, ClearlyClaire)
|
||||
* This reorganized scattered privacy and reach settings to a single place, as well as improve their wording.
|
||||
* Add display of out-of-band hashtags in the web interface (Gargron, arbolitoloco1, ClearlyClaire, ClearlyClaire, ClearlyClaire, Gargron, ClearlyClaire)
|
||||
* Add role badges to the web interface (ClearlyClaire, Gargron)
|
||||
* Add ability to pick domains to forward reports to using the forward_to_domains parameter in POST /api/v1/reports (ClearlyClaire, ClearlyClaire)
|
||||
* The forward_to_domains REST API parameter is a list of strings. If it is empty or omitted, the previous behavior is maintained.
|
||||
* The forward parameter still needs to be set for forward_to_domains to be taken into account.
|
||||
* The forwarded-to domains can only include that of the original author and people being replied to.
|
||||
* Add forwarding of reported replies to servers being replied to (Gargron, ClearlyClaire)
|
||||
* Add ONE_CLICK_SSO_LOGIN environment variable to directly link to the Single-Sign On provider if there is only one sign up method available (CSDUMMI, ClearlyClaire, CSDUMMI, ClearlyClaire)
|
||||
* Add webhook templating (Gargron)
|
||||
* Add webhooks for local status.created, status.updated, account.updated and report.updated (VyrCossont, VyrCossont, VyrCossont)
|
||||
|
||||
[1.12.1]
|
||||
* Update Mastodon to 4.2.1
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.2.1)
|
||||
* Add redirection on /deck URLs for logged-out users (ClearlyClaire)
|
||||
* Add support for v4.2.0 migrations to tootctl maintenance fix-duplicates (ClearlyClaire)
|
||||
* Change some worker lock TTLs to be shorter-lived (ClearlyClaire)
|
||||
* Change user archive export allowed period from 7 days to 6 days (suddjian)
|
||||
|
||||
[1.12.2]
|
||||
* Update Mastodon to 4.2.2
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.2.2)
|
||||
* Change dismissed banners to be stored server-side (ClearlyClaire)
|
||||
* Change GIF max matrix size error to explicitly mention GIF files (ClearlyClaire)
|
||||
* Change Follow activities delivery to bypass availability check (ShadowJonathan)
|
||||
* Change single-column navigation notice to be displayed outside of the logo container (renchap, renchap)
|
||||
* Change Content-Security-Policy to be tighter on media paths (ClearlyClaire)
|
||||
* Change post language code to include country code when relevant (gunchleoc, ClearlyClaire)
|
||||
* Fix upper border radius of onboarding columns (ClearlyClaire)
|
||||
* Fix incoming status creation date not being restricted to standard ISO8601 (ClearlyClaire, ClearlyClaire)
|
||||
* Fix some posts from threads received out-of-order sometimes not being inserted into timelines (ClearlyClaire)
|
||||
* Fix posts from force-sensitized accounts being able to trend (ClearlyClaire)
|
||||
* Fix error when trying to delete already-deleted file with OpenStack Swift (ClearlyClaire)
|
||||
* Fix batch attachment deletion when using OpenStack Swift (ClearlyClaire)
|
||||
* Fix processing LDSigned activities from actors with unknown public keys (ClearlyClaire)
|
||||
* Fix error and incorrect URLs in /api/v1/accounts/:id/featured_tags for remote accounts (ClearlyClaire)
|
||||
* Fix report processing notice not mentioning the report number when performing a custom action (ClearlyClaire)
|
||||
* Fix handling of inLanguage attribute in preview card processing (ClearlyClaire)
|
||||
* Fix own posts being removed from home timeline when unfollowing a used hashtag (kmycode)
|
||||
* Fix some link anchors being recognized as hashtags (ClearlyClaire, ClearlyClaire)
|
||||
* Fix format-dependent redirects being cached regardless of requested format (ClearlyClaire)
|
||||
|
||||
[1.12.3]
|
||||
* Update Mastodon to 4.2.3
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.2.3)
|
||||
* Fix dependency on json-canonicalization version that has been made unavailable since last release
|
||||
|
||||
[1.12.4]
|
||||
* Update Mastodon to 4.2.4
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.2.4)
|
||||
* Add rate-limit of TOTP authentication attempts at controller level (ClearlyClaire)
|
||||
* Fix error when processing remote files with unusually long names (ClearlyClaire)
|
||||
* Fix processing of compacted single-item JSON-LD collections (ClearlyClaire)
|
||||
* Retry 401 errors on replies fetching (ShadowJonathan)
|
||||
* Fix RecordNotUnique errors in LinkCrawlWorker (tribela)
|
||||
* Fix Mastodon not correctly processing HTTP Signatures with query strings (ClearlyClaire, ClearlyClaire)
|
||||
|
||||
[1.12.5]
|
||||
* Update Mastodon to 4.2.5
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.2.5)
|
||||
* Fix insufficient origin validation (CVE-2024-23832, GHSA-3fjr-858r-92rw)
|
||||
|
||||
[1.12.6]
|
||||
* Update Mastodon to 4.2.6
|
||||
* This release is an important security release fixing several security issue.
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.2.6)
|
||||
* Change external authentication behavior to never reattach a new identity to an existing user by default (GHSA-vm39-j3vx-pch3)
|
||||
* Update the nokogiri dependency (see GHSA-xc9x-jj77-9p9j)
|
||||
* Disable administrative Doorkeeper routes (ThisIsMissEm)
|
||||
* Fix ongoing streaming sessions not being invalidated when applications get deleted in some cases (GHSA-7w3c-p9j8-mq3x)
|
||||
* Update the sidekiq-unique-jobs dependency (see GHSA-cmh9-rx85-xj38)
|
||||
|
||||
[1.13.0]
|
||||
* Update Mastodon to 4.2.7
|
||||
* This release is an important security release fixing several security issue.
|
||||
* With this package release, the app moves from LDAP authentication to OpenID Connect
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.2.7)
|
||||
* Fix OmniAuth tests and edge cases in error handling (ClearlyClaire, ClearlyClaire)
|
||||
* Fix new installs by upgrading to the latest release of the nsa gem, instead of a no longer existing commit (mjankowski)
|
||||
* Fix insufficient checking of remote posts (GHSA-jhrq-qvrm-qr36)
|
||||
|
||||
[1.13.1]
|
||||
* Update Mastodon to 4.2.8
|
||||
* This update changes registrations to be closed by default.
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.2.8)
|
||||
* Add hourly task to automatically require approval for new registrations in the absence of moderators (ClearlyClaire, ClearlyClaire)
|
||||
* In order to prevent future abandoned Mastodon servers from being used for spam, harassment and other malicious activity, Mastodon will now automatically switch new user registrations to require moderator approval whenever they are left open and no activity (including non-moderation actions from apps) from any logged-in user with permission to access moderation reports has been detected in a full week.
|
||||
* When this happens, users with the permission to change server settings will receive an email notification.
|
||||
* This feature is disabled when EMAIL_DOMAIN_ALLOWLIST is used, and can also be disabled with DISABLE_AUTOMATIC_SWITCHING_TO_APPROVED_REGISTRATIONS=true.
|
||||
* Change registrations to be closed by default on new installations (ClearlyClaire)
|
||||
* If you are running a server and never changed your registrations mode from the default, updating will automatically close your registrations.
|
||||
* Simply re-enable them through the administration interface or using tootctl settings registrations open if you want to enable them again.
|
||||
* Fix processing of remote ActivityPub actors making use of Link objects as Image url (ClearlyClaire)
|
||||
* Fix link verifications when page size exceeds 1MB (ClearlyClaire)
|
||||
|
||||
[1.13.2]
|
||||
* Update Mastodon to 4.2.9
|
||||
* [Full changelog](https://github.com/mastodon/mastodon/releases/tag/v4.2.9)
|
||||
* Update dependencies
|
||||
* Fix private mention filtering (GHSA-5fq7-3p3j-9vrf)
|
||||
* Fix password change endpoint not being rate-limited (GHSA-q3rg-xx5v-4mxh)
|
||||
* Add hardening around rate-limit bypass (GHSA-c2r5-cfqr-c553)
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
"description": "file://DESCRIPTION.md",
|
||||
"changelog": "file://CHANGELOG",
|
||||
"tagline": "Federated social network",
|
||||
"version": "1.11.2",
|
||||
"upstreamVersion": "4.1.1",
|
||||
"version": "1.13.2",
|
||||
"upstreamVersion": "4.2.9",
|
||||
"healthCheckPath": "/about",
|
||||
"httpPort": 8000,
|
||||
"memoryLimit": 1610612736,
|
||||
|
@ -16,10 +16,10 @@
|
|||
"postgresql": {},
|
||||
"redis": {},
|
||||
"sendmail": {},
|
||||
"ldap": {},
|
||||
"oidc": { "loginRedirectUri": "/auth/auth/openid_connect/callback" },
|
||||
"scheduler": {
|
||||
"cleanup": {
|
||||
"schedule": "11 11 * * *",
|
||||
"schedule": "11 01 * * *",
|
||||
"command": "/app/pkg/cleanup.sh"
|
||||
}
|
||||
}
|
||||
|
|
19
Dockerfile
19
Dockerfile
|
@ -1,4 +1,4 @@
|
|||
FROM cloudron/base:4.0.0@sha256:31b195ed0662bdb06a6e8a5ddbedb6f191ce92e8bee04c03fb02dd4e9d0286df
|
||||
FROM cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768ba473078319a47f4
|
||||
|
||||
RUN mkdir -p /app/code /app/pkg
|
||||
WORKDIR /app/code
|
||||
|
@ -17,30 +17,31 @@ RUN apt-get update && \
|
|||
libidn11-dev libicu-dev libjemalloc-dev && \
|
||||
rm -rf /var/cache/apt /var/lib/apt/lists
|
||||
|
||||
# install rbenv since we need ruby 3.0.4
|
||||
# install rbenv since we need ruby 3.2.3
|
||||
RUN mkdir -p /usr/local/rbenv && curl -LSs "https://github.com/rbenv/rbenv/archive/refs/tags/v1.2.0.tar.gz" | tar -xz -C /usr/local/rbenv --strip-components 1 -f -
|
||||
ENV PATH /usr/local/rbenv/bin:$PATH
|
||||
RUN mkdir -p "$(rbenv root)"/plugins/ruby-build && curl -LSs "https://github.com/rbenv/ruby-build/archive/refs/tags/v20221101.tar.gz" | tar -xz -C "$(rbenv root)"/plugins/ruby-build --strip-components 1 -f -
|
||||
ENV RBENV_ROOT /home/cloudron/rbenv
|
||||
RUN mkdir -p "$(rbenv root)"/plugins/ruby-build && curl -LSs "https://github.com/rbenv/ruby-build/archive/refs/tags/v20240530.1.tar.gz" | tar -xz -C "$(rbenv root)"/plugins/ruby-build --strip-components 1 -f -
|
||||
|
||||
# install specific ruby version (https://github.com/mastodon/mastodon/blob/main/Dockerfile)
|
||||
ARG RUBY_VERSION=3.0.4
|
||||
ARG RUBY_VERSION=3.2.3
|
||||
RUN rbenv install ${RUBY_VERSION}
|
||||
# this allows cloudron user to access ruby
|
||||
RUN chmod o+rx /root
|
||||
ENV PATH /root/.rbenv/versions/${RUBY_VERSION}/bin:$PATH
|
||||
ENV PATH ${RBENV_ROOT}/versions/${RUBY_VERSION}/bin:$PATH
|
||||
|
||||
RUN gem install --no-document bundler
|
||||
|
||||
ENV RAILS_ENV production
|
||||
ENV NODE_ENV production
|
||||
|
||||
ARG VERSION=4.1.1
|
||||
ARG VERSION=4.2.9
|
||||
|
||||
RUN curl -L https://github.com/tootsuite/mastodon/archive/v${VERSION}.tar.gz | tar -xz --strip-components 1 -f - && \
|
||||
bundle config --local set deployment 'true' && \
|
||||
bundle config --local set without 'development test' && \
|
||||
bundle config --local set silence_root_warning true && \
|
||||
bundle install && \
|
||||
bundle clean --force && \
|
||||
rm -rf ~/.bundle /usr/local/bundle/cache && \
|
||||
yarn install --pure-lockfile
|
||||
|
||||
# secret keys are not built into assets, so precompiling is safe to do here
|
||||
|
@ -68,7 +69,7 @@ RUN ln -sf /run/mastodon/supervisord.log /var/log/supervisor/supervisord.log
|
|||
RUN ln -fs /app/data/env.production /app/code/.env.production
|
||||
RUN ln -fs /app/data/system /app/code/public/system
|
||||
|
||||
COPY start.sh cleanup.sh config.sh env.template /app/pkg/
|
||||
COPY start.sh cleanup.sh config.sh env.template cache-env.sh.template /app/pkg/
|
||||
|
||||
CMD [ "/app/pkg/start.sh" ]
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
Accounts are created with the username and the subdomain under which this app is installed e.g. `@$CLOUDRON-USERNAME@$CLOUDRON-APP-FQDN`. Mastodon does not allow changing the domain part of the account later. See [the docs](https://docs.cloudron.io/apps/mastodon/#federation) for more information, if you want to change this domain.
|
||||
Accounts are created with the username and the subdomain under which this app is installed e.g. `@$CLOUDRON-USERNAME@$CLOUDRON-APP-FQDN`.
|
||||
Mastodon does not allow changing the domain part of the account later.
|
||||
See [the docs](https://docs.cloudron.io/apps/mastodon/#federation) for more information, f you want to change this domain.
|
||||
|
||||
<sso>
|
||||
**NOTE:**
|
||||
|
@ -7,3 +9,9 @@ Accounts are created with the username and the subdomain under which this app is
|
|||
* External registration [does not work well](https://github.com/mastodon/mastodon/issues/20655) when Cloudron user management is enabled.
|
||||
</sso>
|
||||
|
||||
<nosso>
|
||||
**NOTE:**
|
||||
* Open registration is disabled by default. To enable this, see the [docs](https://docs.cloudron.io/apps/mastodon/#registration)
|
||||
|
||||
* To add an initial account follow those [instructions](https://docs.cloudron.io/apps/mastodon/#adding-users)
|
||||
</nosso>
|
||||
|
|
4
cache-env.sh.template
Normal file
4
cache-env.sh.template
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
# number of days to keep cache
|
||||
export CACHE_RETENTION_DAYS=2
|
30
cleanup.sh
30
cleanup.sh
|
@ -5,11 +5,35 @@ set -eu
|
|||
echo "=> Cleanup"
|
||||
cd /app/code
|
||||
|
||||
if [[ ! -f /app/data/cache-env.sh ]]; then
|
||||
echo "==> Creating initial cache-env.sh"
|
||||
cp /app/pkg/cache-env.sh.template /app/data/cache-env.sh
|
||||
fi
|
||||
|
||||
source /app/data/cache-env.sh
|
||||
|
||||
echo "=> Retention days set to ${CACHE_RETENTION_DAYS}"
|
||||
|
||||
echo "==> media cache ..."
|
||||
./bin/tootctl media remove --days=7
|
||||
./bin/tootctl media remove --days=${CACHE_RETENTION_DAYS}
|
||||
|
||||
echo "==> orphaned media ..."
|
||||
./bin/tootctl media remove-orphans
|
||||
|
||||
echo "==> preview cards.."
|
||||
./bin/tootctl preview-cards remove --days=7
|
||||
echo "==> preview cards ..."
|
||||
./bin/tootctl preview-cards remove --days=${CACHE_RETENTION_DAYS}
|
||||
|
||||
echo "==> prune profiles ..."
|
||||
./bin/tootctl media remove --prune-profiles --days=${CACHE_RETENTION_DAYS}
|
||||
|
||||
echo "==> remove headers ..."
|
||||
./bin/tootctl media remove --remove-headers --days=${CACHE_RETENTION_DAYS}
|
||||
|
||||
echo "==> clear cache ..."
|
||||
/app/code/bin/tootctl cache clear
|
||||
|
||||
echo "==> remove unreferenced statuses ..."
|
||||
/app/code/bin/tootctl statuses remove --days=${CACHE_RETENTION_DAYS}
|
||||
|
||||
echo "==> prune accounts ..."
|
||||
/app/code/bin/tootctl accounts prune
|
||||
|
|
20
env.template
20
env.template
|
@ -32,20 +32,22 @@ SMTP_AUTH_METHOD=plain
|
|||
SMTP_OPENSSL_VERIFY_MODE=none
|
||||
|
||||
# SSO configuration
|
||||
LDAP_ENABLED=
|
||||
LDAP_HOST=
|
||||
LDAP_PORT=
|
||||
LDAP_BASE=
|
||||
LDAP_BIND_DN=
|
||||
LDAP_PASSWORD=
|
||||
LDAP_UID=username
|
||||
LDAP_SEARCH_FILTER=(|(%{uid}=%{email})(mail=%{email}))
|
||||
LDAP_METHOD=plain
|
||||
OIDC_ENABLED=
|
||||
OIDC_DISPLAY_NAME=
|
||||
OIDC_ISSUER=
|
||||
OIDC_CLIENT_ID=
|
||||
OIDC_CLIENT_SECRET=
|
||||
OIDC_REDIRECT_URI=
|
||||
OIDC_DISCOVERY=
|
||||
OIDC_SCOPE=
|
||||
OIDC_UID_FIELD=
|
||||
|
||||
# Application secrets
|
||||
SECRET_KEY_BASE=
|
||||
OTP_SECRET=
|
||||
|
||||
UPDATE_CHECK_URL=
|
||||
|
||||
# Optionally change default language
|
||||
# DEFAULT_LOCALE=de
|
||||
|
||||
|
|
|
@ -89,6 +89,8 @@ server {
|
|||
location ~ ^/system/ {
|
||||
add_header Cache-Control "public, max-age=2419200, immutable";
|
||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains";
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header Content-Security-Policy "default-src 'none'; form-action 'none'";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
|
|
27
start.sh
27
start.sh
|
@ -30,16 +30,19 @@ sed -e "s/DB_HOST=.*/DB_HOST=${CLOUDRON_POSTGRESQL_HOST}/g" \
|
|||
-e "s/WEB_DOMAIN=.*/WEB_DOMAIN=${CLOUDRON_APP_DOMAIN}/g" \
|
||||
-i /app/data/env.production
|
||||
|
||||
if [[ -n "${CLOUDRON_LDAP_SERVER:-}" ]]; then
|
||||
sed -e "s/LDAP_ENABLED=.*/LDAP_ENABLED=true/g" \
|
||||
-e "s/LDAP_HOST=.*/LDAP_HOST=${CLOUDRON_LDAP_SERVER}/g" \
|
||||
-e "s/LDAP_PORT=.*/LDAP_PORT=${CLOUDRON_LDAP_PORT}/g" \
|
||||
-e "s/LDAP_BASE=.*/LDAP_BASE=${CLOUDRON_LDAP_USERS_BASE_DN}/g" \
|
||||
-e "s/LDAP_BIND_DN=.*/LDAP_BIND_DN=${CLOUDRON_LDAP_BIND_DN}/g" \
|
||||
-e "s/LDAP_BIND_PASSWORD=.*/LDAP_BIND_PASSWORD=${CLOUDRON_LDAP_BIND_PASSWORD}/g" \
|
||||
if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
|
||||
echo "==> Setting up OIDC"
|
||||
sed -e "s/OIDC_ENABLED=.*/OIDC_ENABLED=true/g" \
|
||||
-e "s/OIDC_DISPLAY_NAME=.*/OIDC_DISPLAY_NAME=Cloudron/g" \
|
||||
-e "s/OIDC_ISSUER=.*/OIDC_ISSUER=${CLOUDRON_OIDC_ISSUER//\//\\\/}/g" \
|
||||
-e "s/OIDC_CLIENT_ID=.*/OIDC_CLIENT_ID=${CLOUDRON_OIDC_CLIENT_ID}/g" \
|
||||
-e "s/OIDC_CLIENT_SECRET=.*/OIDC_CLIENT_SECRET=${CLOUDRON_OIDC_CLIENT_SECRET}/g" \
|
||||
-e "s/OIDC_REDIRECT_URI=.*/OIDC_REDIRECT_URI=${CLOUDRON_APP_ORIGIN//\//\\\/}\/auth\/auth\/openid_connect\/callback/g" \
|
||||
-e "s/OIDC_DISCOVERY=.*/OIDC_DISCOVERY=true/g" \
|
||||
-e "s/OIDC_SCOPE=.*/OIDC_SCOPE=openid,profile,email/g" \
|
||||
-e "s/OIDC_UID_FIELD=.*/OIDC_UID_FIELD=sub/g" \
|
||||
-e "s/OIDC_SECURITY_ASSUME_EMAIL_IS_VERIFIED=.*/OIDC_SECURITY_ASSUME_EMAIL_IS_VERIFIED=true/g" \
|
||||
-i /app/data/env.production
|
||||
else
|
||||
sed -e "s/LDAP_ENABLED=.*/LDAP_ENABLED=false/g" -i /app/data/env.production
|
||||
fi
|
||||
|
||||
rm -f /run/mastodon/Gemfile.lock && cp /app/code/Gemfile.lock.original /run/mastodon/Gemfile.lock
|
||||
|
@ -57,7 +60,7 @@ if grep -q "^SECRET_KEY_BASE=$" /app/data/env.production; then
|
|||
echo "==> Init database"
|
||||
HOME=/app/data SAFETY_ASSURED=1 bundle exec rails db:schema:load db:seed
|
||||
|
||||
if [[ -n "${CLOUDRON_LDAP_SERVER:-}" ]]; then
|
||||
if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
|
||||
echo "Disabling registration by default"
|
||||
PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} \
|
||||
-c "INSERT INTO settings (var, value) VALUES ('registrations_mode', 'none')"
|
||||
|
@ -67,6 +70,10 @@ else
|
|||
HOME=/app/data SAFETY_ASSURED=1 bundle exec rails db:migrate
|
||||
fi
|
||||
|
||||
if ! grep -q UPDATE_CHECK_URL /app/data/env.production; then
|
||||
echo -e "\nUPDATE_CHECK_URL=" >> /app/data/env.production
|
||||
fi
|
||||
|
||||
chown -R cloudron:cloudron /tmp/mastodon /run/mastodon
|
||||
|
||||
if [[ "$(stat -c '%U' /app/data)" != "cloudron" ]]; then
|
||||
|
|
870
test/package-lock.json
generated
870
test/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -10,10 +10,10 @@
|
|||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"expect.js": "^0.3.1",
|
||||
"mocha": "^10.2.0",
|
||||
"selenium-webdriver": "^4.8.1"
|
||||
"mocha": "^10.4.0",
|
||||
"selenium-webdriver": "^4.21.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chromedriver": "^111.0.0"
|
||||
"chromedriver": "^125.0.2"
|
||||
}
|
||||
}
|
||||
|
|
139
test/test.js
139
test/test.js
|
@ -30,6 +30,7 @@ describe('Application life cycle test', function () {
|
|||
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
|
||||
|
||||
let browser, app;
|
||||
var athenticated_by_oidc = false;
|
||||
let username = process.env.USERNAME;
|
||||
let password = process.env.PASSWORD;
|
||||
let manifest = require('../CloudronManifest.json');
|
||||
|
@ -42,6 +43,15 @@ describe('Application life cycle test', function () {
|
|||
browser.quit();
|
||||
});
|
||||
|
||||
function sleep(millis) {
|
||||
return new Promise(resolve => setTimeout(resolve, millis));
|
||||
}
|
||||
|
||||
async function waitForElement(elem) {
|
||||
await browser.wait(until.elementLocated(elem), TEST_TIMEOUT);
|
||||
await browser.wait(until.elementIsVisible(browser.findElement(elem)), TEST_TIMEOUT);
|
||||
}
|
||||
|
||||
async function exists(selector) {
|
||||
await browser.wait(until.elementLocated(selector), TEST_TIMEOUT);
|
||||
}
|
||||
|
@ -52,10 +62,10 @@ describe('Application life cycle test', function () {
|
|||
}
|
||||
|
||||
async function checkRegistration(mode) {
|
||||
if (mode === 'none') {
|
||||
if (mode === 'none') {
|
||||
await browser.get('https://' + app.fqdn);
|
||||
await browser.sleep(2000);
|
||||
await browser.findElement(By.xpath('//div[@class="sign-in-banner"]/descendant::button/span[contains(text(), "Create account")]')).click();
|
||||
await browser.findElement(By.xpath('//div[@class="sign-in-banner"]/descendant::button/span[contains(text(), "Create account")] | //div[@class="sign-in-banner"]/descendant::a/span[contains(text(), "Create account")]')).click();
|
||||
await visible(By.xpath('//span[contains(text()[2], "is currently not possible")]'));
|
||||
} else if (mode === 'open') {
|
||||
await browser.get('https://' + app.fqdn + '/auth/sign_up');
|
||||
|
@ -65,85 +75,66 @@ describe('Application life cycle test', function () {
|
|||
|
||||
async function login(username, password) {
|
||||
await browser.get('https://' + app.fqdn + '/auth/sign_in'); // there is also separate login page at /users/sign_in
|
||||
await browser.wait(until.elementLocated(By.xpath('//button[contains(text(), "Log in")]')), TEST_TIMEOUT);
|
||||
await visible(By.xpath('//button[contains(text(), "Log in")]'));
|
||||
await browser.findElement(By.id('user_email')).sendKeys(username);
|
||||
await browser.findElement(By.id('user_password')).sendKeys(password);
|
||||
await browser.findElement(By.xpath('//button[contains(text(), "Log in")]')).click();
|
||||
await browser.sleep(3000); // can be wizard or timeline at this point
|
||||
}
|
||||
|
||||
async function loginOIDC(username, password) {
|
||||
browser.manage().deleteAllCookies();
|
||||
await browser.get(`https://${app.fqdn}/auth/sign_in`);
|
||||
await browser.sleep(4000);
|
||||
|
||||
await browser.findElement(By.xpath('//a[contains(@class, "button") and text()="Cloudron"]')).click();
|
||||
await browser.sleep(4000);
|
||||
|
||||
if (!athenticated_by_oidc) {
|
||||
await waitForElement(By.xpath('//input[@name="username"]'));
|
||||
await browser.findElement(By.xpath('//input[@name="username"]')).sendKeys(username);
|
||||
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(password);
|
||||
await browser.sleep(2000);
|
||||
await browser.findElement(By.id('loginSubmitButton')).click();
|
||||
await browser.sleep(2000);
|
||||
|
||||
athenticated_by_oidc = true;
|
||||
}
|
||||
|
||||
await waitForElement(By.xpath('//a[contains(., "Edit profile")] | //strong[text()="Successfully authenticated from Cloudron account."]'));
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await browser.get('https://' + app.fqdn + '/settings/preferences/appearance'); // there is also separate login page at /users/sign_in
|
||||
await browser.wait(until.elementLocated(By.id('logout')), TEST_TIMEOUT);
|
||||
await browser.findElement(By.id('logout')).click();
|
||||
await browser.wait(until.elementLocated(By.id('user_email')), TEST_TIMEOUT);
|
||||
await visible(By.id('user_email'));
|
||||
}
|
||||
|
||||
async function skipTutorial() {
|
||||
await browser.get('https://' + app.fqdn + '/web/start');
|
||||
await browser.wait(until.elementLocated(By.xpath('//button/span[text() = "Done"]')), TEST_TIMEOUT);
|
||||
await browser.findElement(By.xpath('//button/span[text() = "Done"]')).click();
|
||||
await browser.sleep(5000); // can be wizard or timeline at this point
|
||||
await browser.wait(until.elementLocated(By.xpath('//span[text() = "See some suggestions"]')), TEST_TIMEOUT);
|
||||
await browser.sleep(5000);
|
||||
async function dismissHelp() {
|
||||
await browser.get('https://' + app.fqdn + '/home');
|
||||
await visible(By.xpath('//button[@title = "Dismiss"]'));
|
||||
await browser.findElement(By.xpath('//button[@title ="Dismiss"]')).click();
|
||||
}
|
||||
|
||||
async function checkTimeline() {
|
||||
await browser.get('https://' + app.fqdn + '/home');
|
||||
await browser.sleep(2000);
|
||||
await browser.wait(until.elementLocated(By.xpath('//span[text() = "See some suggestions"]')), TEST_TIMEOUT);
|
||||
await visible(By.xpath('//span[contains(text(), "Your home timeline is empty")]'));
|
||||
}
|
||||
|
||||
function getAppInfo() {
|
||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
||||
const inspect = JSON.parse(execSync('cloudron inspect'));
|
||||
app = inspect.apps.filter(function (a) { return a.location === LOCATION || a.location === LOCATION + '2'; })[0];
|
||||
expect(app).to.be.an('object');
|
||||
}
|
||||
|
||||
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
|
||||
it('install app', function () { execSync('cloudron install --location ' + LOCATION, EXEC_ARGS); });
|
||||
|
||||
it('can get app information', getAppInfo);
|
||||
it('registration is disabled', checkRegistration.bind(null, 'none'));
|
||||
it('can LDAP login', login.bind(null, username, password));
|
||||
it('can skip tutorial', skipTutorial);
|
||||
it('can see timeline', checkTimeline);
|
||||
it('can logout', logout);
|
||||
|
||||
it('backup app', function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); });
|
||||
it('restore app', function () {
|
||||
const backups = JSON.parse(execSync('cloudron backup list --raw'));
|
||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
|
||||
getAppInfo();
|
||||
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
|
||||
});
|
||||
|
||||
it('can LDAP login', login.bind(null, username, password));
|
||||
it('can see timeline', checkTimeline);
|
||||
|
||||
it('can restart app', function () { execSync('cloudron restart --app ' + app.id, EXEC_ARGS); });
|
||||
it('can see timeline', checkTimeline);
|
||||
|
||||
it('move to different location', async function () {
|
||||
await browser.get('about:blank');
|
||||
execSync('cloudron configure --location ' + LOCATION + '2 --app ' + app.id, EXEC_ARGS);
|
||||
});
|
||||
it('can get app information', getAppInfo);
|
||||
|
||||
it('can LDAP login', login.bind(null, username, password));
|
||||
it('can see timeline', checkTimeline);
|
||||
|
||||
it('uninstall app', async function () {
|
||||
await browser.get('about:blank');
|
||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||
});
|
||||
|
||||
// No SSO
|
||||
it('install app (no sso)', function () { execSync('cloudron install --no-sso --location ' + LOCATION, EXEC_ARGS); });
|
||||
it('can get app information', getAppInfo);
|
||||
|
||||
it('has registration open', checkRegistration.bind(null, 'open'));
|
||||
it('has registration open', checkRegistration.bind(null, 'none'));
|
||||
let testPassword;
|
||||
it('create a user with CLI', function () {
|
||||
let output = execSync('cloudron exec --app ' + LOCATION + ' -- bin/tootctl accounts create test --email=test@cloudron.io', { cwd: path.resolve(__dirname, '..'), encoding: 'utf8' });
|
||||
|
@ -165,10 +156,50 @@ describe('Application life cycle test', function () {
|
|||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||
});
|
||||
|
||||
// SSO
|
||||
it('install app (sso)', function () { execSync('cloudron install --location ' + LOCATION, EXEC_ARGS); });
|
||||
|
||||
it('can get app information', getAppInfo);
|
||||
it('registration is disabled', checkRegistration.bind(null, 'none'));
|
||||
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||
it('can dismiss help', dismissHelp);
|
||||
it('can see timeline', checkTimeline);
|
||||
it('can logout', logout);
|
||||
|
||||
it('backup app', function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); });
|
||||
it('restore app', function () {
|
||||
const backups = JSON.parse(execSync('cloudron backup list --raw'));
|
||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
|
||||
getAppInfo();
|
||||
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
|
||||
});
|
||||
|
||||
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||
it('can see timeline', checkTimeline);
|
||||
|
||||
it('can restart app', function () { execSync('cloudron restart --app ' + app.id, EXEC_ARGS); });
|
||||
it('can see timeline', checkTimeline);
|
||||
|
||||
it('move to different location', async function () {
|
||||
await browser.get('about:blank');
|
||||
execSync('cloudron configure --location ' + LOCATION + '2 --app ' + app.id, EXEC_ARGS);
|
||||
});
|
||||
it('can get app information', getAppInfo);
|
||||
|
||||
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||
it('can see timeline', checkTimeline);
|
||||
|
||||
it('uninstall app', async function () {
|
||||
await browser.get('about:blank');
|
||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||
});
|
||||
|
||||
// test update
|
||||
it('can install app', function () { execSync('cloudron install --appstore-id ' + manifest.id + ' --location ' + LOCATION, EXEC_ARGS); });
|
||||
it('can get app information', getAppInfo);
|
||||
it('can LDAP login', login.bind(null, username, password));
|
||||
// needs to be changed to loginOIDC on the next release
|
||||
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||
it('can logout', logout);
|
||||
|
||||
it('can update', async function () {
|
||||
|
@ -176,7 +207,7 @@ describe('Application life cycle test', function () {
|
|||
execSync('cloudron update --app ' + LOCATION, EXEC_ARGS);
|
||||
});
|
||||
|
||||
it('can LDAP login', login.bind(null, username, password));
|
||||
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||
|
||||
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); });
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue