about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-12-29 19:52:04 +0100
committerGitHub <noreply@github.com>2017-12-29 19:52:04 +0100
commit38fc1b498d971f7b33532c583b12e5dd3469af3c (patch)
tree622690ead8b672b115718b8d027cfef1acac9902 /config
parent511c6f96251a4492f7c5bea1f13018d61cfb9ce0 (diff)
Add more instance stats APIs (#6125)
* Add GET /api/v1/instance/peers API to reveal known domains

* Add GET /api/v1/instance/activity API

* Make new APIs disableable, exclude private statuses from activity stats

* Fix code style issue

* Fix week timestamps
Diffstat (limited to 'config')
-rw-r--r--config/locales/en.yml6
-rw-r--r--config/routes.rb6
-rw-r--r--config/settings.yml3
3 files changed, 13 insertions, 2 deletions
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 325391cfd..e4425b424 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -265,12 +265,18 @@ en:
       unresolved: Unresolved
       view: View
     settings:
+      activity_api_enabled:
+        desc_html: Counts of locally posted statuses, active users, and new registrations in weekly buckets
+        title: Publish aggregate statistics about user activity
       bootstrap_timeline_accounts:
         desc_html: Separate multiple usernames by comma. Only local and unlocked accounts will work. Default when empty is all local admins.
         title: Default follows for new users
       contact_information:
         email: Business e-mail
         username: Contact username
+      peers_api_enabled:
+        desc_html: Domain names this instance has encountered in the fediverse
+        title: Publish list of discovered instances
       registrations:
         closed_message:
           desc_html: Displayed on frontpage when registrations are closed. You can use HTML tags
diff --git a/config/routes.rb b/config/routes.rb
index 467849c03..80a2c6d13 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -241,7 +241,11 @@ Rails.application.routes.draw do
 
       resources :apps, only: [:create]
 
-      resource :instance,      only: [:show]
+      resource :instance, only: [:show] do
+        resources :peers, only: [:index], controller: 'instances/peers'
+        resource :activity, only: [:show], controller: 'instances/activity'
+      end
+
       resource :domain_blocks, only: [:show, :create, :destroy]
 
       resources :follow_requests, only: [:index] do
diff --git a/config/settings.yml b/config/settings.yml
index f03a32e50..4a2519464 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -47,7 +47,8 @@ defaults: &defaults
     - webmaster
     - administrator
   bootstrap_timeline_accounts: ''
-
+  activity_api_enabled: true
+  peers_api_enabled: true
 development:
   <<: *defaults