102 Commits
Author SHA1 Message Date
raucao 64d12c6658 Merge branch 'master' into live 2026-08-10 21:37:50 -06:00
raucao 8453c38f41 Merge pull request 'Fix avatars failing to be set on ejabberd accounts' (#247) from bugfix/246-xmpp_avatar_publishing into master
CI / Test (push) Successful in 31s
Reviewed-on: #247
2026-08-11 03:37:28 +00:00
raucao 1957df3bbd Fix avatars failing to be set on XMPP accounts
CI / Test (pull_request) Successful in 32s
Release Drafter / Update release notes draft (pull_request) Successful in 3s
There's a stray `end` that prematurely closes the class
2026-08-10 21:35:28 -06:00
raucao 7df61ddcd7 Merge branch 'master' into live 2026-08-10 17:24:47 -06:00
raucao d196c161df Force-shutdown Puma if necessary
CI / Test (push) Successful in 31s
Do it before the systemd service's timeout is reached
2026-08-10 17:24:08 -06:00
raucao 34cd98625c Merge branch 'master' into live 2026-08-10 17:12:06 -06:00
raucao 44b5a0b36b Merge pull request 'Upgrade Rails to 8.1' (#245) from chore/upgrade_rails into master
CI / Test (push) Successful in 32s
Reviewed-on: #245
2026-08-10 23:11:28 +00:00
raucao 5ebf496096 Upgrade Rails to 8.1
CI / Test (pull_request) Successful in 1m4s
Release Drafter / Update release notes draft (pull_request) Successful in 2s
2026-08-10 17:02:37 -06:00
raucao 7a63c87b03 Fix deprecation warning 2026-08-10 17:02:20 -06:00
raucao 6cc35f07eb Remove more obsolete Devise code
The initializer was a no-op override after our Devise upgrade
2026-08-10 17:01:36 -06:00
raucao 89423ecf84 Merge pull request 'Upgrade Devise to 5.0, remove obsolete workarounds' (#244) from chore/upgrade_devise into master
CI / Test (push) Successful in 31s
Reviewed-on: #244
2026-08-10 22:40:47 +00:00
raucao c79c421b89 Fix Devise Turbo Stream responses for flash messages
CI / Test (pull_request) Successful in 33s
Release Drafter / Update release notes draft (pull_request) Successful in 2s
Wire Users::DeviseController as Devise parent controller with the
Turbo-aware responder, so failed form submissions (login, password
reset) render correctly as HTML with 422 status instead of
unprocessable turbo-stream content that Turbo silently drops.

Also fixes a NameError in the responder (rendering_options ->
error_rendering_options) and removes the dead TurboController.
2026-08-10 16:37:01 -06:00
raucao 8a8d407bcc Add missing whitespace between Devise (sign-in) errors and forms
CI / Test (pull_request) Successful in 32s
2026-08-10 15:17:43 -06:00
raucao 045df94c29 Upgrade Devise to 5.0, remove workarounds
CI / Test (pull_request) Successful in 52s
2026-08-10 15:15:27 -06:00
raucao fa64cf64a2 Merge branch 'master' into live 2026-08-10 14:24:57 -06:00
raucao 8336930077 Merge branch 'master' into live 2026-08-09 18:51:24 -06:00
raucao 1a69f59b32 Merge branch 'master' into live 2026-08-09 14:31:39 -06:00
raucao 975d1ca614 Merge branch 'master' into live
continuous-integration/drone/push Build is failing
2026-08-07 12:38:27 -06:00
raucao 28127bc1f5 Gah 2026-07-09 16:53:29 +02:00
raucao 93e4a65a00 Point tailwind command at module executable 2026-07-09 16:45:16 +02:00
raucao 8728684c21 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-06-12 16:10:06 +04:00
raucao dfb5b6b794 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-06-12 15:39:15 +04:00
raucao 8cf138b035 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-05-28 14:51:31 +04:00
raucao d48f1caa28 Merge branch 'master' into live
continuous-integration/drone/push Build is failing
2025-05-28 14:29:09 +04:00
raucao 6a2ad475be Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-05-28 13:26:51 +04:00
raucao 942ae25f09 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-05-23 14:10:16 +04:00
raucao b6968f1742 Merge branch 'feature/mastodon_api' into live
continuous-integration/drone/push Build is passing
2025-05-18 14:56:52 +04:00
raucao 4f4e086518 Merge branch 'feature/mastodon_api' into live
continuous-integration/drone/push Build is passing
2025-05-18 14:46:33 +04:00
raucao a04a1479f8 Merge branch 'feature/mastodon_api' into live
continuous-integration/drone/push Build is passing
2025-05-18 14:38:00 +04:00
raucao 613090d38a Merge branch 'feature/mastodon_api' into live
continuous-integration/drone/push Build is passing
2025-05-17 18:57:10 +04:00
raucao f1c540537a Merge branch 'feature/mastodon_api' into live
continuous-integration/drone/push Build is passing
2025-05-17 18:22:38 +04:00
raucao 1dcdc2b032 Allow syncing a single Mastodon profile
continuous-integration/drone/push Build is passing
2025-05-17 18:22:11 +04:00
raucao 4545c3ba19 Merge branch 'feature/mastodon_api' into live
continuous-integration/drone/push Build is passing
2025-05-17 18:12:57 +04:00
raucao bfa1514181 Update doc
continuous-integration/drone/push Build is passing
2025-05-17 18:11:17 +04:00
raucao f0846308da Only update other avatars in one place
continuous-integration/drone/push Build is passing
Prevent future mistakes
2025-05-17 18:02:13 +04:00
raucao b3b7fe6359 Don't queue job when service isn't enabled 2025-05-17 18:02:13 +04:00
raucao f0b541ee50 Add avatar to admin user page 2025-05-17 18:02:13 +04:00
raucao df9077e3c1 Sync Mastodon IDs/profiles to local accounts
Add a new service to import some data from Mastodon accounts:

* Find users by username, store Mastodon account ID in local db when
  found
* Import display name (don't overwrite existing)
* Import avatar (don't overwrite existing)
2025-05-17 18:02:07 +04:00
raucao 74666130c0 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-05-16 17:30:30 +04:00
raucao 7c43a4d919 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-05-16 16:01:31 +04:00
raucao 520552ec70 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-05-16 15:38:20 +04:00
raucao 307095bfd0 WTF
continuous-integration/drone/push Build is passing
2025-05-15 22:21:33 +04:00
raucao ae7291d4f1 Merge branch 'feature/ejabberd_pep' into live
continuous-integration/drone/push Build is failing
2025-05-15 22:07:26 +04:00
raucao 322ca98da9 Merge branch 'feature/ejabberd_pep' into live
continuous-integration/drone/push Build is passing
2025-05-15 20:05:30 +04:00
raucao 66f3950b83 Add job for setting avatar via XMPP 2025-05-15 20:04:55 +04:00
raucao 4e115eb514 Merge branch 'feature/ejabberd_pep' into live
continuous-integration/drone/push Build is failing
2025-05-15 19:50:30 +04:00
raucao fc9b471a10 Add job for setting avatar via XMPP 2025-05-15 19:50:05 +04:00
raucao b33e47e60f Merge branch 'feature/ejabberd_pep' into live
continuous-integration/drone/push Build is passing
2025-05-15 12:54:25 +04:00
raucao 9878e4a3e8 Merge branch 'feature/ejabberd_pep' into live
continuous-integration/drone/push Build is passing
2025-05-15 12:38:58 +04:00
raucao 9c35323bcd Return response for ejabberd API calls 2025-05-15 12:38:40 +04:00
raucao e2716d94c0 Merge branch 'feature/ejabberd_pep' into live
continuous-integration/drone/push Build is passing
2025-05-15 12:22:29 +04:00
raucao 9394f649a6 Merge branch 'feature/ejabberd_pep' into live
continuous-integration/drone/push Build is passing
2025-05-15 12:02:05 +04:00
raucao 41b9cb722b Merge branch 'feature/ejabberd_pep' into live
continuous-integration/drone/push Build is passing
2025-05-15 11:48:10 +04:00
raucao f1c13d7bd9 Add private_get to ejabberd service
continuous-integration/drone/push Build is passing
2025-05-15 11:47:23 +04:00
raucao c6cb9caa6d Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-05-14 18:58:38 +04:00
raucao 208977177a Merge branch 'feature/user_avatars' into live
continuous-integration/drone/push Build is passing
2025-05-14 15:40:47 +04:00
raucao 9a406b8381 Merge branch 'feature/user_avatars' into live
continuous-integration/drone/push Build is passing
2025-05-14 14:44:14 +04:00
raucao 4c972bfe7a Merge branch 'feature/user_avatars' into live
continuous-integration/drone/push Build is passing
2025-05-12 16:40:44 +04:00
raucao 0191d248f8 Merge branch 'feature/user_avatars' into live
continuous-integration/drone/push Build is passing
2025-05-12 15:11:39 +04:00
raucao 710afb6c78 Merge branch 'chore/215-configs' into live
continuous-integration/drone/push Build is passing
2025-05-06 20:14:42 +04:00
raucao 69e9662133 Merge branch 'chore/215-configs' into live
continuous-integration/drone/push Build is failing
2025-05-06 20:01:15 +04:00
raucao a73d0f29bd Merge branch 'chore/215-configs' into live
continuous-integration/drone/push Build is passing
2025-05-06 19:53:52 +04:00
raucao 7836805570 Merge branch 'chore/215-configs' into live
continuous-integration/drone/push Build is passing
2025-05-06 19:04:03 +04:00
raucao 1fc434cb3a Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-05-05 17:39:06 +04:00
raucao dad7d5195e Merge branch 'chore/db_configs' into live
continuous-integration/drone/push Build is passing
2025-05-05 15:28:16 +04:00
raucao 596cad34da Merge branch 'chore/upgrade_rails' into live 2025-04-29 17:25:25 +04:00
raucao aaee5cb4ed Merge branch 'chore/upgrade_rails' into live
continuous-integration/drone/push Build is passing
2025-04-28 17:56:57 +04:00
raucao ebaca5ba65 Merge branch 'chore/upgrade_rails' into live 2025-04-28 15:58:17 +04:00
raucao b6bcfa2ee3 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2025-04-18 14:54:01 +04:00
raucao 9082ee45d8 Merge branch 'master' into live 2025-01-02 08:32:15 -05:00
raucao 29264aad98 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-10-16 13:33:35 +02:00
raucao 259b51a95e Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-09-24 21:40:25 +02:00
raucao fb369530e3 Merge branch 'master' into live
continuous-integration/drone/push Build is failing
2024-09-14 17:18:09 +02:00
raucao 5dc10a4d33 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-09-14 16:46:27 +02:00
raucao 2297c68046 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-09-14 16:41:01 +02:00
raucao b82ab45c99 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-09-14 14:57:35 +02:00
raucao d12c63db26 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-09-10 16:07:24 +02:00
raucao e6a9ef84ce Merge branch 'master' into live
continuous-integration/drone/push Build is failing
2024-08-19 15:13:46 +02:00
raucao b7e91344a0 Merge branch 'master' into live
continuous-integration/drone/push Build is failing
2024-08-19 14:48:35 +02:00
raucao 0f07e32781 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-08-17 14:49:29 +02:00
raucao 1311b5ed6a Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-08-17 14:46:00 +02:00
raucao 12f82061e8 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-08-17 14:42:32 +02:00
raucao a07b4369ab Hide njump link for users without pubkey
continuous-integration/drone/push Build is passing
2024-06-23 17:33:34 +02:00
raucao 2605c06807 Merge branch 'feature/admin_pages' into live
continuous-integration/drone/push Build is passing
2024-06-23 17:30:22 +02:00
raucao 1db768fb15 Merge branch 'feature/admin_pages' into live
continuous-integration/drone/push Build is passing
2024-06-23 17:27:03 +02:00
raucao 8a7403df32 Merge branch 'feature/own_relay' into live
continuous-integration/drone/push Build is passing
2024-06-20 15:52:03 +02:00
raucao f0295fef7a Merge branch 'feature/own_relay' into live
continuous-integration/drone/push Build is passing
2024-06-20 15:28:55 +02:00
raucao 090affd304 Merge branch 'feature/own_relay' into live
continuous-integration/drone/push Build is passing
2024-06-20 14:51:20 +02:00
raucao bafddd436b Merge branch 'feature/own_relay' into live
continuous-integration/drone/push Build is passing
2024-06-20 13:59:59 +02:00
raucao 560f193c4b Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-06-20 13:56:11 +02:00
raucao 8aabbad5bb Merge branch 'feature/strfry_zap_receipts' into live 2024-06-20 13:56:00 +02:00
raucao ba8d21eb7a Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-06-09 13:29:57 +02:00
raucao 53df455d53 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-06-09 13:17:51 +02:00
raucao 9f1af3a9aa Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-06-07 14:13:53 +02:00
raucao 1d09008ce2 Merge branch 'master' into live
continuous-integration/drone/push Build is passing
2024-06-04 17:45:13 +02:00
raucao 57c5317c38 Merge branch 'feature/170-nostr_zaps' into live
continuous-integration/drone/push Build is passing
2024-05-21 18:29:13 +02:00
raucao 41bd920060 Merge branch 'feature/170-nostr_zaps' into live
continuous-integration/drone/push Build is passing
2024-05-21 18:09:09 +02:00
raucao 0815fa6040 Merge branch 'feature/170-nostr_zaps' into live
continuous-integration/drone/push Build is passing
2024-05-19 17:07:58 +02:00
raucao af0e99aa50 Merge branch 'feature/170-nostr_zaps' into live
continuous-integration/drone/push Build is passing
2024-05-19 16:55:10 +02:00
raucao f05eec5255 Merge branch 'feature/170-nostr_zaps' into live
continuous-integration/drone/push Build is passing
2024-05-19 16:48:28 +02:00
raucao 66ca2dc6b0 Merge branch 'feature/173-nostr_ldap' into live
continuous-integration/drone/push Build is passing
2024-05-19 13:44:24 +02:00
raucao 800183e9da Increase sidekiq concurrency in prod
continuous-integration/drone/push Build is passing
2024-05-19 13:44:01 +02:00
17 changed files with 373 additions and 290 deletions
-1
View File
@@ -63,7 +63,6 @@ Warden `Test::Helpers`, DatabaseCleaner (transactional fixtures **off**), ViewCo
and assert on DB rows / `enqueued_jobs`.
- **Request/component/mailer/job/model/helper** specs in matching `spec/` subdirs.
Fixtures live in `spec/fixtures/`; factories in `spec/factories/`.
- `spec_helper.rb` reloads routes before each `type: :controller` spec (Devise + Rails 8 workaround).
## Notes & gotchas
+5 -5
View File
@@ -2,9 +2,9 @@ source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 8.0'
gem 'rails', '~> 8.1'
# Use Puma as the app server
gem 'puma', '~> 6.6'
gem 'puma', '~> 8.0'
# View components
gem "view_component"
# Asset bundler
@@ -18,7 +18,7 @@ gem "turbo-rails"
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails"
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
gem 'jbuilder', '~> 2.15'
# Use Active Model has_secure_password
gem 'bcrypt', '~> 3.1'
@@ -27,7 +27,7 @@ gem 'dotenv-rails'
# Authentication
gem 'warden'
gem 'devise', '~> 4.9.0'
gem 'devise', '~> 5.0'
gem 'devise_ldap_authenticatable'
gem 'net-ldap'
@@ -73,7 +73,7 @@ end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '~> 4.2'
gem 'web-console', '~> 4.3'
gem 'listen', '~> 3.2'
gem 'letter_opener'
gem 'letter_opener_web'
+149 -140
View File
@@ -3,29 +3,31 @@ GEM
specs:
aasm (5.5.0)
concurrent-ruby (~> 1.0)
actioncable (8.0.2)
actionpack (= 8.0.2)
activesupport (= 8.0.2)
action_text-trix (2.1.19)
railties
actioncable (8.1.3.1)
actionpack (= 8.1.3.1)
activesupport (= 8.1.3.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (8.0.2)
actionpack (= 8.0.2)
activejob (= 8.0.2)
activerecord (= 8.0.2)
activestorage (= 8.0.2)
activesupport (= 8.0.2)
actionmailbox (8.1.3.1)
actionpack (= 8.1.3.1)
activejob (= 8.1.3.1)
activerecord (= 8.1.3.1)
activestorage (= 8.1.3.1)
activesupport (= 8.1.3.1)
mail (>= 2.8.0)
actionmailer (8.0.2)
actionpack (= 8.0.2)
actionview (= 8.0.2)
activejob (= 8.0.2)
activesupport (= 8.0.2)
actionmailer (8.1.3.1)
actionpack (= 8.1.3.1)
actionview (= 8.1.3.1)
activejob (= 8.1.3.1)
activesupport (= 8.1.3.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (8.0.2)
actionview (= 8.0.2)
activesupport (= 8.0.2)
actionpack (8.1.3.1)
actionview (= 8.1.3.1)
activesupport (= 8.1.3.1)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
@@ -33,42 +35,43 @@ GEM
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (8.0.2)
actionpack (= 8.0.2)
activerecord (= 8.0.2)
activestorage (= 8.0.2)
activesupport (= 8.0.2)
actiontext (8.1.3.1)
action_text-trix (~> 2.1.15)
actionpack (= 8.1.3.1)
activerecord (= 8.1.3.1)
activestorage (= 8.1.3.1)
activesupport (= 8.1.3.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (8.0.2)
activesupport (= 8.0.2)
actionview (8.1.3.1)
activesupport (= 8.1.3.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (8.0.2)
activesupport (= 8.0.2)
activejob (8.1.3.1)
activesupport (= 8.1.3.1)
globalid (>= 0.3.6)
activemodel (8.0.2)
activesupport (= 8.0.2)
activerecord (8.0.2)
activemodel (= 8.0.2)
activesupport (= 8.0.2)
activemodel (8.1.3.1)
activesupport (= 8.1.3.1)
activerecord (8.1.3.1)
activemodel (= 8.1.3.1)
activesupport (= 8.1.3.1)
timeout (>= 0.4.0)
activestorage (8.0.2)
actionpack (= 8.0.2)
activejob (= 8.0.2)
activerecord (= 8.0.2)
activesupport (= 8.0.2)
activestorage (8.1.3.1)
actionpack (= 8.1.3.1)
activejob (= 8.1.3.1)
activerecord (= 8.1.3.1)
activesupport (= 8.1.3.1)
marcel (~> 1.0)
activesupport (8.0.2)
activesupport (8.1.3.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
json
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
@@ -96,12 +99,12 @@ GEM
aws-sigv4 (1.11.0)
aws-eventstream (~> 1, >= 1.0.2)
backport (1.2.0)
base64 (0.2.0)
bcrypt (3.1.20)
base64 (0.3.0)
bcrypt (3.1.22)
bech32 (1.5.0)
thor (>= 1.1.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
benchmark (0.5.0)
bigdecimal (4.1.2)
bindex (0.8.1)
bip-schnorr (0.7.0)
ecdsa_ext (~> 0.5.0)
@@ -118,12 +121,12 @@ GEM
childprocess (5.1.0)
logger (~> 1.5)
chunky_png (1.4.0)
concurrent-ruby (1.3.4)
connection_pool (2.5.2)
concurrent-ruby (1.3.8)
connection_pool (3.0.2)
crack (1.0.0)
bigdecimal
rexml
crass (1.0.6)
crass (1.0.7)
cssbundling-rails (1.4.3)
railties (>= 6.0.0)
database_cleaner (2.1.0)
@@ -132,17 +135,17 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.4.1)
devise (4.9.4)
date (3.5.1)
devise (5.0.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
railties (>= 7.0)
responders
warden (~> 1.2.3)
devise_ldap_authenticatable (0.8.7)
devise (>= 3.4.1)
net-ldap (>= 0.16.0)
diff-lcs (1.6.1)
diff-lcs (1.6.2)
discourse_api (2.0.1)
faraday (~> 2.7)
faraday-follow_redirects
@@ -154,12 +157,13 @@ GEM
railties (>= 6.1)
down (5.4.2)
addressable (~> 2.8)
drb (2.2.1)
drb (2.2.3)
ecdsa (1.2.0)
ecdsa_ext (0.5.1)
ecdsa (~> 1.2.0)
erb (6.0.7)
erubi (1.13.1)
et-orbi (1.2.11)
et-orbi (1.4.1)
tzinfo
event_emitter (0.2.6)
eventmachine (1.2.7)
@@ -196,34 +200,35 @@ GEM
rack-protection (>= 1.5.3, < 5.0.0)
rack-session (>= 1.0.2, < 3.0.0)
sanitize (< 8)
fugit (1.11.1)
et-orbi (~> 1, >= 1.2.11)
fugit (1.13.0)
et-orbi (~> 1.4)
raabro (~> 1.4)
globalid (1.2.1)
globalid (1.4.0)
activesupport (>= 6.1)
gpgme (2.0.24)
mini_portile2 (~> 2.7)
hashdiff (1.1.2)
i18n (1.14.7)
i18n (1.15.2)
concurrent-ruby (~> 1.0)
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (2.1.0)
importmap-rails (2.2.3)
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
io-console (0.8.0)
irb (1.15.2)
io-console (0.9.2)
irb (1.18.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jaro_winkler (1.6.0)
jbuilder (2.13.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
jbuilder (2.15.1)
actionview (>= 7.0.0)
activesupport (>= 7.0.0)
jmespath (1.6.2)
json (2.11.3)
json (2.21.2)
kramdown (2.5.1)
rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
@@ -247,10 +252,11 @@ GEM
lnurl (1.1.1)
bech32 (~> 1.1)
logger (1.7.0)
loofah (2.24.0)
loofah (2.25.2)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
mail (2.9.1)
logger
mini_mime (>= 0.1.1)
net-imap
net-pop
@@ -259,14 +265,15 @@ GEM
faraday (~> 2.9.0)
faraday-follow_redirects (= 0.3.0)
nokogiri (~> 1.16.0)
marcel (1.0.4)
marcel (1.2.1)
matrix (0.4.2)
method_source (1.1.0)
mini_magick (4.13.2)
mini_mime (1.1.5)
mini_portile2 (2.8.8)
minitest (5.25.5)
mission_control-jobs (1.0.2)
mini_portile2 (2.8.9)
minitest (6.0.6)
drb (~> 2.0)
prism (~> 1.5)
mission_control-jobs (1.1.0)
actioncable (>= 7.1)
actionpack (>= 7.1)
activejob (>= 7.1)
@@ -279,7 +286,7 @@ GEM
multipart-post (2.4.1)
net-http (0.6.0)
uri
net-imap (0.5.7)
net-imap (0.6.6)
date
net-protocol
net-ldap (0.19.0)
@@ -289,7 +296,7 @@ GEM
timeout
net-smtp (0.5.1)
net-protocol
nio4r (2.7.4)
nio4r (2.7.5)
nokogiri (1.16.8)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
@@ -313,24 +320,23 @@ GEM
ast (~> 2.4.1)
racc
pg (1.5.9)
pp (0.6.2)
pp (0.6.4)
prettyprint
prettyprint (0.2.0)
prism (1.4.0)
propshaft (1.1.0)
prism (1.9.0)
propshaft (1.3.2)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
railties (>= 7.0.0)
psych (5.2.3)
psych (5.4.0)
date
stringio
public_suffix (6.0.1)
puma (6.6.0)
puma (8.0.2)
nio4r (~> 2.0)
raabro (1.4.0)
raabro (1.5.0)
racc (1.8.1)
rack (2.2.13)
rack (2.2.23)
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
@@ -341,61 +347,64 @@ GEM
rackup (1.0.1)
rack (< 3)
webrick
rails (8.0.2)
actioncable (= 8.0.2)
actionmailbox (= 8.0.2)
actionmailer (= 8.0.2)
actionpack (= 8.0.2)
actiontext (= 8.0.2)
actionview (= 8.0.2)
activejob (= 8.0.2)
activemodel (= 8.0.2)
activerecord (= 8.0.2)
activestorage (= 8.0.2)
activesupport (= 8.0.2)
rails (8.1.3.1)
actioncable (= 8.1.3.1)
actionmailbox (= 8.1.3.1)
actionmailer (= 8.1.3.1)
actionpack (= 8.1.3.1)
actiontext (= 8.1.3.1)
actionview (= 8.1.3.1)
activejob (= 8.1.3.1)
activemodel (= 8.1.3.1)
activerecord (= 8.1.3.1)
activestorage (= 8.1.3.1)
activesupport (= 8.1.3.1)
bundler (>= 1.15.0)
railties (= 8.0.2)
railties (= 8.1.3.1)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.2.0)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
rails-html-sanitizer (1.7.1)
loofah (~> 2.25, >= 2.25.2)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails-settings-cached (2.8.3)
activerecord (>= 5.0.0)
railties (>= 5.0.0)
railties (8.0.2)
actionpack (= 8.0.2)
activesupport (= 8.0.2)
railties (8.1.3.1)
actionpack (= 8.1.3.1)
activesupport (= 8.1.3.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
tsort (>= 0.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rake (13.4.2)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rbs (3.9.2)
logger
rdoc (6.13.1)
rdoc (7.2.0)
erb
psych (>= 4.0.0)
tsort
redis (5.4.0)
redis-client (>= 0.22.0)
redis-client (0.24.0)
connection_pool
regexp_parser (2.10.0)
reline (0.6.1)
reline (0.7.0)
io-console (~> 0.5)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
responders (3.2.0)
actionpack (>= 7.0)
railties (>= 7.0)
reverse_markdown (3.0.0)
nokogiri
rexml (3.4.1)
@@ -403,23 +412,23 @@ GEM
chunky_png (~> 1.0)
rqrcode_core (~> 1.0)
rqrcode_core (1.2.0)
rspec-core (3.13.3)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (7.1.1)
actionpack (>= 7.0)
activesupport (>= 7.0)
railties (>= 7.0)
rspec-core (~> 3.13)
rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.2)
rspec-rails (8.0.4)
actionpack (>= 7.2)
activesupport (>= 7.2)
railties (>= 7.2)
rspec-core (>= 3.13.0, < 5.0.0)
rspec-expectations (>= 3.13.0, < 5.0.0)
rspec-mocks (>= 3.13.0, < 5.0.0)
rspec-support (>= 3.13.0, < 5.0.0)
rspec-support (3.13.7)
rubocop (1.75.3)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
@@ -467,24 +476,25 @@ GEM
tilt (~> 2.0)
yard (~> 0.9, >= 0.9.24)
yard-solargraph (~> 0.1)
solid_queue (1.1.5)
solid_queue (1.6.0)
activejob (>= 7.1)
activerecord (>= 7.1)
concurrent-ruby (>= 1.3.1)
fugit (~> 1.11.0)
fugit (~> 1.11)
railties (>= 7.1)
thor (~> 1.3.1)
thor (>= 1.3.1)
sqlite3 (2.6.0)
mini_portile2 (~> 2.8.0)
sqlite3 (2.6.0-arm64-darwin)
sqlite3 (2.6.0-x86_64-linux-gnu)
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.1.7)
thor (1.3.2)
stringio (3.2.0)
thor (1.5.0)
tilt (2.6.0)
timeout (0.4.3)
turbo-rails (2.0.13)
timeout (0.6.1)
tsort (0.2.0)
turbo-rails (2.0.23)
actionpack (>= 7.1.0)
railties (>= 7.1.0)
tzinfo (2.0.6)
@@ -492,25 +502,24 @@ GEM
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.3)
uri (1.1.1)
useragent (0.16.11)
view_component (3.22.0)
activesupport (>= 5.2.0, < 8.1)
concurrent-ruby (= 1.3.4)
method_source (~> 1.0)
view_component (4.12.0)
actionview (>= 7.1.0)
activesupport (>= 7.1.0)
concurrent-ruby (~> 1)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
web-console (4.3.0)
actionview (>= 8.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
railties (>= 8.0.0)
webmock (3.25.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.9.1)
websocket-driver (0.7.7)
webrick (1.9.2)
websocket-driver (0.8.2)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
@@ -520,7 +529,7 @@ GEM
yard-solargraph (0.1.0)
yard (~> 0.9)
zbase32 (0.1.1)
zeitwerk (2.7.2)
zeitwerk (2.8.3)
PLATFORMS
arm64-darwin-22
@@ -534,7 +543,7 @@ DEPENDENCIES
capybara
cssbundling-rails
database_cleaner
devise (~> 4.9.0)
devise (~> 5.0)
devise_ldap_authenticatable
discourse_api
dotenv-rails
@@ -548,7 +557,7 @@ DEPENDENCIES
gpgme (~> 2.0.24)
image_processing (~> 1.12.2)
importmap-rails
jbuilder (~> 2.7)
jbuilder (~> 2.15)
kramdown
letter_opener
letter_opener_web
@@ -561,8 +570,8 @@ DEPENDENCIES
pagy (~> 6.0, >= 6.0.2)
pg (~> 1.5)
propshaft
puma (~> 6.6)
rails (~> 8.0)
puma (~> 8.0)
rails (~> 8.1)
rails-controller-testing
rails-settings-cached (~> 2.8.3)
redis (~> 5.4)
@@ -578,7 +587,7 @@ DEPENDENCIES
tzinfo-data
view_component
warden
web-console (~> 4.2)
web-console (~> 4.3)
webmock
zbase32 (~> 0.1.1)
-18
View File
@@ -1,18 +0,0 @@
class TurboController < ApplicationController
class Responder < ActionController::Responder
def to_turbo_stream
controller.render(options.merge(formats: :html))
rescue ActionView::MissingTemplate => error
if get?
raise error
elsif has_errors? && default_action
render rendering_options.merge(formats: :html, status: :unprocessable_entity)
else
redirect_to navigation_location
end
end
end
self.responder = Responder
respond_to :html, :turbo_stream
end
+1 -1
View File
@@ -6,7 +6,7 @@ class Users::DeviseController < ApplicationController
if get?
raise error
elsif has_errors? && default_action
render rendering_options.merge(formats: :html, status: :unprocessable_entity)
render error_rendering_options.merge(formats: :html, status: :unprocessable_entity)
else
redirect_to navigation_location
end
+4 -4
View File
@@ -10,18 +10,18 @@ class LndhubUser < LndhubBase
foreign_key: "login"
def balance
accounts.current.first.ledgers.sum("account_ledgers.amount").to_i.abs
accounts.current.order(:id).first.ledgers.sum("account_ledgers.amount").to_i.abs
end
def sum_outgoing
accounts.outgoing.first.ledgers.sum("account_ledgers.amount").to_i.abs
accounts.outgoing.order(:id).first.ledgers.sum("account_ledgers.amount").to_i.abs
end
def sum_incoming
accounts.incoming.first.ledgers.sum("account_ledgers.amount").to_i.abs
accounts.incoming.order(:id).first.ledgers.sum("account_ledgers.amount").to_i.abs
end
def sum_fees
accounts.fees.first.ledgers.sum("account_ledgers.amount").to_i.abs
accounts.fees.order(:id).first.ledgers.sum("account_ledgers.amount").to_i.abs
end
end
+2 -2
View File
@@ -25,9 +25,8 @@ module EjabberdManager
raise res.inspect if res.status != 200
end
end
end
private
private
def process_avatar
@user.avatar.blob.open do |file|
@@ -77,4 +76,5 @@ module EjabberdManager
""".strip,
]
end
end
end
@@ -1,5 +1,5 @@
<% if resource.errors.any? %>
<div id="error_explanation">
<div id="error_explanation" class="mb-6">
<ul>
<% resource.errors.full_messages.each do |message| %>
<li class="text-red-600"><%= message %></li>
+1 -1
View File
@@ -21,7 +21,7 @@ Bundler.require(*Rails.groups)
module Akkounts
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 8.0
config.load_defaults 8.1
# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
+6 -5
View File
@@ -6,6 +6,7 @@ require 'securerandom'
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# Hotwire/Turbo
config.parent_controller = 'Users::DeviseController'
config.responder.error_status = :unprocessable_entity
config.responder.redirect_status = :see_other
@@ -325,9 +326,9 @@ Devise.setup do |config|
# config.sign_in_after_change_password = true
end
# https://github.com/heartcombo/devise/issues/5644
class Devise::SecretKeyFinder
def find
@application.secret_key_base
end
# Turbo-aware responder for Devise controllers
ActiveSupport.on_load(:devise_controller) do
self.responder = Users::DeviseController::Responder
Users::DeviseController::Responder.error_status = :unprocessable_entity
Users::DeviseController::Responder.redirect_status = :see_other
end
@@ -1,11 +0,0 @@
# See https://alvincrespo.hashnode.dev/rails-8s-lazy-route-loading-devise
# TODO remove when Devise is fixed
require 'devise'
Devise # make sure it's already loaded
module Devise
def self.mappings
Rails.application.try(:reload_routes_unless_loaded)
@@mappings
end
end
+2
View File
@@ -38,6 +38,8 @@ plugin :tmp_restart
# Run the Solid Queue supervisor inside of Puma for single-server deployments
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
force_shutdown_after 25
# Specify the PID file. Defaults to tmp/pids/server.pid in development.
# In other environments, only set the PID file if requested.
pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
+2
View File
@@ -1,4 +1,6 @@
:concurrency: 2
production:
:concurrency: 10
:queues:
- default
- mailers
+40 -40
View File
@@ -10,44 +10,44 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 1) do
ActiveRecord::Schema[8.1].define(version: 1) do
create_table "solid_queue_blocked_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.string "queue_name", null: false
t.integer "priority", default: 0, null: false
t.string "concurrency_key", null: false
t.datetime "expires_at", null: false
t.datetime "created_at", null: false
t.datetime "expires_at", null: false
t.bigint "job_id", null: false
t.integer "priority", default: 0, null: false
t.string "queue_name", null: false
t.index ["concurrency_key", "priority", "job_id"], name: "index_solid_queue_blocked_executions_for_release"
t.index ["expires_at", "concurrency_key"], name: "index_solid_queue_blocked_executions_for_maintenance"
t.index ["job_id"], name: "index_solid_queue_blocked_executions_on_job_id", unique: true
end
create_table "solid_queue_claimed_executions", force: :cascade do |t|
t.datetime "created_at", null: false
t.bigint "job_id", null: false
t.bigint "process_id"
t.datetime "created_at", null: false
t.index ["job_id"], name: "index_solid_queue_claimed_executions_on_job_id", unique: true
t.index ["process_id", "job_id"], name: "index_solid_queue_claimed_executions_on_process_id_and_job_id"
end
create_table "solid_queue_failed_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.text "error"
t.datetime "created_at", null: false
t.text "error"
t.bigint "job_id", null: false
t.index ["job_id"], name: "index_solid_queue_failed_executions_on_job_id", unique: true
end
create_table "solid_queue_jobs", force: :cascade do |t|
t.string "queue_name", null: false
t.string "class_name", null: false
t.text "arguments"
t.integer "priority", default: 0, null: false
t.string "active_job_id"
t.datetime "scheduled_at"
t.datetime "finished_at"
t.text "arguments"
t.string "class_name", null: false
t.string "concurrency_key"
t.datetime "created_at", null: false
t.datetime "finished_at"
t.integer "priority", default: 0, null: false
t.string "queue_name", null: false
t.datetime "scheduled_at"
t.datetime "updated_at", null: false
t.index ["active_job_id"], name: "index_solid_queue_jobs_on_active_job_id"
t.index ["class_name"], name: "index_solid_queue_jobs_on_class_name"
@@ -57,76 +57,76 @@ ActiveRecord::Schema[8.0].define(version: 1) do
end
create_table "solid_queue_pauses", force: :cascade do |t|
t.string "queue_name", null: false
t.datetime "created_at", null: false
t.string "queue_name", null: false
t.index ["queue_name"], name: "index_solid_queue_pauses_on_queue_name", unique: true
end
create_table "solid_queue_processes", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "hostname"
t.string "kind", null: false
t.datetime "last_heartbeat_at", null: false
t.bigint "supervisor_id"
t.integer "pid", null: false
t.string "hostname"
t.text "metadata"
t.datetime "created_at", null: false
t.string "name", null: false
t.integer "pid", null: false
t.bigint "supervisor_id"
t.index ["last_heartbeat_at"], name: "index_solid_queue_processes_on_last_heartbeat_at"
t.index ["name", "supervisor_id"], name: "index_solid_queue_processes_on_name_and_supervisor_id", unique: true
t.index ["supervisor_id"], name: "index_solid_queue_processes_on_supervisor_id"
end
create_table "solid_queue_ready_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.string "queue_name", null: false
t.integer "priority", default: 0, null: false
t.datetime "created_at", null: false
t.bigint "job_id", null: false
t.integer "priority", default: 0, null: false
t.string "queue_name", null: false
t.index ["job_id"], name: "index_solid_queue_ready_executions_on_job_id", unique: true
t.index ["priority", "job_id"], name: "index_solid_queue_poll_all"
t.index ["queue_name", "priority", "job_id"], name: "index_solid_queue_poll_by_queue"
end
create_table "solid_queue_recurring_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.string "task_key", null: false
t.datetime "run_at", null: false
t.datetime "created_at", null: false
t.bigint "job_id", null: false
t.datetime "run_at", null: false
t.string "task_key", null: false
t.index ["job_id"], name: "index_solid_queue_recurring_executions_on_job_id", unique: true
t.index ["task_key", "run_at"], name: "index_solid_queue_recurring_executions_on_task_key_and_run_at", unique: true
end
create_table "solid_queue_recurring_tasks", force: :cascade do |t|
t.string "key", null: false
t.string "schedule", null: false
t.string "command", limit: 2048
t.string "class_name"
t.text "arguments"
t.string "queue_name"
t.integer "priority", default: 0
t.boolean "static", default: true, null: false
t.text "description"
t.string "class_name"
t.string "command", limit: 2048
t.datetime "created_at", null: false
t.text "description"
t.string "key", null: false
t.integer "priority", default: 0
t.string "queue_name"
t.string "schedule", null: false
t.boolean "static", default: true, null: false
t.datetime "updated_at", null: false
t.index ["key"], name: "index_solid_queue_recurring_tasks_on_key", unique: true
t.index ["static"], name: "index_solid_queue_recurring_tasks_on_static"
end
create_table "solid_queue_scheduled_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.string "queue_name", null: false
t.integer "priority", default: 0, null: false
t.datetime "scheduled_at", null: false
t.datetime "created_at", null: false
t.bigint "job_id", null: false
t.integer "priority", default: 0, null: false
t.string "queue_name", null: false
t.datetime "scheduled_at", null: false
t.index ["job_id"], name: "index_solid_queue_scheduled_executions_on_job_id", unique: true
t.index ["scheduled_at", "priority", "job_id"], name: "index_solid_queue_dispatch_all"
end
create_table "solid_queue_semaphores", force: :cascade do |t|
t.string "key", null: false
t.integer "value", default: 1, null: false
t.datetime "expires_at", null: false
t.datetime "created_at", null: false
t.datetime "expires_at", null: false
t.string "key", null: false
t.datetime "updated_at", null: false
t.integer "value", default: 1, null: false
t.index ["expires_at"], name: "index_solid_queue_semaphores_on_expires_at"
t.index ["key", "value"], name: "index_solid_queue_semaphores_on_key_and_value"
t.index ["key"], name: "index_solid_queue_semaphores_on_key", unique: true
+56 -56
View File
@@ -10,26 +10,26 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2025_05_28_092931) do
ActiveRecord::Schema[8.1].define(version: 2025_05_28_092931) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.string "name", null: false
t.bigint "record_id", null: false
t.string "record_type", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
create_table "active_storage_blobs", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.string "service_name", null: false
t.bigint "byte_size", null: false
t.string "checksum"
t.string "content_type"
t.datetime "created_at", null: false
t.string "filename", null: false
t.string "key", null: false
t.text "metadata"
t.string "service_name", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
@@ -40,77 +40,77 @@ ActiveRecord::Schema[8.0].define(version: 2025_05_28_092931) do
end
create_table "app_catalog_web_apps", force: :cascade do |t|
t.string "url"
t.string "name"
t.text "metadata"
t.datetime "created_at", null: false
t.text "metadata"
t.string "name"
t.datetime "updated_at", null: false
t.string "url"
end
create_table "donations", force: :cascade do |t|
t.integer "user_id"
t.integer "amount_sats"
t.integer "fiat_amount"
t.string "public_name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "paid_at", precision: nil
t.string "fiat_currency", default: "USD"
t.string "donation_method"
t.string "payment_method"
t.string "btcpay_invoice_id"
t.datetime "created_at", null: false
t.string "donation_method"
t.integer "fiat_amount"
t.string "fiat_currency", default: "USD"
t.datetime "paid_at", precision: nil
t.string "payment_method"
t.string "payment_status"
t.string "public_name"
t.datetime "updated_at", null: false
t.integer "user_id"
t.index ["payment_status"], name: "index_donations_on_payment_status"
t.index ["user_id"], name: "index_donations_on_user_id"
end
create_table "editable_contents", force: :cascade do |t|
t.text "content"
t.string "context"
t.datetime "created_at", null: false
t.string "key"
t.string "lang", default: "en"
t.text "content"
t.boolean "rich_text", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "flipper_features", force: :cascade do |t|
t.string "key", null: false
t.datetime "created_at", null: false
t.string "key", null: false
t.datetime "updated_at", null: false
t.index ["key"], name: "index_flipper_features_on_key", unique: true
end
create_table "flipper_gates", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "feature_key", null: false
t.string "key", null: false
t.text "value"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "value"
t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true
end
create_table "invitations", force: :cascade do |t|
t.string "token"
t.integer "user_id"
t.integer "invited_user_id"
t.datetime "used_at", precision: nil
t.datetime "created_at", null: false
t.integer "invited_user_id"
t.string "token"
t.datetime "updated_at", null: false
t.datetime "used_at", precision: nil
t.integer "user_id"
t.index ["invited_user_id"], name: "index_invitations_on_invited_user_id"
t.index ["user_id"], name: "index_invitations_on_user_id"
end
create_table "remote_storage_authorizations", force: :cascade do |t|
t.integer "user_id", null: false
t.string "token"
t.text "permissions", default: "--- []\n"
t.string "client_id"
t.string "redirect_uri"
t.string "app_name"
t.datetime "expire_at"
t.string "client_id"
t.datetime "created_at", null: false
t.datetime "expire_at"
t.text "permissions", default: "--- []\n"
t.string "redirect_uri"
t.string "token"
t.datetime "updated_at", null: false
t.integer "user_id", null: false
t.integer "web_app_id"
t.index ["permissions"], name: "index_remote_storage_authorizations_on_permissions"
t.index ["user_id"], name: "index_remote_storage_authorizations_on_user_id"
@@ -118,45 +118,45 @@ ActiveRecord::Schema[8.0].define(version: 2025_05_28_092931) do
end
create_table "settings", force: :cascade do |t|
t.string "var", null: false
t.text "value"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "value"
t.string "var", null: false
t.index ["var"], name: "index_settings_on_var", unique: true
end
create_table "users", force: :cascade do |t|
t.string "cn"
t.string "ou"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "email", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at", precision: nil
t.datetime "confirmation_sent_at", precision: nil
t.string "confirmation_token"
t.datetime "confirmed_at", precision: nil
t.datetime "confirmation_sent_at", precision: nil
t.string "unconfirmed_email"
t.datetime "created_at", null: false
t.string "email", default: "", null: false
t.text "lndhub_password"
t.string "lndhub_username"
t.bigint "mastodon_id"
t.string "ou"
t.string "pgp_fpr"
t.text "preferences"
t.datetime "remember_created_at"
t.string "remember_token"
t.text "preferences"
t.string "pgp_fpr"
t.string "lndhub_username"
t.text "lndhub_password"
t.bigint "mastodon_id"
t.datetime "reset_password_sent_at", precision: nil
t.string "reset_password_token"
t.string "unconfirmed_email"
t.datetime "updated_at", null: false
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
create_table "zaps", force: :cascade do |t|
t.integer "user_id", null: false
t.json "request"
t.json "receipt"
t.text "payment_request"
t.bigint "amount"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "payment_request"
t.json "receipt"
t.json "request"
t.datetime "settled_at"
t.datetime "updated_at", null: false
t.integer "user_id", null: false
t.index ["user_id"], name: "index_zaps_on_user_id"
end
@@ -0,0 +1,104 @@
require 'rails_helper'
require 'webmock/rspec'
require 'digest'
RSpec.describe EjabberdManager::SetAvatar, type: :model do
let(:user) { create :user, cn: "willherschel", ou: "kosmos.org" }
let(:fixture_path) { Rails.root.join("spec/fixtures/files/bender.png") }
let(:img_data) do
ImageProcessing::Vips
.source(File.open(fixture_path))
.resize_to_fill(256, 256)
.convert("png")
.call.read
end
let(:sha1_hash) { Digest::SHA1.hexdigest(img_data) }
let(:base64_data) { Base64.strict_encode64(img_data) }
before do
ActiveStorage::Blob.create_and_upload!(
io: File.open(fixture_path),
filename: "bender.png",
content_type: "image/png"
).tap { |blob| user.avatar.attach(blob) }
end
def stub_send_stanza_ok
stub_request(:post, "http://xmpp.example.com/api/send_stanza")
.to_return(status: 200, body: "", headers: {})
end
context "when an avatar is already set and overwrite is false" do
before do
allow(EjabberdManager::GetAvatar).to receive(:call).with(user: user).and_return({ img_base64: "abc", content_type: "image/png" })
stub_send_stanza_ok
end
it "does not send any stanzas" do
described_class.call(user: user)
expect(WebMock).not_to have_requested(:post, "http://xmpp.example.com/api/send_stanza")
end
end
context "when no avatar is set yet" do
let(:sent_stanzas) { [] }
before do
allow(EjabberdManager::GetAvatar).to receive(:call).with(user: user).and_return(nil)
stub_request(:post, "http://xmpp.example.com/api/send_stanza")
.to_return(status: 200, body: "", headers: {})
end
it "publishes the XEP-0084 data and metadata stanzas" do
service = described_class.new(user: user)
allow(service).to receive(:send_stanza) do |payload|
sent_stanzas << payload[:stanza]
double(status: 200)
end
service.call
expect(sent_stanzas.length).to eq(2)
data_stanza = sent_stanzas.find { |s| s.include?("urn:xmpp:avatar:data") }
meta_stanza = sent_stanzas.find { |s| s.include?("urn:xmpp:avatar:metadata") }
expect(data_stanza).to include("from='willherschel@kosmos.org'")
expect(data_stanza).to include("<item id='#{sha1_hash}'>")
expect(data_stanza).to include("<data xmlns='urn:xmpp:avatar:data'>#{base64_data}</data>")
expect(meta_stanza).to include("from='willherschel@kosmos.org'")
expect(meta_stanza).to include("<item id='#{sha1_hash}'>")
expect(meta_stanza).to include("bytes='#{img_data.size}'")
expect(meta_stanza).to include("id='#{sha1_hash}'")
expect(meta_stanza).to include("type='image/png'")
expect(meta_stanza).to include("height='256'")
expect(meta_stanza).to include("width='256'")
end
end
context "when overwrite is true" do
before do
allow(EjabberdManager::GetAvatar).to receive(:call).and_return({ img_base64: "abc", content_type: "image/png" })
stub_send_stanza_ok
end
it "does not check for an existing avatar and sends stanzas" do
described_class.call(user: user, overwrite: true)
expect(EjabberdManager::GetAvatar).not_to have_received(:call)
expect(WebMock).to have_requested(:post, "http://xmpp.example.com/api/send_stanza").twice
end
end
context "when the ejabberd API returns a non-200 status" do
before do
allow(EjabberdManager::GetAvatar).to receive(:call).with(user: user).and_return(nil)
stub_request(:post, "http://xmpp.example.com/api/send_stanza")
.to_return(status: 500, body: "error", headers: {})
end
it "raises" do
expect { described_class.call(user: user) }.to raise_error(RuntimeError)
end
end
end
-5
View File
@@ -14,11 +14,6 @@
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
# TODO Remove when Devise fixes https://github.com/heartcombo/devise/issues/5705
config.before(:each, type: :controller) do
Rails.application.reload_routes_unless_loaded
end
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.