-
Notifications
You must be signed in to change notification settings - Fork 4
FEATURE: Add nodeinfo endpoint #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
posts_local: local_posts.where("reply_to_post_number IS NULL").count, | ||
replies_local: local_posts.where("reply_to_post_number IS NOT NULL").count, | ||
} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In core, we cache this data. Can we do that here as well? Avoids this route becoming an abuse vector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added caching and rate limiting into the controller: angusmcleod@9ec7523
end | ||
|
||
def active_users | ||
valid_users.where("staged IS FALSE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need the staged clause here. Statistics.valid_users
checks for activated users and I believe activating a user unstages them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this in because staged vs unstaged is the equivalent of remote vs local (for the purposes of activitypub) on the user model itself, i.e. it is a reflection of the distinction that nodeinfo is drawing in its own categorisation of users. It's essentially a clarity/surety measure. active
and staged
are independent values, so it may be possible to have an active staged user. I've updated the method name to local_users
to clarify this, and to make it consistent with the local_posts
method name: angusmcleod@293a81c
Co-authored-by: Penar Musaraj <[email protected]>
@pmusaraj This one is ready now. See further: