Quantcast
Channel: Ignite Realtime : Document List - Community Plugins
Viewing all 31 articles
Browse latest View live

Just married: Change a User Name & Update the Rosters

$
0
0

In a large environment, you may face requests to change user names for some reason.  We often had requests to change the username because somebody married and changed the family name.

 

Our usernames are a combination of the forename and the surname like forename.surname@jabberserver.

So we need to edit the usernames, but sadly Openfire does not support that because the username is unique and the primary key for nearly all user relations in the database.

 

The created plugin creates a new user and copies all the roster entries, groups, password, preferences, vcard et cetera from an other user and deletes the old user (if you want). You also also create just a copy from an existing user for testing purpose or something like that.

 

This is the first version of the plugin, so use it on your own risk. You might keep the old user in database as long as your sure everything works as intended!

 

If you find some bugs feel free to comment, create tickets (if your allowed to) or fix it on your own. Sourcecode is available in openfire svn trunk.

 

Greetz,

Stytrix

 

Dieses Dokument wurde aus folgender Diskussion erzeugt: Just married, Openfire plugin


Openfire Audit Log Reader

$
0
0

by A_Li_N

 

I didn't find any program out there that suited my needs for a log reader to read the server audit logs, so I made one.  I thought I'd share my work for anyone that might find it usefull.

 

Very simple to use:
Click on  Open Log, browse to the log files from the server.

This populates the names on the left.

Click one of the names to show the messages to and from that person on the right.

Click a particular message on the right to show the entire message (if it is longer than visible) at the bottom.

 

No need to convert or edit the logs.

No need to know how many / what users there are.

 

Fast and simple.

 

Updates:

2009/08/14 - Fixed error when file didn't close out Jive tag (believe this happens from taking log still being written to by server), thanks wr00t.

2012/10/24 - Seth Randall made some improvements. Thanks! File attached

2013/04/04 - Joshua Cantara - Fixed a bug resulting from when a user messages themself.

2013/04/29 - Seth Randall - New version that fixes the bug Joshua found. Now it will log the message appropriately without teminating the import.

2013/11/21 - Seth Randall - Release 1.2.0.0 - see below for changes

Handle authorization at DB side, with Dovecot example

$
0
0

Openfire can be enabled to pass authentication to underlying database.

This might be useful if passwords stored by mysql PASSWORD function or some other way inaccesible from openfire directly.

 

There is a library available to enable such behaviour.

It will pass authentication process to database.

 

Wiki: https://github.com/pokebadgerswithspoon/openfire-extended-jdbc/wiki

Source: https://github.com/pokebadgerswithspoon/openfire-extended-jdbc

 

Remember to build from source, attached file is just a nothing but a recent snapshot (working though).

See linked wiki for configuration and Dovecot example

Clustering Plugin

$
0
0

A commercial clustering plugin was available some time ago. This plugin was made open source, see http://www.igniterealtime.org/projects/openfire/plugins.jsp without the Coherence files. Currently one does need an old Coherence version to get it running,

 

If one wants to create a clustering plugin based on an existing clustering solution one does need to look at the packages org.jivesoftware.util.cache and org.jivesoftware.openfire.cluster. In those packages one will find interfaces like:

  • ClusterNodeInfo

  • CacheFactoryStrategy

  • ExternalizableUtilStrategy

  • ClusterTask

  • Cache

 

References:

http://www.igniterealtime.org/community/message/174820

http://www.igniterealtime.org/community/thread/36463

General Complete Setup Guide.pdf

Content Filter - Regular Expressions

$
0
0

These regular expressions are for usage within Conors famous Content Filter Plugin.

Anyhow one can not mix various filters, so one must use either the Emotion or the URL filter.

Filter Emotions

Feel free to use them as soon as you know what "mask" you want to use.

Emotions (various)

(\?:\||;\)|X-\(|;-\)|B-\)|:8\}|:x|:D|:\)|\]:\)|:\(|:_\||:\^0|:0|:p|:\||;\\)

Emotions (only Spark)

(^|\ )((\?:\||;\)|X-\(|;-\)|B-\)|:8\}|:x|:D|:\)|:-\)|\]:\)|:\(|:_\||:\^0|:0|:p|:\||; \\)(\ |$))+

Filter URLs

To make sure that domains which end with .org, .com and .info can not open properly in a browser one can use these patterns. Spark does convert everything which looks like an URL to a link, so www.igniterealtime.org will be converted into a link. Even with this filter this will happen, anyhow http://www.igniterealtime_org/ will return an invalid domain name or DNS error.

Filter pattern: \.(org|com|info)

[x] Enable Mask, Mask: _$1

Script for automatic message in MotD plugin (Linux)

$
0
0

What I love of MotD plugin is that you can give an incentive to users for login in your server.

What I hate of MotD plugin is that with the current implementation you must change the message manually every day.

For this reason I have create a script that change the message everyday.

 

First of all I decided download a package that gives you the new message. But you can get the new message from where you prefer:

 

aptitude install fortune

 

You can search the different themes with 'aptitude searchfortune'

 

I changed the mysql field (plugin.motd.message). But it didn't work because MotD plugin stores some information in the java cache. So, what you have to do is send the information in html POST way.

 

I attach the script.

 

Comments

 

  1. I haven't try the https connection yet. So, be careful with the script permissions/location, because your password is clear there.
  2. It's necessary truncate the text in the message because POST-DATA convert spaces in '+'.
  3. If there are some problems with wget you can use the debug option (-d) and delete the output option (-O).

 

I hope this will be useful for somebody.

User Status Plugin

$
0
0

 

User Status Plugin is a plugin for the Openfire XMPP server to save the user status to the database.

 

This plugin automatically saves the last status (presence, IP address, logon and logoff time) per user and resource to userStatus table in the Openfire database.

 

Optionally you can archive user status entries (IP address, logon and logoff time) for a specified time. History entries are stored in the userStatusHistory table. The settings for history archiving can be configured on the "User Status Settings" page that you'll find on the "Server" tab of the Openfire Admin Console.

 

The plugin is available at http://maven.reucon.com/projects/public/user-status

 

 

 

 

 

According to the project's Web site, currently this plugin only works with MySQL.

 

License: GNU General Public License, Version 2.0

 

 


Helga (a Server-Bot plugin)

$
0
0

Helga is a powerful Server-Bot. It can be controlled by normal chat messages you send to bot@helga.yourserver.com, helga.yourserver.com or generally something@helga.yourserver.com. You will be automatically registered if you add Helga to your roster. Alternatively you can register via service discovery.

 

requirements and license

  • Openfire 3.5.x, 3.6.0 or newer
  • MySQL database is fully supported. Microsoft SQL-Server and HSQLDB (embedded-db) databases are reported to work, too. All other databases supported by Openfire are still beta, because completely untested.
  • released under GNU General Public License
  • I use parts of official plugins ( presence and search ) and Openfire itself. I am not the owner of the complete copyright, so I can't release it under any other license for you.

 

key features

  • advanced shared groups (see below)
  • LaTeX interface: compile LaTeX code into images, using external application.
  • some nice admin commands (e.g. message or email to every registered user, ...)
  • send remind messages to yourself or other users, simple management of this messages
  • import/export your own roster, import nicknames names from vCards (does work with transports, too!)
  • features taken from presence plugin: provide users presence via HTTP-Request, this does only work if the affected user has explicit allowed this.
  • currently available in German and an (maybe bad) English translation. (it would be great if a native English speaking could help translating it)
  • for developers
    • English comments and identifiers in source code (use of JavaDoc)
    • use of i18n files, you can translate Helga in your language
    • use of Openfire's internal database schema manager
    • easy to use base class for commands
    • feature rich utility classes
    • event system, to realize timeouts, callbacks, etc.
    • it should be easy to extend Helga with your ideas!

 

helga shared groups

Helga builds an advanced shared group system around the constricted Openfire system. So everything that was possible with Openfire itself, is possible with Helga, too. A more detailed description is available in German language.

  • All group settings are available through Helga chat commands. This should work with ALL jabber clients.
  • different user classes:
    • everyone - just a user who has an account on your server
    • group member - user who is member of a group
    • moderator - moderators for example can kick or ban users. Only serveradmins can give you this rights.
    • serveradmin - member of special group "Jabber Admins", this users can do everything
  • different group types:
    • OPEN - everyone can join this group or invite others. Moderators can kick or ban users. The list of group members is public and the group appears in global group list.
    • MODERATED - everyone can request a join, moderators can accept their request, invite, kick or ban users. The list of group moderators is public, member list is visible for members. The group appears in global group list.
    • CLOSED - users can only join this group, if they got an invitation from a moderator before. Moderators can kick or ban users, too. The list of group moderators is public, member list is visible for members. The group does not appear on global group list.

