about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-18 02:02:54 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-18 02:18:09 -0600
commit0f3b01eaab82325baaf1c7a4c75a322d3c21a67f (patch)
treef3d19c99328336997919803ffc6850a96d5a6411 /config
parentfc69e4a0bb4e3d2fdcb2ffef0f3211f8c347ed15 (diff)
switch to irc-like oper behavior; require mods & admins to explicitly oper up using `fangs`/`op` bangtag or toggling defang setting in profile; auto-defang after 15 mins or with `defang`/`deop` bangtag
Diffstat (limited to 'config')
-rw-r--r--config/locales/de.yml2
-rw-r--r--config/locales/en.yml3
-rw-r--r--config/locales/en_GB.yml1
-rw-r--r--config/locales/simple_form.en.yml2
-rw-r--r--config/navigation.rb24
-rw-r--r--config/sidekiq.yml3
6 files changed, 22 insertions, 13 deletions
diff --git a/config/locales/de.yml b/config/locales/de.yml
index 63a89ee34..acba57868 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -160,7 +160,7 @@ de:
       role: Berechtigungen
       roles:
         admin: Administrator
-        moderator: Moderator:in
+        moderator: Moderator
         staff: Mitarbeiter
         user: Nutzer
       salmon_url: Salmon-URL
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 426da8847..8bee7423e 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -74,7 +74,9 @@ en:
     roles:
       admin: Admin
       bot: Bot
+      halfmod: Half-mod
       moderator: Mod
+      halfmod: Half-mod
       kobold: Gently the kobold
       gently: Gentlies kobolds
       adult: 🔞 Adult content
@@ -177,6 +179,7 @@ en:
       roles:
         admin: Administrator
         moderator: Moderator
+        halfmod: Half-moderator
         staff: Staff
         user: User
       salmon_url: Salmon URL
diff --git a/config/locales/en_GB.yml b/config/locales/en_GB.yml
index d428a95c3..8a34b0167 100644
--- a/config/locales/en_GB.yml
+++ b/config/locales/en_GB.yml
@@ -157,6 +157,7 @@ en_GB:
       roles:
         admin: Administrator
         moderator: Moderator
+        halfmod: Half-moderator
         staff: Staff
         user: User
       salmon_url: Salmon URL
diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml
index 5e70347bf..a3c7748fe 100644
--- a/config/locales/simple_form.en.yml
+++ b/config/locales/simple_form.en.yml
@@ -10,6 +10,7 @@ en:
         type_html: Choose what to do with <strong>%{acct}</strong>
         warning_preset_id: Optional. You can still add custom text to end of the preset
       defaults:
+        user_defanged: Disable this to access to moderation and admin features for 15 minutes.
         block_anon: Links to your public roars are disabled unless they are made accessible by sharekey. Be aware that roars sent to other Fediverse servers can be publically indexed!
         unlisted: Excludes you from public repeated/admired by lists of *local* monsters
         autofollow: People who sign up through the invite will automatically join your pack
@@ -83,6 +84,7 @@ en:
           suspend: Suspend and irreversibly delete account data
         warning_preset_id: Use a warning preset
       defaults:
+        user_defanged: Defanged mode
         hidden: Invisible mode (affects outgoing federation and discovery!)
         adult_content: Contains adult content
         gently: Gently the kobolds
diff --git a/config/navigation.rb b/config/navigation.rb
index 7862e219c..b2a5b555d 100644
--- a/config/navigation.rb
+++ b/config/navigation.rb
@@ -38,21 +38,21 @@ SimpleNavigation::Configuration.run do |navigation|
 
     n.item :moderation, safe_join([fa_icon('gavel fw'), t('moderation.title')]), admin_action_logs_url, if: proc { !current_user.nil? } do |s|
       s.item :action_logs, safe_join([fa_icon('bars fw'), t('admin.action_logs.title')]), admin_action_logs_url
