Initial version

This commit is contained in:
Joey
2017-03-13 07:59:00 +00:00
commit faba1547ce
9 changed files with 112 additions and 0 deletions

5
.dockerignore Normal file
View File

@@ -0,0 +1,5 @@
.git
.gitignore
.dockerignore
node_modules

2
CHANGELOG Normal file
View File

@@ -0,0 +1,2 @@
[0.1.0]
* Initial version

29
CloudronManifest.json Normal file
View File

@@ -0,0 +1,29 @@
{
"id": "org.matrix.synapse_riot",
"title": "Matrix synapse with Riot",
"author": "Matrix synapse & Riot authors",
"description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG",
"tagline": "matrix server and web client",
"version": "0.1.0",
"healthCheckPath": "/",
"httpPort": 8000,
"tcpPorts": {
"FEDERATION_PORT": {
"title": "Federation Port",
"description": "Federation Port",
"defaultValue": 8448
}
},
"addons": {
"localstorage": {}
},
"manifestVersion": 1,
"website": "https://matrix.org",
"contactEmail": "support@cloudron.io",
"icon": "logo.png",
"tags": [
"im", "collaboration"
],
"mediaLinks": [ ]
}

1
DESCRIPTION.md Normal file
View File

@@ -0,0 +1 @@
Please add the appstore description in markdown format here.

30
Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
FROM cloudron/base:0.10.0
MAINTAINER Authors name <support@cloudron.io>
RUN mkdir -p /app/code
WORKDIR /app/code
EXPOSE 8000
# Riot web
RUN curl -L https://github.com/vector-im/riot-web/releases/download/v0.9.7/vector-v0.9.7.tar.gz | tar -xz --strip-components 1 -f -
RUN ln -sf /app/data/riot_config.json /app/code/config.json
# Nginx
RUN rm /etc/nginx/sites-enabled/*
ADD nginx_matrix.conf /etc/nginx/sites-enabled/
RUN rm -rf /var/lib/nginx && ln -sf /app/data/nginx /var/lib/nginx
RUN rm -rf /var/log/nginx && ln -sf /app/data/nginx_log /var/log/nginx
# Synapse
RUN apt update && apt-get install -y build-essential python2.7-dev libffi-dev \
python-wheel python-pip python-setuptools sqlite3 \
libssl-dev libjpeg-dev libxslt1-dev
RUN pip install --upgrade setuptools
RUN pip install https://github.com/matrix-org/synapse/tarball/master
RUN chown -R www-data.www-data /app/code
ADD start_matrix.sh /app/
CMD [ "/app/start_matrix.sh" ]

0
README.md Normal file
View File

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

16
nginx_matrix.conf Normal file
View File

@@ -0,0 +1,16 @@
server {
listen 8000;
listen [::]:8000;
server_name _;
location /_matrix {
proxy_pass http://localhost:8008;
proxy_set_header X-Forwarded-For $remote_addr;
}
location / {
root /app/code;
index index.html;
}
}

29
start_matrix.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
set -eux
if [[ ! -d /app/data/synapse ]]; then
echo "=> Detected first run"
mkdir -p /app/data/synapse
cd /app/data/synapse
python -m synapse.app.homeserver \
--server-name ${APP_DOMAIN#*.} \
--config-path homeserver.yaml \
--report-stats=no \
--generate-config
fi
if [[ ! -e /app/data/riot_config.json ]]; then
cp /app/code/config.sample.json /app/data/riot_config.json
sed -i "s#https://matrix.org#https://$APP_DOMAIN#" /app/data/riot_config.json
fi
mkdir -p /app/data/nginx
mkdir -p /app/data/nginx_log
chown -R www-data.www-data /app/data
cd /app/data/synapse
gosu www-data python -m synapse.app.homeserver --config-path homeserver.yaml &> /dev/null &
exec /usr/sbin/nginx -g 'daemon off;'