Difference between revisions of "Suggestions"

From Dreamwidth Notes
Jump to: navigation, search
m
m (add SQL statement for validating email; there is no console command for this)
Line 13: Line 13:
 
* Create a new user called "suggestions_bot"
 
* Create a new user called "suggestions_bot"
 
** I did this by [[Invite code generation|creating an invite code]], and signing up a new user in a private/incognito browser window (so it wouldn't sign out my system user), but other methods for creating a user exist.
 
** I did this by [[Invite code generation|creating an invite code]], and signing up a new user in a private/incognito browser window (so it wouldn't sign out my system user), but other methods for creating a user exist.
* Validate the bot account's email address. Three methods:
+
* Validate the bot account's email address. Two methods:
** [[Exploring the database|Edit the database directly]] to record that the email address has been validated. (If you know what that involves, please update this article with more explicit instructions!)
+
** [[Exploring the database|Edit the database directly]] to record that the email address has been validated: <code>UPDATE user SET status='A' WHERE user='[username]';</code>
** I believe there's an admin command somewhere that will let you mark an account's email as validated; or
+
 
** Just configure the bot with a valid email address, run the [[workers]] to get the email sent, and click the validation link you receive. (Check spam if the email doesn't arrive; this is what I ended up doing).
 
** Just configure the bot with a valid email address, run the [[workers]] to get the email sent, and click the validation link you receive. (Check spam if the email doesn't arrive; this is what I ended up doing).
 
* Make the bot an admin of the community at /communities/dw_suggestions/members/edit
 
* Make the bot an admin of the community at /communities/dw_suggestions/members/edit

Revision as of 15:00, 22 February 2016

So you want a version of the Dreamwidth suggestions page working on your Dreamhack. This document should hopefully get you there. It was written by [info]me_and in February 2016.

You will need

  • A Dreamhack.
  • An account on your Dreamhack with admin privs; your default "system" account probably suffices.

Process

  • Create a new community called "dw_suggestions"
    • You can't create this normally, because "dw_" is a reserved name. You need to use a user account with "siteadmin:usernames". Assuming you're logged in as "system", go to /admin/priv/?user=system on your Dreamhack, select "siteadmin" from the drop-down at the bottom, and type "usernames" in the text box, then click "Make changes".
    • You should now be able to create the community at /communities/new
  • Create a new user called "suggestions_bot"
    • I did this by creating an invite code, and signing up a new user in a private/incognito browser window (so it wouldn't sign out my system user), but other methods for creating a user exist.
  • Validate the bot account's email address. Two methods:
    • Edit the database directly to record that the email address has been validated: UPDATE user SET status='A' WHERE user='[username]';
    • Just configure the bot with a valid email address, run the workers to get the email sent, and click the validation link you receive. (Check spam if the email doesn't arrive; this is what I ended up doing).
  • Make the bot an admin of the community at /communities/dw_suggestions/members/edit
  • Make sure the community has a a paid account so anyone can post polls.
    • Give your "system" account the "payments" privilege at /admin/priv/?user=system
    • At /admin/pay/, enter dw_suggestions, and set it to have a paid account.
  • The name of the suggestions bot and the community ought to be picked up from ext/dw-nonfree/etc/config-local.pl, but that didn't seem to work for me. I ended up just editing ext/dw-nonfree/htdocs/site/suggest.bml, which is a horrid hack but did the job for what I needed. Please update this if you can find a better solution!
    • Replace my $destination = LJ::load_user( $LJ::SUGGESTIONS_COMM ); with my $destination = LJ::load_user('dw_suggestions');
    • Replace my $suggestions_bot = LJ::load_user( $LJ::SUGGESTIONS_USER ); with my $suggestions_bot = LJ::load_user('suggestions_bot');