-      s.item :reports, safe_join([fa_icon('flag fw'), t('admin.reports.title')]), admin_reports_url, highlights_on: %r{/admin/reports}, if: -> { current_user.staff? }
-      s.item :accounts, safe_join([fa_icon('users fw'), t('admin.accounts.title')]), admin_accounts_url, highlights_on: %r{/admin/accounts}, if: -> { current_user.staff? }
-      s.item :pending, safe_join([fa_icon('clock-o fw'), t('admin.pending_accounts.title', count: User.pending.count)]), admin_pending_accounts_url, highlights_on: %r{/admin/pending_accounts}, if: -> { current_user.staff? }
-      s.item :invites, safe_join([fa_icon('user-plus fw'), t('admin.invites.title')]), admin_invites_path, if: -> { current_user.staff? }
-      s.item :tags, safe_join([fa_icon('tag fw'), t('admin.tags.title')]), admin_tags_path, if: -> { current_user.staff? }
-      s.item :instances, safe_join([fa_icon('cloud fw'), t('admin.instances.title')]), admin_instances_url(limited: '1'), highlights_on: %r{/admin/instances|/admin/domain_blocks}, if: -> { current_user.staff? }
-      s.item :email_domain_blocks, safe_join([fa_icon('envelope fw'), t('admin.email_domain_blocks.title')]), admin_email_domain_blocks_url, highlights_on: %r{/admin/email_domain_blocks}, if: -> { current_user.staff? }
+      s.item :reports, safe_join([fa_icon('flag fw'), t('admin.reports.title')]), admin_reports_url, highlights_on: %r{/admin/reports}, if: -> { current_user.can_moderate? && !current_user.defanged? }
+      s.item :accounts, safe_join([fa_icon('users fw'), t('admin.accounts.title')]), admin_accounts_url, highlights_on: %r{/admin/accounts}, if: -> { current_user.can_moderate? && !current_user.defanged? }
+      s.item :pending, safe_join([fa_icon('clock-o fw'), t('admin.pending_accounts.title', count: User.pending.count)]), admin_pending_accounts_url, highlights_on: %r{/admin/pending_accounts}, if: -> { current_user.can_moderate? && !current_user.defanged? }
+      s.item :invites, safe_join([fa_icon('user-plus fw'), t('admin.invites.title')]), admin_invites_path, if: -> { current_user.can_moderate? && !current_user.defanged? }
+      s.item :tags, safe_join([fa_icon('tag fw'), t('admin.tags.title')]), admin_tags_path, if: -> { current_user.can_moderate? && !current_user.defanged? }
+      s.item :instances, safe_join([fa_icon('cloud fw'), t('admin.instances.title')]), admin_instances_url(limited: '1'), highlights_on: %r{/admin/instances|/admin/domain_blocks}, if: -> { current_user.staff? && !current_user.defanged? }
+      s.item :email_domain_blocks, safe_join([fa_icon('envelope fw'), t('admin.email_domain_blocks.title')]), admin_email_domain_blocks_url, highlights_on: %r{/admin/email_domain_blocks}, if: -> { current_user.staff? && !current_user.defanged? }
     end
 
-    n.item :admin, safe_join([fa_icon('cogs fw'), t('admin.title')]), admin_dashboard_url, if: proc { current_user.staff? } do |s|
+    n.item :admin, safe_join([fa_icon('cogs fw'), t('admin.title')]), admin_dashboard_url, if: proc { current_user.staff? && !current_user.defanged? } do |s|
       s.item :dashboard, safe_join([fa_icon('tachometer fw'), t('admin.dashboard.title')]), admin_dashboard_url
-      s.item :settings, safe_join([fa_icon('cogs fw'), t('admin.settings.title')]), edit_admin_settings_url, if: -> { current_user.admin? }, highlights_on: %r{/admin/settings}
-      s.item :relays, safe_join([fa_icon('exchange fw'), t('admin.relays.title')]), admin_relays_url, if: -> { current_user.admin? }, highlights_on: %r{/admin/relays}
-      s.item :sidekiq, safe_join([fa_icon('diamond fw'), 'Sidekiq']), sidekiq_url, link_html: { target: 'sidekiq' }, if: -> { current_user.admin? }
-      s.item :pghero, safe_join([fa_icon('database fw'), 'PgHero']), pghero_url, link_html: { target: 'pghero' }, if: -> { current_user.admin? }
+      s.item :settings, safe_join([fa_icon('cogs fw'), t('admin.settings.title')]), edit_admin_settings_url, if: -> { current_user.admin? && !current_user.defanged? }, highlights_on: %r{/admin/settings}
+      s.item :relays, safe_join([fa_icon('exchange fw'), t('admin.relays.title')]), admin_relays_url, if: -> { current_user.admin? && !current_user.defanged? }, highlights_on: %r{/admin/relays}
+      s.item :sidekiq, safe_join([fa_icon('diamond fw'), 'Sidekiq']), sidekiq_url, link_html: { target: 'sidekiq' }, if: -> { current_user.admin? && !current_user.defanged? }
+      s.item :pghero, safe_join([fa_icon('database fw'), 'PgHero']), pghero_url, link_html: { target: 'pghero' }, if: -> { current_user.admin? && !current_user.defanged? }
     end
 
     n.item :logout, safe_join([fa_icon('sign-out fw'), t('auth.logout')]), destroy_user_session_url, link_html: { 'data-method' => 'delete' }
diff --git a/config/sidekiq.yml b/config/sidekiq.yml
index 20ea95aad..230c85c43 100644
--- a/config/sidekiq.yml
+++ b/config/sidekiq.yml
@@ -34,6 +34,9 @@
   ambassador_scheduler:
     every: '<%= ENV['AMBASSADOR_DELAY'] || 10 %>m'
     class: Scheduler::AmbassadorScheduler
+  defang_scheduler:
+    every: '15m'
+    class: Scheduler::DefangScheduler
   media_cleanup_scheduler:
     cron: '<%= Random.rand(0..59) %> <%= Random.rand(3..5) %> * * *'
     class: Scheduler::MediaCleanupScheduler