Compare commits

...

538 Commits

Author SHA1 Message Date
Dennis Schubert
f042f5d490 Merge branch 'hotfix/0.7.18.2' 2023-07-10 01:13:45 +02:00
Dennis Schubert
42b835f0c0 Enforce an ImageMagick policy.xml for all pods.
This fix was heavily inspired by Mastodon's fix for GHSA-9928-3cp5-93fm.
So, thank you Cure53 for finding this issue, thank you Mozilla for
paying Cure53 to look into it, and thanks for Mastodon for fixing it.
2023-07-10 01:12:36 +02:00
Benjamin Neff
52f206fa8a Merge branch 'hotfix/0.7.18.1' 2022-09-10 01:13:25 +02:00
Dennis Schubert
9075dfa470 Update binstubs
Newly generated binstubs will check for the string
`This file was generated by Bundler` inside `bin/bundle`, so we'd have
to update that anyway.

Also, there is a non-zero chance the updated `bundle` binstub resolves
some of the setup-specific issues we've seen.
2022-09-10 00:43:20 +02:00
Benjamin Neff
9485a02639 Merge branch 'next-minor' 2022-07-31 23:12:00 +02:00
Benjamin Neff
eaedd3d26c updated 11 locale files [ci skip] 2022-07-31 23:08:59 +02:00
Benjamin Neff
65909700f3 Merge pull request #8384 from SuperTux88/downgrade-bundler-next-minor
Downgrade Gemfile.lock to bundler 2.1.4
2022-07-24 21:08:14 +02:00
Benjamin Neff
586b319c79 Downgrade Gemfile.lock to bundler 2.1.4
This is the default bundler version that comes with ruby 2.7, and it
looks like ruby ruby 2.7 and bundler 2.3.18 have a problem with the new
splitted version where each gem source has it's own block and it
crashes.

To have less problems for podmins when updating, lets just downgrade
bundler and use the old lockfile format in next-minor. It's not a
problem anymore in develop as we don't have rails-assets anymore there,
as we switched to yarn.
2022-07-24 20:50:01 +02:00
Benjamin Neff
646685b42c Handle Faraday::ServerError (for example 502) as HTTPFailure
closes #8380
2022-07-24 17:20:21 +02:00
Benjamin Neff
78b28c3d54 Handle nodeinfo timeouts gracefully
some (especially bigger pods) are sometimes slow to respond with
statistics, so lets handle that gracefully and not mark the pods as
down.
2022-07-24 17:19:04 +02:00
Benjamin Neff
b29675fead Remove error if there was no error anymore
also add pod uri when logging offline pods ... just having a bunch of
"OFFLINE" log messages doesn't help at all.
2022-07-24 17:17:51 +02:00
Benjamin Neff
eb1c571511 Add xmppChat to NodeInfo 2.1 test for 0.7.x
Follow up for #8379
2022-07-23 18:40:11 +02:00
Benjamin Neff
4efc4dabf8 Show software and version directly in the pods table if no errors
closes #8379
2022-07-23 17:00:48 +02:00
Benjamin Neff
01f8f55dbb Add parsing of newer versions of NodeInfo
Always take the newest versions both nodes support
2022-07-23 16:59:41 +02:00
Benjamin Neff
49ba740b45 Add NodeInfo 2.1 2022-07-23 16:59:37 +02:00
Benjamin Neff
e984fa7d91 Don't use host-meta in connection tester anymore
This route was removed from the federation and doesn't exist anymore, so
checking for it doesn't make any sense.

But lets check if a server responds to /.well-known/nodeinfo instead.
All other software which supports the diaspora protocol should have this
endpoint by now. Parsing/validating nodeinfo is still handled
gracefully.

closes #8377
2022-07-23 00:53:07 +02:00
Dennis Schubert
428c97d089 Disable the default CSRF protection.
This was added in Rails 5.2 defaults, but we upgraded from 5.1 defaults to 6.1, so we didn't notice until now.

closes #8374
2022-07-21 05:30:55 +02:00
Benjamin Neff
3cf84c838f Disable export_concurrent to prevent segfault during precompile
See https://github.com/sass/sassc-ruby/issues/207

closes #8372
2022-07-21 03:57:26 +02:00
Benjamin Neff
ee68da7eeb Don't eager load active storage in production
We don't use active storage, but eager loading it tries to read the
config/storage.yml, which doesn't exist, because we don't need it.

571b4d5fb9/activestorage/lib/active_storage/engine.rb (L137)
571b4d5fb9/activestorage/app/models/active_storage/blob.rb (L354)

closes #8371
2022-07-21 03:53:47 +02:00
Benjamin Neff
2e3bd14a09 Fix some update_attributes in tests only on next-minor
These were already fixed on develop in another branch but were never
backported, so lets do that now.
2022-07-20 22:59:30 +02:00
Benjamin Neff
3c4da76be5 Fix follow up tasks for assets:precompile when no manifest existed
When no `.sprockets-manifest-xxx.json` existed, every instance of
`Sprockets::Manifest` generated their own path with their own random
filename, and since this happened before the assets were actually
precompiled, they were all empty. So the error pages didn't find the
manifest and the non-digest assets also didn't have any assets to copy.

So lets create our own instance of `Sprockets::Manifest` here, AFTER
`assets:precompile`, which then loads the manifest json that was used
during precompile, so all precompiled assets are available.

closes #8366
2022-07-20 21:32:21 +02:00
Benjamin Neff
3b02eb87bd Upgrade to bundler 2 2022-07-20 21:32:11 +02:00
Benjamin Neff
c72b30130e Bump sidekiq and sidekiq-cron 2022-07-20 21:27:53 +02:00
Benjamin Neff
01ab639736 Bump acts-as-taggable-on 2022-07-20 21:27:52 +02:00
Benjamin Neff
8a1e3fbec2 Bump nokogiri 2022-07-20 21:27:46 +02:00
Benjamin Neff
c1c9469840 Add ruby 2.7, drop ruby 2.5 2022-07-20 21:27:46 +02:00
Benjamin Neff
3bb9b9a18d Fix deprecation warnings for rails 6.1 2022-07-20 21:27:41 +02:00
Benjamin Neff
fe84d3e101 Upgrade to rails 6.1 2022-07-20 21:27:41 +02:00
Benjamin Neff
1ef3c83a0a Remove workaround for schema.rb
We don't have the schema.rb anymore in the repo, so we don't need it
compatible with both databases anymore.

See 5b1be7d8da
2022-07-20 21:26:58 +02:00
Benjamin Neff
ac86c29a85 Use template_name instead of action_name for notification mails
This is a new feature in rails 6
2022-07-20 21:26:58 +02:00
Benjamin Neff
17b84d3ddd Fix rendering of error pages to remove deprecation warning for rails 6.0 2022-07-20 21:26:58 +02:00
Benjamin Neff
b5a46cf7bb Fix deprecation warnings for rails 6.0 2022-07-20 21:26:58 +02:00
Benjamin Neff
2d38a24a86 Upgrade to rails 6.0 2022-07-20 21:26:58 +02:00
Benjamin Neff
2f30b42d93 Don't load sidekiq workers during initialization
This is to prevent the warning about zeitwerk autoloader
2022-07-20 21:26:40 +02:00
Benjamin Neff
14e27a65ae Move ActsAsTaggableOn::Tag overrides to initializer
This is to prepare for zeitwerk autoloader, and the old file couldn't be
autoloaded anyway, so the easiest is to just move it out of the models
folder.
2022-07-20 21:26:40 +02:00
Benjamin Neff
429aa8f374 Upgrade to sprockets 4 2022-07-20 21:26:40 +02:00
Benjamin Neff
0382cb48c1 Bump diaspora_federation to support rails 6 2022-07-20 21:26:13 +02:00
Benjamin Neff
13eb095e83 Bump js_image_paths to support rails 6 and sprockets 4 2022-07-20 21:25:51 +02:00
Benjamin Neff
3598a17ee2 Update .gitignore from develop branch 2022-07-18 00:54:42 +02:00
Benjamin Neff
a5e5c7f378 Fix Link to OWASP CSRF more information page
closes #8365
2022-07-16 04:44:17 +02:00
Benjamin Neff
dd3bc39c97 Render markdown to html for notifications 2022-07-16 04:34:07 +02:00
Benjamin Neff
3c02a1f067 Remove unused translation fallback 2022-07-16 04:22:51 +02:00
Benjamin Neff
a9ae84f3a6 Remove markerb dependency
markerb is dead and isn't compatible with rails 6 anymore. Removing it
means adding separate templates for text and html, this sadly means some
code duplication, but also luckily the templates aren't that
complicated, so the duplication is also very minimal.
2022-07-16 04:22:51 +02:00
Benjamin Neff
6cea355636 Fix escaping of names in the from header 2022-07-16 04:22:51 +02:00
Benjamin Neff
f76a8d7deb Fix sending mails after photo export 2022-07-16 04:22:51 +02:00
Benjamin Neff
41633fcea9 Don't autoload PeopleHelper during initialization
this is for future rails versions with zeitwerk autoloader where this
isn't allowed anymore
2022-07-16 04:22:51 +02:00
Benjamin Neff
a7a02e87cf Replace unmaintained sass-rails with sassc-rails
closes #8362
2022-07-03 23:14:42 +02:00
Benjamin Neff
485af7ea78 Remove compass-rails and just use the few images without a sprite
Fixes #6433
2022-07-03 23:14:01 +02:00
Benjamin Neff
5f48cedb84 Remove entypo-rails dependency and add font to vendor/assets
entypo-rails doesn't support newer rails versions

closes #8361
2022-07-03 20:44:10 +02:00
Benjamin Neff
739fc780c3 Manually stringify keys to fix sidekiq 7.0 deprecation warning
closes #8359
2022-06-29 13:27:37 +02:00
Benjamin Neff
2d9f133d30 Merge pull request #8357 from SuperTux88/gem-updates
Gem updates
2022-06-28 00:43:11 +02:00
Benjamin Neff
3ff162320e Bump rails-assets-jquery and jquery-rails 2022-06-27 03:21:28 +02:00
Benjamin Neff
edbb26b926 Bump other dependencies not directly in Gemfile 2022-06-27 03:00:34 +02:00
Benjamin Neff
9b23411d25 Add rails-assets-bootstrap to gems.diasporafoundation.org source block
this prevents a warning because somebody also uploaded an old version of
this to rubygems.org
2022-06-27 02:53:14 +02:00
Benjamin Neff
6753761c74 Bump cucumber-rails 2022-06-27 02:53:14 +02:00
Benjamin Neff
86f306fce8 Bump rspec-rails 2022-06-27 02:53:14 +02:00
Benjamin Neff
b48c72f188 Bump timecop 2022-06-27 02:53:14 +02:00
Benjamin Neff
47d0269043 Bump listen 2022-06-27 02:53:14 +02:00
Benjamin Neff
a1b6209415 Bump pronto-haml 2022-06-27 02:53:14 +02:00
Benjamin Neff
7d7549e01e Bump haml_lint 2022-06-27 02:53:14 +02:00
Benjamin Neff
25f5236d66 Bump asset_sync 2022-06-27 02:53:14 +02:00
Benjamin Neff
f044030db0 Fix version for minitest to 5.15.0
Newer versions don't support ruby 2.5 anymore, which we still use in CI
2022-06-27 02:53:13 +02:00
Benjamin Neff
e3e7d2daab Bump rails-timeago 2022-06-27 02:53:13 +02:00
Benjamin Neff
9189dbf348 Bump hamlit 2022-06-27 02:53:13 +02:00
Benjamin Neff
796047f543 Bump faraday 2022-06-27 02:53:13 +02:00
Benjamin Neff
61a560a58d Bump active_model_serializers 2022-06-27 02:53:13 +02:00
Benjamin Neff
aa0ac5bec6 Bump omniauth and omniauth-rails_csrf_protection 2022-06-27 02:53:13 +02:00
Benjamin Neff
1ba9416e22 Bump ruby-oembed 2022-06-27 02:53:13 +02:00
Benjamin Neff
c0450cbe9d Bump js-routes 2022-06-27 02:53:13 +02:00
Benjamin Neff
8ccf94a587 Bump fog-aws 2022-06-27 02:53:13 +02:00
Benjamin Neff
5238bb4c5d Bump activerecord-import 2022-06-27 02:53:13 +02:00
Benjamin Neff
e096c96c44 Bump pg 2022-06-27 02:53:13 +02:00
Benjamin Neff
a5a0b28d39 Bump mysql2 2022-06-27 02:53:13 +02:00
Benjamin Neff
ca40ca202a Bump sprockets-rails 2022-06-27 02:53:13 +02:00
Benjamin Neff
077bac95c0 Bump autoprefixer-rails 2022-06-27 02:53:13 +02:00
Benjamin Neff
dc1ec7665b Bump toml-rb 2022-06-27 02:53:12 +02:00
Benjamin Neff
d97ff9afce Bump terser 2022-06-27 02:53:12 +02:00
Benjamin Neff
8c4381c1ce Bump sidekiq and sidekiq-cron 2022-06-27 02:53:12 +02:00
Benjamin Neff
db74b364d6 Bump redis 2022-06-27 02:19:39 +02:00
Benjamin Neff
5b298e330c Bump rqrcode 2022-06-27 02:19:39 +02:00
Benjamin Neff
3d8cdc78e0 Bump devise-two-factor 2022-06-27 02:19:39 +02:00
Benjamin Neff
d801adcb6e Bump devise 2022-06-27 02:19:38 +02:00
Benjamin Neff
4076eb3fcf Bump json-schema and remove json-schema-rspec (unmaintained) 2022-06-27 02:19:38 +02:00
Benjamin Neff
7447beb04a Bump json 2022-06-27 02:19:38 +02:00
Benjamin Neff
a8dc10f5ad Bump unicorn 2022-06-27 02:19:38 +02:00
Benjamin Neff
0f7ea165f7 Bump rails 2022-06-27 02:19:38 +02:00
Sage Ross
6fadfb30fe Undo another Capybara refactor that causes CI to break
Alas.

Closed #8331
2022-06-19 19:30:41 +02:00
Sage Ross
107f118db4 Undo change to aspects_steps.rb that breaks the build
When I removed this and tested it locally, the feature spec still passed, but it is failing on CI, so it looks like we still need this `execute_script` use until we find a better Capybara strategy.
2022-06-19 19:29:57 +02:00
Sage Ross
ae5333d67d Revert "Replace "execute_script" for triggering hovercards"
This reverts commit e7dc4eca9e.
2022-06-19 19:29:57 +02:00
Sage Ross
4fe52a72f1 Fix comment style violation 2022-06-19 19:29:57 +02:00
Sage Ross
4588ce11c9 Replace "execute_script" for uploading images in specs 2022-06-19 19:29:57 +02:00
Sage Ross
d14036b630 Replace "evaluate_script" for toggling a Bootstrap switch in spec 2022-06-19 19:29:57 +02:00
Sage Ross
637dad208a Replace "execute_script" in publisher_steps definitions 2022-06-19 19:29:57 +02:00
Sage Ross
4548380080 Replace "execute_script" in spec scrolling down on notifications 2022-06-19 19:29:57 +02:00
Sage Ross
b67cf8e983 Replace "execute_script" for filling in Close Account modal
Using "fill_in" seems to work fine with the apparition driver, and will hopefully also work on CI now.
2022-06-19 19:29:57 +02:00
Sage Ross
ef7a5f8d6e Replace "execute_script" for triggering hovercards
In addition to getting rid of an "execute_script" instance, this approach is slightly higher fidelity, as it renders the hovercard at the correct place on the page and doesn't reach into jQuery to trigger the hovercard.
2022-06-19 19:29:57 +02:00
Sage Ross
688245c0de Remove unnecessary execute_script call in feature spec
This call to `execute_script` would directly call jQuery's `sortable` function on an element to make it sortable. However, this isn't necessary; the test can still drag the "Cat People" aspect to the desired position without it.
2022-06-19 19:29:57 +02:00
Sage Ross
245bc1a05f Remove unused custom web step
It looks like this web step is no longer used anywhere. It was implemented for the "Feature: inifinite scroll" test, but that no longer exists.
2022-06-19 19:29:57 +02:00
Sage Ross
df4504979e Refactor "I scroll" web step to avoid using execute_script
The apparition driver does not support "scroll_by" without going through "execute_script", but we can better express the intention of this test and make the scrolling action a bit more general by replacing "scroll a bit" with "scroll to [some element]" — in this case, we need to scroll until the "Change" button is visible so that we can press it.

