130
edits
(8 intermediate revisions by 4 users not shown) | |||
Line 6: | Line 6: | ||
It is strongly recommended that the Weave Registration Server be set up under https, or behind a firewall with an https proxy in front of it. It uses standard http auth (implemented in the code), which will send the password in the clear unless done over https. | It is strongly recommended that the Weave Registration Server be set up under https, or behind a firewall with an https proxy in front of it. It uses standard http auth (implemented in the code), which will send the password in the clear unless done over https. | ||
The Weave Registration Server requires PHP with PDO, UTF8 and JSON support installed. This should be the case if you are running PHP 5.1+. PDO will need drivers for whatever storage and authentications engines are used. | The Weave Registration Server requires PHP with PDO, UTF8, mbstring, and JSON support installed. This should be the case if you are running PHP 5.1+. PDO will need drivers for whatever storage and authentications engines are used. Be sure to have locale en_US.utf8 (check with locale -a). | ||
WebDav must not be enabled for this server - it intercepts some of the http packets and syncing will fail. | WebDav must not be enabled for this server - it intercepts some of the http packets and syncing will fail. | ||
Line 12: | Line 12: | ||
== Setting up the Server == | == Setting up the Server == | ||
1) You can get the latest server from http://hg.mozilla.org/ | 1) You can get the latest server from http://hg.mozilla.org/services/reg-server/ | ||
2) Edit your apache conf files to add the following: | 2) Edit your apache conf files to add the following: | ||
Line 18: | Line 18: | ||
<pre> | <pre> | ||
Alias /user/1.0 <full path to weave directory>/weaveserver-registration/1.0/index.php | Alias /user/1.0 <full path to weave directory>/weaveserver-registration/1.0/index.php | ||
Alias /user/1 | Alias /user/1 <full path to weave directory>/weaveserver-registration/1.0/index.php | ||
</pre> | </pre> | ||
(the second one is just for backwards compatibility) | (the second one is just for backwards compatibility) | ||
Line 42: | Line 42: | ||
<pre> | <pre> | ||
create table users ( | |||
id int(11) NOT NULL PRIMARY KEY auto_increment, | |||
username varchar(32), | |||
password_hash varbinary(128), | |||
email varbinary(64), | |||
status tinyint(4) default '1', | |||
alert text, | |||
reset varbinary(32) default null, | |||
reset_expiration datetime | |||
) | ) engine=InnoDB;</pre> | ||
Constants: | Constants: | ||
Line 79: | Line 79: | ||
<pre> | <pre> | ||
insert into users (username, | insert into users (username, password_hash, status) values ('username', md5('password'), 1); | ||
</pre> | </pre> | ||
Line 86: | Line 86: | ||
== Captcha == | == Captcha == | ||
If you wish to use a captcha for your account creation, you will need to get yourself a public key and private key from http://recaptcha.net/. Put those keys in the weave_user_constants.php file and change WEAVE_REGISTER_USE_CAPTCHA to 1. | If you wish to use a captcha for your account creation, you will need to get yourself a public key and private key from http://recaptcha.net/. Put those keys in the weave_user_constants.php file and change WEAVE_REGISTER_USE_CAPTCHA to 1. | ||
Note: The PHP mbstring extension is needed for captcha. | |||
To serve up the captchas, use the | To serve up the captchas, use the | ||
<pre> | <pre> | ||
Alias /misc/1.0/captcha_html <full path to weave user directory>/ | Alias /misc/1.0/captcha_html <full path to weave user directory>/weaveserver-registration/1.0/captcha.php | ||
</pre> | </pre> | ||
edits