commands

An complete manual to all commands and parameters is currently only available in German language. Also a first steps guide is available in German.

 

basic commands

command

description

help

Get a list of all supported commands.

help [command]

Get help to an specific command.

get

Reads out the current setting of an option. To change a setting, use the 'set'-command.

latex

Complies given LaTeX Code to an GIF image, uploaded on the server. Helga provides two links:

  • permanent link to the image

  • always the same link which points always onto your last image.

See README for more details.

message

Send a remind message to someone. This command can be used to send an message to yourself or someone else. You can manage your messages with 'show' and 'remove' commands. The number of messages per user is limited to 10.

ping

Simple command which just answers "pong". Helpful to check if your internet connection is still available.

presence

Gives the time when an user was last seen or his presence if the user is only at the moment. For security reasons is is only possible to query users who are registered with Helga and have set public setting to 'true'.

Serveradmins get extended information about users operating system and client.

remove

Active events can be removed. The 'remove'-Command removes an specific or all messages. You can only remove your own messages. You can get the MessageID by the 'show'-Command.

set

Set an option to an new value. To read out the current setting use the 'get'-command.

show

Prints a list of all your active messages.

time

Sends current servertime

welcome

Sends welcome-message again.

 

group management

command

description

group add

This command is only for serveradmins. You can add one ore more users directly to a group. (without user demand)

group ban

This command is only for moderators. The user will deleted from the group and append to a ban list, which prevents the user from rejoin to the group. The ban can be revoked with the 'revoke' command. This ban list of a group can be shown using the 'info' command.

group create

Serveradmins can create new groups with this command. To change group settings later, use 'update'. Both commands are identically, except that 'create' can only create new groups and 'update' can only change existing groups. (security against typos)

group decline

This command has two functions:

  1. You can decline an invitation explicitly. Moderators will noticed about this with a message.

  2. Moderators can decline a join request.

group delete

Serveradmins can delete existing groups.

group find

This command lists all available groups of type OPEN and MODERATED. Groups of type CLOSED are only showed to serveradmins.

An optional filter can be used to restrict the search. All groups are listed who have the given filter in their name. The wildcards * and ? are interpreted as usual. The filter is case sensitive.

group info

A list of groups you are member of or information to an specific group.

group invite

Inside of OPEN groups every member can send invitations. Inside of MODERATED or CLOSED group only moderators are allowed to do this. Make an user an join request, then all moderators will receive a message. By inviting this user a moderator can accept the request. In this case the user will not receive an invite message, but will added to the group directly.

group join

With this command you can join a group. If the group is MODERATED, only a join request is made. This request can be accepted by an moderator with an 'invite' or decline with 'decline'. In CLOSED groups you can only join if you have been invited.

Only serveradmins can 'join' other users.

group kick

Groupmembers can leave the group with this command. Moderators can kick other users out of the group.

group message

Send a message to all members of a group. Only for group members in case of the group is in ONLYGROUP mode. In all other cases this can only done by group moderators.

group revoke

This command is only for moderators. It revokes a ban that was declared using the 'ban' command.

group update

see 'create'

 

roster management

command

description

roster import

With this command you can add multiple contacts at once to your roster (contactlist). This only makes sence if you want to import many contacts, for example a complete contact list if you are doing a server relocation.

roster export

This command does export your roster (contactlist) using the format described under 'import'. Contacts form shared groups where exported, too. Contacts that have a jabberID without a username (e.g. Transports as icq.jabber.rwth-aachen.de) where not exported.

roster names

This command iterates through your complete roster and sets nicknames automatically. This could take some seconds, especially if vCard are not locally available and have to be requested from remote.

 

admin commands

command

description

admin email

Serveradmins can send an email to all users of your server.

admin message

Serveradmins can send a message to all registered users of your server. (really all users, not only available)

 

changelog

2.22 -- August 18, 2008
  • Fixed bugs in database scripts for hsqldb. Using HSQLDB (embedded-db) with Helga should work now. (thx @ dfaure)
  • Changed time format for locale EN to 24h clock for usability reasons.
  • Fixed time format bug in 'message' command manpage.
  • Fixed minor leap year bug in 'message' command.
  • New compile script: No longer hardcoded absolute paths. JavaDoc creation should no longer flood with warnings.

