mirror of
https://github.com/jakejarvis/mastodon-utils.git
synced 2025-04-26 01:05:22 -04:00
update patches for mastodon changes
This commit is contained in:
parent
352a57c1dc
commit
4859964130
@ -1,8 +1,39 @@
|
|||||||
diff --git a/app/javascript/flavours/glitch/features/interaction_modal/index.js b/app/javascript/flavours/glitch/features/interaction_modal/index.js
|
diff --git a/app/javascript/flavours/glitch/features/interaction_modal/index.js b/app/javascript/flavours/glitch/features/interaction_modal/index.js
|
||||||
index b71c041c9..b9bb32341 100644
|
index b71c041c9d..a934178753 100644
|
||||||
--- a/app/javascript/flavours/glitch/features/interaction_modal/index.js
|
--- a/app/javascript/flavours/glitch/features/interaction_modal/index.js
|
||||||
+++ b/app/javascript/flavours/glitch/features/interaction_modal/index.js
|
+++ b/app/javascript/flavours/glitch/features/interaction_modal/index.js
|
||||||
@@ -145,7 +145,6 @@ class InteractionModal extends React.PureComponent {
|
@@ -1,7 +1,6 @@
|
||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
-import { registrationsOpen } from 'flavours/glitch/initial_state';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import Icon from 'flavours/glitch/components/icon';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
@@ -118,22 +117,6 @@ class InteractionModal extends React.PureComponent {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
- let signupButton;
|
||||||
|
-
|
||||||
|
- if (registrationsOpen) {
|
||||||
|
- signupButton = (
|
||||||
|
- <a href='/auth/sign_up' className='button button--block button-tertiary'>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </a>
|
||||||
|
- );
|
||||||
|
- } else {
|
||||||
|
- signupButton = (
|
||||||
|
- <button className='button button--block button-tertiary' onClick={this.handleSignupClick}>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </button>
|
||||||
|
- );
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
return (
|
||||||
|
<div className='modal-root__modal interaction-modal'>
|
||||||
|
<div className='interaction-modal__lead'>
|
||||||
|
@@ -145,7 +128,6 @@ class InteractionModal extends React.PureComponent {
|
||||||
<div className='interaction-modal__choices__choice'>
|
<div className='interaction-modal__choices__choice'>
|
||||||
<h3><FormattedMessage id='interaction_modal.on_this_server' defaultMessage='On this server' /></h3>
|
<h3><FormattedMessage id='interaction_modal.on_this_server' defaultMessage='On this server' /></h3>
|
||||||
<a href='/auth/sign_in' className='button button--block'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
<a href='/auth/sign_in' className='button button--block'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
||||||
@ -11,10 +42,47 @@ index b71c041c9..b9bb32341 100644
|
|||||||
|
|
||||||
<div className='interaction-modal__choices__choice'>
|
<div className='interaction-modal__choices__choice'>
|
||||||
diff --git a/app/javascript/flavours/glitch/features/ui/components/header.js b/app/javascript/flavours/glitch/features/ui/components/header.js
|
diff --git a/app/javascript/flavours/glitch/features/ui/components/header.js b/app/javascript/flavours/glitch/features/ui/components/header.js
|
||||||
index d9ad94961..9a1f31531 100644
|
index d9ad949611..436c001f74 100644
|
||||||
--- a/app/javascript/flavours/glitch/features/ui/components/header.js
|
--- a/app/javascript/flavours/glitch/features/ui/components/header.js
|
||||||
+++ b/app/javascript/flavours/glitch/features/ui/components/header.js
|
+++ b/app/javascript/flavours/glitch/features/ui/components/header.js
|
||||||
@@ -69,7 +69,6 @@ class Header extends React.PureComponent {
|
@@ -2,7 +2,7 @@ import React from 'react';
|
||||||
|
import Logo from 'flavours/glitch/components/logo';
|
||||||
|
import { Link, withRouter } from 'react-router-dom';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
-import { registrationsOpen, me } from 'flavours/glitch/initial_state';
|
||||||
|
+import { me } from 'flavours/glitch/initial_state';
|
||||||
|
import Avatar from 'flavours/glitch/components/avatar';
|
||||||
|
import Permalink from 'flavours/glitch/components/permalink';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
@@ -38,7 +38,7 @@ class Header extends React.PureComponent {
|
||||||
|
|
||||||
|
render () {
|
||||||
|
const { signedIn } = this.context.identity;
|
||||||
|
- const { location, openClosedRegistrationsModal } = this.props;
|
||||||
|
+ const { location } = this.props;
|
||||||
|
|
||||||
|
let content;
|
||||||
|
|
||||||
|
@@ -50,26 +50,9 @@ class Header extends React.PureComponent {
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
- let signupButton;
|
||||||
|
-
|
||||||
|
- if (registrationsOpen) {
|
||||||
|
- signupButton = (
|
||||||
|
- <a href='/auth/sign_up' className='button button-tertiary'>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </a>
|
||||||
|
- );
|
||||||
|
- } else {
|
||||||
|
- signupButton = (
|
||||||
|
- <button className='button button-tertiary' onClick={openClosedRegistrationsModal}>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </button>
|
||||||
|
- );
|
||||||
|
- }
|
||||||
|
-
|
||||||
content = (
|
content = (
|
||||||
<>
|
<>
|
||||||
<a href='/auth/sign_in' className='button'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
<a href='/auth/sign_in' className='button'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
||||||
@ -23,12 +91,44 @@ index d9ad94961..9a1f31531 100644
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
diff --git a/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.js b/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.js
|
diff --git a/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.js b/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.js
|
||||||
index e8023803f..d8c332f08 100644
|
index c0d62aca00..eda16f2654 100644
|
||||||
--- a/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.js
|
--- a/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.js
|
||||||
+++ b/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.js
|
+++ b/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.js
|
||||||
@@ -32,7 +32,6 @@ const SignInBanner = () => {
|
@@ -1,38 +1,11 @@
|
||||||
|
-import React, { useCallback } from 'react';
|
||||||
|
+import React from 'react';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
-import { useDispatch } from 'react-redux';
|
||||||
|
-import { registrationsOpen } from 'flavours/glitch/initial_state';
|
||||||
|
-import { openModal } from 'flavours/glitch/actions/modal';
|
||||||
|
|
||||||
|
const SignInBanner = () => {
|
||||||
|
- const dispatch = useDispatch();
|
||||||
|
-
|
||||||
|
- const openClosedRegistrationsModal = useCallback(
|
||||||
|
- () => dispatch(openModal('CLOSED_REGISTRATIONS')),
|
||||||
|
- [dispatch],
|
||||||
|
- );
|
||||||
|
-
|
||||||
|
- let signupButton;
|
||||||
|
-
|
||||||
|
- if (registrationsOpen) {
|
||||||
|
- signupButton = (
|
||||||
|
- <a href='/auth/sign_up' className='button button--block button-tertiary'>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </a>
|
||||||
|
- );
|
||||||
|
- } else {
|
||||||
|
- signupButton = (
|
||||||
|
- <button className='button button--block button-tertiary' onClick={openClosedRegistrationsModal}>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </button>
|
||||||
|
- );
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
return (
|
||||||
<div className='sign-in-banner'>
|
<div className='sign-in-banner'>
|
||||||
<p><FormattedMessage id='sign_in_banner.text' defaultMessage='Sign in to follow profiles or hashtags, favourite, share and reply to posts, or interact from your account on a different server.' /></p>
|
<p><FormattedMessage id='sign_in_banner.text' defaultMessage='Sign in to follow profiles or hashtags, favourite, share and reply to posts. You can also interact from your account on a different server.' /></p>
|
||||||
<a href='/auth/sign_in' className='button button--block'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
<a href='/auth/sign_in' className='button button--block'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
||||||
- {signupButton}
|
- {signupButton}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,8 +1,39 @@
|
|||||||
diff --git a/app/javascript/mastodon/features/interaction_modal/index.js b/app/javascript/mastodon/features/interaction_modal/index.js
|
diff --git a/app/javascript/mastodon/features/interaction_modal/index.js b/app/javascript/mastodon/features/interaction_modal/index.js
|
||||||
index d4535378f..153c50991 100644
|
index d4535378f0..285fe2ba3a 100644
|
||||||
--- a/app/javascript/mastodon/features/interaction_modal/index.js
|
--- a/app/javascript/mastodon/features/interaction_modal/index.js
|
||||||
+++ b/app/javascript/mastodon/features/interaction_modal/index.js
|
+++ b/app/javascript/mastodon/features/interaction_modal/index.js
|
||||||
@@ -145,7 +145,6 @@ class InteractionModal extends React.PureComponent {
|
@@ -1,7 +1,6 @@
|
||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
-import { registrationsOpen } from 'mastodon/initial_state';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import Icon from 'mastodon/components/icon';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
@@ -118,22 +117,6 @@ class InteractionModal extends React.PureComponent {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
- let signupButton;
|
||||||
|
-
|
||||||
|
- if (registrationsOpen) {
|
||||||
|
- signupButton = (
|
||||||
|
- <a href='/auth/sign_up' className='button button--block button-tertiary'>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </a>
|
||||||
|
- );
|
||||||
|
- } else {
|
||||||
|
- signupButton = (
|
||||||
|
- <button className='button button--block button-tertiary' onClick={this.handleSignupClick}>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </button>
|
||||||
|
- );
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
return (
|
||||||
|
<div className='modal-root__modal interaction-modal'>
|
||||||
|
<div className='interaction-modal__lead'>
|
||||||
|
@@ -145,7 +128,6 @@ class InteractionModal extends React.PureComponent {
|
||||||
<div className='interaction-modal__choices__choice'>
|
<div className='interaction-modal__choices__choice'>
|
||||||
<h3><FormattedMessage id='interaction_modal.on_this_server' defaultMessage='On this server' /></h3>
|
<h3><FormattedMessage id='interaction_modal.on_this_server' defaultMessage='On this server' /></h3>
|
||||||
<a href='/auth/sign_in' className='button button--block'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
<a href='/auth/sign_in' className='button button--block'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
||||||
@ -11,10 +42,47 @@ index d4535378f..153c50991 100644
|
|||||||
|
|
||||||
<div className='interaction-modal__choices__choice'>
|
<div className='interaction-modal__choices__choice'>
|
||||||
diff --git a/app/javascript/mastodon/features/ui/components/header.js b/app/javascript/mastodon/features/ui/components/header.js
|
diff --git a/app/javascript/mastodon/features/ui/components/header.js b/app/javascript/mastodon/features/ui/components/header.js
|
||||||
index 1384bebda..89becd19b 100644
|
index 1384bebda0..10d6f70bb7 100644
|
||||||
--- a/app/javascript/mastodon/features/ui/components/header.js
|
--- a/app/javascript/mastodon/features/ui/components/header.js
|
||||||
+++ b/app/javascript/mastodon/features/ui/components/header.js
|
+++ b/app/javascript/mastodon/features/ui/components/header.js
|
||||||
@@ -68,7 +68,6 @@ class Header extends React.PureComponent {
|
@@ -2,7 +2,7 @@ import React from 'react';
|
||||||
|
import Logo from 'mastodon/components/logo';
|
||||||
|
import { Link, withRouter } from 'react-router-dom';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
-import { registrationsOpen, me } from 'mastodon/initial_state';
|
||||||
|
+import { me } from 'mastodon/initial_state';
|
||||||
|
import Avatar from 'mastodon/components/avatar';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
@@ -37,7 +37,7 @@ class Header extends React.PureComponent {
|
||||||
|
|
||||||
|
render () {
|
||||||
|
const { signedIn } = this.context.identity;
|
||||||
|
- const { location, openClosedRegistrationsModal } = this.props;
|
||||||
|
+ const { location } = this.props;
|
||||||
|
|
||||||
|
let content;
|
||||||
|
|
||||||
|
@@ -49,26 +49,9 @@ class Header extends React.PureComponent {
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
- let signupButton;
|
||||||
|
-
|
||||||
|
- if (registrationsOpen) {
|
||||||
|
- signupButton = (
|
||||||
|
- <a href='/auth/sign_up' className='button button-tertiary'>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </a>
|
||||||
|
- );
|
||||||
|
- } else {
|
||||||
|
- signupButton = (
|
||||||
|
- <button className='button button-tertiary' onClick={openClosedRegistrationsModal}>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </button>
|
||||||
|
- );
|
||||||
|
- }
|
||||||
|
-
|
||||||
content = (
|
content = (
|
||||||
<>
|
<>
|
||||||
<a href='/auth/sign_in' className='button'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
<a href='/auth/sign_in' className='button'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
||||||
@ -23,19 +91,51 @@ index 1384bebda..89becd19b 100644
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
diff --git a/app/javascript/mastodon/features/ui/components/sign_in_banner.js b/app/javascript/mastodon/features/ui/components/sign_in_banner.js
|
diff --git a/app/javascript/mastodon/features/ui/components/sign_in_banner.js b/app/javascript/mastodon/features/ui/components/sign_in_banner.js
|
||||||
index 8bd32edf9..f11ab1893 100644
|
index 86fcc11b56..eda16f2654 100644
|
||||||
--- a/app/javascript/mastodon/features/ui/components/sign_in_banner.js
|
--- a/app/javascript/mastodon/features/ui/components/sign_in_banner.js
|
||||||
+++ b/app/javascript/mastodon/features/ui/components/sign_in_banner.js
|
+++ b/app/javascript/mastodon/features/ui/components/sign_in_banner.js
|
||||||
@@ -32,7 +32,6 @@ const SignInBanner = () => {
|
@@ -1,38 +1,11 @@
|
||||||
|
-import React, { useCallback } from 'react';
|
||||||
|
+import React from 'react';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
-import { useDispatch } from 'react-redux';
|
||||||
|
-import { registrationsOpen } from 'mastodon/initial_state';
|
||||||
|
-import { openModal } from 'mastodon/actions/modal';
|
||||||
|
|
||||||
|
const SignInBanner = () => {
|
||||||
|
- const dispatch = useDispatch();
|
||||||
|
-
|
||||||
|
- const openClosedRegistrationsModal = useCallback(
|
||||||
|
- () => dispatch(openModal('CLOSED_REGISTRATIONS')),
|
||||||
|
- [dispatch],
|
||||||
|
- );
|
||||||
|
-
|
||||||
|
- let signupButton;
|
||||||
|
-
|
||||||
|
- if (registrationsOpen) {
|
||||||
|
- signupButton = (
|
||||||
|
- <a href='/auth/sign_up' className='button button--block button-tertiary'>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </a>
|
||||||
|
- );
|
||||||
|
- } else {
|
||||||
|
- signupButton = (
|
||||||
|
- <button className='button button--block button-tertiary' onClick={openClosedRegistrationsModal}>
|
||||||
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
||||||
|
- </button>
|
||||||
|
- );
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
return (
|
||||||
<div className='sign-in-banner'>
|
<div className='sign-in-banner'>
|
||||||
<p><FormattedMessage id='sign_in_banner.text' defaultMessage='Sign in to follow profiles or hashtags, favourite, share and reply to posts, or interact from your account on a different server.' /></p>
|
<p><FormattedMessage id='sign_in_banner.text' defaultMessage='Sign in to follow profiles or hashtags, favourite, share and reply to posts. You can also interact from your account on a different server.' /></p>
|
||||||
<a href='/auth/sign_in' className='button button--block'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
<a href='/auth/sign_in' className='button button--block'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
||||||
- {signupButton}
|
- {signupButton}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
diff --git a/app/views/auth/shared/_links.html.haml b/app/views/auth/shared/_links.html.haml
|
diff --git a/app/views/auth/shared/_links.html.haml b/app/views/auth/shared/_links.html.haml
|
||||||
index f078e2f7e..6e106cd92 100644
|
index f078e2f7ec..6e106cd92d 100644
|
||||||
--- a/app/views/auth/shared/_links.html.haml
|
--- a/app/views/auth/shared/_links.html.haml
|
||||||
+++ b/app/views/auth/shared/_links.html.haml
|
+++ b/app/views/auth/shared/_links.html.haml
|
||||||
@@ -5,14 +5,8 @@
|
@@ -5,14 +5,8 @@
|
||||||
|
@ -72,7 +72,7 @@ if [ -n "${BACKUP_S3_BUCKET:+x}" ] && command -v s3cmd >/dev/null 2>&1; then
|
|||||||
echo "* Uploading to S3..."
|
echo "* Uploading to S3..."
|
||||||
sudo s3cmd sync --delete-removed "$BACKUPS_ROOT/" "s3://$BACKUP_S3_BUCKET" || :
|
sudo s3cmd sync --delete-removed "$BACKUPS_ROOT/" "s3://$BACKUP_S3_BUCKET" || :
|
||||||
else
|
else
|
||||||
echo "⚠ Skipping S3 upload; check that 's3cmd' is present in \$PATH, and \$BACKUP_S3_BUCKET is set."
|
echo "⚠ Skipping S3 upload; check that 's3cmd' is installed, and \$BACKUP_S3_BUCKET is set."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "* Removing temp files..."
|
echo "* Removing temp files..."
|
||||||
|
@ -281,20 +281,21 @@ tootctl accounts create \
|
|||||||
|
|
||||||
# create directory for cron logdrain
|
# create directory for cron logdrain
|
||||||
as_mastodon mkdir -p "$LOGS_ROOT"
|
as_mastodon mkdir -p "$LOGS_ROOT"
|
||||||
as_mastodon touch "$LOGS_ROOT"/cron.log
|
as_mastodon touch "$LOGS_ROOT"/cron-{purge,backup}.log
|
||||||
|
|
||||||
# set cleanup & backup tasks to run weekly
|
# set cleanup & backup tasks to run weekly
|
||||||
# https://docs.joinmastodon.org/admin/setup/#cleanup
|
# https://docs.joinmastodon.org/admin/setup/#cleanup
|
||||||
(
|
(
|
||||||
sudo crontab -l
|
sudo crontab -l
|
||||||
echo -e "\n$INSTALLER_WUZ_HERE
|
echo -e "\n$INSTALLER_WUZ_HERE
|
||||||
@weekly bash -c \"$UTILS_ROOT/scripts/purge.sh >> $LOGS_ROOT/cron.log 2>&1\"
|
# purge old media weekly
|
||||||
@weekly bash -c \"$UTILS_ROOT/scripts/backup.sh >> $LOGS_ROOT/cron.log 2>&1\"
|
@weekly bash -c \"$UTILS_ROOT/scripts/purge.sh >> $LOGS_ROOT/cron-purge.log 2>&1\"
|
||||||
|
# create & rotate backups daily
|
||||||
|
@daily bash -c \"$UTILS_ROOT/scripts/backup.sh >> $LOGS_ROOT/cron-backup.log 2>&1\"
|
||||||
|
|
||||||
# automatically renew Let's Encrypt certificates
|
# automatically renew Let's Encrypt certificates:
|
||||||
# https://certbot.eff.org/instructions?ws=nginx&os=pip
|
# https://certbot.eff.org/instructions?ws=other&os=pip
|
||||||
0 0,12 * * * root /opt/certbot/bin/python -c \"import random; import time; time.sleep(random.random() * 3600)\" && certbot renew -q
|
0 0,12 * * * /opt/certbot/bin/python -c \"import random; import time; time.sleep(random.random() * 3600)\" && certbot renew -q"
|
||||||
"
|
|
||||||
) | sudo crontab -
|
) | sudo crontab -
|
||||||
|
|
||||||
echo "🎉 done! don't forget to fill in .env.production with optional credentials"
|
echo "🎉 done! don't forget to fill in .env.production with optional credentials"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user