Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

angusmcleod
Copy link
Contributor

@angusmcleod angusmcleod commented Jun 8, 2025

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
Copy link
Contributor

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.

Copy link
Contributor Author

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")
Copy link
Contributor

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.

Copy link
Contributor Author

@angusmcleod angusmcleod Jun 10, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants