Skip to content

Commit

Permalink
Merge pull request #463 from imas/update/v4.0.9
Browse files Browse the repository at this point in the history
Update/v4.0.9
  • Loading branch information
takayamaki committed Oct 5, 2023
2 parents 48b1b27 + a426db2 commit c6baa04
Show file tree
Hide file tree
Showing 34 changed files with 496 additions and 191 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/build-container-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
on:
workflow_call:
inputs:
platforms:
required: true
type: string
use_native_arm64_builder:
type: boolean
push_to_images:
type: string
flavor:
type: string
tags:
type: string
labels:
type: string

jobs:
build-image:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: docker/setup-qemu-action@v2
if: contains(inputs.platforms, 'linux/arm64') && !inputs.use_native_arm64_builder

- uses: docker/setup-buildx-action@v2
id: buildx
if: ${{ !(inputs.use_native_arm64_builder && contains(inputs.platforms, 'linux/arm64')) }}

- name: Start a local Docker Builder
if: inputs.use_native_arm64_builder && contains(inputs.platforms, 'linux/arm64')
run: |
docker run --rm -d --name buildkitd -p 1234:1234 --privileged moby/buildkit:latest --addr tcp://0.0.0.0:1234
- uses: docker/setup-buildx-action@v2
id: buildx-native
if: inputs.use_native_arm64_builder && contains(inputs.platforms, 'linux/arm64')
with:
driver: remote
endpoint: tcp://localhost:1234
platforms: linux/amd64
append: |
- endpoint: tcp://${{ vars.DOCKER_BUILDER_HETZNER_ARM64_01_HOST }}:13865
platforms: linux/arm64
name: mastodon-docker-builder-arm64-01
driver-opts:
- servername=mastodon-docker-builder-arm64-01
env:
BUILDER_NODE_1_AUTH_TLS_CACERT: ${{ secrets.DOCKER_BUILDER_HETZNER_ARM64_01_CACERT }}
BUILDER_NODE_1_AUTH_TLS_CERT: ${{ secrets.DOCKER_BUILDER_HETZNER_ARM64_01_CERT }}
BUILDER_NODE_1_AUTH_TLS_KEY: ${{ secrets.DOCKER_BUILDER_HETZNER_ARM64_01_KEY }}

- name: Log in to Docker Hub
if: contains(inputs.push_to_images, 'tootsuite')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to the Github Container registry
if: contains(inputs.push_to_images, 'ghcr.io')
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/metadata-action@v4
id: meta
if: ${{ inputs.push_to_images != '' }}
with:
images: ${{ inputs.push_to_images }}
flavor: ${{ inputs.flavor }}
tags: ${{ inputs.tags }}
labels: ${{ inputs.labels }}

- uses: docker/build-push-action@v4
with:
context: .
platforms: ${{ inputs.platforms }}
provenance: false
builder: ${{ steps.buildx.outputs.name || steps.buildx-native.outputs.name }}
push: ${{ inputs.push_to_images != '' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
55 changes: 0 additions & 55 deletions .github/workflows/build-image.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/build-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build container release images
on:
push:
tags:
- '*'

permissions:
contents: read
packages: write

jobs:
build-image:
uses: ./.github/workflows/build-container-image.yml
with:
platforms: linux/amd64,linux/arm64
use_native_arm64_builder: true
push_to_images: |
tootsuite/mastodon
ghcr.io/mastodon/mastodon
flavor: |
latest=false
tags: |
type=pep440,pattern={{raw}}
type=pep440,pattern=v{{major}}.{{minor}}
secrets: inherit
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,51 @@ Changelog

All notable changes to this project will be documented in this file.

## End of life notice

**The 4.0.x branch will not receive any update after 2023-10-31.**
This means that no security fix will be made available for this branch after this date, and you will need to update to a more recent version (such as the 4.1.x branch) to receive security fixes.

## [4.0.9] - 2023-09-05

### Changed

- Change remote report processing to accept reports with long comments, but truncate them ([ThisIsMissEm](https://github.com/mastodon/mastodon/pull/25028))

### Fixed

- **Fix blocking subdomains of an already-blocked domain** ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/26392))
- Fix `/api/v1/timelines/tag/:hashtag` allowing for unauthenticated access when public preview is disabled ([danielmbrasil](https://github.com/mastodon/mastodon/pull/26237))
- Fix inefficiencies in `PlainTextFormatter` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/26727))

## [4.0.8] - 2023-07-31

### Fixed

- Fix memory leak in streaming server ([ThisIsMissEm](https://github.com/mastodon/mastodon/pull/26228))
- Fix wrong filters sometimes applying in streaming ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/26159), [ThisIsMissEm](https://github.com/mastodon/mastodon/pull/26213), [renchap](https://github.com/mastodon/mastodon/pull/26233))
- Fix incorrect connect timeout in outgoing requests ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/26116))

## [4.0.7] - 2023-07-21

### Added

- Add check preventing Sidekiq workers from running with Makara configured ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25850))

