Skip to content

Commit

Permalink
Update Docker stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-hilaire committed Oct 27, 2015
1 parent 0cc65af commit f19aaa1
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 55 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
config.json
68 changes: 68 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
FROM phusion/baseimage:0.9.0
MAINTAINER Romain Pignolet <[email protected]>

WORKDIR /root

RUN apt-get update
RUN apt-get -y install build-essential \
libanyevent-httpd-perl \
libdata-uuid-libuuid-perl \
libdatetime-perl \
libdbd-sqlite3-perl \
libdbi-perl \
libemail-address-perl \
libemail-mime-perl \
libhtml-parser-perl \
libhtml-strip-perl \
libhttp-tiny-perl \
libhttp-date-perl \
libimage-size-perl \
libio-socket-ssl-perl \
libjson-perl \
libjson-xs-perl \
liblocale-gettext-perl \
libswitch-perl \
libexpat1-dev \
git \
nginx

RUN cpan; true

RUN curl -L -O http://search.cpan.org/CPAN/authors/id/C/CI/CINDY/AnyEvent-HTTPD-SendMultiHeaderPatch-v0.1.2.tar.gz && \
tar xf AnyEvent-HTTPD-SendMultiHeaderPatch-v0.1.2.tar.gz && \
cd AnyEvent-HTTPD-SendMultiHeaderPatch-v0.1.2 && \
perl Makefile.PL && \
make install

RUN git clone https://github.com/brong/Net-CardDAVTalk.git && \
cd Net-CardDAVTalk && \
perl Makefile.PL && \
make install

RUN perl -MCPAN -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit'

RUN cpan Class::ReturnValue Class::Accessor Set::Infinite \
DateTime::Set DateTime::Event::Recurrence DateTime::TimeZone DateTime::Event::ICal \
Text::vFile::asData Test::LongString Test::Warn \
Data::ICal UNIVERSAL::require Mail::IMAPTalk XML::Parser \
XML::SemanticDiff XML::Spice Email::Sender::Transport::SMTPS \
Net::DAVTalk Net::CalDAVTalk AnyEvent::HTTPD::CookiePatch \
AnyEvent::IMAP Cookie::Baker Date::Parse HTML::GenerateUtil \
Email::Sender:Simple Moose IO:All AnyEvent:HTTP Net::Server::PreFork \
List::Pairwise IO::LockedFile Template EV Net::DNS || true

RUN mkdir -p /home/jmap/data

COPY . /home/jmap/jmap-perl

WORKDIR /home/jmap/jmap-perl

RUN rm /etc/nginx/sites-enabled/default

COPY docker/nginx.conf /etc/nginx/sites-enabled/

COPY docker/entrypoint.sh /root/

EXPOSE 80

ENTRYPOINT ["sh", "/root/entrypoint.sh"]
11 changes: 11 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"client_id" : "XXX",
"client_secret": "YYY",
"auth_url" : "https://accounts.google.com/o/oauth2/auth",
"token_url" : "https://accounts.google.com/o/oauth2/token",
"callback_url" : "https://proxy.jmap.io/cb/google",
"scopes" : [
"https://www.googleapis.com/auth/userinfo.email",
"https://mail.google.com/"
]
}
52 changes: 0 additions & 52 deletions docker/Dockerfile

This file was deleted.

3 changes: 2 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ sed -i "s?https://proxy.jmap.io?http://$IP?g" ./bin/server.pl ./htdocs/landing.h
# Or can be occurrence of previous docker IP
sed -i "s?http://172[^/]*?http://$IP?g" ./bin/server.pl ./htdocs/landing.html ./JMAP/API.pm ./JMAP/DB.pm

export jmaphost=$IP

service nginx start
perl ./bin/server.pl &
#perl ./bin/syncserver.pl &
perl ./bin/apiendpoint.pl

