Set user registration IP address API endpoint

AI-generated summary

The plugin NubeBuster/discourse-set-user-ip adds an API endpoint to set the registration IP address of a user after creation, addressing the issue where the IP is otherwise set to the server’s IP. The endpoint POST /admin/set_user_ip#set_ip accepts id and ip parameters to update the user’s registration IP. Example usage includes a curl command and Java code, with installation instructions available via the Discourse plugin guide. Bugs and feature requests can be submitted on the plugin’s GitHub issue tracker here.

:information_source: Summary Create an API endpoint to set user_registration_ip
:hammer_and_wrench: Repository Link https://github.com/Nubebuster/discourse-set-user-ip
:open_book: Install Guide How to install plugins in Discourse

Abstract

When creating users with the existing API endpoint their registration ip address is set to the ip of the server/application that calls the api. This is a problem when you want to create users from an external service such as a minecraft server. This plugin provides a way to set the registration ip after user creation.

Features

This plugin creates the following API endpoint

POST /admin/set_user_ip#set_ip
Params: id=Number&ip=String

to set the user_registration_ip address of a user with a given forum id.

Example curl command

curl -X POST "http://127.0.0.1:3000/admin/set_user_ip#set_ip" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: <key>" \
-H "Api-Username: <username>" \
-F "id=1" \
-F "ip=127.0.0.1"

Example java code, including account creation

Can be found in the README.md

TODO

  • You can request changes and report bugs here
2 Likes