### Changed

- Change request timeout handling to use a longer deadline ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/26055))

### Fixed

- Fix moderation interface for remote instances with a .zip TLD ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25886))
- Fix remote accounts being possibly persisted to database with incomplete protocol values ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25886))
- Fix trending publishers table not rendering correctly on narrow screens ([vmstan](https://github.com/mastodon/mastodon/pull/25945))

### Security

- Fix CSP headers being unintentionally wide ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/26105))

## [4.0.6] - 2023-07-07

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ RUN apt-get update && \

ENV PATH="${PATH}:/opt/ruby/bin:/opt/node/bin"

RUN npm install -g npm@latest && \
RUN npm install -g npm@9 && \
npm install -g yarn && \
gem install bundler && \
apt-get update && \
Expand Down
11 changes: 6 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ A "vulnerability in Mastodon" is a vulnerability in the code distributed through

## Supported Versions

| Version | Supported |
| ------- | ----------|
| 4.0.x | Yes |
| 3.5.x | Yes |
| < 3.5 | No |
| Version | Supported |
| ------- | ------------------ |
| 4.1.x | Yes |
| 4.0.x | Until 2023-10-31 |
| 3.5.x | Until 2023-12-31 |
| < 3.5 | No |
2 changes: 1 addition & 1 deletion app/controllers/admin/domain_blocks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def create
@domain_block.errors.delete(:domain)
render :new
else
if existing_domain_block.present?
if existing_domain_block.present? && existing_domain_block.domain == TagManager.instance.normalize_domain(@domain_block.domain.strip)
@domain_block = existing_domain_block
@domain_block.update(resource_params)
end
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/api/v1/timelines/tag_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

class Api::V1::Timelines::TagController < Api::BaseController
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }, only: :show, if: :require_auth?
before_action :load_tag
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }

Expand All @@ -11,6 +12,10 @@ def show

private

def require_auth?
!Setting.timeline_preview
end

def load_tag
@tag = Tag.find_normalized(params[:id])
end
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/mastodon/components/avatar_overlay_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const icons = {
};

