-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy docker from Youps -- murmur docker is now working
- Loading branch information
Showing
18 changed files
with
400 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,8 @@ schema/migrations/* | |
# Google secrets file | ||
gmail_setup/client_secrets.json | ||
|
||
sandbox/ | ||
sandbox/ | ||
|
||
env/ | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM python:2 | ||
ENV PYTHONUNBUFFERED 1 | ||
RUN apt-get update && apt-get install -y mysql-client cron && rm -rf /var/lib/apt | ||
RUN apt-get update && rm -rf /var/lib/apt | ||
RUN mkdir -p /home/ubuntu/production/mailx | ||
WORKDIR /home/ubuntu/production/mailx | ||
COPY ./murmur-env/. /opt/murmur/ | ||
# COPY tasks-cron-docker /etc/cron.d/tasks-cron | ||
# RUN crontab /etc/cron.d/tasks-cron | ||
COPY requirements.txt /home/ubuntu/production/mailx/requirements.txt | ||
RUN pip install --upgrade pip && pip install -r requirements.txt --no-cache-dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
.PHONY: default | ||
default: build reset-db start | ||
|
||
# build the docker image | ||
.PHONY: build | ||
build: | ||
docker-compose build | ||
|
||
# start the docker image | ||
.PHONY: start | ||
start: | ||
docker-compose up --force-recreate --build -d | ||
|
||
# stop the docker image | ||
.PHONY: stop | ||
stop: | ||
docker-compose down | ||
|
||
# stop the docker image and remove database information | ||
.PHONY: clean | ||
clean: | ||
docker-compose down -v | ||
|
||
# reset the database | ||
.PHONY: reset-db | ||
reset-db: | ||
mkdir -p schema/migrations | ||
docker-compose run web scripts/new_database_unsafe.sh | ||
|
||
# attach a shell to the running docker image | ||
.PHONY: shell | ||
shell: | ||
docker exec -it murmur_web /bin/sh -c "[ -e /bin/bash ] && /bin/bash || /bin/sh" || echo "\e[33mmake sure you already ran make start\e[0m" | ||
|
||
.PHONY: solo-shell | ||
solo-shell: | ||
docker-compose run web /bin/sh -c "[ -e /bin/bash ] && /bin/bash || /bin/sh" | ||
|
||
# get a manage.py shell for running django things | ||
.PHONY: django-shell | ||
django-shell: | ||
docker exec -it murmur_web python manage.py shell && from schema.youps import * | ||
|
||
# show logs for the running docker containers | ||
.PHONY: logs | ||
logs: | ||
docker-compose logs -f | ||
|
||
# old script for updating code on the server after pushing | ||
.PHONY: update-dev | ||
update-dev: | ||
ssh -t [email protected] " \ | ||
cd /home/ubuntu/production/mailx; \ | ||
git pull; \ | ||
sudo lamson restart || sudo lamson start; \ | ||
./youps_reboot.sh \ | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
version: "3" | ||
|
||
services: | ||
db: | ||
image: mysql:5.7 | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=${MYSQL_PASS} | ||
volumes: | ||
- youps-db:/var/lib/mysql | ||
restart: always | ||
web: | ||
build: . | ||
container_name: murmur_web | ||
command: bash -c "lamson start; cron && python manage.py runserver 0.0.0.0:8000" | ||
volumes: | ||
- .:/home/ubuntu/production/mailx | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
- db | ||
- smtp | ||
environment: | ||
- RELAY_HOST=${RELAY_HOST} # only for local development | ||
- DATABASE_NAME=${DATABASE_NAME} | ||
- MYSQL_PASS=${MYSQL_PASS} | ||
- DOMAIN_NAME=${DOMAIN_NAME} | ||
- DATABASE_HOST=${DATABASE_HOST} | ||
restart: on-failure | ||
smtp: | ||
image: namshi/smtp | ||
expose: | ||
- 587 | ||
environment: | ||
- GMAIL_USER=${GMAIL_USER} | ||
- GMAIL_PASSWORD=${GMAIL_PASSWORD} | ||
- PORT=587 | ||
restart: always | ||
volumes: | ||
youps-db: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
murmur |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ class Post(models.Model): | |
# if the author is null, then the person who wrote the message isn't actually | ||
# a member of this group on Murmur, and it was likely received via a list that | ||
# fwds to this Murmur group | ||
poster_email = models.EmailField(max_length=255, null=True) | ||
poster_email = models.EmailField(max_length=100, null=True) | ||
|
||
# often "from" header is Firstname LastName <[email protected]>. if so, save that name. | ||
poster_name = models.CharField(max_length=50, null=True) | ||
|
@@ -198,7 +198,7 @@ class Meta: | |
|
||
class ForwardingList(models.Model): | ||
id = models.AutoField(primary_key=True) | ||
email = models.EmailField(verbose_name='email address',max_length=255) | ||
email = models.EmailField(verbose_name='email address',max_length=100) | ||
timestamp = models.DateTimeField(auto_now=True) | ||
group = models.ForeignKey('Group') | ||
url = models.URLField(null=True, blank=True) | ||
|
@@ -236,7 +236,7 @@ class Meta: | |
class WhiteOrBlacklist(models.Model): | ||
id = models.AutoField(primary_key=True) | ||
group = models.ForeignKey('Group') | ||
email = models.EmailField(max_length=255) | ||
email = models.EmailField(max_length=100) | ||
|
||
# only one of the following can be true | ||
whitelist = models.BooleanField(default=False) | ||
|
@@ -275,7 +275,7 @@ def create_superuser(self, email, password): | |
class UserProfile(AbstractBaseUser): | ||
email = models.EmailField( | ||
verbose_name='email address', | ||
max_length=255, | ||
max_length=100, | ||
unique=True, | ||
) | ||
first_name = models.CharField('first name', max_length=30, blank=True) | ||
|
@@ -319,26 +319,6 @@ def is_staff(self): | |
"Is the user a member of staff?" | ||
return self.is_admin | ||
|
||
class ImapAccount(models.Model): | ||
newest_msg_id = models.IntegerField(default=-1) | ||
|
||
email = models.EmailField( | ||
verbose_name='email address', | ||
max_length=255, | ||
unique=True, | ||
) | ||
password = models.CharField('password', max_length=100, blank=True) | ||
host = models.CharField('host', max_length=100) | ||
|
||
is_oauth = models.BooleanField(default=False) | ||
access_token = models.CharField('access_token', max_length=100, blank=True) | ||
refresh_token = models.CharField('refresh_token', max_length=100, blank=True) | ||
|
||
arrive_action = models.CharField('access_token', max_length=1000, blank=True) | ||
custom_action = models.CharField('custom_action', max_length=1000, blank=True) | ||
timer_action = models.CharField('timer_action', max_length=1000, blank=True) | ||
repeat_action = models.CharField('repeat_action', max_length=1000, blank=True) | ||
|
||
class Following(models.Model): | ||
id = models.AutoField(primary_key=True) | ||
thread = models.ForeignKey('Thread') | ||
|
Oops, something went wrong.