# HG changeset patch # User Kim Alvefur # Date 1530112637 -7200 # Node ID a36710acd9c8071a43e1f25fb72e1f11751a3468 # Parent 14b6ad2b773f7971be9a08fb2b04273d5f41a104 mod_pubsub_post: Rename README so it gets picked up by the site generator diff -r 14b6ad2b773f -r a36710acd9c8 mod_pubsub_post/README.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_pubsub_post/README.markdown Wed Jun 27 17:17:17 2018 +0200 @@ -0,0 +1,53 @@ +# Introduction + +Lets you easily publish data to PubSub using a HTTP POST request. The +payload can be Atom feeds, arbitrary XML, or arbitrary JSON. The type +should be indicated via the `Content-Type` header. + +``` {.bash} +curl http://localhost:5280/pubsub_post/princely_musings \ + -H "Content-Type: application/json" \ + --data-binary '{"musing":"To be, or not to be: that is the question"}' +``` + +# Configuration + +## Authentication + +Authentication can be handled in two different ways. + +### None + +``` {.lua} +pubsub_post_actor = "superuser" +``` + +The module uses an internal actor that has all privileges and can always +do everything. It is strongly suggested that you do not expose this to +the Internet. *Maybe* it shouldn't be the default... + +### IP + +``` {.lua} +pubsub_post_actor = "request.ip" +``` + +Uses the IP address from the HTTP request as actor, which means this +pseudo-JID must be given a 'publisher' affiliation. This should work +nicely with the `autocreate_on_publish` setting, where the first actor +to attempt to publish to a non-existant node becomes owner of it, which +includes publishing rights. + +Prosodys PubSub module does not currently support [setting affiliations +via XMPP](https://xmpp.org/extensions/xep-0060.html#owner-affiliations), +but this is planned. + +It can however be done from another plugin: + +``` {.lua} +local mod_pubsub = module:depends("pubsub"); +local pubsub = mod_pubsub.service; + +pubsub:create("princely_musings", true); +pubsub:set_affiliation("princely_musings", true, "127.0.0.1", "publisher"); +``` diff -r 14b6ad2b773f -r a36710acd9c8 mod_pubsub_post/README.md --- a/mod_pubsub_post/README.md Tue Jun 26 15:30:03 2018 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -# Introduction - -Lets you easily publish data to PubSub using a HTTP POST request. The -payload can be Atom feeds, arbitrary XML, or arbitrary JSON. The type -should be indicated via the `Content-Type` header. - -``` {.bash} -curl http://localhost:5280/pubsub_post/princely_musings \ - -H "Content-Type: application/json" \ - --data-binary '{"musing":"To be, or not to be: that is the question"}' -``` - -# Configuration - -## Authentication - -Authentication can be handled in two different ways. - -### None - -``` {.lua} -pubsub_post_actor = "superuser" -``` - -The module uses an internal actor that has all privileges and can always -do everything. It is strongly suggested that you do not expose this to -the Internet. *Maybe* it shouldn't be the default... - -### IP - -``` {.lua} -pubsub_post_actor = "request.ip" -``` - -Uses the IP address from the HTTP request as actor, which means this -pseudo-JID must be given a 'publisher' affiliation. This should work -nicely with the `autocreate_on_publish` setting, where the first actor -to attempt to publish to a non-existant node becomes owner of it, which -includes publishing rights. - -Prosodys PubSub module does not currently support [setting affiliations -via XMPP](https://xmpp.org/extensions/xep-0060.html#owner-affiliations), -but this is planned. - -It can however be done from another plugin: - -``` {.lua} -local mod_pubsub = module:depends("pubsub"); -local pubsub = mod_pubsub.service; - -pubsub:create("princely_musings", true); -pubsub:set_affiliation("princely_musings", true, "127.0.0.1", "publisher"); -```