export default class AvatarOverlayIcon extends React.PureComponent {

static propTypes = {
account: ImmutablePropTypes.map.isRequired,
visibility: PropTypes.string.isRequired,
Expand All @@ -23,7 +24,7 @@ export default class AvatarOverlayIcon extends React.PureComponent {

render() {
const { account, visibility, animate } = this.props;
const icon = icons[visibility]
const icon = icons[visibility];

const baseStyle = {
backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,
Expand All @@ -36,4 +37,5 @@ export default class AvatarOverlayIcon extends React.PureComponent {
</div>
);
}

}
7 changes: 3 additions & 4 deletions app/javascript/mastodon/components/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
import Avatar from './avatar';
import AvatarOverlay from './avatar_overlay';
import AvatarOverlayIcon from './avatar_overlay_icon';
import AvatarComposite from './avatar_composite';
import RelativeTimestamp from './relative_timestamp';
import DisplayName from './display_name';
import StatusContent from './status_content';
Expand Down Expand Up @@ -491,10 +490,10 @@ class Status extends ImmutablePureComponent {
);
}

if (account == null && status.get('visibility') === 'public') {
if (account === null && status.get('visibility') === 'public') {
statusAvatar = <Avatar account={status.get('account')} size={46} />;
} else if (account == null) {
statusAvatar = <AvatarOverlayIcon account={status.get('account')} visibility={status.get('visibility')} />
} else if (account === null) {
statusAvatar = <AvatarOverlayIcon account={status.get('account')} visibility={status.get('visibility')} />;
} else {
statusAvatar = <AvatarOverlay account={status.get('account')} friend={account} />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class ComposeForm extends ImmutablePureComponent {
this.autosuggestTextarea.textarea.focus();
}).catch(console.error);
} else if(prevProps.isSubmitting && !this.props.isSubmitting) {
this.autosuggestTextarea.textarea.setSelectionRange(0, 0)
this.autosuggestTextarea.textarea.setSelectionRange(0, 0);
this.autosuggestTextarea.textarea.focus();
} else if (this.props.spoiler !== prevProps.spoiler) {
if (this.props.spoiler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FavouriteTags extends React.PureComponent {
const icon = icons.concat().reverse().find(icon => nextState.lockedVisibility.includes(icon.key));
this.execLockTag(
nextState.lockedTag.join(' '),
typeof icon === 'undefined' ? '' : icon.key
typeof icon === 'undefined' ? '' : icon.key,
);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Button from '../../../components/button';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { defineMessages, injectIntl } from 'react-intl';

const messages = defineMessages({
add_favourite_tags_public: { id: 'tag.add_favourite.public', defaultMessage: 'add in the favourite tags (Public)' },
Expand Down Expand Up @@ -45,7 +45,7 @@ export default class FavouriteToggle extends React.PureComponent {
<div className='column-settings__row'>
<Button className='favourite-tags__remove-button-in-column' text={intl.formatMessage(messages.remove_favourite_tags)} onClick={this.removeFavouriteTags} block />
</div>
:
:
<div className='column-settings__row'>
<Button className='favourite-tags__add-button-in-column' text={intl.formatMessage(messages.add_favourite_tags_public)} onClick={this.addPublic} block />
<Button className='favourite-tags__add-button-in-column' text={intl.formatMessage(messages.add_favourite_tags_unlisted)} onClick={this.addUnlisted} block />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const messages = defineMessages({
followsAndFollowers: { id: 'navigation_bar.follows_and_followers', defaultMessage: 'Follows and followers' },
about: { id: 'navigation_bar.about', defaultMessage: 'About' },
search: { id: 'navigation_bar.search', defaultMessage: 'Search' },
faq: { id: 'navigation_bar.faq', defaultMessage: 'FAQ'}
faq: { id: 'navigation_bar.faq', defaultMessage: 'FAQ' },
});

export default @injectIntl
Expand Down Expand Up @@ -93,7 +93,7 @@ class NavigationPanel extends React.Component {
<hr />

<ColumnLink transparent href='/settings/preferences' icon='cog' text={intl.formatMessage(messages.preferences)} />
<ColumnLink transparent href='https://faq.imastodon.net/getting-started/' icon='question' text={intl.formatMessage(messages.faq)} targetWindow="_blank" />
<ColumnLink transparent href='https://faq.imastodon.net/getting-started/' icon='question' text={intl.formatMessage(messages.faq)} targetWindow='_blank' />

<hr />

Expand All @@ -108,7 +108,7 @@ class NavigationPanel extends React.Component {

<NavigationPortal />


</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/reducers/trend_tags.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TREND_TAGS_SUCCESS,
TREND_TAGS_HISTORY_SUCCESS,
TOGGLE_TREND_TAGS
TOGGLE_TREND_TAGS,
} from '../actions/trend_tags';
import Immutable from 'immutable';

Expand Down
Loading

0 comments on commit c6baa04

Please sign in to comment.