Skip to content

mitodl/reddit-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reddit Config

Custom extension of reddit Vagrant setup to allow custom configuration

Setup

NOTE: It may be helpful to create a directory that is separate from your normal dev directory for the repositories that you'll need to run reddit. When the Vagrant VM is provisioned, all of the repositories at the same directory level as the main reddit repository will be available within the Vagrant VM.

  1. Clone the necessary repositories and make sure reddit has the stable branch checked out.

    cd <reddit development directory>
    git clone git@github.com:mitodl/reddit.git
    git clone git@github.com:mitodl/reddit-config.git
    git clone git@github.com:mitodl/refresh_token.git
    cd reddit
    git checkout stable
  2. Create or reload/provision the reddit-config Vagrant VM.

    • For first time setup:

      cd <reddit-config directory>
      vagrant up
    • For subsequent uses:

      cd <reddit-config directory>
      vagrant reload && vagrant provision
    • NOTE: The server is configured to run automatically upon VM creation/provisioning.

  3. Add the reddit.local hostname to your /etc/hosts file. The IP of the Vagrant VM is 192.168.56.111 by default, so the line to add will most likely be:

    192.168.56.111 reddit.local

  4. Navigate to the site from the host machine: http://reddit.local.

    • It may take some time for the server to be ready to accept requests (~30 seconds in some cases), and the site will likely respond with a 503 error before then.
  5. Register a user with the username reddit at http://reddit.local/login.

    • In order for anonymous access to the reddit instance to work via the API this user needs to be present.

Troubleshooting

  • The main server log file is located in the VM at /var/log/upstart/reddit-paster.log. It will often contain useful error messages.
    • Error messages often come in the form of debug links. These messages look like this: Debug at: http://reddit.local/_debug/view/1234567890. Those links will show a stack trace of the error in question.
    • One-liner to show the debug URL for the last error on the server from the host machine: vagrant ssh -c "sudo tac /var/log/upstart/reddit-paster.log | grep -m 1 'Debug at:' | grep -Eo 'http[^\s]*'"
  • Restarting the server is often helpful. In the VM, run sudo reddit-restart.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published