|
|
| Author |
Message |
|
| Guest |
Posted: Tue Nov 28, 2006 6:45 am |
|
|
|
Guest
|
I really want to contribute code to the ejabberd community. But my Erlang
skills are weak, my code looks like the worst code possible. I can hack
Perl code and be confident in my code, but my Erlang still looks like code
from random PHP users.
I noticed today a Subversion repository for ejabberd modules. Which makes
me happy! But I'm afraid of uploading my code because it is so poor. Is
this list willing to look at code and maybe give pointers to improve the code
before I upload?
For example:
I currently authenticate my users against an external PHP forum user database.
Since the Jabber server does not have direct access to the users database of
the forum software, I hacked an auth module that uses a bit of example
code from somewhere off of the Erlang site (urlget.erl). I take the username
and password (plaintext) and md5 the password and make a standard HTTP request
to a PHP script on the forum site. so (User,Password) is turned into a HTTP
request to "http://mysite.org/auth.php?user:md5(password)". the auth.php
script checks the user/password info and returns a "OK" or "FAIL" as a result.
So it is totally ugly code... But it does allow my ejabberd server to
authenticate users against a random PHP based forum where I don't have direct
access to the user database from the ejabberd server host.
I'm just in a state of confusion as to whether such code would be useful to
other ejabberd users. In theory, with a tiny bit of PHP code on the forum
host side, my module would let ejabberd authenticate against any forum even
without access to the user database... But the code is a bit ugly.
What is the best way to proceed? Should I get an account on the new ejabberd
module repository and commit my poor code? Should I just upload my code to
the ejabberd website? Should i post my code here on this list and hope that
somebody with more Erlang experience would take a look?
I just feel really bad with the idea of uploading my poor code...
----
Carl Hayter
Information Technology Services
University of Southern California
(hacking on www.thejapanesepage.com)
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Tue Nov 28, 2006 8:12 am |
|
|
|
Guest
|
Hello Carl,
I think you should share your code, as it might be usefull to someone.
I do not know which is the best place to put it however.
I see several options:
- You post it in an ejabberd.jabber.ru forum.
- If you really want to be much more deeply involved in the community the module repository could be usefull, probably starting in a sandbox area. It could be use to organise some kind of new developers mentoring by the experienced developers working in the repository).
Please, let me know what you (or other people) think.
-- |
|
|
| Back to top |
|
| Guest |
Posted: Tue Nov 28, 2006 12:01 pm |
|
|
|
Guest
|
2006/11/28, Carl Hayter <hayter@usc.edu>:
> I currently authenticate my users against an external PHP forum user database.
> Since the Jabber server does not have direct access to the users database of
> the forum software, I hacked an auth module that uses a bit of example
> code from somewhere off of the Erlang site (urlget.erl). I take the username
> and password (plaintext) and md5 the password and make a standard HTTP request
> to a PHP script on the forum site. so (User,Password) is turned into a HTTP
> request to "http://mysite.org/auth.php?user:md5(password)". the auth.php
> script checks the user/password info and returns a "OK" or "FAIL" as a result.
So that ejabberd auth code (written in Erlang) talks using HTTP with a
web server.
Just curiosity: that could be implemented as an extauth script too, right?
It's a script in your prefered language (Perl, Python, PHP, C...) that
talks using HTTP with a web server. Then tell ejabberd to authenticate
against that script.
Examples:
http://ejabberd.jabber.ru/extauth
> What is the best way to proceed? Should I get an account on the new ejabberd
> module repository and commit my poor code? Should I just upload my code to
> the ejabberd website? Should i post my code here on this list and hope that
> somebody with more Erlang experience would take a look?
Whatever way you use to publish the code, I'll ask you permission to
add it to the Contributions page
http://ejabberd.jabber.ru/contributions
> I just feel really bad with the idea of uploading my poor code...
Call it version 0.1, and add a big warning to the description:
'This code is a mess. Use it at your own risk. It probably does not
work at all.'
Maybe later on version 0.2 you remove the warning.
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed Nov 29, 2006 1:37 am |
|
|
|
Guest
|
On Tue, Nov 28, 2006 at 01:01:13PM +0100, Badlop wrote:
>
> So that ejabberd auth code (written in Erlang) talks using HTTP with a
> web server.
Yes.
> Just curiosity: that could be implemented as an extauth script too, right?
> It's a script in your prefered language (Perl, Python, PHP, C...) that
> talks using HTTP with a web server. Then tell ejabberd to authenticate
> against that script.
Yes, but no.
I'm hosting my ejabberd server on a *cheap* IRC Server hosting service,
and I'm limited to 2 processes and 50MB. The ejabberd process and the
epmd process use up my long-running-process slots.
I also had to hack epmd and a couple erts modules to allow epmd to only
bind to a single IP address. epmd had options to change the binding port,
but not the binding address. I also had to juggle some ports to comply
with the Hosting Service requirements...
My startup goes something like:
##
HOME=/home/zengargoyle/local
EJD_HOME=/home/zengargoyle/local
#EJD_SHELL="-noshell -detached"
EJD_DOMAIN=devil.localdomain
EJD_NAME="ejabberd@$EJD_DOMAIN"
EJC_NAME="ejabberdctl@$EJD_DOMAIN"
EJS_NAME="ejabbersh@$EJD_DOMAIN"
EJD_MIN=14000
EJD_MAX=15000
export ERL_EPMD_DIST_BIND=192.168.254.129
export EJD_DIST_INTERFACE="{192,168,254,129}"
export ERL_EPMD_DIST_PORT=10009
export ERL_MAX_PORTS=90
export ERL_FULLSWEEP_AFTER=0
PATH=$EJD_HOME/bin:$PATH
erl \
-pa $EJD_HOME/lib/yaws/ebin \
-pa $EJD_HOME/var/lib/ejabberd/ebin \
-name $EJD_NAME \
-s ejabberd \
-ejabberd config \"$EJD_HOME/etc/ejabberd/ejabberd.cfg\" \
log_path \"$EJD_HOME/var/log/ejabberd/ejabberd.log\" \
-kernel inet_dist_use_interface $EJD_DIST_INTERFACE \
-kernel inet_dist_listen_min $EJD_MIN \
-kernel inet_dist_listen_max $EJD_MAX \
-mnesia dir \"$EJD_HOME/var/spool/ejabberd\" \
$EJD_SHELL \
-eval 'application:stop(ssl).' \
$@
##
Which with my epmd patches seems to keep me within the service providers
restrictions, at least they haven't shut me down for not running an IRC
server like I'm supposed to...
Some of that particular configuration can probably go away now that I'm
using Yaws as a webserver. Before I was using the inet package to serve
some Online User and Chatroom Logs pages.
This is just for the www.thejapanesepage.com site. For the ejabberd that
I setup at my workplace... I can do anything I want.
----
Carl Hayter
Information Technology Services
University of Southern California
(hacking for www.thejapanesepage.com)
Post recived from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|