https://github.com/mitodl/reddit-config
https://github.com/mitodl/reddit-config
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mitodl/reddit-config
- Owner: mitodl
- License: bsd-3-clause
- Created: 2017-06-26T15:42:14.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-03T15:06:49.000Z (almost 5 years ago)
- Last Synced: 2025-02-17T20:50:03.451Z (3 months ago)
- Language: Shell
- Size: 19.5 KB
- Stars: 0
- Watchers: 20
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.```bash
cd
git clone [email protected]:mitodl/reddit.git
git clone [email protected]:mitodl/reddit-config.git
git clone [email protected]:mitodl/refresh_token.git
cd reddit
git checkout stable
```1. Create or reload/provision the `reddit-config` Vagrant VM.
- For first time setup:```bash
cd
vagrant up
```- For subsequent uses:
```bash
cd
vagrant reload && vagrant provision
```
- _NOTE: The server is configured to run automatically upon VM creation/provisioning._1. 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`
1. 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.
1. Register a user with the username `reddit` at .
- 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`.