Commit 0c285f91 authored by Michiel de Jong's avatar Michiel de Jong

remove experimental scuttlebot and mediagoblin apps

parent a41b1db4
# based on Nate Jones's https://github.com/mediatemple/federated_services_oscon_2013/tree/master/docker/mediagoblin
FROM ubuntu
# Install needed OS packages
RUN apt-get update \
&& apt-get -yq install \
build-essential \
git-core \
openssh-server \
python \
python-dev \
python-lxml \
python-imaging \
python-virtualenv \
python-psycopg2 \
postgresql \
postgresql-client \
sudo \
supervisor \
&& rm -rf /var/lib/apt/lists/*
# Make a home for mediagoblin
RUN mkdir /srv/mediagoblin
# Setup the environment: clone the mediagoblin repo, install python packages
COPY ./env_setup.sh /srv/mediagoblin/env_setup.sh
RUN bash -c "cd /srv/mediagoblin; chmod +x env_setup.sh"
RUN bash -c "cd /srv/mediagoblin; ./env_setup.sh"
# Patch the email code so that test emails are logged
COPY ./email_logging.patch /srv/mediagoblin/email_logging.patch
RUN bash -c "cd /srv/mediagoblin/mediagoblin; patch -p0 < ../email_logging.patch"
# Set up the mediagoblin database in postgresql
COPY ./db_setup.sh /srv/mediagoblin/db_setup.sh
RUN bash -c "cd /srv/mediagoblin; chmod +x db_setup.sh"
RUN bash -c "cd /srv/mediagoblin; ./db_setup.sh"
# Configure the database connection and create the initial tables
COPY ./mediagoblin_local.ini /srv/mediagoblin/mediagoblin/mediagoblin_local.ini
COPY ./db_update.sh /srv/mediagoblin/db_update.sh
RUN bash -c "cd /srv/mediagoblin; chmod +x db_update.sh"
RUN bash -c "cd /srv/mediagoblin; cd mediagoblin; ../db_update.sh"
# Insert the script to run mediagoblin
COPY ./run_app.sh /srv/mediagoblin/run_app.sh
RUN bash -c "cd /srv/mediagoblin; chmod +x run_app.sh"
# Create a couple of required directories
RUN mkdir -p /var/run/sshd
RUN mkdir -p /var/log/supervisor
RUN locale-gen en_US en_US.UTF-8
# Configure supervisord
COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Expose the ports and set the command to run
EXPOSE 6543
CMD ["/usr/bin/supervisord", "-n"]
# Getting the container
## Pull
$ docker pull mtnate/mediagoblin
## Build
$ docker build -t mediagoblin .
Uploading context 20480 bytes
Step 1 : FROM lopter/raring-base:latest
---> 52dbc0e3cd5a
... snip ...
Step 24 : CMD ["/usr/bin/supervisord", "-n"]
---> Running in 0d1c055df130
---> b10ed0e5267c
Successfully built b10ed0e5267c
$ docker images
REPOSITORY TAG ID CREATED SIZE
lopter/raring-base latest 52dbc0e3cd5a 7 weeks ago 186.4 MB (virtual 347.9 MB)
mediagoblin latest b10ed0e5267c 2 minutes ago 12.29 kB (virtual 1.029 GB)
# Running the container
Start the container:
$ docker run -d mtnate/mediagoblin
da42702ecbb9
The web port is whatever docker maps to port 6543:
$ docker port da42702ecbb9 6543
49156
Access the web port in a browser and click on `Create an account at this site`. After filling out the information, there will be a message about the email verification being printed on the server.
To see the link (root password is `secret`):
$ ssh root@localhost -p `docker port da42702ecbb9 22` tail -f /var/log/supervisor/mediagoblin.log
The authenticity of host '[localhost]:49157 ([127.0.0.1]:49157)' can't be established.
ECDSA key fingerprint is a6:32:d3:b0:1b:a0:2e:dc:62:9e:f6:04:a5:96:df:20.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[localhost]:49157' (ECDSA) to the list of known hosts.
root@localhost's password:
2013-07-23 21:43:29,150 INFO [mediagoblin.tools.mail] From address: notice@mediagoblin.example.org
2013-07-23 21:43:29,150 INFO [mediagoblin.tools.mail] To addresses: test@test.com
2013-07-23 21:43:29,150 INFO [mediagoblin.tools.mail] Subject: GNU MediaGoblin - Verify your email!
2013-07-23 21:43:29,150 INFO [mediagoblin.tools.mail] -- Body: --
2013-07-23 21:43:29,150 INFO [mediagoblin.tools.mail] Hi testtest,
to activate your GNU MediaGoblin account, open the following URL in
your web browser:
http://localhost:49156/auth/verify_email/?token=MQ.BNCKgQ.GLcqe3l61XNibYjH88VJ7Bv2g4U
#!/bin/bash
# die on any error
set -e
set -x
# start up postgres
/etc/init.d/postgresql start
sleep 2;
# create root user
sudo -u postgres createuser root -R -S -D
# create root db
sudo -u postgres createdb root
#!/bin/bash
# die on any error
set -e
set -x
# start up postgres
/etc/init.d/postgresql start
sleep 2;
# load up virtualenv
. bin/activate
# update the database
./bin/gmg dbupdate
diff --git mediagoblin/tools/mail.py mediagoblin/tools/mail.py
index 0fabc5a..2dbea47 100644
--- mediagoblin/tools/mail.py
+++ mediagoblin/tools/mail.py
@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import smtplib
+import logging
from email.MIMEText import MIMEText
from mediagoblin import mg_globals, messages
from mediagoblin.tools import common
@@ -23,6 +24,8 @@ from mediagoblin.tools import common
### Special email test stuff begins HERE
### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+_log = logging.getLogger(__name__)
+
# We have two "test inboxes" here:
#
# EMAIL_TEST_INBOX:
@@ -119,12 +122,12 @@ def send_email(from_addr, to_addrs, subject, message_body):
EMAIL_TEST_INBOX.append(message)
elif mg_globals.app_config['email_debug_mode']:
- print u"===== Email ====="
- print u"From address: %s" % message['From']
- print u"To addresses: %s" % message['To']
- print u"Subject: %s" % message['Subject']
- print u"-- Body: --"
- print message.get_payload(decode=True)
+ _log.info(u"===== Email =====")
+ _log.info(u"From address: %s" % message['From'])
+ _log.info(u"To addresses: %s" % message['To'])
+ _log.info(u"Subject: %s" % message['Subject'])
+ _log.info(u"-- Body: --")
+ _log.info(message.get_payload(decode=True))
return mhost.sendmail(from_addr, to_addrs, message.as_string())
#!/bin/sh
# die on any error
set -e
# clone repo
git clone git://gitorious.org/mediagoblin/mediagoblin.git
cd mediagoblin
git submodule update --init
# set up the deps and main code
(virtualenv --system-site-packages . || virtualenv .) && ./bin/python setup.py develop
# install flup for fcgi
./bin/easy_install flup
[mediagoblin]
direct_remote_path = /mgoblin_static/
email_sender_address = "notice@mediagoblin.example.org"
sql_engine = postgresql:///root
email_debug_mode = true
allow_registration = true
[storage:queuestore]
base_dir = %(here)s/user_dev/media/queue
[storage:publicstore]
base_dir = %(here)s/user_dev/media/public
base_url = /mgoblin_media/
[celery]
[plugins]
[[mediagoblin.plugins.geolocation]]
[[mediagoblin.plugins.basic_auth]]
[[mediagoblin.media_types.image]]
#!/bin/bash
cd /srv/mediagoblin/mediagoblin
. bin/activate
./lazyserver.sh --server-name=broadcast
[supervisord]
nodaemon=true
[program:postgresql]
command=sudo -u postgres /usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=false
autostart=true
redirect_stderr=true
[program:mediagoblin]
command=/srv/mediagoblin/run_app.sh
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=false
autostart=true
redirect_stderr=true
FROM node
RUN git clone https://github.com/dominictarr/scuttlebot.git
RUN cd scuttlebot && npm install
COPY ./run.sh /run.sh
CMD sh /run.sh
EXPOSE 2000
# Usage
````
docker build -t indiehosters/scuttlebot .
docker run -d --net=host --env ssb_master=LONGHASH.blake2s -p 2000:2000 indiehosters/scuttlebot
````
#!/bin/bash
cd /scuttlebot
./client.js server > log.txt &
./client.js add --type follows --'$feed' $ssb_master
tail -f log.txt
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment