Jabberd-Yahoo

From YobiWiki
Jump to: navigation, search

UPDATE this transport seems broken or incompatible with the Yahoo! service since several months :-(
Try xmpppy-yahoo from http://xmpppy.sourceforge.net/ ?

apt-get install libglib1.2-dev
cd jabberd/jabber-1.4.2a
wget http://www.jabberstudio.org/files/yahoo-transport-2/yahoo-t-2.2.0.tar.gz
tar -xzvf yahoo-t-2.2.0.tar.gz
cd yahoo-transport-2
make
mkdir /var/lib/jabber/yahoo
cp yahoo-transport.so /var/lib/jabber/yahoo

Ajouter dans /etc/jabber/jabber.xml, section <browse>:

       <service type="yahoo" jid="yahoo.reseaucitoyen.be" name="Passerelle vers Yahoo!">
         <ns>jabber:iq:gateway</ns>
         <ns>jabber:iq:register</ns>
         <ns>jabber:iq:version</ns>
         <ns>jabber:iq:time</ns>
       </service>

Ajouter dans /etc/jabber/jabber.xml, dans la liste des <service>:

 <service id="linker-yahoo">
   <host>yahoo.reseaucitoyen.be</host>
   <accept>
     <ip>127.0.0.1</ip>
     <port>5225</port>
     <secret>yahookey</secret>
   </accept>
 </service>

Créer /etc/jabber/transport-yahoo.xml:

<jabber>

 <log id='elogger'>
   <host/>
   <logtype/>
   <format>%d: [%t] (%h): %s</format>
   /var/log/jabber/yahoo-error.log
 </log>

 <log id='rlogger'>
   <host/>
   <logtype>record</logtype>
   <format>%d %h %s</format>
   /var/log/jabber/yahoo-record.log
 </log>

   <service id="linker-yahoo">
       <connect>
           <ip>127.0.0.1</ip>
           <port>5225</port>
           <secret>yahookey</secret>
       </connect>
       <uplink/>
   </service>
 <pidfile>/var/run/jabber/jabber-yahoo.pid</pidfile>

 <service id="yahoo.reseaucitoyen.be">
   <load><yahoo_transport>/var/lib/jabber/yahoo/yahoo-transport.so</yahoo_transport></load>
   <config xmlns="jabber:config:yahoo">

     <vCard>
       <NAME>Passerelle vers Yahoo!</NAME>
       <DESC>Ce service fournit une passerelle pour communiquer avec le reseau Yahoo!</DESC>
     </vCard>

     <instructions>Entrez votre login Yahoo! Messenger et password.</instructions>

     <server>scs.yahoo.com</server>

     <port>5050</port>

     <charmap>CP1252</charmap>

     <newmail/>

   </config>
 </service>
</jabber>

Créer /etc/init.d/jabber-yahoo:

#! /bin/sh
#
# jabber	init script to start jabber daemon
#
#		Created from Bernd Eckenfels <ecki@lina.inka.de>
#
#		Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#		Modified for Debian GNU/Linux
#		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version:	@(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
#
# This file was automatically customized by dh-make on Sun, 21 May:31:20 +0200

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/jabberd
NAME=jabber-yahoo
DESC=jabber-yahoo
CONF=/etc/jabber/transport-yahoo.xml
PID=/var/run/jabber/jabber-yahoo.pid
CMDLINE=""

test -f $DAEMON -a -f $CONF || exit 0

# set some parameters like JABBER_HOSTNAME
if test -x /etc/jabber/jabber.cfg; then
 . /etc/jabber/jabber.cfg
fi

if [ x"$JABBER_HOSTNAME" != x"" ]; then
	CMDLINE="$CMDLINE -h $JABBER_HOSTNAME"
fi
if [ x"$JABBER_SPOOL" != x"" ]; then
	CMDLINE="$CMDLINE -s $JABBER_SPOOL"
fi
if [ x"$CONF" != x"" ]; then
	CMDLINE="$CMDLINE -c $CONF"
fi
if [ x"$CMDLINE" != x"" ]; then
	CMDLINE="-- $CMDLINE"
fi

set -e

case "$1" in
  start)
	echo -n "Starting $DESC: "
	cd /usr/lib/jabber/
	start-stop-daemon -b -c daemon --start --quiet --pidfile $PID --startas $DAEMON $CMDLINE ||  echo -n "<Failed> "
	echo "$NAME."
	;;
  stop)
	echo -n "Stopping $DESC: "
	start-stop-daemon --stop --quiet --pidfile $PID || echo -n "<Failed> "
	echo "$NAME."
	;;
  reload)
	echo "Reloading $DESC configuration files."
	start-stop-daemon --stop --signal 1 --quiet \
		--pidfile $PID --exec $DAEMON
  ;;
  restart|force-reload)
	#
	#	If the "reload" option is implemented, move the "force-reload"
	#	option to the "reload" entry above. If not, "force-reload" is
	#	just the same as "restart".
	#
	echo -n "Restarting $DESC: "
	$0 stop
	sleep 1
	$0 start
	;;
  *)
	N=/etc/init.d/$NAME
	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0
update-rc.d jabber-yahoo defaults 21 19

Ajouter également à /etc/init.d/jabber:

case "$1" in
 start)
       echo -n "Starting $DESC: "
       cd /usr/lib/jabber/
       start-stop-daemon -b -c daemon --start --quiet --exec $DAEMON $CMDLINE || echo -n "<Failed>
       echo "$NAME."
+       echo "Don't forget to start also jabber-yahoo"
       ;;
 stop)
+       /etc/init.d/jabber-yahoo stop
       echo -n "Stopping $DESC: "
       start-stop-daemon --stop --quiet --exec $DAEMON || echo -n "<Failed> "
       echo "$NAME."
       ;;

Cela est fait tel que:

/etc/init.d/jabber start     -> lance le jabberd principal
/etc/init.d/jabber-yahoo start -> lance le service Yahoo!
/etc/init.d/jabber-yahoo stop  -> arrete le service Yahoo!
/etc/init.d/jabber stop      -> arrete le jabberd principal ET le service Yahoo
Personal tools
Namespaces

Variants
Actions
Navigation
Tools