diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
index 0000000..1c2e3c7
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,9 @@
+[0.1.0]
+* Initial version
+
+[0.2.0]
+* Fix app title
+
+[0.3.0]
+* Fix first run command
+
diff --git a/CloudronManifest.json b/CloudronManifest.json
index 0bfe0c4..79443ee 100644
--- a/CloudronManifest.json
+++ b/CloudronManifest.json
@@ -1,13 +1,27 @@
{
- "version": "0.1.0",
- "id": "eriktad.prometheus.cloudronapp",
+ "version": "0.3.0",
+ "id": "io.prometheus.cloudronapp",
+ "title": "Prometheus Server",
"author": "Erik Tadevosyan",
- "healthCheckPath": "/healthcheck",
- "httpPort": 8000,
+ "description": "file://DESCRIPTION.md",
+ "tagline": "From metrics to insight",
+ "healthCheckPath": "/",
+ "httpPort": 9090,
"icon": "logo.png",
"addons": {
- "localstorage": {},
- "ldap": {}
+ "localstorage": {}
},
- "manifestVersion": 2
-}
\ No newline at end of file
+ "manifestVersion": 2,
+ "website": "https://prometheus.io/",
+ "contactEmail": "support@cloudron.io",
+ "tags": [ "metrics", "analytics", "graphite", "collect", "graphs" ],
+ "changelog": "file://CHANGELOG",
+ "documentationUrl": "https://docs.cloudron.io/apps/prometheus-server/",
+ "minBoxVersion": "5.5.0",
+ "forumUrl": "https://forum.cloudron.io/category/112/prometheus",
+ "mediaLinks": [
+ "https://screenshots.cloudron.io/io.prometheus.cloudronapp/1.png",
+ "https://screenshots.cloudron.io/io.prometheus.cloudronapp/2.png",
+ "https://screenshots.cloudron.io/io.prometheus.cloudronapp/3.png"
+ ]
+}
diff --git a/DESCRIPTION.md b/DESCRIPTION.md
new file mode 100644
index 0000000..a3d483b
--- /dev/null
+++ b/DESCRIPTION.md
@@ -0,0 +1,19 @@
+This app packages Prometheus 2.22.0
+
+Prometheus, a Cloud Native Computing Foundation project, is a systems and service monitoring system.
+It collects metrics from configured targets at given intervals, evaluates rule expressions, displays
+the results, and can trigger alerts when specified conditions are observed.
+
+## Features
+
+The features that distinguish Prometheus from other metrics and monitoring systems are:
+
+* A multi-dimensional data model (time series defined by metric name and set of key/value dimensions)
+* PromQL, a powerful and flexible query language to leverage this dimensionality
+* No dependency on distributed storage; single server nodes are autonomous
+* An HTTP pull model for time series collection
+* Pushing time series is supported via an intermediary gateway for batch jobs
+* Targets are discovered via service discovery or static configuration
+* Multiple modes of graphing and dashboarding support
+* Support for hierarchical and horizontal federation
+
diff --git a/Dockerfile b/Dockerfile
index 401cf0a..a6e42c3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,31 +1,12 @@
FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4
-EXPOSE 8000
+RUN mkdir -p /app/code
+WORKDIR /app/code
-RUN mkdir -p /app/data/runtime /app/data/config && \
- chown -R cloudron:cloudron /app/data/runtime /app/data/config
-
-WORKDIR /app/data
-
-# configure apache
-RUN rm /etc/apache2/sites-enabled/*
-RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf
-RUN a2disconf other-vhosts-access-log
-ADD apache/prometheus.conf /etc/apache2/sites-enabled/prometheus.conf
-RUN echo "Listen 8000" > /etc/apache2/ports.conf
-RUN a2enmod ldap authnz_ldap proxy proxy_http rewrite
+ARG VERSION=2.22.0
# install Prometheus
-RUN mkdir -p /usr/local/bin/prometheus && \
- cd /usr/local/bin && \
- wget -c https://github.com/prometheus/prometheus/releases/download/v2.22.0/prometheus-2.22.0.linux-amd64.tar.gz && \
- tar xvfz prometheus-*.tar.gz && \
- rm -rf prometheus-*.tar.gz && \
- mv prometheus-*/* prometheus && \
- rm -rf prometheus-* && \
- chown -R cloudron:cloudron prometheus
-
-RUN sudo -u cloudron cp -n /usr/local/bin/prometheus/prometheus.yml /app/data/config/prometheus.yml
+RUN curl -L https://github.com/prometheus/prometheus/releases/download/v${VERSION}/prometheus-${VERSION}.linux-amd64.tar.gz | tar zxvf - --strip-components 1
COPY start.sh /app/pkg/
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..1a9d816
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,9 @@
+MIT License (MIT)
+Copyright (c) 2016 Cloudron UG
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/apache/prometheus.conf b/apache/prometheus.conf
deleted file mode 100644
index 2e4c194..0000000
--- a/apache/prometheus.conf
+++ /dev/null
@@ -1,36 +0,0 @@
-
- DocumentRoot /usr/local/bin/prometheus
-
- ErrorLog "/dev/stderr"
- CustomLog "/dev/stdout" combined
-
-
- AllowOverride None
- Order deny,allow
- Deny from All
-
- AuthType Basic
- AuthBasicProvider ldap
- AuthName "Use your Cloudron Account to login"
- AuthLDAPURL ${CLOUDRON_LDAP_URL}/${CLOUDRON_LDAP_USERS_BASE_DN}?username?sub?(objectclass=user)
- AuthLDAPBindDN "${CLOUDRON_LDAP_BIND_DN}"
- AuthLDAPBindPassword "{CLOUDRON_LDAP_BIND_PASSWORD}"
- Require valid-user
- Satisfy any
-
- ProxyPreserveHost On
- ProxyErrorOverride Off
- ProxyPass http://127.0.0.1:9090/
-
-
-
- Order allow,deny
- Allow from all
- Satisfy Any
-
- ErrorDocument 200 "ok"
- RewriteEngine On
- RewriteRule "/healthcheck" - [R=200]
-
-
-
diff --git a/screenshots/1.png b/screenshots/1.png
new file mode 100644
index 0000000..8d4649d
Binary files /dev/null and b/screenshots/1.png differ
diff --git a/screenshots/2.png b/screenshots/2.png
new file mode 100644
index 0000000..6447942
Binary files /dev/null and b/screenshots/2.png differ
diff --git a/screenshots/3.png b/screenshots/3.png
new file mode 100644
index 0000000..affa77d
Binary files /dev/null and b/screenshots/3.png differ
diff --git a/start.sh b/start.sh
old mode 100644
new mode 100755
index dd51f61..a60e456
--- a/start.sh
+++ b/start.sh
@@ -2,11 +2,14 @@
set -eu
-echo "=> Starting apache"
-APACHE_CONFDIR="" source /etc/apache2/envvars
-rm -f "${APACHE_PID_FILE}"
-/usr/sbin/apache2 -DFOREGROUND &
+mkdir -p /app/data/runtime /app/data/config
+
+if [[ ! -f /app/data/config/prometheus.yml ]]; then
+ echo "=> Creating config file on first run"
+ sudo -u cloudron cp -n /app/code/prometheus.yml /app/data/config/prometheus.yml
+fi
+
+chown -R cloudron:cloudron /app/data
echo "=> Starting Prometheus"
-cd /usr/local/bin/prometheus
-exec /usr/local/bin/gosu cloudron:cloudron ./prometheus --config.file=/app/data/config/prometheus.yml --storage.tsdb.path=/app/data/runtime
\ No newline at end of file
+exec /usr/local/bin/gosu cloudron:cloudron /app/code/prometheus --config.file=/app/data/config/prometheus.yml --storage.tsdb.path=/app/data/runtime