From 54192a9b6f8ee68114e3bc9ebf241099456e85f6 Mon Sep 17 00:00:00 2001 From: Dan Hunsaker Date: Fri, 14 Jun 2019 06:52:32 -0600 Subject: Resync Nanobox files with the 2.9.0 release (#11083) --- boxfile.yml | 74 ++----------------------------------------- nanobox/nginx-local.conf | 20 ++++++++++-- nanobox/nginx-stream.conf.erb | 17 +++++++--- nanobox/nginx-web.conf.erb | 22 ++++++++++--- 4 files changed, 49 insertions(+), 84 deletions(-) diff --git a/boxfile.yml b/boxfile.yml index 9368a7d9d..08526a57c 100644 --- a/boxfile.yml +++ b/boxfile.yml @@ -64,8 +64,9 @@ deploy.config: - |- if [[ "${ES_ENABLED}" != "false" ]] then - bundle exec rake chewy:deploy + bin/tootctl search deploy fi + - bin/tootctl cache clear web.web: @@ -120,77 +121,6 @@ worker.sidekiq: - public/system -worker.cron_only: - start: sleep 365d - - writable_dirs: - - tmp - - log_watch: - rake: 'log/production.log' - - network_dirs: - data.storage: - - public/system - - cron: - # 20:00 (8 pm), server time: send out the daily digest emails to everyone - # who opted to receive one - - id: send_digest_emails - schedule: '00 20 * * *' - command: 'bundle exec rake mastodon:emails:digest' - - # 00:10 (ten past midnight), server time: remove local copies of remote - # users' media once they are older than a certain age (use NUM_DAYS evar to - # change this from the default of 7 days) - - id: clear_remote_media - schedule: '10 00 * * *' - command: 'bundle exec rake mastodon:media:remove_remote' - - # 00:20 (twenty past midnight), server time: remove subscriptions to remote - # users that nobody follows locally (anymore) - - id: clear_unfollowed_subs - schedule: '20 00 * * *' - command: 'bundle exec rake mastodon:push:clear' - - # 00:30 (half past midnight), server time: update local copies of remote - # users' avatars to match whatever they currently have set on their profile - - id: update_remote_avatars - schedule: '30 00 * * *' - command: 'bundle exec rake mastodon:media:redownload_avatars' - - ############################################################################ - # This task is one you might want to enable, or might not. It keeps disk - # usage low, but makes "shadow bans" (scenarios where the user is silenced, - # but not intended to be made aware that the silencing has occurred) much - # more difficult to put in place, as users would then notice their media is - # vanishing on a regular basis. Enable it if you aren't worried about users - # knowing they've been silenced (on the instance level), and want to save - # disk space. Leave it disabled otherwise. - ############################################################################ - # # 00:00 (midnight), server time: remove media posted by silenced users - # - id: clear_silenced_media - # schedule: '00 00 * * *' - # command: 'bundle exec rake mastodon:media:remove_silenced' - - ############################################################################ - # The following two tasks can be uncommented to automatically open and close - # registrations on a schedule. The format of 'schedule' is a standard cron - # time expression: minute hour day month day-of-week; search for "cron - # time expressions" for more info on how to set these up. The examples here - # open registration only from 8 am to 4 pm, server time. - ############################################################################ - # # 08:00 (8 am), server time: open registrations so new users can join - # - id: open_registrations - # schedule: '00 08 * * *' - # command: 'bundle exec rake mastodon:settings:open_registrations' - # - # # 16:00 (4 pm), server time: close registrations so new users *can't* join - # - id: close_registrations - # schedule: '00 16 * * *' - # command: 'bundle exec rake mastodon:settings:close_registrations' - - data.db: image: nanobox/postgresql:9.6 diff --git a/nanobox/nginx-local.conf b/nanobox/nginx-local.conf index c0e883603..37c8a451a 100644 --- a/nanobox/nginx-local.conf +++ b/nanobox/nginx-local.conf @@ -10,10 +10,13 @@ http { sendfile on; gzip on; - gzip_http_version 1.0; + gzip_disable "MSIE [1-6]\."; + gzip_vary on; gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; gzip_min_length 500; - gzip_disable "MSIE [1-6]\."; + gzip_http_version 1.1; gzip_types text/plain text/xml text/javascript text/css text/comma-separated-values application/xml+rss application/xml application/x-javascript application/json application/javascript application/atom+xml; # Proxy upstream to the puma process @@ -36,9 +39,12 @@ http { # Listen on port 8080 listen 8080; + keepalive_timeout 70; + client_max_body_size 80M; + root /app/public; - client_max_body_size 80M; + add_header Strict-Transport-Security "max-age=31536000"; location / { try_files $uri @rails; @@ -47,6 +53,10 @@ http { # Proxy connections to rails location @rails { proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header Proxy ""; proxy_pass_header Server; proxy_pass http://rails; @@ -62,6 +72,10 @@ http { # Proxy connections to node location /api/v1/streaming { proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header Proxy ""; proxy_pass http://node; proxy_buffering off; diff --git a/nanobox/nginx-stream.conf.erb b/nanobox/nginx-stream.conf.erb index 12bcc8ca5..4ea6e30fc 100644 --- a/nanobox/nginx-stream.conf.erb +++ b/nanobox/nginx-stream.conf.erb @@ -10,10 +10,13 @@ http { sendfile on; gzip on; - gzip_http_version 1.1; + gzip_disable "MSIE [1-6]\."; + gzip_vary on; gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; gzip_min_length 500; - gzip_disable "MSIE [1-6]\."; + gzip_http_version 1.1; gzip_types text/plain text/xml text/javascript text/css text/comma-separated-values application/xml+rss application/xml application/x-javascript application/json application/javascript application/atom+xml; # Proxy upstream to the node process @@ -31,11 +34,13 @@ http { # Listen on port 8080 listen 8080; - add_header Strict-Transport-Security "max-age=31536000"; - # add_header Content-Security-Policy "style-src 'self' 'unsafe-inline'; script-src 'self'; object-src 'self'; img-src data: https:; media-src data: https:; connect-src 'self' wss://<%= ENV["LOCAL_DOMAIN"] %>; upgrade-insecure-requests"; + keepalive_timeout 70; + client_max_body_size 80M; root /app/public; + add_header Strict-Transport-Security "max-age=31536000"; + location / { try_files $uri @node; } @@ -43,6 +48,10 @@ http { # Proxy connections to node location @node { proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header Proxy ""; proxy_pass http://node; proxy_buffering off; diff --git a/nanobox/nginx-web.conf.erb b/nanobox/nginx-web.conf.erb index d96f1bfc7..182d99209 100644 --- a/nanobox/nginx-web.conf.erb +++ b/nanobox/nginx-web.conf.erb @@ -10,10 +10,13 @@ http { sendfile on; gzip on; - gzip_http_version 1.0; + gzip_disable "MSIE [1-6]\."; + gzip_vary on; gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; gzip_min_length 500; - gzip_disable "MSIE [1-6]\."; + gzip_http_version 1.1; gzip_types text/plain text/xml text/javascript text/css text/comma-separated-values application/xml+rss application/xml application/x-javascript application/json application/javascript application/atom+xml; # Proxy upstream to the puma process @@ -31,12 +34,12 @@ http { # Listen on port 8080 listen 8080; - add_header Strict-Transport-Security "max-age=31536000"; - # add_header Content-Security-Policy "style-src 'self' 'unsafe-inline'; script-src 'self'; object-src 'self'; img-src data: https:; media-src data: https:; connect-src 'self' wss://<%= ENV["LOCAL_DOMAIN"] %>; upgrade-insecure-requests"; + keepalive_timeout 70; + client_max_body_size 80M; root /app/public; - client_max_body_size 80M; + add_header Strict-Transport-Security "max-age=31536000"; location / { try_files $uri @rails; @@ -44,17 +47,23 @@ http { location /sw.js { add_header Cache-Control "public, max-age=0"; + add_header Strict-Transport-Security "max-age=31536000"; try_files $uri @rails; } location ~ ^/(emoji|packs|system/media_attachments/files|system/accounts/avatars) { add_header Cache-Control "public, max-age=31536000, immutable"; + add_header Strict-Transport-Security "max-age=31536000"; try_files $uri @rails; } # Proxy connections to rails location @rails { proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header Proxy ""; proxy_pass_header Server; proxy_pass http://rails; @@ -66,7 +75,10 @@ http { proxy_cache CACHE; proxy_cache_valid 200 7d; + proxy_cache_valid 410 24h; proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; + add_header Strict-Transport-Security "max-age=31536000"; + add_header X-Cached $upstream_cache_status; tcp_nodelay on; } -- cgit From e433386545e53f84a47f5c1b09a7c0aaafa978a3 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Fri, 14 Jun 2019 12:59:59 +0200 Subject: Fix replying not automatically switching to compose form on mobile --- .../features/compose/components/compose_form.js | 18 --------------- .../compose/containers/compose_form_container.js | 10 -------- .../flavours/glitch/features/compose/index.js | 27 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index b4b43785a..5e73d7651 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -66,8 +66,6 @@ class ComposeForm extends ImmutablePureComponent { preselectOnReply: PropTypes.bool, onChangeSpoilerness: PropTypes.func, onChangeVisibility: PropTypes.func, - onMount: PropTypes.func, - onUnmount: PropTypes.func, onPaste: PropTypes.func, onMediaDescriptionConfirm: PropTypes.func, }; @@ -196,22 +194,6 @@ class ComposeForm extends ImmutablePureComponent { } } - // Tells our state the composer has been mounted. - componentDidMount () { - const { onMount } = this.props; - if (onMount) { - onMount(); - } - } - - // Tells our state the composer has been unmounted. - componentWillUnmount () { - const { onUnmount } = this.props; - if (onUnmount) { - onUnmount(); - } - } - handleFocus = () => { if (this.composeForm) { this.composeForm.scrollIntoView(); diff --git a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js index 814f9a97a..199d43913 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js @@ -9,10 +9,8 @@ import { clearComposeSuggestions, fetchComposeSuggestions, insertEmojiCompose, - mountCompose, selectComposeSuggestion, submitCompose, - unmountCompose, uploadCompose, } from 'flavours/glitch/actions/compose'; import { @@ -114,14 +112,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ dispatch(changeComposeVisibility(value)); }, - onMount() { - dispatch(mountCompose()); - }, - - onUnmount() { - dispatch(unmountCompose()); - }, - onMediaDescriptionConfirm(routerHistory) { dispatch(openModal('CONFIRM', { message: intl.formatMessage(messages.missingDescriptionMessage), diff --git a/app/javascript/flavours/glitch/features/compose/index.js b/app/javascript/flavours/glitch/features/compose/index.js index d3070a199..cb6c54a48 100644 --- a/app/javascript/flavours/glitch/features/compose/index.js +++ b/app/javascript/flavours/glitch/features/compose/index.js @@ -4,6 +4,7 @@ import NavigationContainer from './containers/navigation_container'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; +import { mountCompose, unmountCompose } from 'flavours/glitch/actions/compose'; import { injectIntl, defineMessages } from 'react-intl'; import classNames from 'classnames'; import SearchContainer from './containers/search_container'; @@ -27,6 +28,14 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ onClickElefriend () { dispatch(cycleElefriendCompose()); }, + + onMount () { + dispatch(mountCompose()); + }, + + onUnmount () { + dispatch(unmountCompose()); + }, }); export default @connect(mapStateToProps, mapDispatchToProps) @@ -38,9 +47,27 @@ class Compose extends React.PureComponent { isSearchPage: PropTypes.bool, elefriend: PropTypes.number, onClickElefriend: PropTypes.func, + onMount: PropTypes.func, + onUnmount: PropTypes.func, intl: PropTypes.object.isRequired, }; + componentDidMount () { + const { isSearchPage } = this.props; + + if (!isSearchPage) { + this.props.onMount(); + } + } + + componentWillUnmount () { + const { isSearchPage } = this.props; + + if (!isSearchPage) { + this.props.onUnmount(); + } + } + render () { const { elefriend, -- cgit From b6f76d130600ded7f0f2cb585d8b9732e7aa1cff Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 8 Jun 2019 15:30:06 +0200 Subject: [Glitch] Change full logo to use primary text color of the given theme Port 20dda5cca0a4015a743250b4e584a3101e7675f2 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/styles/about.scss | 3 ++- app/javascript/flavours/glitch/styles/containers.scss | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/javascript/flavours/glitch/styles/about.scss b/app/javascript/flavours/glitch/styles/about.scss index d4ead07a1..0e910693d 100644 --- a/app/javascript/flavours/glitch/styles/about.scss +++ b/app/javascript/flavours/glitch/styles/about.scss @@ -662,7 +662,8 @@ $small-breakpoint: 960px; align-items: center; padding: 50px; - img { + svg { + fill: $primary-text-color; height: 52px; } diff --git a/app/javascript/flavours/glitch/styles/containers.scss b/app/javascript/flavours/glitch/styles/containers.scss index b0c187eab..dc60dd14b 100644 --- a/app/javascript/flavours/glitch/styles/containers.scss +++ b/app/javascript/flavours/glitch/styles/containers.scss @@ -21,7 +21,8 @@ justify-content: center; align-items: center; - img { + svg { + fill: $primary-text-color; height: 42px; margin-right: 10px; } @@ -258,12 +259,13 @@ display: block; padding: 15px; - img { + svg { display: block; height: 18px; width: auto; position: relative; bottom: -2px; + fill: $primary-text-color; @media screen and (max-width: $no-gap-breakpoint) { height: 20px; -- cgit From a29ab6f1bdd13262d206e41c66dea15ed4dc3f22 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 16 Jun 2019 15:18:53 +0200 Subject: Fix composer buttons overflowing the composer box in single-column --- app/javascript/flavours/glitch/styles/components/composer.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/javascript/flavours/glitch/styles/components/composer.scss b/app/javascript/flavours/glitch/styles/components/composer.scss index 62eca49a1..c06d79ffc 100644 --- a/app/javascript/flavours/glitch/styles/components/composer.scss +++ b/app/javascript/flavours/glitch/styles/components/composer.scss @@ -586,6 +586,7 @@ white-space: nowrap; overflow: hidden; justify-content: flex-end; + flex: 0 0 auto; & > .count { display: inline-block; -- cgit From 082812678411429e1c0d8ce628a428916bb7c703 Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Mon, 17 Jun 2019 01:36:47 +0900 Subject: Update translating platform has changed to crowdin (CONTRIBUTING.md) (#11094) Restore and change from 89096860 --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f944309d5..76f512198 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,9 @@ Bug reports and feature suggestions can be submitted to [GitHub Issues](https:// ## Translations -You can submit translations via pull request. +You can submit translations via [Crowdin](https://crowdin.com/project/mastodon). They are periodically merged into the codebase. + +[![Crowdin](https://d322cqt584bo4o.cloudfront.net/mastodon/localized.svg)][crowdin] ## Pull requests -- cgit From 01e362316c5273ab5ae6acaa44834260b731fe57 Mon Sep 17 00:00:00 2001 From: ThibG Date: Sun, 16 Jun 2019 18:46:55 +0200 Subject: Do not scroll in the compose panel on single-column (#11093) --- app/javascript/mastodon/features/compose/components/compose_form.js | 3 ++- app/javascript/mastodon/features/ui/components/compose_panel.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 60d6ce673..c846ad6e7 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -60,6 +60,7 @@ class ComposeForm extends ImmutablePureComponent { onPickEmoji: PropTypes.func.isRequired, showSearch: PropTypes.bool, anyMedia: PropTypes.bool, + singleColumn: PropTypes.bool, }; static defaultProps = { @@ -115,7 +116,7 @@ class ComposeForm extends ImmutablePureComponent { } handleFocus = () => { - if (this.composeForm) { + if (this.composeForm && !this.props.singleColumn) { this.composeForm.scrollIntoView(); } } diff --git a/app/javascript/mastodon/features/ui/components/compose_panel.js b/app/javascript/mastodon/features/ui/components/compose_panel.js index a05fbbe39..c7821f473 100644 --- a/app/javascript/mastodon/features/ui/components/compose_panel.js +++ b/app/javascript/mastodon/features/ui/components/compose_panel.js @@ -8,7 +8,7 @@ const ComposePanel = () => (
- +
); -- cgit From 65efe892cf56cd4f998de885bccc36e9231d8144 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 16 Jun 2019 19:12:12 +0200 Subject: Fix check-i18n builds (#11084) * Fix check-i18n builds * Remove check for missing plural forms --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e8bfde299..2355d9d7d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,8 +174,7 @@ jobs: steps: - *attach_workspace - run: bundle exec i18n-tasks check-normalized - - run: bundle exec i18n-tasks unused - - run: bundle exec i18n-tasks missing -t plural + - run: bundle exec i18n-tasks unused -l en - run: bundle exec i18n-tasks check-consistent-interpolations workflows: -- cgit From d3aaacb6d48ab815a79cc4feb6b2c9a1ffc41717 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 16 Jun 2019 16:02:26 +0200 Subject: Do not scroll in the compose panel on single-column --- .../flavours/glitch/features/compose/components/compose_form.js | 6 ++++-- .../flavours/glitch/features/ui/components/compose_panel.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index 5e73d7651..cbce675d5 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -55,6 +55,7 @@ class ComposeForm extends ImmutablePureComponent { onPickEmoji: PropTypes.func, showSearch: PropTypes.bool, anyMedia: PropTypes.bool, + singleColumn: PropTypes.bool, advancedOptions: ImmutablePropTypes.map, layout: PropTypes.string, @@ -195,7 +196,7 @@ class ComposeForm extends ImmutablePureComponent { } handleFocus = () => { - if (this.composeForm) { + if (this.composeForm && !this.props.singleColumn) { this.composeForm.scrollIntoView(); } } @@ -219,6 +220,7 @@ class ComposeForm extends ImmutablePureComponent { preselectDate, text, preselectOnReply, + singleColumn, } = this.props; let selectionEnd, selectionStart; @@ -238,7 +240,7 @@ class ComposeForm extends ImmutablePureComponent { if (textarea) { textarea.setSelectionRange(selectionStart, selectionEnd); textarea.focus(); - textarea.scrollIntoView(); + if (!singleColumn) textarea.scrollIntoView(); } // Refocuses the textarea after submitting. diff --git a/app/javascript/flavours/glitch/features/ui/components/compose_panel.js b/app/javascript/flavours/glitch/features/ui/components/compose_panel.js index f5eefee0d..498f09ab6 100644 --- a/app/javascript/flavours/glitch/features/ui/components/compose_panel.js +++ b/app/javascript/flavours/glitch/features/ui/components/compose_panel.js @@ -8,7 +8,7 @@ const ComposePanel = () => (
- +
); -- cgit From f57a0f89a8b2b894d028de8e75caddcf3a8c904e Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 16 Jun 2019 20:41:03 +0200 Subject: Fix styling of poll options on public pages in glitch flavour --- app/javascript/flavours/glitch/styles/polls.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/javascript/flavours/glitch/styles/polls.scss b/app/javascript/flavours/glitch/styles/polls.scss index 50bb45e7c..5261f17f4 100644 --- a/app/javascript/flavours/glitch/styles/polls.scss +++ b/app/javascript/flavours/glitch/styles/polls.scss @@ -2,6 +2,12 @@ margin-top: 16px; font-size: 14px; + ul, + .e-content & ul { + margin: 0; + list-style: none; + } + li { margin-bottom: 10px; position: relative; -- cgit