2.21 -- April 8, 2008

  • Applied API changes for Openfire 3.5.0. Set minServerVersion to 3.5.0

  • Fixed some bad quoting bugs in i18n files.

  • Fixed NullPointerException for commands 'group create' and 'group update' if parameter '-g' is not given.

  • Fixed NullPointerException when revoking moderator rights with command 'group update'.

  • command 'presence' does now show also group memberships, if an admin is querying.

2.20 -- March 13, 2008

  • new command: 'latex' - compiles LaTeX code to images, using an external application.

2.11 -- March 4, 2008

  • Fixed serveral problems with SQL-server database. SQL-server should work now, but helga's group features are still untested with SQL-server. thx@deafsquad

  • Other databases than MySQL and SQL-server are still Beta. Would be nice if someone could test it and report results to me.

  • Added some linebreaks to in-band-registration-instructions.

2.1 -- February 21, 2008

  • 'message' command does now check if a local resource is available before sending to it. If the resource is unavailable it redirects to bare JID. For external resources can't checked if they are available, so message were lost, if the external server does not redirect the message.

  • fixed small bug while loading message events from database

  • 'admin message' sends to all connected resources now, not only to the most available resource of each user. Added option not to send to unavailable users, too. This should be equivalent to send a message through the admin console.

  • new command: 'ping' - It just answers "pong". Helpful to check you Internet connection.

  • new alias: (date -> time)

  • removed experimental transport settings, because they didn't work and are not needed anymore. Removed HelgaTransportManager class and related code.

  • Helga should now be able to import nicknames from everything that supports vCards (XEP-0054 vcard-temp). In particular this should work with pyICQt and pyMSNt.

  • command: 'roster names', added an option to restrict work on an specific domain or subdomain.

  • massive changes on database tables. Helga should now support all databases that openfire supports, but everything else than MySQL is still Beta.

  • Helga is now integrated into Openfires database update system. In future database changes can be done automatically. If you are updating from Helga 2.1x execute the following SQL statement before updating to a newer version of Helga:

INSERT INTO jiveVersion (name, version) VALUES ('helga', 0);
  • If you are updating from 1.xx (before offical release), you have to update manually.

2.02 -- November 18, 2007

  • compiled with Openfire 3.4.1 and JDK 6u3

  • minor changes

