-
Description Why this would be useful |
Beta Was this translation helpful? Give feedback.
Replies: 20 comments 2 replies
-
Unless you really need to use an external program, Anope has a built-in webcpanel that allows you to register nicknames and manage accounts, channels, etc. On Anope 2.0 you need to build webcpanel with You could take a look at it and see if it fits your needs. |
Beta Was this translation helpful? Give feedback.
-
I do eventually really need to use an external program because I want to link the user account to info in another database, but I will look at the webpanel and see if it can at least be used as a stop gap. |
Beta Was this translation helpful? Give feedback.
-
Hmmm, I don't see webpanel listed in extras. I am running Anope 2.0.16...
|
Beta Was this translation helpful? Give feedback.
-
Right. |
Beta Was this translation helpful? Give feedback.
-
If you are moving towards a centralized account system that will span multiple services, it may be worth considering LDAP in the future. |
Beta Was this translation helpful? Give feedback.
-
I got the Webcpanel working, although I am having isseues getting it to use TLS. It doesn't really fit what I need also. I could write something but I would need to be able to have it hash the password. Anope doesn't seem to be using a simple sha256 hash with a salt. |
Beta Was this translation helpful? Give feedback.
-
The way the password strings look depends on the choice of the primary "encryption" module. You can see how the format works by looking at the "OnEncrypt" function in the module file for whatever method you have chosen. |
Beta Was this translation helpful? Give feedback.
-
I am looking at sha256. |
Beta Was this translation helpful? Give feedback.
-
Looking at the hashed password, that looks like hex encoding, not base 64...? |
Beta Was this translation helpful? Give feedback.
-
If in the config I have something like this:
With sha256 listed first as shown, the configuration documentation says:
|
Beta Was this translation helpful? Give feedback.
-
If you want to authenticate against an external SQL database you should probably use the sql_authentication module rather than messing around with Anope's database. |
Beta Was this translation helpful? Give feedback.
-
But Anope's NickServ already has a database, why not improve the registration process? |
Beta Was this translation helpful? Give feedback.
-
I'm not sure what benefit it has? Anope has options for authenticating an external service against Anope (xmlrpc) and using an external service for authenticating against Anope (sql_authentication). It doesn't seem like a widely useful feature to maintain two databases. |
Beta Was this translation helpful? Give feedback.
-
Maintaining two databases is exactly what I am trying to avoid. The NickServ database is required in order to have registered nicks, why setup another database just to authenticate nicks when the NickServ already has a database that does that? Plus the NickServ is (or at least was) clunky and required the users to confirm their email by typing text commands to IRC, I fised that so that now users get an email with a link that they can click to conform their email. All I need is better documentation on the sha256 password hash method and I could easily create a program to register and maintain nicks in an external program. This would allow integration with other systems that require users to register, like blogs, company logins, etc... |
Beta Was this translation helpful? Give feedback.
-
The Web CPanel is good, but it's not easily extendable and the handling of email confirmations leaves much to be desired. This is what a confirmation email for my system looks like now because of an external program I wrote...
As opposed to this:
|
Beta Was this translation helpful? Give feedback.
-
It sounds like what you want is the xmlrpc module? You can create and authenticate a user using that. |
Beta Was this translation helpful? Give feedback.
-
Does anyone have a simple complete example program that would register a user, preferably written in PHP using XMLRPC? Just the basics, but something that I could run? |
Beta Was this translation helpful? Give feedback.
-
There's one here: https://github.com/anope/anope/blob/2.1/docs/XMLRPC/xmlrpc.php#L61 |
Beta Was this translation helpful? Give feedback.
-
That has functions, but no example of how to use the functions. Also, I am guessing I would need to include that file using an includude statement from my actual code? |
Beta Was this translation helpful? Give feedback.
-
Ok, first off, I found that the xmlrpc extension is no longer bundled with PHP 8.x. You have to download it and build it separately. It is available here: https://github.com/php/pecl-networking-xmlrpc Now your PHP has the XMLRPC extension loaded, copy https://github.com/anope/anope/blob/2.1/docs/XMLRPC/xmlrpc.php and edit the last line to contain the URL of your Anope web server instance. Make sure m_httpd is enabled and configured in your Anope modules.conf file. Also make sure m_xmlrpc and m_xmlrpc_main are uncommented and enabled. Now you can created a php file that includes xmlrpc.php and runs a command like this:
This example crates a nick name of "testuser" with a password of "password" and an email of "[email protected]". |
Beta Was this translation helpful? Give feedback.
Ok, first off, I found that the xmlrpc extension is no longer bundled with PHP 8.x. You have to download it and build it separately. It is available here: https://github.com/php/pecl-networking-xmlrpc
To build it you need to run phpize in the folder where you extracted it, then run configure, then make, then make install. After that you will need to go to /etc/php8/conf.d and create a file named xmlrpc.ini containing the line:
extension=xmlrpc.so
Now your PHP has the XMLRPC extension loaded, copy https://github.com/anope/anope/blob/2.1/docs/XMLRPC/xmlrpc.php and edit the last line to contain the URL of your Anope web server instance. Make sure m_httpd is enabled and configured in your Ano…