mirror of https://github.com/grafana/grafana
commit
11e35f7b68
@ -1,68 +1,50 @@ |
|||||||
from ubuntu:14.10 |
from ubuntu:14.04 |
||||||
|
|
||||||
run apt-get -y update |
run apt-get -y update |
||||||
|
|
||||||
run apt-get -y install software-properties-common |
run apt-get -y install libcairo2-dev libffi-dev pkg-config python-dev python-pip fontconfig apache2 libapache2-mod-wsgi git-core collectd memcached gcc g++ make supervisor nginx-light gunicorn |
||||||
|
|
||||||
run apt-get -y install python-software-properties &&\ |
|
||||||
add-apt-repository ppa:chris-lea/node.js &&\ |
|
||||||
apt-get -y update |
|
||||||
|
|
||||||
run apt-get -y install python-django-tagging python-simplejson python-memcache \ |
|
||||||
python-ldap python-cairo python-django python-twisted \ |
|
||||||
python-pysqlite2 python-support python-pip gunicorn \ |
|
||||||
supervisor nginx-light nodejs git wget curl |
|
||||||
|
|
||||||
# Install statsd |
|
||||||
run mkdir /src && git clone https://github.com/etsy/statsd.git /src/statsd |
|
||||||
|
|
||||||
run cd /usr/local/src && git clone https://github.com/graphite-project/graphite-web.git |
run cd /usr/local/src && git clone https://github.com/graphite-project/graphite-web.git |
||||||
run cd /usr/local/src && git clone https://github.com/graphite-project/carbon.git |
run cd /usr/local/src && git clone https://github.com/graphite-project/carbon.git |
||||||
run cd /usr/local/src && git clone https://github.com/graphite-project/whisper.git |
run cd /usr/local/src && git clone https://github.com/graphite-project/whisper.git |
||||||
|
|
||||||
run cd /usr/local/src/whisper && git checkout master && python setup.py install |
run cd /usr/local/src/whisper && git checkout master && python setup.py install |
||||||
run cd /usr/local/src/carbon && git checkout 0.9.x && python setup.py install |
run cd /usr/local/src/carbon && git checkout 0.9.x && pip install -r requirements.txt; python setup.py install |
||||||
run cd /usr/local/src/graphite-web && git checkout 0.9.x && python check-dependencies.py; python setup.py install |
run cd /usr/local/src/graphite-web && git checkout 0.9.x && pip install -r requirements.txt; python check-dependencies.py; python setup.py install |
||||||
|
|
||||||
# statsd |
|
||||||
add ./files/statsd_config.js /src/statsd/config.js |
|
||||||
|
|
||||||
# Add graphite config |
# Add graphite config |
||||||
add ./files/initial_data.json /opt/graphite/webapp/graphite/initial_data.json |
add ./files/initial_data.json /opt/graphite/webapp/graphite/initial_data.json |
||||||
add ./files/local_settings.py /opt/graphite/webapp/graphite/local_settings.py |
add ./files/local_settings.py /opt/graphite/webapp/graphite/local_settings.py |
||||||
add ./files/carbon.conf /opt/graphite/conf/carbon.conf |
add ./files/carbon.conf /opt/graphite/conf/carbon.conf |
||||||
add ./files/storage-schemas.conf /opt/graphite/conf/storage-schemas.conf |
add ./files/storage-schemas.conf /opt/graphite/conf/storage-schemas.conf |
||||||
add ./files/storage-aggregation.conf /opt/graphite/conf/storage-aggregation.conf |
add ./files/storage-aggregation.conf /opt/graphite/conf/storage-aggregation.conf |
||||||
add ./files/events_views.py /opt/graphite/webapp/graphite/events/views.py |
add ./files/events_views.py /opt/graphite/webapp/graphite/events/views.py |
||||||
|
|
||||||
run mkdir -p /opt/graphite/storage/whisper |
run mkdir -p /opt/graphite/storage/whisper |
||||||
run touch /opt/graphite/storage/graphite.db /opt/graphite/storage/index |
run touch /opt/graphite/storage/graphite.db /opt/graphite/storage/index |
||||||
run chown -R www-data /opt/graphite/storage |
run chown -R www-data /opt/graphite/storage |
||||||
run chmod 0775 /opt/graphite/storage /opt/graphite/storage/whisper |
run chmod 0775 /opt/graphite/storage /opt/graphite/storage/whisper |
||||||
run chmod 0664 /opt/graphite/storage/graphite.db |
run chmod 0664 /opt/graphite/storage/graphite.db |
||||||
run cd /opt/graphite/webapp/graphite && python manage.py syncdb --noinput |
run cd /opt/graphite/webapp/graphite && python manage.py syncdb --noinput |
||||||
|
|
||||||
|
add ./files/my_htpasswd /etc/nginx/.htpasswd |
||||||
|
|
||||||
# Add system service config |
# Add system service config |
||||||
add ./files/nginx.conf /etc/nginx/nginx.conf |
add ./files/nginx.conf /etc/nginx/nginx.conf |
||||||
add ./files/supervisord.conf /etc/supervisor/conf.d/supervisord.conf |
add ./files/supervisord.conf /etc/supervisor/conf.d/supervisord.conf |
||||||
|
# Nginx |
||||||
|
# |
||||||
# graphite |
# graphite |
||||||
expose 80 |
expose 80 |
||||||
|
|
||||||
# Carbon line receiver port |
# Carbon line receiver port |
||||||
expose 2003 |
expose 2003 |
||||||
# Carbon cache query port |
# Carbon cache query port |
||||||
expose 7002 |
expose 7002 |
||||||
|
|
||||||
# Statsd UDP port |
|
||||||
expose 8125/udp |
|
||||||
# Statsd Management port |
|
||||||
expose 8126 |
|
||||||
|
|
||||||
VOLUME ["/var/lib/elasticsearch"] |
|
||||||
VOLUME ["/opt/graphite/storage/whisper"] |
VOLUME ["/opt/graphite/storage/whisper"] |
||||||
VOLUME ["/var/lib/log/supervisor"] |
VOLUME ["/var/lib/log/supervisor"] |
||||||
|
|
||||||
cmd ["/usr/bin/supervisord"] |
cmd ["/usr/bin/supervisord"] |
||||||
|
|
||||||
# vim:ts=8:noet: |
# vim:ts=8:noet: |
||||||
|
@ -1,4 +1,10 @@ |
|||||||
graphite: |
graphite: |
||||||
build: blocks/graphite |
build: blocks/graphite |
||||||
ports: |
ports: |
||||||
- "8776:80" |
- "8080:80" |
||||||
|
- "2003:2003" |
||||||
|
volumes: |
||||||
|
- /var/docker/gfdev/graphite:/opt/graphite/storage/whisper |
||||||
|
- /etc/localtime:/etc/localtime:ro |
||||||
|
- /etc/timezone:/etc/timezone:ro |
||||||
|
|
||||||
|
@ -0,0 +1 @@ |
|||||||
|
grafana:$apr1$4R/20xhC$8t37jPP5dbcLr48btdkU// |
@ -1,38 +0,0 @@ |
|||||||
package plugins |
|
||||||
|
|
||||||
import ( |
|
||||||
"encoding/json" |
|
||||||
|
|
||||||
"github.com/grafana/grafana/pkg/models" |
|
||||||
) |
|
||||||
|
|
||||||
type ApiPluginRoute struct { |
|
||||||
Path string `json:"path"` |
|
||||||
Method string `json:"method"` |
|
||||||
ReqSignedIn bool `json:"reqSignedIn"` |
|
||||||
ReqGrafanaAdmin bool `json:"reqGrafanaAdmin"` |
|
||||||
ReqRole models.RoleType `json:"reqRole"` |
|
||||||
Url string `json:"url"` |
|
||||||
Headers []ApiPluginHeader `json:"headers"` |
|
||||||
} |
|
||||||
|
|
||||||
type ApiPlugin struct { |
|
||||||
PluginBase |
|
||||||
Routes []*ApiPluginRoute `json:"routes"` |
|
||||||
} |
|
||||||
|
|
||||||
type ApiPluginHeader struct { |
|
||||||
Name string `json:"name"` |
|
||||||
Content string `json:"content"` |
|
||||||
} |
|
||||||
|
|
||||||
func (app *ApiPlugin) Load(decoder *json.Decoder, pluginDir string) error { |
|
||||||
if err := decoder.Decode(&app); err != nil { |
|
||||||
return err |
|
||||||
} |
|
||||||
|
|
||||||
app.PluginDir = pluginDir |
|
||||||
|
|
||||||
ApiPlugins[app.Id] = app |
|
||||||
return nil |
|
||||||
} |
|
Loading…
Reference in new issue