Skip to content

Commit

Permalink
Merge pull request #336 from haystack/2067bcf2_recovery
Browse files Browse the repository at this point in the history
2067bcf recovery
  • Loading branch information
soyapark authored Feb 2, 2021
2 parents 6bec739 + 2067bcf commit d8c5ffe
Show file tree
Hide file tree
Showing 132 changed files with 53,831 additions and 8,200 deletions.
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Please enter your gmail username and password
# Also enable insecure logins
# Please enter your gmail address
# Also create an gmail app password
GMAIL_USER=[email protected]
GMAIL_PASSWORD=YOU_GMAIL_PASSWORD
GMAIL_PASSWORD=YOUR_APP_PASSWORD



Expand All @@ -17,6 +17,7 @@ GMAIL_PASSWORD=YOU_GMAIL_PASSWORD
DATABASE_NAME=murmur
MYSQL_PASS=murmurdb
DATABASE_HOST=db
GMAIL_PORT=587

# domain name used for sending emails
DOMAIN_NAME=localhost:8000
Expand Down
98 changes: 12 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/haystack/murmur?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Django version](https://img.shields.io/badge/Django-1.7-blue)](https://docs.djangoproject.com/en/3.0/releases/1.7/) [![python version](https://img.shields.io/badge/python-2.7-yellowgreen.svg)](https://www.python.org/download/releases/2.7/)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/haystack/murmur?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Django version](https://img.shields.io/badge/Django-1.10-blue)](https://docs.djangoproject.com/en/3.0/releases/1.10/) [![python version](https://img.shields.io/badge/python-2.7-yellowgreen.svg)](https://www.python.org/download/releases/2.7/)

Murmur
=

Murmur uses Django with a MySQL backend (you can replace with any other backend Django supports). For email, we use postfix along with the python lamson library.

#### Private File

Please contact us for an example of the private file. You cannot run the program without it.

#### Install MySQL Server

#### setup the database
* change the root mysql account to one written in private file.
* make sure you can log in to mysql with the password in the command line: `mysql -u root -p`

#### Install Git and clone this repository
* `git clone https://github.com/haystack/murmur.git`

Expand All @@ -29,89 +19,25 @@ Please contact us for an example of the private file. You cannot run the program

To install the Docker Engine select your [Linux distribution](https://docs.docker.com/engine/install/#server) and follow the instructions to install.

Currently you need a gmail account in order for Murmur to send verification emails, such as registration confirmation. In order for Murmur to log in to your gmail account you need to [enable less secure logins](https://support.google.com/accounts/answer/6010255?hl=en).
Currently you need a gmail account in order for Murmur to send verification emails, such as registration confirmation.

Next set up the environment variables. The only variables you should need to set are your gmail username and password.

1. `cp .env.example .env`
2. Fill in the correct values in `.env` for your gmail account. Make sure to enable insecure logins on gmail.
3. Use `make` to create the database and create a superuser account to login
4. Check it out on `localhost:8000

#### Starting and Stopping Docker

In order to stop docker you can simply run `make stop` and run `make start` to start it up again.

## Not Running Docker i.e. on the server

#### install required linux packages if on linux
* `sudo apt-get install libmysqlclient-dev python-dev`

#### install virtualenv and python packages
* `/usr/bin/python2.7`
* pip: `sudo easy_install pip`
* `sudo pip install virtualenv `
* create a virtualenv for this project: `virtualenv murmur-env`
* make sure your virtualenv is activated: `source murmur-env/bin/activate`

#### install required python packages
* `pip install mysql-python`
* `pip install -r requirements.txt`

#### configuration
* edit database details in a new file called private.py. http_handler/settings.py looks for this file to populate database information:
`MYSQL_LOCAL = {
'NAME': 'murmur',
'USER': 'admin',
'PASSWORD': 'password',
'HOST': 'localhost'
}`
* also in this private.py file, add your Amazon S3 settings:
* `AWS_STORAGE_BUCKET_NAME = 'bucket-name-goes-here'`
* `AWS_ACCESS_KEY_ID = 'key-goes-here'`
* `AWS_SECRET_ACCESS_KEY = 'secret-key-goes-here'`
* create file /opt/murmur/env with single word containing "dev", "staging", or "prod" for the type of server you are setting up
* create file /opt/murmur/debug with single word containing "true" or "false" to turn on debug mode
* edit file /opt/murmur/website with single word containing "murmur" or "squadbox" to direct to the respective landing page
* If using Google integration, create a Google API project and enable the Gmail, People and Contacts APIs; generate an Oauth2 client_secrets.json file for this project and put this in the /gmail_setup/ directory
* Run [this command](https://github.com/haystack/murmur/blob/master/mysql_encoding) at mysql
2. Fill in the correct values in `.env` for your gmail account. Put your gmail address and a google app password.
3. `cp private.py.example private.py`
4. Fill in the correct values in `private.py` such as your AWS IDs for message-attachment storage.
5. Use `make` to create the database and create a superuser account to login
6. Check it out on `localhost:8000`

#### setup the database
* `mysql -u root -p`
* `create database murmur;`
* Give privileges to the user that will access the database from django: `grant all privileges ON murmur.* TO root@localhost;`

#### install schema and create superuser
* `python manage.py syncdb`and create superuser
* Convert schema app to be managed by South: `python manage.py schemamigration schema --initial`
* Then do fake migration: `python manage.py migrate schema 0001 --fake`

#### run murmur server
* Webserver: `python manage.py runserver 0.0.0.0:8000` (check [here](https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-16-04) for details)

### Email Instructions

Setting for relay & outgoing server is in `config/settings.py` (Double check you open firewall for the ports)

#### Postfix setting (if you are using postfix as a relay system)
* change the root mysql account to one written in `.env`
* make sure you can log in to mysql with the password in the command line: `mysql -u root -p`

If you are using Postfix, you should update two postfix files:

1. `master.cf`: add a line `RELAY_PORT_YOU_SPECIFIED_at_config/settings.py inet n - n - - smtpd`
2. `main.cf`:
```
mydestination =
local_recipient_maps =
local_transport = error: local mail delivery disabled
relay_domains = YOUR DOMAIN NAME
relay_transport = smtp:127.0.0.1:[RECEIVER PORT YOU SPECIFIED at config/settings.py]
```
#### Starting and Stopping Docker

Then reboot Postfix.
In order to stop docker you can simply run `make stop` and run `make start` to start it up again.

#### run murmur server
* If running email server: `lamson start`
+ ⚠️ If it is not running without any error msg or throws `connection refused` error, then check your email port being used by other services (e.g., `netstat -peanut | grep ":8825"`) and check logs at logs/lamson.err. If the port is being used, use another port or kill the process using the port.

#### enable daily digest feature
* `crontab -e` and add a line `0 */24 * * * python ABSOLUTE_DIRECTORY/manage.py digest`
If you want to deploy Murmur on your own server and domain, check out the [advanced settings](https://github.com/haystack/murmur/wiki/Advanced-set-up:-server-deployment)
6 changes: 3 additions & 3 deletions browser/templates/mobile_list_groups.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h3>My {{ group_or_squad | title }}s</h3>
{% endif %}
</div>

<ul id="post-list-table">
<ul id="group-list-table">
{% for group, link in pairs %}
{% if website == 'murmur' %}
<a href="/groups/{{ group.name }}">
Expand All @@ -28,7 +28,7 @@ <h3>My {{ group_or_squad | title }}s</h3>
<li class="row-item" id="{{ group.name }}">
<span class="strong">{{ group.name }}</span>
{% if group.admin %}
<span class="admin label">
<span class="admin label text-light rounded-sm">
{% if website == 'murmur' %}
Admin
{% elif website == 'squadbox' %}
Expand All @@ -37,7 +37,7 @@ <h3>My {{ group_or_squad | title }}s</h3>
</span>
{% endif %}
{% if group.mod %}
<span class="mod label">
<span class="mod label text-light rounded-sm">
{% if website == 'murmur' %}
Mod
{% elif website == 'squadbox' %}
Expand Down
70 changes: 26 additions & 44 deletions browser/templates/murmur/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,62 +14,44 @@

{% block content %}

{% if flavour != "mobile" %}
<div class="container-home">
{% else %}
<div class="container">
{% endif %}
{% if flavour != "mobile" %}
<div class="home-left">
{% else %}
<div class="home-left-mobile">
{% endif %}


<h4>We're re-imagining mailing lists and community discourse for the age of social media.</h4>

Murmur is a new tool for group communication that blends concepts from mailing lists, forums, and social media.
Now members can choose how they receive emails and collaboratively moderate discussion.
<br /><br />
Murmur is a research project from the <a href="http://haystack.csail.mit.edu">Haystack Group</a> at <a href="http://csail.mit.edu">MIT CSAIL</a>.
<br />
<br />
<h4>We're re-imagining mailing lists and community discourse for the age of social media.</h4>
<p>Murmur is a new tool for group communication that blends concepts from mailing lists, forums, and social media.
Now members can choose how they receive emails and collaboratively moderate discussion.</p>
<p>Murmur is a research project from the <a href="http://haystack.csail.mit.edu">Haystack Group</a> at <a href="http://csail.mit.edu">MIT CSAIL</a>.</p>


<h4>Publications</h4>
Amy X. Zhang, Mark S. Ackerman, David R. Karger.
<span class="strong">Mailing Lists: Why Are They Still Here, What’s Wrong With Them, and How Can We Fix Them?</span>
In Proceedings of the ACM Conference on Human Factors in Computing Systems
(CHI 2015). Seoul, Korea. April 2015. <br />
<a href="http://people.csail.mit.edu/axz/papers/mailinglists.pdf"><button class="btn btn-xs">PDF</button></a>
<a href="http://people.csail.mit.edu/axz/mailinglists.html"><button class="btn btn-xs">Slides</button></a>
<a href="http://haystack.csail.mit.edu/blog/2015/05/05/mailing-lists-why-are-they-still-here-whats-wrong-with-them-and-how-can-we-fix-them/"><button class="btn btn-xs">Blog Post</button></a>


<br />
<br />
<h4>Code</h4>
Check out our <a href="https://github.com/haystack/murmur">Github page</a> to run your own version, report an issue, see what we're currently
working on, or get involved!
<br />
<br />
<br />
Still curious about Murmur? Then
<a href="/group_list">explore some public groups</a>!
<h4>Publications</h4>
<div class="d-inline-block mb-2">
<span>Amy X. Zhang, Mark S. Ackerman, David R. Karger.</span>
<span class="strong">Mailing Lists: Why Are They Still Here, What’s Wrong With Them, and How Can We Fix Them?</span>
<span>In Proceedings of the ACM Conference on Human Factors in Computing Systems
(CHI 2015). Seoul, Korea. April 2015.</span>
</div>

<a href="http://people.csail.mit.edu/axz/papers/mailinglists.pdf"><button class="btn btn-xs btn-primary">PDF</button></a>
<a href="http://people.csail.mit.edu/axz/mailinglists.html"><button class="btn btn-xs btn-primary">Slides</button></a>
<a href="http://haystack.csail.mit.edu/blog/2015/05/05/mailing-lists-why-are-they-still-here-whats-wrong-with-them-and-how-can-we-fix-them/"><button class="btn btn-xs btn-primary">Blog Post</button></a>


<br />
<br />
<h4>Code</h4>
<p>Check out our <a href="https://github.com/haystack/murmur">Github page</a> to run your own version, report an issue, see what we're currently
working on, or get involved!</p>
<p>Still curious about Murmur? Then
<a href="/group_list">explore some public groups</a>!</p>





</div>


{% if flavour != "mobile" %}
<div class="home-right">
{% else %}
<div class="home-right-mobile">
{% endif %}



<div style="text-align: center;">
<h4>Our Research Team</h4>
<img class="img-circle" src="https://raw.githubusercontent.com/haystack/website/master/images/people/KakaoTalk_Photo_2017-11-22-17-47-17.jpeg" width=70><BR>
Expand Down
Loading

0 comments on commit d8c5ffe

Please sign in to comment.