This change_settings.feature spec is the only place that used "I scroll a bit".
2022-06-19 19:29:57 +02:00
Benjamin Neff
e5b65f6498 Fix jasmine fake publisher messing with follow up tests in random order 2022-06-19 19:29:50 +02:00
Sage Ross
cb774d1c50 Fix another order-dependent failure in router_spec.js 2022-06-19 17:24:41 +02:00
Sage Ross
692f5fdafb Fix style violations, per automated code review 2022-06-19 17:24:40 +02:00
Sage Ross
37d440f91e Turn on random spec order in jasmine.yml 2022-06-19 17:23:00 +02:00
Sage Ross
baeeee8e73 More order-dependent Jasmine test fixes 2022-06-19 17:23:00 +02:00
Sage Ross
23c2487550 Delete specs that cause order-dependent failures elsewhere
This set of specs — in particular, all the calls to `this.view.$el.find(...).trigger('click') — are changing the environment in ways that cause I18n missing key errors elsewhere.

There are failures in `app_spec.js` if this spec file is run before it, and I haven't found a way to reset the environment to avoid the issue.
2022-06-19 17:23:00 +02:00
Sage Ross
94956a2eda Add workound for order-dependent notification_collection_spec.js
This is from Flaburgan: https://github.com/diaspora/diaspora/pull/8305/files

I can't find a better way around it. The specs that call `onChangedUnreadStatus` change the environment in ways we can't figure out how to reset cleanly.
2022-06-19 17:23:00 +02:00
Sage Ross
09ecaec0b5 Fix order-dependent Jasmine failure due to missing translation key
There must be another Jasmine spec that modifies the locale without loading the default afterwards.
2022-06-19 17:23:00 +02:00
Sage Ross
2b352b86ae Fix order-dependent failures in comment_view_spec.js
It looks like these specs expect a logged-in user, and would fail when run after a test that logged out.
2022-06-19 17:23:00 +02:00
Sage Ross
1c577fb5b2 More fixes for order-dependent Jasmine spec failures
These ones would fail if `app.page` was in the wrong state from a previous test.
2022-06-19 17:23:00 +02:00
Sage Ross
b2ee986815 Fix order-dependent failure in app_spec.js
The 'sets the user' spec was failing if run after a spec that had already set the user.
2022-06-19 17:23:00 +02:00
Sage Ross
ae3bd1f62e Fix order-dependent jasmine failure in contacts_collection_spec.js
This was failing if `app.aspect` got set by another spec than ran before it (such as one of the other specs in the same file, when run in a different order).
2022-06-19 17:22:59 +02:00
Sage Ross
b195861483 Fix order-dependent failures in notification_dropdown_view_spec.js
These tests were failing because of an error thrown from `this.header.render()`, unless `head_view_spec.js` had already been run to set app.notificationsCollection.
2022-06-19 17:22:59 +02:00
Sage Ross
4e4d332d6e Fix more order-dependent jasmine specs 2022-06-19 17:22:59 +02:00
Sage Ross
56ef83fa8a Don't overwrite app.stream properties in tests
These cases of modifying app.stream can cause other specs to fail, depending on test order. Here we either don't modify them if the tests still pass without manually stubbing `addNow`, or we cache and restore the properties we need to test.
2022-06-19 17:22:59 +02:00
Sage Ross
f4234fa3a0 Fix order-dependence bug in single_post_interactions_spec.js
This was only passing when run after a loginAs from another spec.
2022-06-19 17:22:59 +02:00
Sage Ross
f85135f726 Make shortcuts_spec.js more order-independent
This spec was failing whenever router_spec.js was not run prior it it running.
2022-06-19 17:22:59 +02:00
Sage Ross
0831d4e294 Fix order-dependent failure of stream_view_spec.js
This spec was only passing when it was run after another spec (router_spec.js) that put `app.page` in an appropriate state.
2022-06-19 17:22:53 +02:00
Dennis Schubert
058090afe7 Start 0.7.18.0 cycle 2022-04-27 21:15:32 +02:00
Dennis Schubert
02eba842ae Merge branch 'next-minor' 2022-04-27 21:11:26 +02:00
Dennis Schubert
9212fd3f46 Merge pull request #8351 into next-minor 2022-04-27 20:35:34 +02:00
Dennis Schubert
31ea07daa1 Merge pull request #8350 into next-minor 2022-04-27 20:32:19 +02:00
Jonne Haß
43ee2dbb50 Do not allow to mass assign OTP fields on user edit page 2022-04-27 19:48:42 +02:00
Jonne Haß
8e6f3b91d3 bump rails to 5.2.7 2022-04-27 19:06:22 +02:00
Jonne Haß
1cfe0037f9 Do not allow the user to mass assign their own password alongside other
parameters

Much thanks to Breno Vitório (@brenu) for the report!
2022-04-27 13:44:48 +02:00
Dennis Schubert
f88807909c Merge branch 'main' into next-minor 2022-04-26 21:03:43 +02:00
Dennis Schubert
6ad4eb3be7 Add dedicated SECURITY.md.
Closes #8348
2022-04-26 21:02:35 +02:00
Dennis Schubert
7611391f9f Don't suggest to retry exports on failure.
closes #8343
2022-03-05 16:31:25 +01:00
Benjamin Neff
d896744ca1 Start 0.7.17.0 cycle 2022-02-12 00:07:58 +01:00
Benjamin Neff
82291ed7e7 Merge branch 'next-minor' 2022-02-12 00:06:20 +01:00
Benjamin Neff
d7fb7405ae updated 25 locale files [ci skip] 2022-02-11 23:59:53 +01:00
Benjamin Neff
d4800544f0 Bump rails to fix CVE-2022-23633
closes #8336
2022-02-11 23:31:19 +01:00
Benjamin Neff
eb977dc25a Use old person private key if relayable author migrated away
We only store signatures for relayables if the author is external, but
if the author becomes external through a migration, the signature is
missing. Lets just use the old persons private key to still be able to
generate a signature for the export.

closes #8310
2021-11-23 00:46:50 +01:00
Benjamin Neff
1570e3fb9a Migrate remote_photo_path and cleanup old photo uploads
If the migration contains a new remote_photo_path migrate all photos of
the old person to this path. If the person was local before, cleanup old
uploaded files of the photos.

closes #8314
2021-11-23 00:43:56 +01:00
flaburgan
c67fc4e0f7 Add sharing status in hovercards, fixes #6542
closes #8317
2021-11-23 00:31:41 +01:00
flaburgan
f6c885394d Refactor hovercards, fixes #8315
closes #8316
2021-11-23 00:30:21 +01:00
flaburgan
37f081959c Add a max-width to user name in the header, fixes #7676
closes #8313
2021-11-23 00:27:05 +01:00
Benjamin Neff
f69215edf1 Merge pull request #8318 from SuperTux88/update-gems
Update gems
2021-11-23 00:22:31 +01:00
Benjamin Neff
ec22f5883e Bump omniauth 2021-11-06 17:43:57 +01:00
Benjamin Neff
fbd14c8804 Bump indirect dependency gems 2021-11-06 05:01:21 +01:00
Benjamin Neff
b8e5021dd1 Bump will_paginate 2021-11-06 05:01:21 +01:00
Benjamin Neff
862796131f Bump webmock 2021-11-06 05:01:21 +01:00
Benjamin Neff
a5f59ef105 Bump toml-rb 2021-11-06 05:01:20 +01:00
Benjamin Neff
eea6d71c8d Bump terser 2021-11-06 05:01:20 +01:00
Benjamin Neff
c8fba1ffad Bump sidekiq 2021-11-06 05:01:20 +01:00
Benjamin Neff
fe0c143c89 Bump secure_headers 2021-11-06 05:01:20 +01:00
Benjamin Neff
62f98dcaff Bump rubyzip 2021-11-06 05:01:20 +01:00
Benjamin Neff
19f6057ded Bump rspec-rails 2021-11-06 05:01:20 +01:00
Benjamin Neff
ae6b5a634c Bump rqrcode 2021-11-06 05:01:20 +01:00
Benjamin Neff
cd32959b93 Bump redis 2021-11-06 05:01:20 +01:00
Benjamin Neff
6e8a0dd66a Bump openid_connect 2021-11-06 05:01:19 +01:00
Benjamin Neff
b3c13bc49e Bump nokogiri 2021-11-06 02:35:57 +01:00
Benjamin Neff
fef6380721 Bump js-routes 2021-11-06 02:35:57 +01:00
Benjamin Neff
9548a3645c Bump jasmine 2021-11-06 02:35:56 +01:00
Benjamin Neff
51a46f60f1 Bump hamlit 2021-11-06 02:35:56 +01:00
Benjamin Neff
a66bfc9614 Bump fog-aws 2021-11-06 02:35:56 +01:00
Benjamin Neff
10f62391d4 Bump faraday_middleware and faraday-cookie_jar 2021-11-06 02:35:56 +01:00
Benjamin Neff
a0646e9363 Bump devise-two-factor 2021-11-06 00:51:12 +01:00
Benjamin Neff
2eb52cedec Bump database_cleaner 2021-11-06 00:48:51 +01:00
Benjamin Neff
67069b1519 Bump cucumber 2021-11-06 00:45:06 +01:00
Benjamin Neff
ad24678be3 Bump autoprefixer-rails 2021-11-06 00:29:51 +01:00
Benjamin Neff
f27b4ae920 Bump asset_sync 2021-11-06 00:28:15 +01:00
Benjamin Neff
c939829912 Bump addressable 2021-11-06 00:25:18 +01:00
Benjamin Neff
39ab87d111 Remove deprecated Sidekiq::Web.sessions
See https://github.com/mperham/sidekiq/pull/4804

closes #8311
2021-10-30 03:11:23 +02:00
flaburgan
8a3c9a2463 Bump faraday to 0.17.4, diaspora_federation to 0.2.7
closes #8312
2021-10-30 03:10:36 +02:00
Benjamin Neff
5714e83ab2 Store signatures of AccountMigrations if the old person is local
That way it can be re-used when sending the AccountMigrations to other
pods again if a message for the migrated account is received.

fixes #7902
closes #8309
2021-10-25 03:40:16 +02:00
Benjamin Neff
3cb1e470a4 Resend AccountMigration or AccountDeletion for closed recipients 2021-10-25 03:34:03 +02:00
Thorsten Claus
88e2e593a4 Update open_graph_reader gem
closes #8307
2021-10-25 03:28:56 +02:00
Benjamin Neff
3292ce64fc Change placeholder in translations for #8304 2021-10-25 03:26:05 +02:00
Benjamin Neff
89cd77751f Change placeholder in translations for #8037 2021-10-25 03:26:04 +02:00
Benjamin Neff
d22ae06cff updated 82 locale files [ci skip] 2021-10-25 03:26:04 +02:00
David Morley
af9f26d11c Change domain for poduptime
closes #8304
2021-10-25 01:59:30 +02:00
flaburgan
5b3f75f011 Remind the username in the reset password e-mail
closes #8037
2021-10-25 01:58:47 +02:00
Benjamin Neff
dc99f0f77a Fix namespace for LineLength rule
closes #8303
2021-10-01 02:12:33 +02:00
Benjamin Neff
59baef3146 Enable HashTransform rules in rubocop because we have ruby >= 2.5 now 2021-10-01 02:12:25 +02:00
Benjamin Neff
0bb4ffce89 Disable Style/AccessorGrouping in rubocop
It makes more sense to allow to structure and group accessors how it
makes sense in the code instead of enforcing it to be grouped in a
specific way.
2021-10-01 02:12:25 +02:00
Benjamin Neff
b2a56376cd Fix running jasmine tests in docker
closes #8299
2021-10-01 02:11:36 +02:00
Thorsten Claus
4c337c6952 8139 add a podmin mail to footer
fixes #8139
closes #8242
2021-09-19 14:27:46 +02:00
Benjamin Neff
d39a4e3621 Also need to handle account_migration in AccountDeleter spec
Also backported from #7660
2021-09-19 03:45:52 +02:00
Benjamin Neff
fab48ee96d Also need to exclude account_migration from persons reference
Also backported from #7660
2021-09-19 03:41:26 +02:00
Benjamin Neff
b8ea120ff2 Backport account_migration relation on person from #7660 2021-09-19 03:13:02 +02:00
Thorsten Claus
2a99cc93ba diaspora should send AccountMigration message back when a federation message received for a moved account
I use Senya's Patch for this
The extra check is for satisfying tests, which don't create real database objects.

fixes #7902
closes #8288
2021-09-19 02:20:38 +02:00
Thorsten Claus
8f9ac33649 Using shared markdown options for plain text
fixes #7960
closes #8277
2021-09-18 19:22:27 +02:00
Thorsten Claus
c71caa5cb8 #7960 Add support for Markdown footnote syntax in Mobile view
Splitting stripdown and markdownify options, because the footnote option seems to let the Redcarpet::Render::StripDown function crash
2021-09-18 19:19:02 +02:00
Thorsten Claus
122e12a068 #7960 Add support for Markdown footnote syntax 2021-09-18 19:19:02 +02:00
Benjamin Neff
28f03f0a11 Cleanup person_by_handle route
I think this is a leftover from a long time ago and I can't find
anything that still uses that

closes #8280
2021-09-18 19:18:34 +02:00
Thorsten Claus
8392c894d2 ensure ./log folder exists
closes #8287
2021-09-18 19:18:03 +02:00
Benjamin Neff
b2ba0123e1 Fix FactoryBot for next-minor 2021-08-16 01:02:08 +02:00
Thorsten Claus
8691e650dc Person.find_or_fetch_by_identifier never return nil
Person.find_or_fetch_by_identifier raises an exception if person is not found localy and not fetchable. It never returns nil. These code changes take care about this behaviour and changes specs and code to behave equally.

Also related to #8253
2021-08-16 00:24:33 +02:00
Pirate Praveen
20a3abd864 Switch to terser gem from uglifier for JS compression
closes #8268
2021-08-16 00:21:17 +02:00
Thorsten Claus
07a49de7e1 Using galleries default border radius Small indicator images in image gallery are round ones, this doesn't correspond with preview shown in stream. It also doesn't look good on real-world images. (may look OK for User profile images)
closes #8275
2021-07-26 02:37:22 +02:00
Benjamin Neff
7d0c29e99a Update repo data before trying to install packages
closes #8276
2021-07-26 02:31:53 +02:00
Benjamin Neff
7e9987b7f5 Downgrade ethon because of https://github.com/typhoeus/ethon/issues/194
closes #8267
2021-07-04 23:28:15 +02:00
Dennis Schubert
805a35e985 Point /protocol route to the current federation documentation. 2021-07-04 22:07:51 +02:00
Dennis Schubert
407f51d5a3 Allow points and dashes in the username.
This reverts b3ca504c40. We don't quite know why that was added, but we assume it's because of format strings. Some pre-2011 users exist that still have dots or dashes in their username, and those accounts are somewhat broken now.

closes #8266
2021-07-04 22:07:21 +02:00
Benjamin Neff
8f804e376a Don't export chat_enabled flag anymore
The chat is already removed for 0.8, so there is no need to still export
this data since it can't be imported anyway.

Related to #8069

closes #8265
2021-07-04 22:03:37 +02:00
Benjamin Neff
342d4f7fde Add blocks to archive json schema 2021-07-03 03:00:45 +02:00
Thorsten Claus
b31f9106a1 Migration: Exporting user blocks
closes #8263
2021-07-03 02:51:41 +02:00
Benjamin Neff
7b73002a2c Merge pull request #8261 from SuperTux88/gem-updates
Gem updates
2021-06-30 23:21:52 +02:00
Benjamin Neff
c203c1eb94 Cleanup unused commenting_disabled? and can_comment?
closes #8262
2021-06-30 23:19:29 +02:00
Benjamin Neff
c1093abaef Bump some dependency gems 2021-06-28 01:34:26 +02:00
Benjamin Neff
319d5b55d9 Bump webmock 2021-06-28 01:34:26 +02:00
Benjamin Neff
6b48580373 Bump sprockets-rails 2021-06-28 01:34:25 +02:00
Benjamin Neff
da68d363a0 Bump simplecov 2021-06-28 01:34:25 +02:00
Benjamin Neff
2f29bb3035 Bump ruby-oembed 2021-06-28 01:34:25 +02:00
Benjamin Neff
b08202f51d Bump rqrcode 2021-06-28 01:31:01 +02:00
Benjamin Neff
053a93ea08 Bump redis 2021-06-28 01:30:37 +02:00
Benjamin Neff
e790e01753 Bump rails-timeago 2021-06-28 01:30:37 +02:00
Benjamin Neff
0e81a2da86 Bump rails-controller-testing 2021-06-28 01:30:37 +02:00
Benjamin Neff
2fd82c92dd Bump pry 2021-06-28 01:30:37 +02:00
Benjamin Neff
72b66a2782 Bump openid_connect 2021-06-28 01:30:37 +02:00
Benjamin Neff
72ad6fd23b Bump mini_magick 2021-06-28 01:30:37 +02:00
Benjamin Neff
29ea68737d Bump leaflet-rails 2021-06-28 01:30:37 +02:00
Benjamin Neff
c98598b8bc Bump js-routes 2021-06-28 01:30:37 +02:00
Benjamin Neff
edccab4ab3 Bump handlebars_assets 2021-06-28 01:30:36 +02:00
Benjamin Neff
414638476e Bump hamlit 2021-06-28 01:30:36 +02:00
Benjamin Neff
8eb2a9ca12 Bump haml_lint 2021-06-28 01:30:36 +02:00
Benjamin Neff
e1061c3d5c Bump fog-aws 2021-06-28 01:30:36 +02:00
Benjamin Neff
096297bd86 Bump devise 2021-06-28 01:30:34 +02:00
Benjamin Neff
dc3bef6a93 Bump carrierwave 2021-06-28 01:28:15 +02:00
Benjamin Neff
0c4d9bb702 Bump autoprefixer-rails 2021-06-28 01:28:15 +02:00
Benjamin Neff
ca44e91de6 Bump asset_sync 2021-06-28 01:28:15 +02:00
Benjamin Neff
93fae13cab Bump acts-as-taggable-on 2021-06-28 01:28:15 +02:00
Benjamin Neff
bd68e8ec83 Bump activerecord-import 2021-06-28 01:28:14 +02:00
Benjamin Neff
22f0538464 Bump gon 2021-06-27 23:09:12 +02:00
Benjamin Neff
486026a1b6 Bump nokogiri 2021-06-27 23:07:28 +02:00
Benjamin Neff
32e580b3ec Bump bindata 2021-06-27 23:05:02 +02:00
Benjamin Neff
2a22bb01c4 Bump rails 2021-06-27 23:01:41 +02:00
Akshay S Dinesh
b375bfa630 Add more closing tags to fix specs
closes #8159
2021-06-27 22:23:22 +02:00
Pirate Praveen
77edc5105e Update jquery to 3.5.1 (jquery-rails 4.4.0 and rails-assets-jquery 3.5.1) 2021-06-27 22:21:27 +02:00
Thorsten Claus
43d489edda Fixed test
closes #8244
2021-06-13 01:26:27 +02:00
Thorsten Claus
3793d36609 Added tag handling 2021-06-13 01:24:49 +02:00
Allan Klaus
b2b03d2679 Improve Service::Tumblr
- Fix rubocop styles
- Improve specs coverage
2021-06-13 01:24:48 +02:00
Pirate Praveen
92a096f03c Add closing tags to replace invalid self-closing tags
closes #8251
closes #8158
2021-06-13 01:14:03 +02:00
Thorsten Claus
1f510d0b40 Wrapped local_comments also in a cache
closes #8241
closes #7992
2021-06-13 01:09:44 +02:00
Thorsten Claus
7042237218 Styles, SQL format 2021-06-13 01:03:22 +02:00
Thorsten Claus
d4331f4e65 7992 wrap local_posts from statistics in a cache 2021-06-13 01:03:18 +02:00
Jonne Haß
ba905334f7 Start 0.7.16.0 cycle 2021-04-18 13:14:29 +02:00
Jonne Haß
1d0982822b Merge branch 'next-minor' 2021-04-18 13:09:59 +02:00
Jonne Haß
33b7d3253a Update unicorn to 6.0.0 2021-04-17 11:55:47 +02:00
Jonne Haß
0fcd166387 Redis#client.disconnect is Redis#close now 2021-04-11 20:49:41 +02:00
Jonne Haß
cba2b9a3a9 Revert "Update bootstrap-switch-rails 3.3.3 -> 3.3.5"
This reverts commit cb675f5c8d.
2021-04-11 20:34:11 +02:00
Jonne Haß
22815abb22 Rails depends on the listen gem in development mode 2021-04-11 20:30:11 +02:00
Jonne Haß
6e55ae7b5e update Gemfile.lock for carrierwave 1.3.2
🙈
2021-04-11 17:42:21 +02:00
Jonne Haß
6f9c52e2b4 update to carrierwave 1.3.2 2021-04-11 17:35:01 +02:00
Jonne Haß
231ca2c3b1 update unrestricted gems 2021-04-11 17:25:18 +02:00
Jonne Haß
24e8be37c2 update jasmine to 3.7.0 2021-04-11 17:25:18 +02:00
Jonne Haß
1d8b9bde43 update hamlit to 2.14.6 2021-04-11 17:25:18 +02:00
Jonne Haß
a18defc90f update haml to 5.2.1 2021-04-11 17:25:18 +02:00
Jonne Haß
e4164eb18f update rspec suite dependencies 2021-04-11 17:25:18 +02:00
Jonne Haß
a36ffff5f7 update linters 2021-04-11 17:25:18 +02:00
Jonne Haß
2412ee390d update capybara and cucumber-rails 2021-04-11 17:25:18 +02:00
Jonne Haß
f949ae2aab update pry 2021-04-11 17:25:18 +02:00
Jonne Haß
b4b4efbab1 drop guard dev tool 2021-04-11 17:25:18 +02:00
Jonne Haß
7277200bc5 update devise to 4.7.3 2021-04-11 17:25:18 +02:00
Jonne Haß
7960a51d12 update open_graph_reader to 0.7.1 2021-04-11 17:25:18 +02:00
Jonne Haß
f55237ca6b update nokogiri to 1.11.3 2021-04-11 17:25:18 +02:00
Jonne Haß
52f08f1178 update redcarpet to 3.5.1 2021-04-11 17:25:18 +02:00
Jonne Haß
aa51329a49 update to rails 5.2.5 2021-04-11 17:25:18 +02:00
Jonne Haß
62bb4dc7b6 Update to Sidekiq 6
closes #8153
closes #8162
2021-04-11 17:25:18 +02:00
Jonne Haß
f52dbe570d Update autoprefixer-rails to 10.2.4.0
closes #8155
2021-04-11 17:25:18 +02:00
Jonne Haß
8d7b866c87 update secure_headers to 6.3.2
closes #8151
2021-04-11 17:25:18 +02:00
Jonne Haß
ee35ad3200 update devise-two-factor to 4.0.0 2021-04-11 17:25:18 +02:00
Pirate Praveen
cb675f5c8d Update bootstrap-switch-rails 3.3.3 -> 3.3.5
closes #8149
2021-04-11 17:25:18 +02:00
Pirate Praveen
4c6937838d Update responders 2.4.1 -> 3.0.1
closes #8148
2021-04-11 17:25:18 +02:00
Pirate Praveen
18ea3343fd Update typhoeus 1.3.1 -> 1.4.0
closes #8145
2021-04-11 17:25:18 +02:00
Pirate Praveen
cd9f79a018 Update rubyzip from 1.3.0 to 2.3.0
closes #8145
2021-04-11 17:25:18 +02:00
gabrielrumiranda
394eafccc5 Actually implement validation error case in Photo#ownserhip_of_status_message
closes #8214
closes #8048

Co-authored-by: Thorsten Claus <thorstenclaus@web.de>
2021-04-11 17:22:40 +02:00
Gayathrir1666
ef9e764f7a Add scrollbar to aspect dropdowns
closes #8213
closes #7696

Co-authored-by: Hank Grabowski <hankgrabowski@gmail.com>
Co-authored-by: Thorsten Claus <thorstenclaus@web.de>
2021-04-11 17:13:25 +02:00
Thorsten Claus
a420ba2cfc Formatting post per user fractions
closes #8227
2021-04-11 13:16:15 +02:00
Thorsten Claus
a98fdc8079 Remove 'heidelberg' tile map service.
Updated settings for MapTiles as recommended by leaflet.js
Updating current licence text

Closes #8209
closes #8215
2021-04-11 01:45:05 +02:00
Jonne Haß
7154fc3ccc Port cukes from poltergeist to aparition
closes #8234
2021-04-10 23:17:39 +02:00
Jonne Haß
cd6eb3de7f Run jasmine specs using chrome headless 2021-04-10 23:16:10 +02:00
Pirate Praveen
79133df4a9 Update mimemagic (0.3.5 is removed from rubygems.org)
closes #8231
2021-04-10 11:33:22 +02:00
Benjamin Neff
e7c5da2fff Use bundler-cache: true instead of actions/cache@v2
Using actions/cache@v2 causes problems with ruby, see
https://github.com/ruby/setup-ruby#caching-bundle-install-manually

Closes #8221

closes #8226
2021-04-10 11:07:37 +02:00
Thorsten Claus
d7941230a4 Replace some http links with their https counterparts.
closes #8207
2021-02-21 19:44:42 +01:00
Ashley Nelson
d5d53baa1c Delete user invitation code during account deletion
closes #8202
2021-02-14 18:49:48 +01:00
Dennis Schubert
7a7c48a470 CI - Don't fail fast.
Other runs might still result in interesting results, even if one suite fails.

closes #8204
2021-02-08 21:13:50 +01:00
Dennis Schubert
875f54b846 CI - Install all Ubuntu deps into the CI environment.
This matches what we suggest on the wiki -- just to make sure.
2021-02-08 21:13:44 +01:00
Benjamin Neff
1faddbc911 Fix "Change email" button position on mobile-ui
closes #8193
2020-12-30 14:16:02 +01:00
Benjamin Neff
98e70c8221 Fix syntax error for default_color_theme in diaspora.toml.example
closes #8194
2020-12-30 13:29:39 +01:00
Jonne Haß
cfd5397cfc GHA: Run Jasmine in separate, time limited step for now
closes #8182
2020-11-04 18:09:36 +01:00
Benjamin Neff
d9013250fd Upgrade docker image to ruby 2.6 and debian buster
closes #8180
2020-11-04 14:22:22 +01:00
Benjamin Neff
f51ad14c1b Cleanup dependencies in docker image
Replace ghostscript with gsfonts, the captcha only needs gsfonts to
work.
2020-11-04 14:22:02 +01:00
Jonne Haß
6f3d68110a bump jasmine to 3.6.0
closes #8179
2020-11-02 19:55:38 +01:00
Jonne Haß
8bca84422e cucumber: don't fail on flaky tests, fail-fast 2020-11-02 19:55:36 +01:00
Jonne Haß
e1aff7e3ab drop coveralls 2020-11-02 19:55:36 +01:00
Jonne Haß
203ca77a2f github actions ci: don't stop other jobs in matrix if one fails 2020-11-02 16:08:10 +01:00
David Morley
9793f89761 Update poduptime link to diaspora only list
closes #8174
2020-11-02 15:33:38 +01:00
David Morley
e24eb65ca4 update poduptime to diaspora list in readme
closes #8173
2020-11-02 15:31:01 +01:00
Jonne Haß
b8a85850e1 Migrate from Travis to Github Actions
closes #8178
2020-11-02 15:20:53 +01:00
Thorsten Claus
d0eb711ca0 In single post view deleting a comment updates the counter 2020-10-24 14:25:32 +02:00
Jonne Haß
2aaf37659d bump kostya-sigar to 2.0.8
closes #8165
2020-10-20 11:54:45 +02:00
Jonne Haß
c268495e04 Switch to toml-rb gem
For them dotted keys

closes #8152
2020-09-17 08:48:39 +02:00
Jonne Haß
ce82ba3dde Drop spring
it does more harm than good at this point

closes #8133
2020-09-04 21:52:24 +02:00
Jonne Haß
2acdc8e095 Add chat configuration to diaspora.toml.example 2020-09-04 21:49:30 +02:00
Jonne Haß
08395cc877 Migrate configuration to TOML
YAML is just too easy to get wrong

closes #8132
2020-09-04 21:48:54 +02:00
Jonne Haß
9dff9642b6 bundler: disable post install messages in production
closes #8131
2020-07-08 22:05:45 +02:00
Dennis Schubert
0937bfc420 updated 9 locale files [ci skip] 2020-06-24 18:46:08 +02:00
Dennis Schubert
d061c4e2cf Merge branch 'master' into next-minor 2020-06-14 22:12:58 +02:00
Dennis Schubert
4ca68a71d9 Merge branch 'release/0.7.14.0' 2020-06-14 22:11:23 +02:00
Dennis Schubert
3c124cefc3 updated 6 locale files [ci skip] 2020-06-14 22:10:24 +02:00
Dennis Schubert
9771a96add Start 0.7.15.0 cycle.
[ci skip]
2020-06-14 21:49:07 +02:00
Dennis Schubert
efa89cc2f3 Merge pull request #8130 from denschub/gem-updates
Bump Rails
2020-06-14 20:43:00 +02:00
Dennis Schubert
77062cbcaf Bump Rails 2020-06-13 23:49:57 +02:00
Noah Leal
ad91dddd63 Issue #8119 - Add length validation to a profile's gender field.
closes #8127
2020-06-13 23:31:03 +02:00
flaburgan
7193099902 Bump ruby version to 2.6, drop support of 2.3
closes #7929
2020-06-13 23:29:47 +02:00
Benjamin Neff
f882dd2d6f Bump octokit to 4.18.0 ... 4.17.0 was yanked :(
See octokit/octokit.rb#1219
2020-03-28 01:12:53 +01:00
Vitalie Ciubotaru
827a2ce991 Remove links to deleted profiles in admin user stats
closes #8063
closes #8061
2020-03-21 19:14:56 +01:00
Jonne Haß
ba8e0907cc update rails-timeago to 2.18.0 2020-03-20 20:03:42 +01:00
Jonne Haß
38d746b240 use latest ruby patch releases on travis 2020-03-20 20:03:42 +01:00
Jonne Haß
bd7feb83a6 update rqrcode to 1.1.2 2020-03-20 20:03:42 +01:00
Jonne Haß
813e6d4781 update rubocop to 0.80.1 and rubocop-rails to 2.4.1 2020-03-20 20:03:42 +01:00
Jonne Haß
9b6bc59854 update twitter to 7.0.0 2020-03-20 20:03:42 +01:00
Jonne Haß
3a3a9008b6 update simple_captcha2 to 0.5.0 2020-03-20 20:03:42 +01:00
Jonne Haß
1da14f2ef7 update sidekiq to 5.2.8 2020-03-20 20:03:42 +01:00
Jonne Haß
bec7e77e9e update asset_sync to 2.11.0 2020-03-20 20:03:42 +01:00
Jonne Haß
4a5610df2f update acts-as-taggable-on to 6.5.0 2020-03-20 20:03:42 +01:00
Jonne Haß
a7119fa7c1 update activerecord-import to 1.0.4 2020-03-20 20:03:42 +01:00
Jonne Haß
abec056c02 update omniauth to 1.9.1 2020-03-20 20:03:42 +01:00
Jonne Haß
60a50c881d update will_paginate to 3.3.0 2020-03-20 20:03:42 +01:00
Jonne Haß
de4a416280 update versionist to 2.0.1 2020-03-20 20:03:42 +01:00
Jonne Haß
3042b385c6 update string-direction to 1.2.2 2020-03-20 20:03:42 +01:00
Jonne Haß
a7f3ea976f update redcarpet to 3.5.0 2020-03-20 20:03:42 +01:00
Jonne Haß
33405d6ee6 update pg to 1.2.3 2020-03-20 20:03:42 +01:00
Jonne Haß
a681b317f3 update mysql2 to 0.5.3 2020-03-20 20:03:42 +01:00
Jonne Haß
db8bc5d874 update leaflet-rails to 1.6.0 2020-03-20 20:03:42 +01:00
Jonne Haß
04c545ef7d update js-routes to 1.4.9 2020-03-20 20:03:42 +01:00
Jonne Haß
ecdf130bcd update handlebars_assets to 0.23.8 2020-03-20 20:03:42 +01:00
Jonne Haß
a4dd210669 update hamlit to 2.11.0 2020-03-20 20:03:42 +01:00
Jonne Haß
8913a30d57 update haml_lint to 0.35.0 2020-03-20 20:03:42 +01:00
Jonne Haß
d6814878e9 update gon to 6.3.2 2020-03-20 20:03:42 +01:00
Jonne Haß
78b62dd3ed update addressable to 2.7.0 2020-03-20 20:03:42 +01:00
Jonne Haß
c74b0ab611 update nokogiri to 1.10.9 2020-03-20 20:03:42 +01:00
Jonne Haß
3eba2f3fa3 update fog-aws to 3.5.2 2020-03-20 20:03:42 +01:00
Jonne Haß
d9ef60b8b3 update uglifier to 4.2.0 2020-03-20 20:03:42 +01:00
Jonne Haß
05ee8f3db0 update unicorn to 5.5.3 2020-03-20 20:03:42 +01:00
Jonne Haß
872d87c772 update webmock to 3.8.3 2020-03-20 20:03:42 +01:00
Jonne Haß
27493cee41 update rspec-rails to 3.9.1 2020-03-20 20:03:42 +01:00
Jonne Haß
d0e5f90f84 update yard to 0.9.24 2020-03-20 20:03:42 +01:00
Jonne Haß
25a6c9583f update tins to 1.24.1 2020-03-20 20:03:42 +01:00
Jonne Haß
e5e4189569 update tilt to 2.0.10 2020-03-20 20:03:42 +01:00
Jonne Haß
8f0826a8bc update temple to 0.8.2 2020-03-20 20:03:42 +01:00
Jonne Haß
9c7d9186f6 update sassc to 2.2.1 2020-03-20 20:03:42 +01:00
Jonne Haß
d3210f1154 update rugged to 0.99.0 2020-03-20 20:03:42 +01:00
Jonne Haß
d5c22c3e49 update request_store to 1.5.0 2020-03-20 20:03:42 +01:00
Jonne Haß
ea4b670582 update raindrops to 0.19.1 2020-03-20 20:03:42 +01:00
Jonne Haß
9c449b0298 update rack-protection to 2.0.8.1 2020-03-20 20:03:42 +01:00
Jonne Haß
fa26c29bb2 update rack-oauth2 to 1.10.1 2020-03-20 20:03:42 +01:00
Jonne Haß
7f90110696 update parser to 2.7.0.4 2020-03-20 20:03:42 +01:00
Jonne Haß
8779a15e27 update parallel to 1.19.1 2020-03-20 20:03:42 +01:00
Jonne Haß
196f0699b0 update octokit to 4.17.0 2020-03-20 20:03:42 +01:00
Jonne Haß
19314f8a94 update oauth2 to 1.4.4 2020-03-20 20:03:42 +01:00
Jonne Haß
90926d95e9 update kgio to 2.11.3 2020-03-20 20:03:42 +01:00
Jonne Haß
95aaa7a140 update jsonpath to 1.0.5 2020-03-20 20:03:42 +01:00
Jonne Haß
95f08ac9af update jaro_winkler to 1.5.4 2020-03-20 20:03:42 +01:00
Jonne Haß
f0f8cf334c update http-form_data to 2.3.0 2020-03-20 20:03:42 +01:00
Jonne Haß
195780122b update gitlab to 4.14.0 2020-03-20 20:03:42 +01:00
Jonne Haß
403960811f update get_process_mem to 0.2.5 2020-03-20 20:03:42 +01:00
Jonne Haß
659bdf4b7a update fugit to 1.3.3 2020-03-20 20:03:42 +01:00
Jonne Haß
ffa69df704 update fog-core to 2.2.0 2020-03-20 20:03:42 +01:00
Jonne Haß
2d742ec0ff update fabrication to 2.21.0 2020-03-20 20:03:42 +01:00
Jonne Haß
95422c7566 update excon to 0.73.0 2020-03-20 20:03:42 +01:00
Jonne Haß
fc6d736471 update et-orbi to 1.2.4 2020-03-20 20:03:42 +01:00
Jonne Haß
2149ebb2df update domain_name to 0.5.20190701 2020-03-20 20:03:42 +01:00
Jonne Haß
e046a4cc3a update bindata to 2.4.6 2020-03-20 20:03:42 +01:00
Jonne Haß
4ac1b9ae87 update spring to 2.1.0 2020-03-20 20:03:42 +01:00
Jonne Haß
eb7a71a2a5 update rb-inotify to 0.10.1 2020-03-20 20:03:42 +01:00
Jonne Haß
b325d2ca43 update jasmine to 3.5.1 2020-03-20 20:03:42 +01:00
Jonne Haß
7ec921c956 update guard to 2.16.1 2020-03-20 20:03:42 +01:00
Jonne Haß
d561d2caf1 update fuubar to 2.5.0 2020-03-20 20:03:42 +01:00
Jonne Haß
67924fc404 update fixture_builder to 0.5.2 2020-03-20 20:03:42 +01:00
Jonne Haß
51e7eae2c3 update factory_girl_rails to 4.9.0 2020-03-20 20:03:42 +01:00
Jonne Haß
b54679a634 update database_cleaner to 1.8.3 2020-03-20 20:03:42 +01:00
Jonne Haß
b146c90e57 update cucumber-rails to 2.0 2020-03-20 20:03:42 +01:00
Jonne Haß
9211f930cd update json to 2.3.0 2020-03-20 20:03:42 +01:00
Jonne Haß
00c5f35190 Update Rails to 5.2.4.2 2020-03-20 20:03:42 +01:00
Benjamin Neff
c432a658dd Start 0.7.14.0 cycle 2020-02-12 00:36:21 +01:00
Benjamin Neff
c2a991fec1 Merge branch 'release/0.7.13.0' 2020-02-12 00:33:50 +01:00
Benjamin Neff
6f65d9f96c updated 11 locale files [ci skip] 2020-02-12 00:29:37 +01:00
Dennis Schubert
b0181fbbb9 Bump mini_magick.
closes #8108
2020-02-12 00:09:54 +01:00
Dennis Schubert
ec72ac1277 Bump nokogiri. 2020-02-11 23:56:49 +01:00
Dennis Schubert
bc601f7c34 Bump devise. 2020-02-11 23:56:49 +01:00
Dennis Schubert
905df19a34 Bump rubyzip. 2020-02-11 23:54:56 +01:00
Dennis Schubert
43b83cf8f7 Bump json-jwt. 2020-02-11 23:54:56 +01:00
Dennis Schubert
d898b5ba69 Bump rack-cors. 2020-02-11 23:54:56 +01:00
Dennis Schubert
b7ee911778 Bump excon. 2020-02-11 23:54:56 +01:00
Dennis Schubert
67d73ece80 Bump secure_headers. 2020-02-11 23:54:55 +01:00
Dennis Schubert
71023a8713 Replace secret_token with secret_key_base.
secrets.secret_token is deprecated in favor of secret_key_base and will be removed in Rails 6.0.
2020-02-11 23:54:55 +01:00
Dennis Schubert
2e2b42ef1a Mark non-attribute usage in SQL queries as safe.
Non-attribute arguments will be disallowed in Rails 6.0.
2020-02-11 23:54:55 +01:00
Dennis Schubert
4685df634c Make Person.search_query_string public.
Accessibility of private/protected class methods in :scope is deprecated and will be removed in Rails 6.0.
2020-02-11 23:53:14 +01:00
Dennis Schubert
e40a07f204 Replace be_success with be_successful in specs.
be_success is deprecated and will be removed in Rails 6.
2020-02-11 23:53:14 +01:00
Dennis Schubert
45e8b54bea Check for status codes instead of relying on response.redirect?.
Rack did so much refactoring, we do not see a Response object here anymore.
2020-02-11 23:53:14 +01:00
Dennis Schubert
35da56109f Create a dup string from the return value of .truncate.
Due to a bug in Rails, .truncate returns a frozen string if the string actually changed, but not if there are no changes. This leads to inconsistent behaviour, and broken tests.

This was fixed upstream, see https://github.com/rails/rails/pull/36109, but the fix did not make it into 5.2.x, so we have to work around for the time being.
2020-02-11 23:53:14 +01:00
Dennis Schubert
75ef13b5d1 Replace content_security_policy_nonce with content_security_policy_script_nonce.
To avoid an conflict with Rails, and to avoid confusing by twitter's gem overloading the method.
2020-02-11 23:53:14 +01:00
Dennis Schubert
25e9728fae Do not depend on the default parameter being set in Person#initialize.
ActiveRecord 5.2.x occasionally calls with a nil parameter explicitly provided, so using default arguments does not work.
2020-02-11 23:53:14 +01:00
Dennis Schubert
93b0e1eb22 Bump Rails. 2020-02-11 23:53:14 +01:00
Jonne Haß
1e642be040 Hide sign up link in mobile header when registrations are disabled
closes #8060
2020-01-27 09:30:11 +01:00
Dennis Schubert
1d72f95705 Issue #8062 - Drop rails-assets.org.
and replace it with our own Gem cache. This isn't pretty, as we have to manage that one ourselves, and pushing updates requires a core-team member, but rails-assets.org has become way too unreliable for us to be a viable option.

closes #8087
2020-01-22 21:08:06 +01:00
Jonne Haß
36b4076af6 set better example values for unicorn stdout/stderr log settings
[ci skip]

closes #8058
2019-10-25 01:24:08 +02:00
FeruzOripov
3856b44c57 Refactoring aspects_controller.rb
closes #8064
2019-10-25 01:22:02 +02:00
Jonne Haß
ba16185b8e install ghostscript on travis
closes #8049
2019-09-01 02:43:51 +02:00
Jonne Haß
6937fa13e5 travis: ensure postgresql and mysql are available 2019-09-01 02:42:11 +02:00
Jonne Haß
5b09e9d38d install libidn-dev on travis 2019-09-01 02:42:11 +02:00
Jonne Haß
6a7e937d90 Update open_graph_reader to 0.7.0
This should fix undefined method `og' for #<OpenGraphReader::Base:0x00007f73c53f2308 @bases={}>
for sites that have OpenGraph tags of other namespaces but no actual OpenGraph core tags
2019-09-01 02:42:11 +02:00
Benjamin Neff
593614aef1 Bump fuubar
Version 2.4.0 was yanked ... why do people do such things? m(

https://github.com/thekompanee/fuubar/issues/111
2019-07-06 22:43:41 +02:00
Benjamin Neff
b42c9896bc Migrate pending profile photos and fix upload to unpend profile photos
fixes #8043

closes #8044
2019-07-04 02:29:17 +02:00
Benjamin Neff
df4e79b842 Cleanup pending photos which were never posted with cronjob
Only delete photos older than a day, so we don't delete photos for posts
which were uploaded 10 minutes ago and the author is still writing the
post for it.

closes #8041
2019-07-03 13:24:27 +02:00
Benjamin Neff
397dbdbee8 Bump unf_ext
closes #8042
2019-07-03 13:21:20 +02:00
Benjamin Neff
68234fc91f Bump macaddr 2019-07-03 13:20:09 +02:00
Benjamin Neff
2b8cc070f2 Bump jsonpath 2019-07-03 13:20:08 +02:00
Benjamin Neff
18d6d39c62 Bump jwt 2019-07-03 13:20:08 +02:00
Benjamin Neff
6ede2ade7b Bump bcrypt 2019-07-03 13:20:08 +02:00
Benjamin Neff
4b2414c9eb Bump rspec-expectations and rspec-mocks 2019-07-03 13:20:08 +02:00
Benjamin Neff
b654ca7f82 Bump rails-assets-bootstrap 2019-07-03 13:20:08 +02:00
Benjamin Neff
5278ae6a96 Bump fugit 2019-07-03 13:20:08 +02:00
Benjamin Neff
4b921816eb Bump ffi 2019-07-03 13:20:08 +02:00
Benjamin Neff
2503934a04 Bump fabrication 2019-07-03 13:20:08 +02:00
Benjamin Neff
cde29af545 Bump rails-assets-jasmine-ajax 2019-07-03 13:20:07 +02:00
Benjamin Neff
1e2e064268 Bump jasmine 2019-07-03 13:20:07 +02:00
Benjamin Neff
435e60c214 Bump cucumber-rails 2019-07-03 13:20:07 +02:00
Benjamin Neff
51e7958c4b Bump pronto 2019-07-03 13:18:38 +02:00
Benjamin Neff
18b0dd0060 Bump coveralls 2019-07-03 13:18:38 +02:00
Benjamin Neff
26b247bf98 Bump webmock 2019-07-03 13:18:38 +02:00
Benjamin Neff
800676a90f Bump rspec-json_expectations 2019-07-03 13:18:38 +02:00
Benjamin Neff
556fa42004 Bump fuubar 2019-07-03 13:18:38 +02:00
Benjamin Neff
1458d2d57f Bump rubocop 2019-07-03 13:18:38 +02:00
Benjamin Neff
d2c4faeb9f Bump versionist 2019-07-03 13:18:37 +02:00
Benjamin Neff
3a1428a672 Bump hamlit 2019-07-03 13:17:37 +02:00
Benjamin Neff
06c582a672 Bump faraday_middleware 2019-07-03 13:17:36 +02:00
Benjamin Neff
fa08ebf7bd Bump addressable 2019-07-03 13:17:36 +02:00
Benjamin Neff
c059550943 Bump openid_connect 2019-07-03 13:17:36 +02:00
Benjamin Neff
ee503737cb Bump secure_headers 2019-07-03 13:17:36 +02:00
Benjamin Neff
a6261fdc64 Bump nokogiri 2019-07-03 13:17:36 +02:00
Benjamin Neff
56670865b9 Bump leaflet-rails 2019-07-03 13:17:36 +02:00
Benjamin Neff
325a9122b8 Bump js-routes 2019-07-03 13:17:36 +02:00
Benjamin Neff
a018abcfe9 Bump jquery 2019-07-03 13:17:35 +02:00
Benjamin Neff
8f5c248536 Bump handlebars_assets 2019-07-03 13:17:35 +02:00
Benjamin Neff
e2ce43c3c7 Bump fog-aws 2019-07-03 13:17:35 +02:00
Benjamin Neff
c154c4e2af Bump activerecord-import 2019-07-03 13:17:35 +02:00
Benjamin Neff
07513e2ec0 Bump rack-cors 2019-07-03 13:17:35 +02:00
Benjamin Neff
b1441356d2 Bump sidekiq 2019-07-03 13:17:35 +02:00
Benjamin Neff
e7a7f62531 Bump unicorn 2019-07-03 13:17:35 +02:00
Benjamin Neff
4ae373e3a2 Bump rails 2019-07-03 13:17:30 +02:00
Benjamin Neff
4cef2a4325 Merge branch 'master' into next-minor 2019-06-25 02:14:45 +02:00
Benjamin Neff
09a425cbbc Merge branch 'release/0.7.12.0' 2019-06-25 02:13:50 +02:00
Benjamin Neff
1e8a96d817 updated 64 locale files [ci skip] 2019-06-25 02:06:07 +02:00
Benjamin Neff
d674f53910 Start 0.7.13.0 cycle 2019-06-17 01:19:44 +02:00
Benjamin Neff
5602dc4418 Use username parameter first if present
this makes sure we don't use an old otp_user_id from an old session

closes #8031
2019-06-17 01:14:22 +02:00
Benjamin Neff
88e35d3f3a Use :database_authenticatable strategy to check password for OTP user
This:
* makes sure that after_database_authentication is called for users with
enabled 2fa.
* handles paranoid mode correctly
2019-06-17 01:12:42 +02:00
Benjamin Neff
ef31ea6b96 Enable remember me for all forms
fixes #8023
2019-06-17 01:12:42 +02:00
flaburgan
78538d034a Harmonize markdown titles sizes
fixes #7757

closes #8029
2019-06-17 01:10:41 +02:00
flaburgan
d8b3718a08 Fix wrong padding for captcha label in registration form
fixes #8016

closes #8028
2019-06-17 01:08:38 +02:00
Jonne Haß
1227f34b2a Pass normalized URI to OpenGraphReader
This ensures the hostname is downcase and thus subsequent third party library
assumptions hold, namely http-cookie (pulled through faraday-cookie_jar) doesn't
raise

closes #8021
2019-05-24 22:43:08 +02:00
Benjamin Neff
4a22f08539 Merge branch 'master' into next-minor 2019-05-13 22:52:08 +02:00
Benjamin Neff
dc7c5ffef6 Merge branch 'release/0.7.11.0' 2019-05-13 22:51:22 +02:00
Benjamin Neff
5aec9b966c updated 74 locale files [ci skip] 2019-05-13 22:49:16 +02:00
Benjamin Neff
e5ba9a1a46 Move translations to registrations.closed
And remove unused translations and make "another pod" translatable.

closes #7896
2019-05-12 00:25:36 +02:00
flaburgan
4feab5219e Use a partial to share code between mobile and desktop, add the new route to the RegistrationController, drop flash message for closed registrations 2019-05-12 00:25:36 +02:00
alebor-5
469983a623 Improve communication about signing up on closed pods
fixes #7767
2019-05-12 00:25:08 +02:00
flaburgan
6826e89a95 Change design, add a link to the official website
fixes #7910

closes #7966
2019-05-12 00:12:12 +02:00
David Moseler
e04ddd0bcc Clarify pod is part of diaspora in splash screen 2019-05-12 00:09:58 +02:00
Benjamin Neff
4d02aee375 Merge branch 'release/0.7.11.0' into next-minor 2019-05-12 00:07:36 +02:00
Benjamin Neff
165b8f4f6e Don't encrypt the OTP secret
It doesn't add any security to have this encrypted, but it adds
complexity for podmins, because they need to backup the key.

closes #8014
2019-05-12 00:06:28 +02:00
Jonne Haß
2d23a2601e fix old photos without a remote_photo_path or remote_photo_name
closes #8012
2019-05-11 22:07:48 +02:00
Dennis Schubert
3704be8bec Prepare 0.7.12.0 cycle
[ci skip]
2019-05-05 04:22:10 +02:00
Dennis Schubert
39b86ed486 Remvoe unused Changelog headline
[ci skip]
2019-05-05 04:21:37 +02:00
flaburgan
83a9877def Improve likes steps
closes #8002
2019-05-03 17:17:32 +02:00
flaburgan
554faa4116 Reorganize steps a bit 2019-05-03 17:15:32 +02:00
Dennis Schubert
caf822f497 Make sure 2fa settings have the right background color
closes #8008
2019-05-01 00:22:04 +02:00
Benjamin Neff
54fd4846c0 Use password to disable 2FA instead of a token
Using token doesn't make much sense when you can generate new tokens
right below.

closes #8006
2019-04-30 22:51:51 +02:00
Benjamin Neff
ecda6eccf6 Remove password reset and sign up link below two factor form
They don't make sense on that page, because at this stage, the user
already has an account and also has already entered their password.

closes #8005
2019-04-30 22:51:11 +02:00
Dennis Schubert
3c06bb2f4c Center <p>s inside formes used as secondary labels
closes #8004
2019-04-30 00:21:43 +02:00
Dennis Schubert
ef137f09f2 Add lock icon to the 2fa OTP field 2019-04-30 00:21:36 +02:00
Benjamin Neff
607659939d Enable paranoid mode for devise
fixes #8001

closes #8003
2019-04-30 00:21:00 +02:00
lislis
9d5b981809 Two factor authentication (#7751) 2019-04-28 23:24:40 +02:00
cmrd Senya
3f74a759b3 Bump diaspora_federation 2019-04-28 19:28:25 +03:00
Jonne Haß
1e827161fe rubocop: increase complexity limits [ci skip] 2019-04-28 16:48:40 +02:00
Benjamin Neff
17af65e22c Allow links with only the diaspora ID to link to a profile
closes #8000
2019-04-28 16:48:31 +02:00
Benjamin Neff
91aae4d755 Fix 500er when calling protocol handler with invalid URL 2019-04-28 16:44:29 +02:00
Benjamin Neff
035b6f39fc Change wording of description in PWA manifest 2019-04-27 19:11:27 +02:00
flaburgan
2073791cee Add a manifest.json file as a first step to make diaspora* a PWA
fixes #7997

closes #7998
2019-04-27 18:00:14 +02:00
flaburgan
5b6cef0679 Remove legacy mobile web-capable 2019-04-27 17:56:51 +02:00
Jonne Haß
d443401361 Stabilize Diaspora::Federation::Entities.build.builds a comment with edited_at
closes #7994
2019-04-26 17:41:25 +02:00
Jonne Haß
a38a93523d Stabilize Diaspora::Federation::Receive.comment.saves the signature data 2019-04-26 17:40:48 +02:00
Benjamin Neff
a28be72e74 Bump other dependency gems 2019-03-30 15:04:33 +01:00
Benjamin Neff
093cca9a76 Bump rails-controller-testing 2019-03-30 15:03:12 +01:00
Benjamin Neff
ccbc65993d Bump rspec-rails 2019-03-30 15:03:12 +01:00
Benjamin Neff
d9d0eb1512 Bump webmock 2019-03-30 15:03:12 +01:00
Benjamin Neff
f8419b14ba Bump shoulda-matchers 2019-03-30 15:03:12 +01:00
Benjamin Neff
290ddbf271 Bump capybara 2019-03-30 15:03:11 +01:00
Benjamin Neff
48c4cabd3f Bump byebug 2019-03-30 15:03:11 +01:00
Benjamin Neff
18d7b38037 Bump rubocop 2019-03-30 15:03:11 +01:00
Benjamin Neff
01468c34dd Bump rb-inotify 2019-03-30 15:03:11 +01:00
Benjamin Neff
7ae2dc6249 Bump asset_sync 2019-03-30 15:03:11 +01:00
Benjamin Neff
6f53f1bc0a Bump will_paginate 2019-03-30 15:03:11 +01:00
Benjamin Neff
5195f7daac Bump rails-timeago 2019-03-30 15:03:11 +01:00
Benjamin Neff
2585fb9b49 Bump hamlit 2019-03-30 15:03:11 +01:00
Benjamin Neff
02617a3562 Bump faraday 2019-03-30 15:03:10 +01:00
Benjamin Neff
0372924b90 Bump omniauth 2019-03-30 15:03:10 +01:00
Benjamin Neff
05472cc4f9 Bump secure_headers 2019-03-30 15:03:10 +01:00
Benjamin Neff
da39750244 Bump nokogiri 2019-03-30 15:03:10 +01:00
Benjamin Neff
3b0f435f69 Bump rails-i18n 2019-03-30 15:03:10 +01:00
Benjamin Neff
adaca8d0a3 Bump handlebars_assets 2019-03-30 15:03:10 +01:00
Benjamin Neff
8a10655f7f Bump mini_magick 2019-03-30 15:01:01 +01:00
Benjamin Neff
c8bef1077d Bump fog-aws 2019-03-30 15:01:01 +01:00
Benjamin Neff
da83456660 Bump carrierwave 2019-03-30 15:01:01 +01:00
Benjamin Neff
b7183d7cee Bump activerecord-import 2019-03-30 15:01:01 +01:00
Benjamin Neff
cd7af6df50 Bump pg 2019-03-30 15:01:01 +01:00
Benjamin Neff
54e44d6d7e Bump uglifier 2019-03-30 15:01:01 +01:00
Benjamin Neff
a63f11bbf4 Bump sidekiq-cron 2019-03-30 15:01:01 +01:00
Benjamin Neff
7b201f4bb9 Bump sidekiq 2019-03-30 15:01:00 +01:00
Benjamin Neff
f4fa7e10bd Bump json 2019-03-30 15:01:00 +01:00
Benjamin Neff
23d637b9a1 Bump unicorn 2019-03-30 15:01:00 +01:00
Benjamin Neff
360780c17f Bump responders 2019-03-30 15:01:00 +01:00
Benjamin Neff
c253272d83 Bump bootstrap-sass 2019-03-30 15:01:00 +01:00
Benjamin Neff
c063f6fa1b Bump devise 2019-03-30 15:01:00 +01:00
Benjamin Neff
94a32b2833 Bump rails 2019-03-30 15:00:54 +01:00
Benjamin Neff
a4031e09e1 Merge branch 'master' into next-minor 2019-02-26 01:02:42 +01:00
Benjamin Neff
663da1ef25 Merge branch 'release/0.7.10.0' 2019-02-26 01:01:51 +01:00
Benjamin Neff
7595168e01 updated 7 locale files [ci skip] 2019-02-26 00:57:43 +01:00
Dennis Schubert
189923040d Merge branch 'release/0.7.10.0' into next-minor 2019-02-19 03:03:51 +01:00
Dennis Schubert
a3a0a1fba9 Fix incorrect bug number in the changelog
Good one, eh? [ci skip]
2019-02-19 03:03:20 +01:00
Benjamin Neff
4687d7e1ea Start 0.7.11.0 cycle 2019-02-19 01:48:11 +01:00
Dennis Schubert
e47d0d9675 Replace dandelion.jpg with a public domain photo
Closes #7972

closes #7976
2019-02-19 01:29:52 +01:00
Benjamin Neff
3ea4396ddb Merge branch 'master' into next-minor 2019-01-14 03:13:44 +01:00
Benjamin Neff
1edcb0013c Merge branch 'release/0.7.9.0' 2019-01-14 03:11:54 +01:00
Benjamin Neff
1925127964 updated 87 locale files [ci skip] 2019-01-14 03:09:05 +01:00
Benjamin Neff
2894984f57 Fix order of posts on tags-stream for tags including 'activity'
closes #7959
2019-01-13 02:17:15 +01:00
Benjamin Neff
71595b4cbd Start 0.7.10.0 cycle 2019-01-07 02:03:06 +01:00
Benjamin Neff
654b524397 Fix typo in changelog for 0.7.9.0 2019-01-06 22:27:15 +01:00
Benjamin Neff
efcaa860ac Revert "Bump bootstrap-switch-rails"
It looks like 3.3.4 is broken :(

Fixes #7940

This reverts commit 5205e3c526.

closes #7955
2019-01-06 22:16:02 +01:00
flaburgan
3f700c3960 Fix photos galley when too many thumbnails by adding a scroll-x
fixes #7942

closes #7943
2019-01-06 22:12:38 +01:00
flaburgan
c8a1f308c6 Rename 'toggle mobile' to 'switch to touch-optimized mode' or 'switch to standard mode'
closes #7926
2019-01-06 22:04:22 +01:00
flaburgan
6804132c15 Do not autofollow back a user you are ignoring
fixes #7808

closes #7913
2019-01-06 22:02:10 +01:00
Hank Grabowski
58d2ce7ba6 Ignore Users in Mobile UI
fixes #7840

closes #7884
2019-01-06 21:55:33 +01:00
CSammy
a21cde4c00 Speed up public stream and remove obsolete indexes
closes #7944
2018-12-28 01:39:49 +01:00
Benjamin Neff
5a0381f832 Merge branch 'master' into next-minor 2018-11-25 22:37:43 +01:00
Benjamin Neff
2d6a68c28f Start 0.7.9.0 cycle
[ci skip]
2018-11-19 00:50:04 +01:00
645 changed files with 15533 additions and 9098 deletions

63
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,63 @@
name: CI
on:
push:
branches:
- develop
- next-minor
- main
- master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- 2.7
- 2.6
db:
- mysql
- postgresql
kind:
- cucumber
- other
env:
DB: ${{ matrix.db }}
RAILS_ENV: test
BUNDLE_WITH: ${{ matrix.db }}
BUNDLE_WITHOUT: development
BUNDLE_FROZEN: true
BUNDLE_DISABLE_SHARED_GEMS: true
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Install system dependencies
run: sudo apt update && sudo apt install -y build-essential curl git gsfonts imagemagick libcurl4-openssl-dev libidn11-dev libmagickwand-dev libssl-dev libxml2-dev libxslt1-dev
- name: Start MySQL
run: sudo systemctl start mysql.service
if: matrix.db == 'mysql'
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Prepare
run: script/ci/prepare.sh
- name: Run tests
run: bin/rake --trace ci:${{ matrix.kind }}
- name: Run Jasmine
run: bin/rake jasmine:ci
timeout-minutes: 2
if: matrix.kind == 'other'

7
.gitignore vendored
View File

@@ -9,6 +9,7 @@ app/views/terms/terms.*
app/assets/images/custom/
# Configuration files
config/diaspora.toml
config/diaspora.yml
config/initializers/secret_token.rb
.bundle
@@ -81,3 +82,9 @@ diaspora.iml
# WebTranslateIt
.wti
# MacOS
/__MACOSX/
# yarn
node_modules

View File

@@ -1,24 +1,24 @@
require: rubocop-rails
AllCops:
TargetRubyVersion: 2.3
TargetRubyVersion: 2.6
NewCops: enable
Exclude:
- "bin/**/*"
- "db/schema.rb"
- "config/locales/cldr/plurals.rb"
Rails:
Enabled: true
# Disable for rails 4
Rails/HttpPositionalArguments:
Enabled: false
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Layout/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
Metrics/MethodLength:
Max: 20
# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
@@ -26,11 +26,17 @@ Metrics/ClassLength:
Max: 1500
Metrics/ModuleLength:
Max: 1500
# Raise AbcSize from 15 to 20
# Raise complexity metrics
Metrics/AbcSize:
Max: 20
Metrics/CyclomaticComplexity:
Max: 20
Metrics/PerceivedComplexity:
Max: 20
# Some blocks are longer.
Metrics/BlockLength:
ExcludedMethods:
@@ -51,13 +57,19 @@ Layout/SpaceAroundEqualsInParameterDefault:
# are needed.
Style/StringLiterals:
EnforcedStyle: double_quotes
Exclude:
# These files are generated by rails, so it's best to keep them close to the original for smaller diffs
- "config/application.rb"
- "config/boot.rb"
- "config/environment.rb"
- "config/environments/*.rb"
# We do not need to support Ruby 1.9, so this is good to use.
Style/SymbolArray:
Enabled: true
# Most readable form.
Layout/AlignHash:
Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
@@ -79,7 +91,6 @@ Style/CollectionMethods:
# inject seems more common in the community.
reduce: "inject"
# Either allow this style or don't. Marking it as safe with parenthesis
# is silly. Let's try to live without them for now.
Style/ParenthesesAroundCondition:
@@ -88,7 +99,7 @@ Lint/AssignmentInCondition:
AllowSafeAssignment: false
# A specialized exception class will take one or more arguments and construct the message from it.
# So both variants make sense.
# So both variants make sense.
Style/RaiseArgs:
Enabled: false
@@ -106,7 +117,7 @@ Style/SignalException:
# Suppressing exceptions can be perfectly fine, and be it to avoid to
# explicitly type nil into the rescue since that's what you want to return,
# or suppressing LoadError for optional dependencies
Lint/HandleExceptions:
Lint/SuppressedException:
Enabled: false
Layout/SpaceInsideBlockBraces:
@@ -151,11 +162,11 @@ Lint/ShadowingOuterLocalVariable:
# Check with yard instead.
Style/Documentation:
Enabled: false
Enabled: false
# This is just silly. Calling the argument `other` in all cases makes no sense.
Naming/BinaryOperatorParameterName:
Enabled: false
Enabled: false
# There are valid cases, for example debugging Cucumber steps,
# also they'll fail CI anyway
@@ -169,3 +180,11 @@ Style/NumericPredicate:
# Reset some HoundCI changes back to Rubocop defaults
Layout/DotPosition:
EnforcedStyle: leading
# Not enabled by default but good
Style/HashEachMethods:
Enabled: true
# It makes more sense to allow to structure and group them how it makes sense in the code
Style/AccessorGrouping:
Enabled: false

View File

@@ -1 +1 @@
2.4
2.7

View File

@@ -1,40 +0,0 @@
language: ruby
rvm:
- 2.4.2
- 2.3.5
env:
- DB=postgresql BUILD_TYPE=cucumber
- DB=mysql BUILD_TYPE=cucumber
- DB=postgresql BUILD_TYPE=other
- DB=mysql BUILD_TYPE=other
sudo: false
cache:
bundler: true
directories:
- app/assets/images
- tmp/cache/assets
branches:
only:
- 'master'
- 'next-minor'
- 'develop'
before_install:
- script/ci/prepare.sh
- mkdir travis-phantomjs
- wget http://cifiles.diasporafoundation.org/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
script: "bin/rake --trace ci:travis:${BUILD_TYPE}"
notifications:
irc:
channels:
- secure: YvYkeTAw+5oOl/RaXVwu7JkKGNWPoFosNQRmLvJkBFbWzZ1s5LZD1u3+Qj819bT3lGzJu9pxmJg765IRYrGWmBi4mcAV3dpO6qowVdFTcorf0JsnLw3Kvkga9rrDunsRNr21KTAQqHOO5mKUzw9DtMzd52BiWuZwIj3xcl72gQI=
template:
- "%{repository_slug}#%{commit} (%{branch} - %{commit_subject}): %{message} %{build_url}"

View File

@@ -1,3 +1,171 @@
# 0.7.18.2
To avoid potential security issues, diaspora\* now makes sure that ImageMagick image processing always runs with a restricted `policy.xml`, regardless of the global system settings.
# 0.7.18.1
## Bug fixes
* Update binstubs to fix diaspora\* being unable to start when multiple bundler versions were available [#8392](https://github.com/diaspora/diaspora/pull/8392/commits/bfd42a1914a99ac9c71ecb16bbf6fa5bb118148a)
# 0.7.18.0
## Refactor
* Fix order-dependent jasmine test failures and switch to random order [#8333](https://github.com/diaspora/diaspora/pull/8333)
* Get rid of some uses of "execute\_script" in feature specs [#8331](https://github.com/diaspora/diaspora/pull/8331)
* Fix deprecation warnings for sidekiq 7.0 [#8359](https://github.com/diaspora/diaspora/pull/8359)
* Remove entypo-rails dependency to prepare for rails 6 [#8361](https://github.com/diaspora/diaspora/pull/8361)
* Remove compass-rails dependency which is not supported anymore [#8362](https://github.com/diaspora/diaspora/pull/8362)
* Switch to sassc-rails which speeds up `assets:precompile` a lot [#8362](https://github.com/diaspora/diaspora/pull/8362)
* Remove markerb dependency which doesn't exist anymore [#8365](https://github.com/diaspora/diaspora/pull/8365)
* Upgrade to rails 6.1 [#8366](https://github.com/diaspora/diaspora/pull/8366)
* Update the suggested Ruby version to 2.7. If you run into trouble during the update and you followed our installation guides, run `rvm install 2.7`. [#8366](https://github.com/diaspora/diaspora/pull/8366)
* Upgrade to bundler 2 [#8366](https://github.com/diaspora/diaspora/pull/8366)
* Stop checking `/.well-known/host-meta`, check for `/.well-known/nodeinfo` instead [#8377](https://github.com/diaspora/diaspora/pull/8377)
* Handle NodeInfo timeouts gracefully [#8380](https://github.com/diaspora/diaspora/pull/8380)
## Bug fixes
* Fix that no mails were sent after photo export [#8365](https://github.com/diaspora/diaspora/pull/8365)
* Fix people with quotes in the name causing issues with mail sender [#8365](https://github.com/diaspora/diaspora/pull/8365)
## Features
* Render posts and comments as HTML in HTML mails [#8365](https://github.com/diaspora/diaspora/pull/8365)
* Add NodeInfo 2.1 support and also read newer versions of NodeInfo [#8379](https://github.com/diaspora/diaspora/pull/8379)
# 0.7.17.0
## Security
* Bump Rails to 5.2.7 to address [CVE-2022-22577](https://discuss.rubyonrails.org/t/cve-2022-22577-possible-xss-vulnerability-in-action-pack/80533) and [CVE-2022-27777](https://discuss.rubyonrails.org/t/cve-2022-27777-possible-xss-vulnerability-in-action-view-tag-helpers/80534) [#8350](https://github.com/diaspora/diaspora/pull/8350)
* Do not allow the user to mass assign their own password and 2fa settings alongside other parameters. Reported by Breno Vitório (@brenu) - thank you! [#8351](https://github.com/diaspora/diaspora/pull/8351)
## Bug fixes
* Don't suggest to retry exports on failure [#8343](https://github.com/diaspora/diaspora/pull/8343)
# 0.7.16.0
## Security
* Update rails to fix [CVE-2022-23633](https://github.com/advisories/GHSA-wh98-p28r-vrc9) [#8336](https://github.com/diaspora/diaspora/pull/8336)
## Refactor
* Cache local posts/comments count for statistics [#8241](https://github.com/diaspora/diaspora/pull/8241)
* Fix html-syntax in some handlebars templates [#8251](https://github.com/diaspora/diaspora/pull/8251)
* Remove `chat_enabled` flag from archive export [#8265](https://github.com/diaspora/diaspora/pull/8265)
* Change thumbnails in image slideshow to squares [#8275](https://github.com/diaspora/diaspora/pull/8275)
* Replace uglifier with terser for JS compression [#8268](https://github.com/diaspora/diaspora/pull/8268)
## Bug fixes
* Ensure the log folder exists [#8287](https://github.com/diaspora/diaspora/pull/8287)
* Limit name length in header [#8313](https://github.com/diaspora/diaspora/pull/8313)
* Fix fallback avatar in hovercards [#8316](https://github.com/diaspora/diaspora/pull/8316)
* Use old person private key for export if relayable author migrated away [#8310](https://github.com/diaspora/diaspora/pull/8310)
## Features
* Add tags to tumblr posts [#8244](https://github.com/diaspora/diaspora/pull/8244)
* Add blocks to the archive export [#8263](https://github.com/diaspora/diaspora/pull/8263)
* Allow points and dashes in the username [#8266](https://github.com/diaspora/diaspora/pull/8266)
* Add support for footnotes in markdown [#8277](https://github.com/diaspora/diaspora/pull/8277)
* Send `AccountMigration` if receiving message to a migrated account [#8288](https://github.com/diaspora/diaspora/pull/8288)
* Add podmin mail address to the footer [#8242](https://github.com/diaspora/diaspora/pull/8242)
* Add username to password-reset mail [#8037](https://github.com/diaspora/diaspora/pull/8037)
* Resend account migration and deletion for closed recipients [#8309](https://github.com/diaspora/diaspora/pull/8309)
* Add sharing status to hovercards [#8317](https://github.com/diaspora/diaspora/pull/8317)
* Migrate photo URLs and cleanup old uploaded photos [#8314](https://github.com/diaspora/diaspora/pull/8314)
# 0.7.15.0
## Refactor
* Replaced some `http://` links in the UI with their `https://` counterparts [#8207](https://github.com/diaspora/diaspora/pull/8207)
* Testing: Replaced phantomjs with headless Chrome/Chromium [#8234](https://github.com/diaspora/diaspora/pull/8234)
## Bug fixes
* Update comment counter when weleting a comment in the Single Post View [#7938](https://github.com/diaspora/diaspora/pull/7938)
* Link diaspora only poduptime list [#8174](https://github.com/diaspora/diaspora/pull/8174)
* Delete a user's invitation code during account deletion [#8202](https://github.com/diaspora/diaspora/pull/8202)
* Bump mimemagic [#8231](https://github.com/diaspora/diaspora/pull/8231)
* Removed support for defunct Uni Heidelberg OSM tile server, Mapbox is now required if you want to show maps [#8215](https://github.com/diaspora/diaspora/pull/8215)
* Render only two fractional digits in the posts per user/day admin statistics [#8227](https://github.com/diaspora/diaspora/pull/8227)
* Make aspect dropdowns scrollable [#8213](https://github.com/diaspora/diaspora/pull/8213)
* Fix `Photo#ownserhip_of_status_message` validation [#8214](https://github.com/diaspora/diaspora/pull/8214)
## Features
* Support and recommend TOML as configuration format [#8132](https://github.com/diaspora/diaspora/pull/8132)
# 0.7.14.0
## Refactor
* Update the suggested Ruby version to 2.6. If you run into trouble during the update and you followed our installation guides, run `rvm install 2.6`. [#7929](https://github.com/diaspora/diaspora/pull/7929)
## Bug fixes
* Don't link to deleted users in admin user stats [#8063](https://github.com/diaspora/diaspora/pull/8063)
* Properly validate a profile's gender field length instead of failing with a database error. [#8127](https://github.com/diaspora/diaspora/pull/8127)
## Features
# 0.7.13.0
## Security
* Fixes [USN-4274-1](https://usn.ubuntu.com/4274-1/), a potential Denial-of-Service vulnerability in Nokogiri. [#8108](https://github.com/diaspora/diaspora/pull/8108)
## Refactor
* Set better example values for unicorn stdout/stderr log settings [#8058](https://github.com/diaspora/diaspora/pull/8058)
* Replace dependency on rails-assets.org with custom gems cache at gems.diasporafoundation.org [#8087](https://github.com/diaspora/diaspora/pull/8087)
## Bug fixes
* Fix error while trying to fetch some sites with invalid OpenGraph data [#8049](https://github.com/diaspora/diaspora/pull/8049)
* Don't show sign up link on mobile when registrations are disabled [#8060](https://github.com/diaspora/diaspora/pull/8060)
## Features
* Add cronjob to cleanup pending photos which were never posted [#8041](https://github.com/diaspora/diaspora/pull/8041)
# 0.7.12.0
## Refactor
* Harmonize markdown titles sizes [#8029](https://github.com/diaspora/diaspora/pull/8029)
## Bug fixes
* Improve handling of mixed case hostnames while fetching OpenGraph data [#8021](https://github.com/diaspora/diaspora/pull/8021)
* Fix "remember me" with two factor authentication enabled [#8031](https://github.com/diaspora/diaspora/pull/8031)
## Features
* Add line mentioning diaspora\* on the splash page [#7966](https://github.com/diaspora/diaspora/pull/7966)
* Improve communication about signing up on closed pods [#7896](https://github.com/diaspora/diaspora/pull/7896)
# 0.7.11.0
## Refactor
* Enable paranoid mode for devise [#8003](https://github.com/diaspora/diaspora/pull/8003)
* Refactor likes cucumber test [#8002](https://github.com/diaspora/diaspora/pull/8002)
## Bug fixes
* Fix old photos without remote url for export [#8012](https://github.com/diaspora/diaspora/pull/8012)
## Features
* Add a manifest.json file as a first step to make diaspora\* a Progressive Web App [#7998](https://github.com/diaspora/diaspora/pull/7998)
* Allow `web+diaspora://` links to link to a profile with only the diaspora ID [#8000](https://github.com/diaspora/diaspora/pull/8000)
* Support TOTP two factor authentication [#7751](https://github.com/diaspora/diaspora/pull/7751)
# 0.7.10.0
## Refactor
* Replace dandelion.jpg with a public domain photo [#7976](https://github.com/diaspora/diaspora/pull/7976)
## Bug fixes
* Fix incorrect post sorting on tag streams and tag searches for tags containing the word "activity" [#7959](https://github.com/diaspora/diaspora/issues/7959)
# 0.7.9.0
## Refactor
* Improve public stream performance and cleanup unused indexes [#7944](https://github.com/diaspora/diaspora/pull/7944)
* Improve wording of "Toggle mobile" [#7926](https://github.com/diaspora/diaspora/pull/7926)
## Bug fixes
* Do not autofollow back a user you are ignoring [#7913](https://github.com/diaspora/diaspora/pull/7913)
* Fix photos gallery when too many thumbnails are shown [#7943](https://github.com/diaspora/diaspora/pull/7943)
* Fix extended profile visibility switch showing the wrong state [#7955](https://github.com/diaspora/diaspora/pull/7955)
## Features
* Support ignore users on mobile [#7884](https://github.com/diaspora/diaspora/pull/7884)
# 0.7.8.0
## Refactor

213
Gemfile
View File

@@ -2,113 +2,112 @@
source "https://rubygems.org"
gem "rails", "5.1.6"
gem "rails", "6.1.6.1"
# Legacy Rails features, remove me!
# responders (class level)
gem "responders", "2.4.0"
gem "responders", "3.0.1"
# Appserver
gem "unicorn", "5.4.1", require: false
gem "unicorn-worker-killer", "0.4.4"
gem "unicorn", "6.1.0", require: false
gem "unicorn-worker-killer", "0.4.5"
# Federation
gem "diaspora_federation-json_schema", "0.2.5"
gem "diaspora_federation-rails", "0.2.5"
gem "diaspora_federation-json_schema", "0.2.8"
gem "diaspora_federation-rails", "0.2.8"
# API and JSON
gem "acts_as_api", "1.0.1"
gem "json", "2.1.0"
gem "json-schema", "2.8.1"
gem "json", "2.6.2"
gem "json-schema", "3.0.0"
# Authentication
gem "devise", "4.5.0"
gem "devise", "4.8.1"
gem "devise_lastseenable", "0.0.6"
gem "devise-two-factor", "4.0.2"
gem "rqrcode", "2.1.1"
# Captcha
gem "simple_captcha2", "0.4.3", require: "simple_captcha"
gem "simple_captcha2", "0.5.0", require: "simple_captcha"
# Background processing
gem "redis", "3.3.5" # Pinned to 3.3.x because of https://github.com/antirez/redis/issues/4272
gem "sidekiq", "5.2.3"
gem "redis", "4.7.0"
gem "sidekiq", "6.5.1"
# Scheduled processing
gem "sidekiq-cron", "1.0.4"
gem "sidekiq-cron", "1.6.0"
# Compression
gem "uglifier", "4.1.19"
gem "terser", "1.1.10"
# Configuration
gem "configurate", "0.3.1"
gem "configurate", "0.5.0"
gem "toml-rb", "2.1.2"
# Cross-origin resource sharing
gem "rack-cors", "1.0.2", require: "rack/cors"
gem "rack-cors", "1.1.1", require: "rack/cors"
# CSS
gem "autoprefixer-rails", "8.6.5"
gem "bootstrap-sass", "3.3.7"
gem "bootstrap-switch-rails", "3.3.4"
gem "compass-rails", "3.1.0"
gem "sass-rails", "5.0.7"
gem "sprockets-rails", "3.2.1"
gem "autoprefixer-rails", "10.4.7.0"
gem "bootstrap-sass", "3.4.1"
gem "bootstrap-switch-rails", "3.3.3" # 3.3.4 and 3.3.5 is broken, see https://github.com/Bttstrp/bootstrap-switch/issues/691
gem "sassc-rails", "2.1.2"
gem "sprockets-rails", "3.4.2"
# Database
group :mysql, optional: true do
gem "mysql2", "0.5.2"
gem "mysql2", "0.5.4"
end
group :postgresql, optional: true do
gem "pg", "1.1.3"
gem "pg", "1.4.1"
end
gem "activerecord-import", "0.27.0"
gem "activerecord-import", "1.4.0"
# File uploading
gem "carrierwave", "1.2.3"
gem "fog-aws", "3.3.0"
gem "mini_magick", "4.9.2"
gem "carrierwave", "2.2.2"
gem "fog-aws", "3.14.0"
gem "mini_magick", "4.11.0"
# GUID generation
gem "uuid", "2.3.9"
# Icons
gem "entypo-rails", "3.0.0"
# JavaScript
gem "handlebars_assets", "0.23.2"
gem "jquery-rails", "4.3.3"
gem "js-routes", "1.4.4"
gem "js_image_paths", "0.1.1"
gem "handlebars_assets", "0.23.9"
gem "jquery-rails", "4.5.0"
gem "js_image_paths", "0.2.0"
gem "js-routes", "2.2.4"
source "https://rails-assets.org" do
gem "rails-assets-jquery", "3.3.1" # Should be kept in sync with jquery-rails
source "https://gems.diasporafoundation.org" do
gem "rails-assets-jquery", "3.6.0" # Should be kept in sync with jquery-rails
gem "rails-assets-jquery.ui", "1.11.4"
gem "rails-assets-highlightjs", "9.12.0"
gem "rails-assets-markdown-it", "8.4.2"
gem "rails-assets-markdown-it-hashtag", "0.4.0"
gem "rails-assets-markdown-it-diaspora-mention", "1.2.0"
gem "rails-assets-markdown-it-sanitizer", "0.4.3"
gem "rails-assets-markdown-it-footnote", "3.0.3"
gem "rails-assets-markdown-it-hashtag", "0.4.0"
gem "rails-assets-markdown-it--markdown-it-for-inline", "0.1.1"
gem "rails-assets-markdown-it-sanitizer", "0.4.3"
gem "rails-assets-markdown-it-sub", "1.0.0"
gem "rails-assets-markdown-it-sup", "1.0.0"
gem "rails-assets-backbone", "1.3.3"
gem "rails-assets-bootstrap", "3.4.1"
gem "rails-assets-bootstrap-markdown", "2.10.0"
gem "rails-assets-corejs-typeahead", "1.2.1"
gem "rails-assets-fine-uploader", "5.13.0"
@@ -129,69 +128,66 @@ gem "markdown-it-html5-embed", "1.0.0"
gem "http_accept_language", "2.1.1"
gem "i18n-inflector-rails", "1.0.7"
gem "rails-i18n", "5.1.2"
# Mail
gem "markerb", "1.1.0"
gem "rails-i18n", "6.0.0"
# Map
gem "leaflet-rails", "1.3.1"
gem "leaflet-rails", "1.7.0"
# Parsing
gem "nokogiri", "1.8.5"
gem "open_graph_reader", "0.6.2" # also update User-Agent in features/support/webmock.rb
gem "redcarpet", "3.4.0"
gem "ruby-oembed", "0.12.0"
gem "nokogiri", "1.13.7"
gem "open_graph_reader", "0.7.2" # also update User-Agent in features/support/webmock.rb and open_graph_cache_spec.rb
gem "redcarpet", "3.5.1"
gem "ruby-oembed", "0.16.1"
gem "twitter-text", "1.14.7"
# RTL support
gem "string-direction", "1.2.1"
gem "string-direction", "1.2.2"
# Security Headers
gem "secure_headers", "6.0.0"
gem "secure_headers", "6.3.3"
# Services
gem "omniauth", "1.8.1"
gem "omniauth-tumblr", "1.2"
gem "omniauth-twitter", "1.4.0"
gem "omniauth-wordpress", "0.2.2"
gem "twitter", "6.2.0"
gem "omniauth", "2.1.0"
gem "omniauth-rails_csrf_protection", "1.0.1"
gem "omniauth-tumblr", "1.2"
gem "omniauth-twitter", "1.4.0"
gem "omniauth-wordpress", "0.2.2"
gem "twitter", "7.0.0"
# OpenID Connect
gem "openid_connect", "1.1.6"
gem "openid_connect", "1.3.0"
# Serializers
gem "active_model_serializers", "0.9.7"
gem "active_model_serializers", "0.9.8"
# XMPP chat dependencies
gem "diaspora-prosody-config", "0.0.7"
gem "rails-assets-diaspora_jsxc", "0.1.5.develop.7", source: "https://rails-assets.org"
gem "rails-assets-diaspora_jsxc", "0.1.5.develop.7", source: "https://gems.diasporafoundation.org"
# Tags
gem "acts-as-taggable-on", "6.0.0"
gem "acts-as-taggable-on", "9.0.1"
# URIs and HTTP
gem "addressable", "2.5.2", require: "addressable/uri"
gem "faraday", "0.15.3"
gem "faraday_middleware", "0.12.2"
gem "faraday-cookie_jar", "0.0.6"
gem "typhoeus", "1.3.1"
gem "addressable", "2.8.0", require: "addressable/uri"
gem "faraday", "0.17.5"
gem "faraday-cookie_jar", "0.0.7"
gem "faraday_middleware", "0.14.0"
gem "typhoeus", "1.4.0"
# Views
gem "gon", "6.2.1"
gem "hamlit", "2.9.1"
gem "gon", "6.4.0"
gem "hamlit", "2.16.0"
gem "mobile-fu", "1.4.0"
gem "rails-timeago", "2.16.0"
gem "will_paginate", "3.1.6"
gem "rails-timeago", "2.20.0"
gem "will_paginate", "3.3.1"
# Logging
@@ -199,16 +195,16 @@ gem "logging-rails", "0.6.0", require: "logging/rails"
# Reading and writing zip files
gem "rubyzip", "1.2.2", require: "zip"
gem "rubyzip", "2.3.2", require: "zip"
# Prevent occasions where minitest is not bundled in
# packaged versions of ruby. See following issues/prs:
# https://github.com/gitlabhq/gitlabhq/issues/3826
# https://github.com/gitlabhq/gitlabhq/pull/3852
# https://github.com/discourse/discourse/pull/238
gem "minitest"
gem "minitest", "5.15.0"
gem "versionist", "1.7.0"
gem "versionist", "2.0.1"
# Windows and OSX have an execjs compatible runtime built-in, Linux users should
# install Node.js or use "therubyracer".
@@ -234,84 +230,71 @@ group :production do # we don"t install these on travis to speed up test runs
# Third party asset hosting
gem "asset_sync", "2.5.0", require: false
gem "asset_sync", "2.15.2", require: false
end
group :development do
# Automatic test runs
gem "guard", "2.15.0", require: false
gem "guard-rspec", "4.7.3", require: false
gem "guard-rubocop", "1.3.0", require: false
gem "rb-fsevent", "0.10.3", require: false
gem "rb-inotify", "0.9.10", require: false
# Linters
gem "haml_lint", "0.28.0", require: false
gem "pronto", "0.9.5", require: false
gem "pronto-eslint", "0.9.1", require: false
gem "pronto-haml", "0.9.0", require: false
gem "pronto-rubocop", "0.9.1", require: false
gem "pronto-scss", "0.9.1", require: false
gem "rubocop", "0.60.0", require: false
# Preloading environment
gem "spring", "2.0.2"
gem "spring-commands-rspec", "1.0.4"
gem "spring-commands-cucumber", "1.0.1"
gem "haml_lint", "0.40.0", require: false
gem "pronto", "0.11.0", require: false
gem "pronto-eslint", "0.11.0", require: false
gem "pronto-haml", "0.11.1", require: false
gem "pronto-rubocop", "0.11.1", require: false
gem "pronto-scss", "0.11.0", require: false
gem "rubocop", "0.93.1", require: false
gem "rubocop-rails", "2.9.1", require: false
# Debugging
gem "pry"
gem "pry-byebug"
# test coverage
gem "simplecov", "0.16.1", require: false
gem "simplecov", "0.21.2", require: false
gem "turbo_dev_assets", "0.0.2"
gem "listen", "3.7.1"
end
group :test do
# RSpec (unit tests, some integration tests)
gem "fixture_builder", "0.5.2.rc3"
gem "fuubar", "2.3.2"
gem "json-schema-rspec", "0.0.4"
gem "fixture_builder", "0.5.2"
gem "fuubar", "2.5.1"
gem "rspec-json_expectations", "~> 2.1"
# Cucumber (integration tests)
gem "capybara", "3.11.1"
gem "database_cleaner", "1.7.0"
gem "poltergeist", "1.18.1"
gem "apparition", "0.6.0"
gem "capybara", "3.35.3"
gem "database_cleaner-active_record", "2.0.1"
gem "cucumber-api-steps", "0.14", require: false
# General helpers
gem "factory_girl_rails", "4.8.0"
gem "shoulda-matchers", "3.1.2"
gem "timecop", "0.9.1"
gem "webmock", "3.4.2", require: false
gem "factory_girl_rails", "4.9.0"
gem "shoulda-matchers", "4.5.1"
gem "timecop", "0.9.5"
gem "webmock", "3.14.0", require: false
gem "diaspora_federation-test", "0.2.5"
# Coverage
gem "coveralls", "0.8.22", require: false
gem "diaspora_federation-test", "0.2.8"
end
group :development, :test do
# RSpec (unit tests, some integration tests)
gem "rspec-rails", "3.8.1"
gem "rspec-rails", "5.1.2"
# Cucumber (integration tests)
gem "cucumber-rails", "1.6.0", require: false
gem "cucumber-rails", "2.5.1", require: false
# Jasmine (client side application tests (JS))
gem "jasmine", "3.3.0"
gem "chrome_remote", "0.3.0"
gem "jasmine", "3.10.0"
gem "jasmine-jquery-rails", "2.0.3"
gem "rails-assets-jasmine-ajax", "3.4.0", source: "https://rails-assets.org"
gem "rails-assets-jasmine-ajax", "4.0.0", source: "https://gems.diasporafoundation.org"
gem "sinon-rails", "1.15.0"
# For `assigns` in controller specs
gem "rails-controller-testing", "1.0.2"
gem "rails-controller-testing", "1.0.5"
end

File diff suppressed because it is too large Load Diff

View File

@@ -1,29 +0,0 @@
# frozen_string_literal: true
guard :rspec, cmd: "bin/spring rspec", all_on_start: false, all_after_pass: false do
watch(/^spec\/.+_spec\.rb$/)
watch(/^lib\/(.+)\.rb$/) {|m| "spec/lib/#{m[1]}_spec.rb" }
watch(/spec\/spec_helper.rb/) { "spec" }
# Rails example
watch(/^spec\/.+_spec\.rb$/)
watch(/^app\/(.+)\.rb$/) {|m| "spec/#{m[1]}_spec.rb" }
watch(/^lib\/(.+)\.rb$/) {|m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) {|m|
["spec/routing/#{m[1]}_routing_spec.rb",
"spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb",
"spec/acceptance/#{m[1]}_spec.rb"]
}
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch("spec/spec_helper.rb") { "spec" }
watch("config/routes.rb") { "spec/routing" }
watch("app/controllers/application_controller.rb") { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) {|m| "spec/requests/#{m[1]}_spec.rb" }
end
guard :rubocop, all_on_start: false, keep_failed: false do
watch(/(?:app|config|db|lib|features|spec)\/.+\.rb$/)
watch(/(config.ru|Gemfile|Guardfile|Rakefile)$/)
end

View File

@@ -1,13 +1,6 @@
# diaspora\*
### A privacy-aware, distributed, open source social network
**master:** [![Build Status master](https://secure.travis-ci.org/diaspora/diaspora.svg?branch=master)](http://travis-ci.org/diaspora/diaspora)
**next-minor:** [![Build Status next-minor](https://secure.travis-ci.org/diaspora/diaspora.svg?branch=next-minor)](http://travis-ci.org/diaspora/diaspora)
[![Coverage Status next-minor](https://coveralls.io/repos/github/diaspora/diaspora/badge.svg?branch=next-minor)](https://coveralls.io/github/diaspora/diaspora?branch=next-minor)|
**develop:** [![Build Status develop](https://secure.travis-ci.org/diaspora/diaspora.svg?branch=develop)](http://travis-ci.org/diaspora/diaspora)
[![Coverage Status develop](https://coveralls.io/repos/github/diaspora/diaspora/badge.svg?branch=develop)](https://coveralls.io/github/diaspora/diaspora?branch=develop) |
[![Code Climate](https://codeclimate.com/github/diaspora/diaspora/badges/gpa.svg)](https://codeclimate.com/github/diaspora/diaspora)
[Project site](https://diasporafoundation.org) |
[Wiki](https://wiki.diasporafoundation.org) |
[Bugtracker](https://github.com/diaspora/diaspora/issues) |
@@ -17,7 +10,7 @@
## Installation
You don't have to install diaspora\* to use the network. There are many servers connected to diaspora\*s network which are open to anyone, and you can create an account on one of these servers. Have a look at our [tips for finding a home](https://wiki.diasporafoundation.org/Choosing_a_pod), or you can just go straight to the [list of open servers](http://podupti.me) to sign up.
You don't have to install diaspora\* to use the network. There are many servers connected to diaspora\*s network which are open to anyone, and you can create an account on one of these servers. Have a look at our [tips for finding a home](https://wiki.diasporafoundation.org/Choosing_a_pod), or you can just go straight to the [list of open servers](https://diaspora.fediverse.observer) to sign up.
Want to own your data and install diaspora\*? Whether you just want to try it out, want to install it on your server or want to contribute and need a development setup, our [installation guides](https://wiki.diasporafoundation.org/Installation) will get you started!
@@ -35,4 +28,4 @@ Everyone interacting in diasporas codebases, issue trackers, chat rooms, the
## Security
Found a security issue? Please disclose it responsibly. We have a team of developers listening to [security@diasporafoundation.org](mailto:security@diasporafoundation.org). The PGP fingerprint is [AB0D AB02 0FC5 D398 03AB 3CE1 6F70 243F 27AD 886A](https://pgp.mit.edu/pks/lookup?op=get&search=0x6F70243F27AD886A).
See [`SECURITY.md`](/SECURITY.md) for instructions on how to responsibly report a security vulnerability.

9
SECURITY.md Normal file
View File

@@ -0,0 +1,9 @@
# Security Policy
## Supported Versions
We support the latest stable release, as well as the current state of the `next-minor` and `develop` branches. Security issues for older releases are out of scope.
## Reporting a Vulnerability
Found a security issue? Please disclose it responsibly. We have a team of developers listening to [security@diasporafoundation.org](mailto:security@diasporafoundation.org). The PGP fingerprint is [AB0D AB02 0FC5 D398 03AB 3CE1 6F70 243F 27AD 886A](https://pgp.mit.edu/pks/lookup?op=get&search=0x6F70243F27AD886A).

View File

@@ -1,11 +1,14 @@
//= link_tree ../images
//= link main.js
//= link mobile/mobile.js
//= link contact-list.js
//= link jquery3.js
//= link jquery_ujs.js
//= link main.js
//= link jsxc.js
//= link bookmarklet.js
//= link mobile/bookmarklet.js
//= link mobile/mobile.js
//= link error_pages.css
//= link admin.css
//= link error_pages.css
//= link rtl.css

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -44,7 +44,7 @@ Handlebars.registerHelper('linkToPerson', function(context, block) {
// relationship indicator for profile page
Handlebars.registerHelper("sharingMessage", function(person) {
var i18nScope = "people.helper.is_not_sharing";
var icon = "circle";
var icon = "entypo-record";
if( person.is_sharing ) {
i18nScope = "people.helper.is_sharing";
icon = "entypo-check";

View File

@@ -1,25 +1,23 @@
(function() {
app.helpers.locations = {
getTiles: function() {
// If the mapbox option is enabled in the diaspora.yml, the mapbox tiles with the podmin's credentials are used.
// If the mapbox option is enabled in the diaspora.toml, the mapbox tiles with the podmin's credentials are used.
if (gon.appConfig.map.mapbox.enabled) {
return L.tileLayer("https://api.mapbox.com/styles/v1/{style}/tiles/256/{z}/{x}/{y}?access_token={accessToken}", {
accessToken: gon.appConfig.map.mapbox.access_token,
style: gon.appConfig.map.mapbox.style,
attribution: "Map data &copy; <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
"<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
maxZoom: 18
});
return L.tileLayer(
"https://api.mapbox.com/styles/v1/{style}/tiles/256/{z}/{x}/{y}?access_token={accessToken}",
{
accessToken: gon.appConfig.map.mapbox.access_token,
style: gon.appConfig.map.mapbox.style,
attribution:
"Map data &copy; <a href='https://openstreetmap.org'>OpenStreetMap</a> contributors, " +
"<a href='http://opendatacommons.org/licenses/dbcl/1.0/'>Open Database License, ODbL 1.0</a>, " +
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
maxZoom: 18,
tileSize: 512,
zoomOffset: -1
}
);
}
// maptiles from the Heidelberg University are used by default.
return L.tileLayer("http://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}", {
attribution: "Map data &copy; <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
"rendering <a href='http://giscience.uni-hd.de/'>" +
"GIScience Research Group @ Heidelberg University</a>",
maxZoom: 18
});
}
};
})();

View File

@@ -16,6 +16,9 @@
typographer: true
});
var footnote = window.markdownitFootnote;
md.use(footnote);
var inlinePlugin = window.markdownitForInline;
md.use(inlinePlugin, "utf8_symbols", "text", function (tokens, idx) {
tokens[idx].content = tokens[idx].content.replace(/<->/g, "↔")
@@ -40,7 +43,7 @@
var hashtagPlugin = window.markdownitHashtag;
md.use(hashtagPlugin, {
// compare tag_text_regexp in app/models/acts_as_taggable_on-tag.rb
// compare tag_text_regexp in config/initializers/acts_as_taggable_on.rb
hashtagRegExp: "[" + PosixBracketExpressions.word +
"\\u055b" + // Armenian emphasis mark
"\\u055c" + // Armenian exclamation mark

View File

@@ -85,6 +85,10 @@ app.models.Post.Interactions = Backbone.Model.extend({
});
},
removedComment: function() {
this.set({"comments_count": this.get("comments_count") - 1});
},
reshare : function(){
var interactions = this;

View File

@@ -69,7 +69,7 @@ app.models.Stream = Backbone.Collection.extend({
},
sortOrder : function() {
return /activity/.test(this.basePath()) ? "interactedAt" : "createdAt";
return /^\/activity/.test(this.basePath()) ? "interactedAt" : "createdAt";
},
/* This function is for adding a large number of posts one by one.

View File

@@ -16,10 +16,8 @@ app.views.AspectMembership = app.views.Base.extend({
},
events: {
"click ul.aspect_membership.dropdown-menu > li.aspect_selector"
: "_clickHandler",
"keypress ul.aspect_membership.dropdown-menu > li.aspect_selector"
: "_clickHandler"
"click ul.aspect-membership.dropdown-menu > li.aspect_selector": "_clickHandler",
"keypress ul.aspect-membership.dropdown-menu > li.aspect_selector": "_clickHandler"
},
initialize: function(opts) {

View File

@@ -135,7 +135,10 @@ app.views.CommentStream = app.views.Base.extend({
},
removeComment: function(comment) {
this.$("#" + comment.get("guid")).closest(".comment.media").remove();
var result = this.$("#" + comment.get("guid")).closest(".comment.media").remove();
if (result.hasClass("deleting")) {
this.model.interactions.removedComment();
}
},
expandComments: function(evt){

View File

@@ -41,7 +41,7 @@ app.views.Gallery = app.views.Base.extend({
if (image.naturalHeight > window.innerHeight && image.naturalHeight > image.naturalWidth * 2) {
image.classList.add("too-tall");
} else {
var margins = 95; // Margins are 80px for thumbnails height and 15px for top image margin
var margins = 110; // Margins are 80px for thumbnails height and 15px for top image margin + scroll-x height
image.style = "max-height: " + (window.innerHeight - margins) + "px";
}
}

View File

@@ -13,9 +13,10 @@ app.views.Help = app.views.StaticContentView.extend({
"click .faq-link-chat": "chat"
},
/* eslint-disable camelcase */
initialize : function() {
this.GETTING_HELP_SUBS = {
getting_started_a: {tutorial_series: this.linkHtml("http://diasporafoundation.org/getting_started/sign_up", Diaspora.I18n.t("getting_started_tutorial"))},
getting_started_a: {tutorial_series: this.linkHtml("https://diasporafoundation.org/getting_started/sign_up", Diaspora.I18n.t("getting_started_tutorial"))},
get_support_a_website: {link: this.linkHtml("https://diasporafoundation.org/", Diaspora.I18n.t("foundation_website"))},
get_support_a_tutorials: {tutorials: this.linkHtml("https://diasporafoundation.org/tutorials", Diaspora.I18n.t("tutorials"))},
get_support_a_wiki: {link: this.linkHtml("https://wiki.diasporafoundation.org/Special:Search", Diaspora.I18n.t("wiki"))},
@@ -28,10 +29,11 @@ app.views.Help = app.views.StaticContentView.extend({
this.POSTS_AND_POSTING_SUBS = {
post_report_a: {community_guidelines: this.linkHtml("https://diasporafoundation.org/community_guidelines", Diaspora.I18n.t("community_guidelines"))},
format_text_a: {
markdown: this.linkHtml("http://diasporafoundation.org/formatting", Diaspora.I18n.t( 'markdown' )),
here: this.linkHtml("http://daringfireball.net/projects/markdown/syntax", Diaspora.I18n.t( 'here' ))
markdown: this.linkHtml("https://diasporafoundation.org/formatting", Diaspora.I18n.t("markdown")),
here: this.linkHtml("https://daringfireball.net/projects/markdown/syntax", Diaspora.I18n.t("here"))
}
};
/* eslint-enable camelcase */
this.TAGS_SUBS = {
filter_tags_a: {

View File

@@ -19,10 +19,15 @@ app.views.Hovercard = app.views.Base.extend({
this.showMe = false;
this.parent = null; // current 'hovercardable' element that caused HC to appear
this.active = true;
},
presenter: function() {
return _.extend({}, this.defaultPresenter(), {
person: this.person
});
},
postRenderTemplate: function() {
this.$el.appendTo($("body"));
@@ -102,14 +107,14 @@ app.views.Hovercard = app.views.Base.extend({
if( !person || person.length === 0 ) {
throw new Error("received data is not a person object");
}
var personModel = new app.models.Person(person);
person.is_sharing = personModel.isSharing();
self.person = person;
if (app.currentUser.authenticated()) {
self.aspectMembershipDropdown = new app.views.AspectMembership({person: new app.models.Person(person)});
self.aspectMembershipDropdown = new app.views.AspectMembership({person: personModel});
}
self.render();
self._populateHovercardWith(person);
if( !self.showMe ) {
// mouse has left element
return;
@@ -118,23 +123,6 @@ app.views.Hovercard = app.views.Base.extend({
});
},
_populateHovercardWith: function(person) {
this.avatarLink.attr("href", this.href());
this.personLink.attr("href", this.href());
this.personLink.text(person.name);
this.personID.text(person.diaspora_id);
if (person.profile) {
this.avatar.attr("src", person.profile.avatar);
// set hashtags
this.hashtags.empty();
this.hashtags.html($(_.map(person.profile.tags, function(tag) {
return $("<a/>", {href: Routes.tag(tag)}).text("#" + tag)[0];
})));
}
},
_positionHovercard: function() {
var p_pos = this.parent.offset();
var p_height = this.parent.height();

View File

@@ -19,7 +19,7 @@ app.views.Location = Backbone.View.extend({
var locator = new OSM.Locator();
locator.getAddress(function(address, latlng){
$(element).empty();
$("<input/>",
$("<input></input>",
{ id: "location_address",
value: address,
type: "text",

View File

@@ -351,7 +351,7 @@ app.views.Publisher = Backbone.View.extend({
};
var previewPost = new app.views.PreviewPost({model: new app.models.Post(previewMessage)}).render().el;
return $("<div/>").append(previewPost).html();
return $("<div></div>").append(previewPost).html();
},
keyDown : function(evt) {

View File

@@ -36,8 +36,9 @@ app.views.SinglePostContent = app.views.Base.extend({
var map = L.map(mapContainer[0]).setView([location.lat, location.lng], 14);
var tiles = app.helpers.locations.getTiles();
tiles.addTo(map);
if (tiles) {
tiles.addTo(map);
}
// put marker on map
L.marker(location).addTo(map);

View File

@@ -48,7 +48,7 @@ app.views.TagFollowingList = app.views.Base.extend({
if(evt){ evt.preventDefault(); }
var name = this.$(".tag_input").val();
// compare tag_text_regexp in app/models/acts_as_taggable_on-tag.rb
// compare tag_text_regexp in config/initializers/acts_as_taggable_on.rb
var normalizedName = (name === "<3" ? name : name.replace(
new RegExp("[^" + PosixBracketExpressions.alnum + "_\\-]+", "gi"), "").toLowerCase());

View File

@@ -23,6 +23,7 @@
//= require markdown-it
//= require markdown-it-diaspora-mention
//= require markdown-it-for-inline
//= require markdown-it-footnote
//= require markdown-it-hashtag
//= require markdown-it-sanitizer
//= require markdown-it-sub

View File

@@ -185,8 +185,8 @@
addNewComments: function(bottomBar, data) {
if ($(".comment-container", bottomBar).length === 0) {
$(".show-comments", bottomBar).after($("<div/>", {"class": "comment-container"}));
$(".comment-container", bottomBar).append($("<ul/>", {"class": "comments"}));
$(".show-comments", bottomBar).after($("<div></div>", {"class": "comment-container"}));
$(".comment-container", bottomBar).append($("<ul></ul>", {"class": "comments"}));
}
$(".comment-container .comments", bottomBar).append(data);
},
@@ -212,8 +212,10 @@
var postGuid = bottomBar.parents(".stream-element").data("guid");
toggleReactionsLink.remove();
toggleReactionsLink = $("<a/>", {"class": "show-comments", "href": Routes.postComments(postGuid) + ".mobile"})
.html(text + "<i class='entypo-chevron-up'/>");
toggleReactionsLink = $("<a></a>", {
"class": "show-comments",
"href": Routes.postComments(postGuid) + ".mobile"
}).html(text + "<i class='entypo-chevron-up'/>");
parent.prepend(toggleReactionsLink);
bottomBar.removeClass("inactive").addClass("active");
}

View File

@@ -33,7 +33,7 @@ $(document).ready(function(){
if(hiddenField.length > 0) { hiddenField.remove(); }
else {
$("#new_status_message").append(
$("<input/>", {
$("<input></input>", {
name: "services[]",
type: "hidden",
value: provider

View File

@@ -11,7 +11,6 @@
@import 'icons';
@import 'animations';
@import 'flash_messages';
@import 'sprites';
@import 'hovercard';
@import 'base';
@import 'interactions';

View File

@@ -21,3 +21,7 @@
}
}
}
.aspect-membership {
max-height: 300px;
overflow: auto;
}

View File

@@ -10,14 +10,15 @@ body {
.page-contacts,
.page-conversations,
.page-notifications,
.page-people.action-show,
.page-people.action-contacts,
.page-people.action-show,
.page-photos,
.page-posts,
.page-profiles.action-edit,
.page-services.action-index,
.page-streams,
.page-tags,
.page-two_factor_authentications,
.page-user_applications,
.page-users.action-edit,
.page-users.action-update,

View File

@@ -55,8 +55,8 @@ body {
.tag:hover { background-color: desaturate(darken($link-color, 35%), 20%); }
#profile_container .profile_header {
#author_info #sharing_message.entypo-check { color: lighten($green, 10%); }
#sharing_message.entypo-check {
color: lighten($green, 10%);
}
#invitationsModal #email_invitation { border-top: 1px dashed $gray-light; }

View File

@@ -93,5 +93,10 @@ textarea {
}
::placeholder { text-transform: uppercase; }
p {
margin-top: .5rem;
text-align: center;
}
}
}

View File

@@ -50,15 +50,16 @@ $margin: 15px;
.indicator {
bottom: 0;
overflow-x: auto;
white-space: nowrap;
li {
border: 0;
border-radius: $thumbnail-size / 2;
height: $thumbnail-size;
margin: 6px;
margin-bottom: $margin;
margin: $margin 6px;
vertical-align: middle;
width: $thumbnail-size;
background-size: cover;
&.active,
&:hover {

View File

@@ -119,6 +119,19 @@
}
}
.dropdown-toggle {
align-items: center;
display: flex;
.user-name {
margin-right: 3px;
max-width: 250px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.user-menu-dropdown {
padding: 0;
}

View File

@@ -42,6 +42,14 @@
padding: 15px;
}
.part-of-diaspora {
font-style: italic;
a {
color: $white;
}
}
.login-form {
fieldset { background: none; }

View File

@@ -33,6 +33,12 @@
text-overflow: ellipsis;
}
.status-container {
align-items: center;
display: flex;
margin-bottom: 5px;
}
#hovercard_dropdown_container {
overflow: visible !important; /* otherwise the aspect dropdown is cropped */
}
@@ -53,10 +59,7 @@
.handle {
color: $text-grey;
line-height: 18px;
padding-top: 0px;
margin-top: 0px;
margin-bottom: 5px;
margin-right: 2px;
}
.btn-group.aspect-membership-dropdown { margin: 0 !important; }

View File

@@ -1,12 +1,13 @@
.page-sessions.action-new,
.page-sessions.action-create,
.page-passwords.action-new,
.page-passwords.action-edit {
padding-top: 25px;
.logos-asterisk {
background: image-url('branding/logos/asterisk.png') no-repeat;
height: 154px;
margin: auto;
margin-bottom: 12px;
margin: auto auto 12px;
width: 154px;
}

View File

@@ -16,6 +16,30 @@
}
}
h1 {
font-size: 2.7rem;
}
h2 {
font-size: 2.3rem;
}
h3 {
font-size: 2rem;
}
h4 {
font-size: 1.8rem;
}
h5 {
font-size: 1.6rem;
}
h6 {
font-size: 1.4rem;
}
.img-responsive {
display: inline;
}

View File

@@ -350,6 +350,7 @@ footer {
}
.bottom-bar {
margin: 0;
position: static;
}
}
@@ -694,6 +695,21 @@ select#aspect_ids_ {
.entypo-camera { margin-right: 0; }
}
.mobile-icon-bar {
background: $framed-background;
border-top: 1px solid $border-grey;
display: block;
padding: 1px 6px;
position: relative;
}
.mobile-icon-bar-button {
color: $text-grey;
float: right;
font-size: large;
padding: 0;
}
#publisher-textarea-wrapper {
border-radius: 2px;
margin: 12px 0px;

View File

@@ -202,10 +202,23 @@
.social-media-logos-twitter-24x24,
.social-media-logos-tumblr-24x24,
.social-media-logos-wordpress-24x24 {
background-repeat: no-repeat;
height: 24px;
width: 24px;
}
.social-media-logos-twitter-24x24 {
background-image: image-url('social-media-logos/twitter-24x24.png');
}
.social-media-logos-tumblr-24x24 {
background-image: image-url('social-media-logos/tumblr-24x24.png');
}
.social-media-logos-wordpress-24x24 {
background-image: image-url('social-media-logos/wordpress-24x24.png');
}
a {
display: inline-block;
}

View File

@@ -5,6 +5,7 @@
}
.invitations-button { padding-left: 0; }
}
#people-stream {
.media, .media-body {
overflow: visible;
@@ -28,6 +29,7 @@
.info { font-size: $font-size-small; }
}
}
#blocked_people {
.blocked-person {
border-bottom: 1px solid $border-grey;
@@ -45,3 +47,13 @@
.btn-danger { margin-top: 9px; }
}
}
#sharing_message {
&.entypo-check {
color: darken($brand-success, 20%);
}
&.entypo-record {
color: $text-grey;
}
}

View File

@@ -28,11 +28,6 @@
#sharing_message {
cursor: default;
font-size: 20px;
&.circle {
color: $text-grey;
&:before { content: '\26aa'; }
}
&.entypo-check { color: darken($brand-success,20%); }
}
.description {
margin-bottom: 20px;
@@ -145,14 +140,6 @@
}
}
#email-form{
padding: 0;
.form-group{
margin-left: 0;
margin-right: 0;
}
}
#birth-date{
text-align: center;
select{

View File

@@ -43,6 +43,7 @@
.btn.btn-link.question_mark:hover .entypo-cog { color: $black; }
.dim { opacity: 0.3; }
.social-media-logos-wordpress-16x16 {
background: image-url('social-media-logos/wordpress-16x16.png') no-repeat;
display: inline-block;
height: 16px;
width: 16px;

View File

@@ -1,5 +1,4 @@
.page-registrations.action-new,
.page-registrations.action-create {
.page-registrations {
.ball {
background: image-url('branding/ball.png') no-repeat;
background-size: contain;
@@ -12,19 +11,24 @@
height: 633px;
}
@media (max-width: $screen-xs-max) {
.v-center {
height: auto;
}
}
.content {
display: table-cell;
vertical-align: middle;
h2 {
h1 {
font-size: 35px;
margin: 12px;
text-align: center;
margin: 12px 0;
}
}
form {
max-width: 400px;
max-width: 500px;
}
.captcha-img {
@@ -34,16 +38,13 @@
width: 120px;
}
.captcha-input {
.form-control.captcha-input {
border-bottom: 1px solid $input-border;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-sizing: border-box;
font-size: 16px;
height: 40px;
line-height: $line-height-base;
padding: 10px 10px 10px 130px;
width: 100%;
padding-left: 130px;
}
.terms > a {

View File

@@ -1,5 +0,0 @@
/* ===== sprites ===== */
@import 'branding/logos/*.png';
@import 'social-media-logos/*.png';
@include all-logos-sprites;
@include all-social-media-logos-sprites;

View File

@@ -10,10 +10,10 @@
{{ t "aspect_dropdown.toggle" count=aspectMembershipsLength }}
{{/if}}
</span>
<span class="caret" />
<span class="caret"></span>
</button>
<ul class="dropdown-menu aspect_membership pull-right" unselectable="on">
<ul class="dropdown-menu aspect-membership pull-right" unselectable="on">
{{#each aspects}}
<li
{{#if membership}}
@@ -29,8 +29,8 @@
>
<a>
<span class="status_indicator">
<i class="glyphicon glyphicon-ok" />
<i class="glyphicon glyphicon-refresh" />
<i class="glyphicon glyphicon-ok"></i>
<i class="glyphicon glyphicon-refresh"></i>
</span>
<span class="text">
{{name}}
@@ -39,7 +39,7 @@
</li>
{{/each}}
{{#if dropdownMayCreateNewAspect}}
<li class="divider" />
<li class="divider"></li>
<li class="newItem add_aspect">
<a data-target="#newAspectModal" data-toggle="modal" href="#">
{{ t "aspects.create.add_a_new_aspect" }}
@@ -48,5 +48,5 @@
{{/if}}
</ul>
{{#if dropdownMayCreateNewAspect}}
<div class="newAspectContainer"/>
<div class="newAspectContainer"></div>
{{/if}}

View File

@@ -1,5 +1,5 @@
<li class="hoverable">
<a class="selectable toggle_selector" href="#">
<a class="selectable toggle_selector aspect-membership" href="#">
{{ t "aspect_navigation.select_all" }}
</a>
</li>

View File

@@ -29,7 +29,7 @@
class="new-comment" id="new-comment-on-{{id}}" method="post">
<textarea class="comment-box form-control mention-textarea"
id="comment_text_on_{{id}}" name="text" rows="1" required placeholder="{{t "stream.comment"}}" />
id="comment_text_on_{{id}}" name="text" rows="1" required placeholder="{{t "stream.comment"}}"></textarea>
<div class="typeahead-mention-box-wrap">
<input class="typeahead-mention-box hidden" type="text">
</div>

View File

@@ -11,7 +11,7 @@
{{#if canRemove}}
<a href="#" class="delete comment_delete" title="{{t "delete"}}">
<i class="entypo-trash"></i>
<a/>
</a>
{{else}}
<a href="#" data-type="Comment" class="comment_report" title="{{t "report.name"}}">
<i class="entypo-warning"></i>
@@ -26,7 +26,7 @@
{{/linkToAuthor}}
-
<a href="/posts/{{parent.id}}#{{guid}}" class="permalink_comment">
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}"/>
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}"></time>
</a>
<a href="/posts/{{parent.guid}}#{{guid}}" class="permalink gray" title="{{t "stream.permalink"}}">
<i class="entypo-link"></i>

View File

@@ -64,13 +64,12 @@
<ul class="nav navbar-nav navbar-left visible-sm-block visible-xs-block">
<li class="visible-xs-block"><a href="/stream">{{t "my_stream"}}</a></li>
<li class="visible-xs-block"><a href="/activity">{{t "my_activity"}}</a></li>
<li><a href="/mobile/toggle">{{t "header.toggle_mobile"}}</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown user-menu" id="user-menu">
<a href="{{urlTo "person" current_user.guid}}" class="dropdown-toggle hidden-xs hidden-sm" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="user-avatar pull-left">
<span class="user-avatar">
{{{personImage current_user "small"}}}
</span>
<span class="user-name">{{current_user.name}}</span>
@@ -87,6 +86,7 @@
{{else if current_user.moderator}}
<li><a href="/report">{{t "header.moderator"}}</a></li>
{{/if}}
<li><a class="visible-xs-block" href="/mobile/toggle">{{t "header.switch_to_touch_optimized_mode"}}</a></li>
<li><a href="/users/sign_out" data-method="delete">{{t "header.log_out"}}</a></li>
</ul>
</li>

View File

@@ -1,15 +1,22 @@
{{#with person}}
<div id="hovercard">
<a class='person_avatar'>
<img class="avatar">
<a class="person_avatar" href="{{urlTo 'person' guid}}">
<img class="avatar" src="{{profile.avatar}}" />
</a>
<h4>
<a class="person"></a>
<a class="person" href="{{urlTo 'person' guid}}">{{name}}</a>
</h4>
<div class="handle"></div>
<div class="status-container">
<div class="handle">{{diaspora_id}}</div>
{{{sharingMessage this}}}
</div>
<div id="hovercard_dropdown_container"></div>
<div class="card-footer">
<div class="footer-container">
<div class="hashtags"></div>
<div class="hashtags">
{{fmtTags profile.tags}}
</div>
</div>
</div>
</div>
{{/with}}

View File

@@ -27,10 +27,10 @@
<div class="footer-container">
{{#if status_message}}
<a href="{{urlTo "post" status_message.id}}">
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" />
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}"></time>
</a>
{{else}}
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" />
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}"></time>
{{/if}}
</div>
</div>

View File

@@ -1,5 +1,5 @@
<td class="ssl-status"">
<td class="ssl-status">
{{#if ssl}}
<i title="{{t 'admin.pods.ssl_enabled'}}" class="entypo-check">
{{else}}
@@ -9,19 +9,20 @@
</td>
<td class="pod-title" title="{{host}}">{{host}}</td>
<td class="added">
<small><time datetime="{{created_at}}" title="{{localTime created_at}}" /></small>
<small><time datetime="{{created_at}}" title="{{localTime created_at}}"></time></small>
</td>
<td>
{{#if has_no_errors}}
<i title="{{status_text}}" class="glyphicon glyphicon-ok"></i>
{{software}}
{{else}}
{{status_text}}
{{/if}}
{{#unless is_unchecked}}
<br><small>{{t 'admin.pods.last_check'}} <time datetime="{{checked_at}}" title="{{localTime checked_at}}" /></small>
<br><small>{{t 'admin.pods.last_check'}} <time datetime="{{checked_at}}" title="{{localTime checked_at}}"></time></small>
{{/unless}}
{{#if offline}}
| <small>{{t 'admin.pods.offline_since'}} <time datetime="{{offline_since}}" title="{{localTime offline_since}}" /></small>
| <small>{{t 'admin.pods.offline_since'}} <time datetime="{{offline_since}}" title="{{localTime offline_since}}"></time></small>
{{/if}}
{{#if is_unchecked}}<br><small class="text-muted">{{t 'admin.pods.no_info'}}</small>{{/if}}
<pre class="details" style="display: none;">

View File

@@ -15,7 +15,7 @@
<span class="details gray">
-
<a href="/posts/{{id}}">
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" />
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}"></time>
</a>
</span>
</div>

View File

@@ -40,11 +40,11 @@
<span class="post-time">
{{#if root}}
<a href="/posts/{{root.guid}}">
<time datetime="{{root.created_at}}" title="{{localTime root.created_at}}" />
<time datetime="{{root.created_at}}" title="{{localTime root.created_at}}"></time>
</a>
{{else}}
<a href="/posts/{{guid}}">
<time datetime="{{created_at}}" title="{{localTime created_at}}" />
<time datetime="{{created_at}}" title="{{localTime created_at}}"></time>
</a>
{{/if}}
</span>
@@ -59,12 +59,12 @@
{{/if}}
</div>
{{#unless root}}
<div id="single-post-moderation" />
<div id="single-post-moderation"></div>
{{/unless}}
</div>
</div>
{{#unless root}}
<div id="single-post-actions" class="col-md-4" />
<div id="single-post-actions" class="col-md-4"></div>
{{/unless}}
</div>
{{#if location.lat}}
@@ -92,13 +92,13 @@
<div class="post-context">
<span class="post-time">
<a href="/posts/{{guid}}">
<time datetime="{{created_at}}" title="{{localTime created_at}}" />
<time datetime="{{created_at}}" title="{{localTime created_at}}"></time>
</a>
</span>
<span id="single-post-moderation" />
<span id="single-post-moderation"></span>
</div>
</div>
<div id="single-post-actions" class="col-md-4" />
<div id="single-post-actions" class="col-md-4"></div>
</div>
{{/if}}
</div>

View File

@@ -22,7 +22,7 @@
<span class="details gray post-timestamp">
-
<a href="/posts/{{id}}">
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" />
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}"></time>
</a>
<a href="/posts/{{guid}}" class="permalink" title="{{t "stream.permalink"}}">

View File

@@ -43,7 +43,7 @@ class AdminsController < Admin::AdminController
@created_users = User.where("username IS NOT NULL and created_at IS NOT NULL")
@created_users.find_each do |u|
week = u.created_at.beginning_of_week.strftime("%Y-%m-%d")
@created_users_by_week[week] << u.username
@created_users_by_week[week] << {username: u.username, closed_account: u.person.closed_account}
end
@selected_week = params[:week] || @created_users_by_week.keys.last
@@ -51,7 +51,11 @@ class AdminsController < Admin::AdminController
end
def stats
@popular_tags = ActsAsTaggableOn::Tagging.joins(:tag).limit(50).order('count(taggings.id) DESC').group(:tag).count
@popular_tags = ActsAsTaggableOn::Tagging.joins(:tag)
.limit(50)
.order(Arel.sql("count(taggings.id) DESC"))
.group(:tag)
.count
case params[:range]
when "week"
@@ -72,7 +76,10 @@ class AdminsController < Admin::AdminController
create_hash(model, :range => range)
end
@posts_per_day = Post.where("created_at >= ?", Date.today - 21.days).group("DATE(created_at)").order("DATE(created_at) ASC").count
@posts_per_day = Post.where("created_at >= ?", Time.zone.today - 21.days)
.group(Arel.sql("DATE(created_at)"))
.order(Arel.sql("DATE(created_at) ASC"))
.count
@most_posts_within = @posts_per_day.values.max.to_f
@user_count = User.count

View File

@@ -104,8 +104,9 @@ module Api
end
def handle_start_point_response(endpoint)
_status, header, response = endpoint.call(request.env)
if response.redirect?
status, header, _response = endpoint.call(request.env)
if status.in?([301, 302, 303, 307, 308])
redirect_to header["Location"]
else
save_params_and_render_consent_form(endpoint)

View File

@@ -27,6 +27,7 @@ class ApplicationController < ActionController::Base
before_action :gon_set_current_user
before_action :gon_set_appconfig
before_action :gon_set_preloads
before_action :configure_permitted_parameters, if: :devise_controller?
inflection_method grammatical_gender: :gender
@@ -182,4 +183,10 @@ class ApplicationController < ActionController::Base
return unless gon.preloads.nil?
gon.preloads = {}
end
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_in, keys: [:otp_attempt])
end
end

View File

@@ -29,21 +29,19 @@ class AspectsController < ApplicationController
end
def destroy
@aspect = current_user.aspects.where(id: params[:id]).first
begin
if current_user.auto_follow_back && @aspect.id == current_user.auto_follow_back_aspect.id
if current_user.auto_follow_back && aspect.id == current_user.auto_follow_back_aspect.id
current_user.update(auto_follow_back: false, auto_follow_back_aspect: nil)
flash[:notice] = I18n.t "aspects.destroy.success_auto_follow_back", name: @aspect.name
flash[:notice] = I18n.t "aspects.destroy.success_auto_follow_back", name: aspect.name
else
flash[:notice] = I18n.t "aspects.destroy.success", name: @aspect.name
flash[:notice] = I18n.t "aspects.destroy.success", name: aspect.name
end
@aspect.destroy
aspect.destroy
rescue ActiveRecord::StatementInvalid => e
flash[:error] = I18n.t "aspects.destroy.failure", name: @aspect.name
flash[:error] = I18n.t "aspects.destroy.failure", name: aspect.name
end
if request.referer.include?('contacts')
if request.referer.include?("contacts")
redirect_to contacts_path
else
redirect_to aspects_path
@@ -51,41 +49,41 @@ class AspectsController < ApplicationController
end
def show
if @aspect = current_user.aspects.where(:id => params[:id]).first
redirect_to aspects_path('a_ids[]' => @aspect.id)
if aspect
redirect_to aspects_path("a_ids[]" => aspect.id)
else
redirect_to aspects_path
end
end
def update
@aspect = current_user.aspects.where(:id => params[:id]).first
if @aspect.update_attributes!(aspect_params)
flash[:notice] = I18n.t 'aspects.update.success', :name => @aspect.name
if aspect.update!(aspect_params)
flash[:notice] = I18n.t "aspects.update.success", name: aspect.name
else
flash[:error] = I18n.t 'aspects.update.failure', :name => @aspect.name
flash[:error] = I18n.t "aspects.update.failure", name: aspect.name
end
render :json => { :id => @aspect.id, :name => @aspect.name }
render json: {id: aspect.id, name: aspect.name}
end
def update_order
params[:ordered_aspect_ids].each_with_index do |id, i|
current_user.aspects.find(id).update_attributes(order_id: i)
current_user.aspects.find(id).update(order_id: i)
end
head :no_content
end
def toggle_chat_privilege
@aspect = current_user.aspects.where(:id => params[:aspect_id]).first
@aspect.chat_enabled = !@aspect.chat_enabled
@aspect.save
aspect.chat_enabled = !aspect.chat_enabled
aspect.save
head :no_content
end
private
def aspect
@aspect ||= current_user.aspects.where(id: (params[:id] || params[:aspect_id])).first
end
def connect_person_to_aspect(aspecting_person_id)
@person = Person.find(aspecting_person_id)
if @contact = current_user.contact_for(@person)

View File

@@ -10,6 +10,7 @@ class BlocksController < ApplicationController
respond_to do |format|
format.json { head :no_content }
format.any { redirect_back fallback_location: root_path }
end
end

View File

@@ -66,7 +66,7 @@ class ContactsController < ApplicationController
when "receiving"
current_user.contacts.receiving
when "by_aspect"
order.unshift "contact_id IS NOT NULL DESC"
order.unshift Arel.sql("contact_id IS NOT NULL DESC")
contacts_by_aspect(@aspect.id)
else
raise ArgumentError, "unknown type #{type}"

View File

@@ -0,0 +1,27 @@
# frozen_string_literal: true
class ManifestController < ApplicationController
def show # rubocop:disable Metrics/MethodLength
render json: {
short_name: AppConfig.settings.pod_name,
name: AppConfig.settings.pod_name,
description: "diaspora* is a free, decentralized and privacy-respecting social network",
icons: [
{
src: helpers.image_path("branding/logos/app-icon.png"),
type: "image/png",
sizes: "192x192"
},
{
src: helpers.image_path("branding/logos/app-icon-512.png"),
type: "image/png",
sizes: "512x512"
}
],
start_url: "/",
background_color: "#000000",
display: "standalone",
theme_color: "#000000"
}
end
end

View File

@@ -15,8 +15,7 @@ class PeopleController < ApplicationController
respond_to :json, :only => [:index, :show]
rescue_from ActiveRecord::RecordNotFound do
render :file => Rails.root.join('public', '404').to_s,
:format => :html, :layout => false, :status => 404
render file: Rails.root.join("public/404.html").to_s, format: :html, layout: false, status: :not_found
end
rescue_from Diaspora::AccountClosed do
@@ -113,15 +112,6 @@ class PeopleController < ApplicationController
end
end
def retrieve_remote
if params[:diaspora_handle]
Workers::FetchWebfinger.perform_async(params[:diaspora_handle])
head :ok
else
head :unprocessable_entity
end
end
private
def find_person

View File

@@ -147,12 +147,7 @@ class PhotosController < ApplicationController
current_user.dispatch_post(@photo, to: photo_params[:aspect_ids])
end
if photo_params[:set_profile_photo]
profile_params = {:image_url => @photo.url(:thumb_large),
:image_url_medium => @photo.url(:thumb_medium),
:image_url_small => @photo.url(:thumb_small)}
current_user.update_profile(profile_params)
end
current_user.update_profile(photo: @photo) if photo_params[:set_profile_photo]
respond_to do |format|
format.json{ render(:layout => false , :json => {"success" => true, "data" => @photo}.to_json )}

View File

@@ -5,9 +5,9 @@
# the COPYRIGHT file.
class RegistrationsController < Devise::RegistrationsController
before_action :check_registrations_open_or_valid_invite!
before_action :check_registrations_open_or_valid_invite!, except: :registrations_closed
layout -> { request.format == :mobile ? "application" : "with_header" }
layout -> { request.format == :mobile ? "application" : "with_header_with_footer" }
def create
@user = User.build(user_params)
@@ -28,13 +28,17 @@ class RegistrationsController < Devise::RegistrationsController
end
end
def registrations_closed
render "registrations/registrations_closed"
end
private
def check_registrations_open_or_valid_invite!
return true if AppConfig.settings.enable_registrations? || invite.try(:can_be_used?)
flash[:error] = params[:invite] ? t("registrations.invalid_invite") : t("registrations.closed")
redirect_to new_user_session_path
flash[:error] = t("registrations.invalid_invite") if params[:invite]
redirect_to registrations_closed_path
end
def invite

View File

@@ -5,10 +5,54 @@
# the COPYRIGHT file.
class SessionsController < Devise::SessionsController
after_action :reset_authentication_token, only: [:create]
before_action :reset_authentication_token, only: [:destroy]
# rubocop:disable Rails/LexicallyScopedActionFilter
before_action :authenticate_with_2fa, only: :create
after_action :reset_authentication_token, only: :create
before_action :reset_authentication_token, only: :destroy
# rubocop:enable Rails/LexicallyScopedActionFilter
def find_user
return User.find_for_authentication(username: params[:user][:username]) if params[:user][:username]
User.find(session[:otp_user_id]) if session[:otp_user_id]
end
def authenticate_with_2fa
self.resource = find_user
return true unless resource&.otp_required_for_login?
if params[:user][:otp_attempt].present? && session[:otp_user_id]
authenticate_with_two_factor_via_otp(resource)
else
strategy = Warden::Strategies[:database_authenticatable].new(warden.env, :user)
prompt_for_two_factor(strategy.user) if strategy.valid? && strategy._run!.successful?
end
end
def valid_otp_attempt?(user)
user.validate_and_consume_otp!(params[:user][:otp_attempt]) ||
user.invalidate_otp_backup_code!(params[:user][:otp_attempt])
rescue OpenSSL::Cipher::CipherError => _error
false
end
def authenticate_with_two_factor_via_otp(user)
if valid_otp_attempt?(user)
session.delete(:otp_user_id)
sign_in(user)
else
flash.now[:alert] = "Invalid token"
prompt_for_two_factor(user)
end
end
def prompt_for_two_factor(user)
session[:otp_user_id] = user.id
render :two_factor
end
def reset_authentication_token
current_user.reset_authentication_token! unless current_user.nil?
current_user&.reset_authentication_token!
end
end

View File

@@ -0,0 +1,55 @@
# frozen_string_literal: true
class TwoFactorAuthenticationsController < ApplicationController
before_action :authenticate_user!
before_action :verify_otp_required, only: [:create]
def show
@user = current_user
end
def create
current_user.otp_secret = User.generate_otp_secret(32)
current_user.save!
redirect_to confirm_two_factor_authentication_path
end
def confirm_2fa
redirect_to two_factor_authentication_path if current_user.otp_required_for_login?
end
def confirm_and_activate_2fa
if current_user.validate_and_consume_otp!(params[:user][:code])
current_user.otp_required_for_login = true
current_user.save!
flash[:notice] = t("two_factor_auth.flash.success_activation")
redirect_to recovery_codes_two_factor_authentication_path
else
flash[:alert] = t("two_factor_auth.flash.error_token")
redirect_to confirm_two_factor_authentication_path
end
end
def recovery_codes
@recovery_codes = current_user.generate_otp_backup_codes!
current_user.save!
end
def destroy
if current_user.valid_password?(params[:two_factor_authentication][:password])
current_user.otp_required_for_login = false
current_user.save!
flash[:notice] = t("two_factor_auth.flash.success_deactivation")
else
flash[:alert] = t("users.destroy.wrong_password")
end
redirect_to two_factor_authentication_path
end
private
def verify_otp_required
redirect_to two_factor_authentication_path if current_user.otp_required_for_login?
end
end

View File

@@ -18,31 +18,23 @@ class UsersController < ApplicationController
end
def update
password_changed = false
user_data = user_params
@user = current_user
if user_data
# change password
if params[:change_password]
password_changed = change_password(user_data)
else
update_user(user_data)
end
if params[:change_password] && user_password_params
password_changed = change_password(user_password_params)
return redirect_to new_user_session_path if password_changed
elsif user_params
update_user(user_params)
end
if password_changed
redirect_to new_user_session_path
else
set_email_preferences
render :edit
end
set_email_preferences
render :edit
end
def update_privacy_settings
privacy_params = params.fetch(:user).permit(:strip_exif)
if current_user.update_attributes(strip_exif: privacy_params[:strip_exif])
if current_user.update(strip_exif: privacy_params[:strip_exif])
flash[:notice] = t("users.update.settings_updated")
else
flash[:error] = t("users.update.settings_not_updated")
@@ -137,13 +129,9 @@ class UsersController < ApplicationController
private
# rubocop:disable Metrics/MethodLength
def user_params
params.fetch(:user).permit(
:email,
:current_password,
:password,
:password_confirmation,
:language,
:color_theme,
:disable_mail,
@@ -155,7 +143,14 @@ class UsersController < ApplicationController
email_preferences: UserPreference::VALID_EMAIL_TYPES.map(&:to_sym)
)
end
# rubocop:enable Metrics/MethodLength
def user_password_params
params.fetch(:user).permit(
:current_password,
:password,
:password_confirmation
)
end
def update_user(user_data)
if user_data[:email_preferences]
@@ -175,8 +170,8 @@ class UsersController < ApplicationController
end
end
def change_password(user_data)
if @user.update_with_password(user_data)
def change_password(password_params)
if @user.update_with_password(password_params)
flash[:notice] = t("users.update.password_changed")
true
else
@@ -204,7 +199,7 @@ class UsersController < ApplicationController
end
def change_language(user_data)
if @user.update_attributes(user_data)
if @user.update(user_data)
I18n.locale = @user.language
flash.now[:notice] = t("users.update.language_changed")
else
@@ -234,7 +229,7 @@ class UsersController < ApplicationController
end
def change_settings(user_data, successful="users.update.settings_updated", error="users.update.settings_not_updated")
if @user.update_attributes(user_data)
if @user.update(user_data)
flash.now[:notice] = t(successful)
else
flash.now[:error] = t(error)

View File

@@ -72,4 +72,9 @@ module ApplicationHelper
buf << [nonced_javascript_tag("$.fx.off = true;")] if Rails.env.test?
buf.join("\n").html_safe
end
def qrcode_uri
label = current_user.username
current_user.otp_provisioning_uri(label, issuer: AppConfig.environment.url)
end
end

View File

@@ -1,17 +1,6 @@
# frozen_string_literal: true
module InterimStreamHackinessHelper
def commenting_disabled?(post)
return true unless user_signed_in?
if defined?(@commenting_disabled)
@commenting_disabled
elsif defined?(@stream)
!@stream.can_comment?(post)
else
false
end
end
##### These methods need to go away once we pass publisher object into the partial ######
def publisher_formatted_text
if params[:prefill].present?

View File

@@ -5,7 +5,7 @@ module MetaDataHelper
include ActionView::Helpers::TagHelper
def og_prefix
'og: http://ogp.me/ns# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#'
"og: https://ogp.me/ns# article: https://ogp.me/ns/article# profile: https://ogp.me/ns/profile#"
end
def site_url

View File

@@ -4,21 +4,19 @@ module NotifierHelper
include PostsHelper
# @param post [Post] The post object.
# @param opts [Hash] Optional hash. Accepts :length parameters.
# @param opts [Hash] Optional hash. Accepts :html parameter.
# @return [String] The formatted post.
def post_message(post, opts={})
if post.respond_to? :message
post.message.try(:plain_text_without_markdown).presence || post_page_title(post)
else
I18n.translate "notifier.a_post_you_shared"
end
rendered = opts[:html] ? post.message&.markdownified_for_mail : post.message&.plain_text_without_markdown
rendered.presence || post_page_title(post)
end
# @param comment [Comment] The comment to process.
# @param opts [Hash] Optional hash. Accepts :html parameter.
# @return [String] The formatted comment.
def comment_message(comment, opts={})
if comment.post.public?
comment.message.plain_text_without_markdown
opts[:html] ? comment.message.markdownified_for_mail : comment.message.plain_text_without_markdown
else
I18n.translate "notifier.a_limited_post_comment"
end

View File

@@ -27,10 +27,10 @@ module PeopleHelper
def person_link(person, opts={})
css_class = person_link_class(person, opts[:class])
remote_or_hovercard_link = Rails.application.routes.url_helpers.person_path(person).html_safe
"<a data-hovercard='#{remote_or_hovercard_link}' href='#{remote_or_hovercard_link}' class='#{css_class}'>"\
"#{html_escape_once(opts[:display_name] || person.name)}</a>"\
.html_safe
remote_or_hovercard_link = person_path(person)
tag.a('data-hovercard': remote_or_hovercard_link, href: remote_or_hovercard_link, class: css_class) do
opts[:display_name] || person.name
end
end
def person_image_tag(person, size = :thumb_small)
@@ -44,15 +44,12 @@ module PeopleHelper
if opts[:to] == :photos
link_to person_image_tag(person, opts[:size]), person_photos_path(person)
else
css_class = person_link_class(person, opts[:class])
remote_or_hovercard_link = Rails.application.routes.url_helpers.person_path(person).html_safe
"<a href='#{remote_or_hovercard_link}' class='#{css_class}' #{('target=' + opts[:target]) if opts[:target]}>
#{person_image_tag(person, opts[:size])}
</a>".html_safe
tag.a(href: person_path(person), class: person_link_class(person, opts[:class])) do
person_image_tag(person, opts[:size])
end
end
end
# Rails.application.routes.url_helpers is needed since this is indirectly called from a model
def local_or_remote_person_path(person, opts={})
opts.merge!(:protocol => AppConfig.pod_uri.scheme, :host => AppConfig.pod_uri.authority)
absolute = opts.delete(:absolute)
@@ -61,19 +58,11 @@ module PeopleHelper
username = person.username
unless username.include?('.')
opts.merge!(:username => username)
if absolute
return Rails.application.routes.url_helpers.user_profile_url(opts)
else
return Rails.application.routes.url_helpers.user_profile_path(opts)
end
return absolute ? user_profile_url(opts) : user_profile_path(opts)
end
end
if absolute
return Rails.application.routes.url_helpers.person_url(person, opts)
else
return Rails.application.routes.url_helpers.person_path(person, opts)
end
absolute ? person_url(person, opts) : person_path(person, opts)
end
private

View File

@@ -11,7 +11,7 @@ module SessionsHelper
end
def display_registration_link?
AppConfig.settings.enable_registrations? && devise_mapping.registerable? && controller_name != "registrations"
AppConfig.settings.enable_registrations? && controller_name != "registrations"
end
def display_password_reset_link?

View File

@@ -2,38 +2,31 @@
class ExportMailer < ApplicationMailer
def export_complete_for(user)
@user = user
mail(to: @user.email, subject: I18n.t('notifier.export_email.subject', name: @user.name)) do |format|
format.html { render 'users/export_email' }
format.text { render 'users/export_email' }
end
send_mail(user, I18n.t("notifier.export_email.subject", name: user.name),
I18n.t("notifier.export_email.body", url: download_profile_user_url, name: user.first_name))
end
def export_failure_for(user)
@user = user
mail(to: @user.email, subject: I18n.t('notifier.export_failure_email.subject', name: @user.name)) do |format|
format.html { render 'users/export_failure_email' }
format.text { render 'users/export_failure_email' }
end
send_mail(user, I18n.t("notifier.export_failure_email.subject", name: user.name),
I18n.t("notifier.export_failure_email.body", name: user.first_name))
end
def export_photos_complete_for(user)
@user = user
mail(to: @user.email, subject: I18n.t('notifier.export_photos_email.subject', name: @user.name)) do |format|
format.html { render 'users/export_photos_email' }
format.text { render 'users/export_photos_email' }
end
send_mail(user, I18n.t("notifier.export_photos_email.subject", name: user.name),
I18n.t("notifier.export_photos_email.body", url: download_photos_user_url, name: user.first_name))
end
def export_photos_failure_for(user)
@user = user
send_mail(user, I18n.t("notifier.export_photos_failure_email.subject", name: user.name),
I18n.t("notifier.export_photos_failure_email.body", name: user.first_name))
end
mail(to: @user.email, subject: I18n.t('notifier.export_photos_failure_email.subject', name: @user.name)) do |format|
format.html { render 'users/export_photos_failure_email' }
format.text { render 'users/export_photos_failure_email' }
private
def send_mail(user, subject, body)
mail(to: user.email, subject: subject) do |format|
format.html { render "notifier/plain_markdown_email", locals: {body: body} }
format.text { render "notifier/plain_markdown_email", locals: {body: body} }
end
end
end

View File

@@ -2,16 +2,15 @@
class Maintenance < ApplicationMailer
def account_removal_warning(user)
@user = user
@login_url = new_user_session_url
@pod_url = AppConfig.environment.url
@after_days = AppConfig.settings.maintenance.remove_old_users.after_days.to_s
@remove_after = @user.remove_after
I18n.with_locale(@user.language) do
mail(to: @user.email, subject: I18n.t("notifier.remove_old_user.subject")) do |format|
format.text
format.html
I18n.with_locale(user.language) do
body = I18n.t("notifier.remove_old_user.body",
pod_url: AppConfig.environment.url,
login_url: new_user_session_url,
after_days: AppConfig.settings.maintenance.remove_old_users.after_days.to_s,
remove_after: user.remove_after)
mail(to: user.email, subject: I18n.t("notifier.remove_old_user.subject")) do |format|
format.text { render "notifier/plain_markdown_email", locals: {body: body} }
format.html { render "notifier/plain_markdown_email", locals: {body: body} }
end
end
end

View File

@@ -35,16 +35,14 @@ module NotificationMailers
private
def default_headers
headers = {
from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>",
host: "#{AppConfig.pod_uri.host}",
to: name_and_address(@recipient.name, @recipient.email)
}
return headers if @sender.blank?
sender_in_header = @sender.profile.full_name.empty? ? @sender.username : @sender.name
headers[:from] = "\"#{AppConfig.settings.pod_name} (#{sender_in_header})\" <#{AppConfig.mail.sender_address}>"
from_name = AppConfig.settings.pod_name
from_name += " (#{@sender.profile.full_name.empty? ? @sender.username : @sender.name})" if @sender.present?
headers
{
from: name_and_address(from_name, AppConfig.mail.sender_address),
to: name_and_address(@recipient.name, @recipient.email),
template_name: self.class.name.demodulize.underscore
}
end
def with_recipient_locale(&block)

View File

@@ -24,46 +24,37 @@ class Notifier < ApplicationMailer
}
end
unless subject
subject = I18n.t('notifier.single_admin.subject')
end
subject ||= I18n.t("notifier.single_admin.subject")
default_opts = {:to => @receiver.email,
:from => AppConfig.mail.sender_address,
:subject => subject, :host => AppConfig.pod_uri.host}
default_opts = {to: @receiver.email, from: AppConfig.mail.sender_address, subject: subject}
default_opts.merge!(opts)
mail(default_opts) do |format|
format.text
format.html
end
mail(default_opts)
end
def invite(email, inviter, invitation_code, locale)
@inviter = inviter
@invitation_code = invitation_code
I18n.with_locale(locale) do
mail_opts = {to: email, from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>",
subject: I18n.t("notifier.invited_you", name: @inviter.name),
host: AppConfig.pod_uri.host}
subject: I18n.t("notifier.invited_you", name: inviter.name)}
name = inviter.full_name.empty? ? inviter.diaspora_handle : "#{inviter.name} (#{inviter.diaspora_handle})"
body = I18n.t("notifier.invite.message",
invite_url: invite_code_url(invitation_code),
diasporafoundation_url: "https://diasporafoundation.org/",
user: name,
diaspora_id: inviter.diaspora_handle)
mail(mail_opts) do |format|
format.text { render :layout => nil }
format.html { render :layout => nil }
format.text { render "notifier/plain_markdown_email", layout: nil, locals: {body: body} }
format.html { render "notifier/plain_markdown_email", layout: nil, locals: {body: body} }
end
end
end
def send_notification(type, *args)
@notification = NotificationMailers.const_get(type.to_s.camelize).new(*args)
@notification = NotificationMailers.const_get(type.camelize).new(*args)
with_recipient_locale do
mail(@notification.headers) do |format|
self.action_name = type
format.text
format.html
end
mail(@notification.headers)
end
end

View File

@@ -26,9 +26,10 @@ class ReportMailer < ApplicationMailer
private
def format(resource)
body = I18n.t("notifier.report_email.body", resource)
mail(to: resource[:email], subject: I18n.t("notifier.report_email.subject", type: resource[:type])) do |format|
format.html { render "report/report_email", locals: {resource: resource} }
format.text { render "report/report_email", locals: {resource: resource} }
format.html { render "notifier/plain_markdown_email", locals: {body: body} }
format.text { render "notifier/plain_markdown_email", locals: {body: body} }
end
end
end

View File

@@ -90,6 +90,10 @@ class AccountMigration < ApplicationRecord
old_user && new_user
end
def includes_photo_migration?
remote_photo_path.present?
end
# We need to resend contacts of users of our pod for the remote new person so that the remote pod received this
# contact information from the authoritative source.
def dispatch_contacts
@@ -122,13 +126,14 @@ class AccountMigration < ApplicationRecord
end
def update_all_references
update_remote_photo_path if remotely_initiated? && includes_photo_migration?
update_person_references
update_user_references if user_changed_id_locally?
end
def person_references
references = Person.reflections.reject {|key, _|
%w[profile owner notifications pod].include?(key)
%w[profile owner notifications pod account_deletion account_migration].include?(key)
}
references.map {|key, value|
@@ -200,6 +205,20 @@ class AccountMigration < ApplicationRecord
.destroy_all
end
def update_remote_photo_path
Photo.where(author: old_person)
.update_all(remote_photo_path: remote_photo_path) # rubocop:disable Rails/SkipsModelValidations
return unless user_left_our_pod?
Photo.where(author: old_person).find_in_batches do |batch|
batch.each do |photo|
photo.processed_image = nil
photo.unprocessed_image = nil
logger.warn "Error cleaning up photo #{photo.id}" unless photo.save
end
end
end
def update_person_references
logger.debug "Updating references from person id=#{old_person.id} to person id=#{new_person.id}"
eliminate_person_duplicates

View File

@@ -1,25 +0,0 @@
# frozen_string_literal: true
module ActsAsTaggableOn
class Tag
self.include_root_in_json = false
def self.tag_text_regexp
@tag_text_regexp ||= "[[:word:]]\u055b\u055c\u055e\u058a_-"
end
def self.autocomplete(name)
where("name LIKE ?", "#{name.downcase}%").order("name ASC")
end
def self.normalize(name)
if name =~ /^#?<3/
# Special case for love, because the world needs more love.
'<3'
elsif name
name.gsub(/[^#{self.tag_text_regexp}]/, '').downcase
end
end
end
end

View File

@@ -4,16 +4,16 @@ class Block < ApplicationRecord
belongs_to :person
belongs_to :user
delegate :name, to: :person, prefix: true
delegate :name, :diaspora_handle, to: :person, prefix: true
validates :person_id, uniqueness: {scope: :user_id}
validate :not_blocking_yourself
def not_blocking_yourself
if self.user.person.id == self.person_id
errors[:person_id] << "stop blocking yourself!"
end
return unless user.person.id == person_id
errors.add(:person_id, "stop blocking yourself!")
end
# @return [Array<Person>] The recipient of the block

View File

@@ -16,17 +16,18 @@ class InvitationCode < ApplicationRecord
end
def add_invites!
self.update_attributes(:count => self.count+100)
update(count: count + 100)
end
def use!
self.update_attributes(:count => self.count-1)
update(count: count - 1)
end
def generate_token
begin
loop do
self.token = SecureRandom.hex(6)
end while InvitationCode.exists?(:token => self[:token])
break unless InvitationCode.default_scoped.exists?(token: token)
end
end
def self.default_inviter_or(user)

View File

@@ -37,10 +37,8 @@ class Message < ApplicationRecord
private
def participant_of_parent_conversation
if conversation && !conversation.participants.include?(author)
errors[:base] << "Author is not participating in the conversation"
else
true
end
return unless conversation&.participants&.exclude?(author)
errors.add(:base, "Author is not participating in the conversation")
end
end

View File

@@ -33,7 +33,9 @@ class OpenGraphCache < ApplicationRecord
end
def fetch_and_save_opengraph_data!
object = OpenGraphReader.fetch!(self.url)
uri = URI.parse(url.start_with?("http") ? url : "http://#{url}")
uri.normalize!
object = OpenGraphReader.fetch!(uri)
return unless object

View File

@@ -57,6 +57,9 @@ class Person < ApplicationRecord
has_many :mentions, :dependent => :destroy
has_one :account_deletion, dependent: :destroy
has_one :account_migration, foreign_key: :old_person_id, dependent: :nullify, inverse_of: :old_person
validate :owner_xor_pod
validate :other_person_with_same_guid, on: :create
validates :profile, :presence => true
@@ -162,7 +165,7 @@ class Person < ApplicationRecord
contacts.id IS NOT NULL AS is_contact
SQL
)
.order(<<-SQL
.order(Arel.sql(<<-SQL
is_author DESC,
is_commenter DESC,
is_liker DESC,
@@ -170,7 +173,7 @@ class Person < ApplicationRecord
profiles.full_name,
people.diaspora_handle
SQL
)
))
}
def self.community_spotlight
@@ -185,6 +188,8 @@ class Person < ApplicationRecord
# end
# will not work! The nil profile will be overriden with an empty one.
def initialize(params={})
params = {} if params.nil?
profile_set = params.has_key?(:profile) || params.has_key?("profile")
params[:profile_attributes] = params.delete(:profile) if params.has_key?(:profile) && params[:profile].is_a?(Hash)
super
@@ -207,7 +212,7 @@ class Person < ApplicationRecord
self.guid
end
private_class_method def self.search_query_string(query)
def self.search_query_string(query)
query = query.downcase
like_operator = AppConfig.postgres? ? "ILIKE" : "LIKE"
@@ -239,7 +244,7 @@ class Person < ApplicationRecord
query = query.where(contacts: {sharing: true, receiving: true}) if mutual
query.where(closed_account: false)
.order(["contacts.user_id IS NULL", "profiles.last_name ASC", "profiles.first_name ASC"])
.order([Arel.sql("contacts.user_id IS NULL"), "profiles.last_name ASC", "profiles.first_name ASC"])
end
def name(opts = {})

View File

@@ -68,11 +68,9 @@ class Photo < ApplicationRecord
def ownership_of_status_message
message = StatusMessage.find_by_guid(self.status_message_guid)
if self.status_message_guid && message
self.diaspora_handle == message.diaspora_handle
else
true
end
return unless status_message_guid && message && diaspora_handle != message.diaspora_handle
errors.add(:base, "Photo must have the same owner as status message")
end
def self.diaspora_initialize(params={})

View File

@@ -114,7 +114,7 @@ class Pod < ApplicationRecord
def update_from_result(result)
self.status = status_from_result(result)
update_offline_since
logger.warn "OFFLINE #{result.failure_message}" if offline?
logger.warn "#{uri} OFFLINE: #{result.failure_message}" if offline?
attributes_from_result(result)
touch(:checked_at)
@@ -125,7 +125,7 @@ class Pod < ApplicationRecord
def attributes_from_result(result)
self.ssl ||= result.ssl
self.error = result.failure_message[0..254] if result.error?
self.error = result.error? ? result.failure_message[0..254] : nil
self.software = result.software_version[0..254] if result.software_version.present?
self.response_time = result.rt
end

View File

@@ -21,6 +21,7 @@ class Profile < ApplicationRecord
validates :first_name, :length => { :maximum => 32 }
validates :last_name, :length => { :maximum => 32 }
validates :location, :length => { :maximum =>255 }
validates :gender, length: {maximum: 255}
validates_format_of :first_name, :with => /\A[^;]+\z/, :allow_blank => true
validates_format_of :last_name, :with => /\A[^;]+\z/, :allow_blank => true

View File

@@ -22,15 +22,15 @@ class Report < ApplicationRecord
end
def entry_does_not_exist
if Report.where(item_id: item_id, item_type: item_type).exists?(user_id: user_id)
errors[:base] << 'You cannot report the same post twice.'
end
return unless Report.where(item_id: item_id, item_type: item_type).exists?(user_id: user_id)
errors.add(:base, "You cannot report the same post twice.")
end
def post_or_comment_does_exist
if Post.find_by_id(item_id).nil? && Comment.find_by_id(item_id).nil?
errors[:base] << 'Post or comment was already deleted or doesn\'t exists.'
end
return unless Post.find_by(id: item_id).nil? && Comment.find_by(id: item_id).nil?
errors.add(:base, "Post or comment was already deleted or doesn't exists.")
end
def destroy_reported_item

View File

@@ -86,9 +86,6 @@ class Reshare < Post
private
def root_must_be_public
if self.root && !self.root.public
errors[:base] << "Only posts which are public may be reshared."
return false
end
errors.add(:base, "Only posts which are public may be reshared.") if root && !root.public
end
end

View File

@@ -1,69 +1,78 @@
# frozen_string_literal: true
class Services::Tumblr < Service
MAX_CHARACTERS = 1000
module Services
class Tumblr < Service
MAX_CHARACTERS = 1000
def provider
"tumblr"
end
def consumer_key
AppConfig.services.tumblr.key
end
def consumer_secret
AppConfig.services.tumblr.secret
end
def post(post, url='')
body = build_tumblr_post(post, url)
user_info = JSON.parse(client.get("/v2/user/info").body)
blogs = user_info["response"]["user"]["blogs"]
primaryblog = blogs.find {|blog| blog["primary"] } || blogs[0]
tumblr_ids = {}
blogurl = URI.parse(primaryblog["url"])
resp = client.post("/v2/blog/#{blogurl.host}/post", body)
if resp.code == "201"
tumblr_ids[blogurl.host.to_s] = JSON.parse(resp.body)["response"]["id"]
def provider
"tumblr"
end
post.tumblr_ids = tumblr_ids.to_json
post.save
end
def post(post, url="") # rubocop:disable Metrics/AbcSize
return true if post.nil? # return if post is deleted while waiting in queue
def build_tumblr_post(post, url)
{ :type => 'text', :format => "markdown", :body => tumblr_template(post, url) }
end
body = build_tumblr_post(post, url)
user_info = JSON.parse(client.get("/v2/user/info").body)
blogs = user_info["response"]["user"]["blogs"]
primaryblog = blogs.find {|blog| blog["primary"] } || blogs[0]
def tumblr_template(post, url)
photo_html = post.photos.map {|photo|
"![photo](#{photo.url(:scaled_full)})\n\n"
}.join
tumblr_ids = {}
"#{photo_html}#{post.message.html(mentioned_people: [])}\n\n[original post](#{url})"
end
blogurl = URI.parse(primaryblog["url"])
tumblr_ids[blogurl.host.to_s] = request_to_external_blog(blogurl, body)
def post_opts(post)
{tumblr_ids: post.tumblr_ids} if post.tumblr_ids.present?
end
def delete_from_service(opts)
logger.debug "event=delete_from_service type=tumblr sender_id=#{user_id} tumblr_ids=#{opts[:tumblr_ids]}"
tumblr_posts = JSON.parse(opts[:tumblr_ids])
tumblr_posts.each do |blog_name, post_id|
delete_from_tumblr(blog_name, post_id)
post.tumblr_ids = tumblr_ids.to_json
post.save
end
end
def delete_from_tumblr(blog_name, service_post_id)
client.post("/v2/blog/#{blog_name}/post/delete", "id" => service_post_id)
end
def post_opts(post)
{tumblr_ids: post.tumblr_ids} if post.tumblr_ids.present?
end
private
def client
@consumer ||= OAuth::Consumer.new(consumer_key, consumer_secret, :site => 'http://api.tumblr.com')
@client ||= OAuth::AccessToken.new(@consumer, self.access_token, self.access_secret)
def delete_from_service(opts)
logger.debug "event=delete_from_service type=tumblr sender_id=#{user_id} tumblr_ids=#{opts[:tumblr_ids]}"
tumblr_posts = JSON.parse(opts[:tumblr_ids])
tumblr_posts.each do |blog_name, post_id|
delete_from_tumblr(blog_name, post_id)
end
end
def build_tumblr_post(post, url)
{type: "text", format: "markdown", body: tumblr_template(post, url), tags: tags(post), native_inline_images: true}
end
private
def client
@consumer ||= OAuth::Consumer.new(consumer_key, consumer_secret, site: "https://api.tumblr.com")
@client ||= OAuth::AccessToken.new(@consumer, access_token, access_secret)
end
def tumblr_template(post, url)
photo_html = post.photos.map {|photo| "![photo](#{photo.url(:scaled_full)})\n\n" }.join
"#{photo_html}#{post.message.html(mentioned_people: [])}\n\n[original post](#{url})"
end
def tags(post)
post.tags.pluck(:name).join(",").to_s
end
def delete_from_tumblr(blog_name, service_post_id)
client.post("/v2/blog/#{blog_name}/post/delete", "id" => service_post_id)
end
def request_to_external_blog(blogurl, body)
resp = client.post("/v2/blog/#{blogurl.host}/post", body)
JSON.parse(resp.body)["response"]["id"] if resp.code == "201"
end
def consumer_key
AppConfig.services.tumblr.key
end
def consumer_secret
AppConfig.services.tumblr.secret
end
end
end

View File

@@ -130,7 +130,7 @@ class StatusMessage < Post
private
def presence_of_content
errors[:base] << "Cannot create a StatusMessage without content" if text_and_photos_blank?
errors.add(:base, "Cannot create a StatusMessage without content") if text_and_photos_blank?
end
end

Some files were not shown because too many files have changed in this diff Show More