2.01 -- November 2, 2007

  • nicer presence images, images taken from Psi's "Crystal (Roster)" Icons (Author: Everaldo Coelho, http://www.everaldo.com)

  • changed the way how Helga loads the presence images

  • now an local username is accepted in a HTTP-Request. You can use something like: ...helga/user?jid=user1 instead of ...helga/user?jid=user1@yourserver.com

     

    download

    This complete bundle contains: compiled jar-file, source code, JavaDoc files, some scripts and GPL license text.

     

    helga-2.22-415.tar.gz

    You should read the configuration section in README file before using!

    Do not use on productive systems, if you do not have an MySQL database!

     

     

    If you have questions, improvements, etc. leave a comment on this document.

     

    Martin Weusten (Coolcat)

    Botz: Internal Bot Library for Openfire

    $
    0
    0

    Overview

    A common way of creating a new XMPP service is to develop a plugin that will serve the service as a sub domain. That said, if Openfire's domain is example.com programmers would develop the new service as an internal or external component and deploy it as myservice.example.com.

     

    Botz library adds the already rich and extensible Openfire with the ability to create internal user bots. With Botz library, programmers may choose to develop a user bot to run as a service bearing myservice@example.com as its JID. To Openfire, the user bot is just like other (human) users.

     

    Botz library is strictly internal for Openfire. The notion of a user connection doesn't involve any TCP/IP or socket; hence virtual. There isn't even a C2S implementation.

     

    Botz Classes

    Botz library contains BotzConnection class that allows a user bot to login as a registered or anonymous user. The class optionally automates the creation and registration of the user bot if it has not existed in the database. To make the user bot useful, programmers would implement BotzPacketReceiver interface to respond to received packets. BotzPacketReceiver.processIncomingPacket(Packet) will be called for every packet received by the user bot. To send packets to other XMPP entities, programmers in turn call BotzConnection.sendPacket(Packet).

     

    Botz classes may be used in situations where an internal user bot is needed. Botz most likely proves itself useful in the development of Openfire extensions through plugins.

     

    Key Features

    • Login anonymously

    • Login as an existing Openfire user

    • Optionally create a new user as a registered user (bot) if it does not exist. The newly created user account will be stored in the database. Because user creation is done using SQL statements internal to Openfire, this should work for all Openfire-supported databases.

    • The above features hide programmers from handling the connection establishment and allow programmers to focus on packet exchanges.

    • Change BotPacketReceiver on the fly, thus switch behaviors and create multiple personalities of a bot.

     

    Using Botz in A Plugin

    The following is the code snippet that shows a way to use Botz classes in a plugin. The sample plugin is a parrot bot service that simply echoes <message/> packets back to the sender.

     

    import org.jivesoftware.openfire.botz.BotzConnection;
    import org.jivesoftware.openfire.botz.BotzPacketReceiver;
    
    public class ParrotBot implements Plugin {
        @Override    public void destroyPlugin() { }    @Override    public void initializePlugin(PluginManager manager, File pluginDirectory) {        BotzPacketReceiver packetReceiver = new BotzPacketReceiver() {            BotzConnection bot;            public void initialize(BotzConnection bot) {                this.bot = bot;            }            public void processIncoming(Packet packet) {                if (packet instanceof Message) {                    // Echo back to sender                    packet.setTo(packet.getFrom());                    bot.sendPacket(packet);                }            }            public void processIncomingRaw(String rawText) { };            public void terminate() { };        };        BotzConnection bot = new BotzConnection(packetReceiver);        try {            // Create user and login            bot.login("parrot");            Presence presence = new Presence();            presence.setStatus("Online");            bot.sendPacket(presence);        } catch (Exception e) {            e.printStackTrace();        }    }
    }

     

     

     

     

    License

    This software is published under the terms of the GNU General Public License (GPL).

     

    Downloads

    Botz Library

    Openfire Version

    Botz Library

    Source Code

    Version

    License

    3.4.*

    1.0.0

    GPL

    3.3.2-3.3.*

    1.0.0

    GPL

     

    Sample Bot Plugin

    Plugin Name

    Openfire Version

    Plugin JAR

    Source Code

    Version

    License

    ParrotBot

    3.4.*

    1.0.0

    GPL

    ParrotBot

    3.3.2-3.3.*

    1.0.0

    GPL

     

    Installation

    The Botz library is not a plugin in itself, and does not contain any plugin-related class. It is meant for use in an application development. To use the library in an Openfire plugin development, copy botz-openfire-version.jar file into the lib directory of the plugin directory structure. If there are more than one plugins that will use Botz library, the JAR file can be copied to a global class path like openfire/build/lib/dist or {$OPENFIRE_HOME}/lib.

     

    To install the sample ParrotBot plugin, rename parrotbot-openfire-version.jar to parrotbot.jar and copy it into {$OPENFIRE_HOME}/plugins directory. To see the ParrotBot in action, send messages to it using your favorite Jabber client.

     

    The parrot user bot appears as a real user in Openfire admin console:

     

    Figure 1: Parrot Bot As A Registered User

     

    When logged in, the bot has a client session:

     

    Figure 2: Parrot Bot Logged In

     

     

    User-Contributed Bot Plugins

    Plugin Name

    Plugin JAR

    Source Code

    Version

    Author

    License

     

    Bot Plugins Wish List

    Plugin Name

    Description

    CAPService

    An implementation of XEP-0127:Common Alerting Protocol(CAP) Over XMPP

    NameService

    MUC Name Service

    RoomService

    MUC Room Service

     

    Openfire Audit Log Reader

    $
    0
    0

    by A_Li_N

     

    I didn't find any program out there that suited my needs for a log reader to read the server audit logs, so I made one.  I thought I'd share my work for anyone that might find it usefull.

     

    Very simple to use:
    Click on  Open Log, browse to the log files from the server.

    This populates the names on the left.

    Click one of the names to show the messages to and from that person on the right.

    Click a particular message on the right to show the entire message (if it is longer than visible) at the bottom.

     

    No need to convert or edit the logs.

    No need to know how many / what users there are.

     

    Fast and simple.

     

    Updates:

    2009/08/14 - Fixed error when file didn't close out Jive tag (believe this happens from taking log still being written to by server), thanks wr00t.

    2012/10/24 - Seth Randall made some improvements. Thanks! File attached

    2013/04/04 - Joshua Cantara - Fixed a bug resulting from when a user messages themself.

    2013/04/29 - Seth Randall - New version that fixes the bug Joshua found. Now it will log the message appropriately without teminating the import.

    2013/11/21 - Seth Randall - Release 1.2.0.0 - see below for changes

    Viewing all 31 articles
    Browse latest View live