6 changes: 5 additions & 1 deletion docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
server {
listen 80;
listen 443;
ssl on;
ssl_certificate /home/jmap/jmap-perl/docker/ssl/self-ssl.crt;
ssl_certificate_key /home/jmap/jmap-perl/docker/ssl/self-ssl.key;

root /home/jmap/jmap-perl/htdocs/;
index index.html index.htm;

server_name proxy.jmap.io;

location / {
Expand Down
13 changes: 13 additions & 0 deletions docker/ssl/self-ssl.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----BEGIN CERTIFICATE-----
MIICATCCAWoCCQCgtjAVJ/JxQjANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJB
VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
cyBQdHkgTHRkMB4XDTE1MTAyNzA4NTExNFoXDTE2MTAyNjA4NTExNFowRTELMAkG
A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAsm9F
vEFh0fCz916vNBf4F7+tsAKR/2SXZIhL+GUvCX6WZZGmzKf9myG1xA6uooZGGwcE
xXofMu5GKHPfani5SCe3Cs9StS1sAmd+9vBeiF1aGTaX5Ynqvmaw8t+TlshJPj9r
2eB871pd50wo0TzvkVabrFiESGPKY/fjEHLq8HcCAwEAATANBgkqhkiG9w0BAQsF
AAOBgQBiGDRl4pXT+E2o2zWAQSK6NJW9nWJvi6Eicali9uLiRUfp1cH57p7PBKhV
7B6YEFNVMrJ6oA6yrASro3zrHnY4Llq3UAqqJUmVZYtJXWUzN/PoeAnWK1SS5EO+
pHq9U/lrqBzX+vVYLvDjF/iV+tE/sgm4kVg2ODXCj8myJ/He1g==
-----END CERTIFICATE-----
11 changes: 11 additions & 0 deletions docker/ssl/self-ssl.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIBhDCB7gIBADBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEh
MB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEB
AQUAA4GNADCBiQKBgQCyb0W8QWHR8LP3Xq80F/gXv62wApH/ZJdkiEv4ZS8JfpZl
kabMp/2bIbXEDq6ihkYbBwTFeh8y7kYoc99qeLlIJ7cKz1K1LWwCZ3728F6IXVoZ
Npflieq+ZrDy35OWyEk+P2vZ4HzvWl3nTCjRPO+RVpusWIRIY8pj9+MQcurwdwID
AQABoAAwDQYJKoZIhvcNAQELBQADgYEAV9cECmy/Rzb+V0yEAiIZBTeOQ+bNw1aq
S6P6MU2uh1S3Zp0R686L5XDEDVu2w3xqMnlL+tzsCRZUdU0xW34YEcyeJfWF71Fa
vCNg5CsofwaG7b/LBdX3EV/zgEKAm19trrodHrvB9UCe4msK8YtHNFIX+8wdckQ3
ouibKzQ4KiU=
-----END CERTIFICATE REQUEST-----
15 changes: 15 additions & 0 deletions docker/ssl/self-ssl.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQCyb0W8QWHR8LP3Xq80F/gXv62wApH/ZJdkiEv4ZS8JfpZlkabM
p/2bIbXEDq6ihkYbBwTFeh8y7kYoc99qeLlIJ7cKz1K1LWwCZ3728F6IXVoZNpfl
ieq+ZrDy35OWyEk+P2vZ4HzvWl3nTCjRPO+RVpusWIRIY8pj9+MQcurwdwIDAQAB
AoGAF3Eq9jqYwV4gJqWX2v4zJ9uU1ATibW0nvptxb6bLcTHiTGHASi7f0JuzJ5jO
NKfzWeWoKNGMe8J2ESZ3+aL2pF3VL8pJXsnhKGUZ8IdSik1HQO2ota8DzbQ6xKon
zF+3mffOmF/5//17HnALKBt8JJlHl5UGxXbHcZg19jHiK9ECQQDlxegE7c7wzJdS
zO8fE73Vz4LSuTINsgoKQfCmt7FqrVp7uHKfNXl61v8irckZcafZthiJsnqDt3iD
nBCbUy7lAkEAxs061JZ2OcUchNZ+eUBG4LGXQUWJc37LE3SDLQLy/2p7qFRuX7bm
dQzit1GFLQ7yTlRWH597Sm5d759aePjQKwJBALj6EkeliyugCVLHWNoT8ofmftNV
9E3CPwLzAuG0kEfpNybS3rP9QMb7vnoUngi1zwMd7bMs1CSl14dcZKIm3WECQQCL
wYsyF/RU+HTsDb4rjzxEiZRDlpbiUqiArM/qvMAHPtxfobtWHkY00zIunWh6HJ/K
4Q8KfBs4YA45flUj5gaxAkEAmRPjmQQjkKOaoR7qxedS/xrcaQOteKjbOnWAYC0n
OArshjCNPAJy47iU/o2nAyV8vwaoBUOCepshuyLl+m5PQg==
-----END RSA PRIVATE KEY-----

0 comments on commit f19aaa1

Please sign in to comment.