[
  {
    "path": ".gitignore",
    "content": "/update-releases.json"
  },
  {
    "path": "LICENSE",
    "content": "Creative Commons Legal Code\n\nCC0 1.0 Universal\n\n    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE\n    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN\n    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS\n    INFORMATION ON AN \"AS-IS\" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES\n    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS\n    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM\n    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED\n    HEREUNDER.\n\nStatement of Purpose\n\nThe laws of most jurisdictions throughout the world automatically confer\nexclusive Copyright and Related Rights (defined below) upon the creator\nand subsequent owner(s) (each and all, an \"owner\") of an original work of\nauthorship and/or a database (each, a \"Work\").\n\nCertain owners wish to permanently relinquish those rights to a Work for\nthe purpose of contributing to a commons of creative, cultural and\nscientific works (\"Commons\") that the public can reliably and without fear\nof later claims of infringement build upon, modify, incorporate in other\nworks, reuse and redistribute as freely as possible in any form whatsoever\nand for any purposes, including without limitation commercial purposes.\nThese owners may contribute to the Commons to promote the ideal of a free\nculture and the further production of creative, cultural and scientific\nworks, or to gain reputation or greater distribution for their Work in\npart through the use and efforts of others.\n\nFor these and/or other purposes and motivations, and without any\nexpectation of additional consideration or compensation, the person\nassociating CC0 with a Work (the \"Affirmer\"), to the extent that he or she\nis an owner of Copyright and Related Rights in the Work, voluntarily\nelects to apply CC0 to the Work and publicly distribute the Work under its\nterms, with knowledge of his or her Copyright and Related Rights in the\nWork and the meaning and intended legal effect of CC0 on those rights.\n\n1. Copyright and Related Rights. A Work made available under CC0 may be\nprotected by copyright and related or neighboring rights (\"Copyright and\nRelated Rights\"). Copyright and Related Rights include, but are not\nlimited to, the following:\n\n  i. the right to reproduce, adapt, distribute, perform, display,\n     communicate, and translate a Work;\n ii. moral rights retained by the original author(s) and/or performer(s);\niii. publicity and privacy rights pertaining to a person's image or\n     likeness depicted in a Work;\n iv. rights protecting against unfair competition in regards to a Work,\n     subject to the limitations in paragraph 4(a), below;\n  v. rights protecting the extraction, dissemination, use and reuse of data\n     in a Work;\n vi. database rights (such as those arising under Directive 96/9/EC of the\n     European Parliament and of the Council of 11 March 1996 on the legal\n     protection of databases, and under any national implementation\n     thereof, including any amended or successor version of such\n     directive); and\nvii. other similar, equivalent or corresponding rights throughout the\n     world based on applicable law or treaty, and any national\n     implementations thereof.\n\n2. Waiver. To the greatest extent permitted by, but not in contravention\nof, applicable law, Affirmer hereby overtly, fully, permanently,\nirrevocably and unconditionally waives, abandons, and surrenders all of\nAffirmer's Copyright and Related Rights and associated claims and causes\nof action, whether now known or unknown (including existing as well as\nfuture claims and causes of action), in the Work (i) in all territories\nworldwide, (ii) for the maximum duration provided by applicable law or\ntreaty (including future time extensions), (iii) in any current or future\nmedium and for any number of copies, and (iv) for any purpose whatsoever,\nincluding without limitation commercial, advertising or promotional\npurposes (the \"Waiver\"). Affirmer makes the Waiver for the benefit of each\nmember of the public at large and to the detriment of Affirmer's heirs and\nsuccessors, fully intending that such Waiver shall not be subject to\nrevocation, rescission, cancellation, termination, or any other legal or\nequitable action to disrupt the quiet enjoyment of the Work by the public\nas contemplated by Affirmer's express Statement of Purpose.\n\n3. Public License Fallback. Should any part of the Waiver for any reason\nbe judged legally invalid or ineffective under applicable law, then the\nWaiver shall be preserved to the maximum extent permitted taking into\naccount Affirmer's express Statement of Purpose. In addition, to the\nextent the Waiver is so judged Affirmer hereby grants to each affected\nperson a royalty-free, non transferable, non sublicensable, non exclusive,\nirrevocable and unconditional license to exercise Affirmer's Copyright and\nRelated Rights in the Work (i) in all territories worldwide, (ii) for the\nmaximum duration provided by applicable law or treaty (including future\ntime extensions), (iii) in any current or future medium and for any number\nof copies, and (iv) for any purpose whatsoever, including without\nlimitation commercial, advertising or promotional purposes (the\n\"License\"). The License shall be deemed effective as of the date CC0 was\napplied by Affirmer to the Work. Should any part of the License for any\nreason be judged legally invalid or ineffective under applicable law, such\npartial invalidity or ineffectiveness shall not invalidate the remainder\nof the License, and in such case Affirmer hereby affirms that he or she\nwill not (i) exercise any of his or her remaining Copyright and Related\nRights in the Work or (ii) assert any associated claims and causes of\naction with respect to the Work, in either case contrary to Affirmer's\nexpress Statement of Purpose.\n\n4. Limitations and Disclaimers.\n\n a. No trademark or patent rights held by Affirmer are waived, abandoned,\n    surrendered, licensed or otherwise affected by this document.\n b. Affirmer offers the Work as-is and makes no representations or\n    warranties of any kind concerning the Work, express, implied,\n    statutory or otherwise, including without limitation warranties of\n    title, merchantability, fitness for a particular purpose, non\n    infringement, or the absence of latent or other defects, accuracy, or\n    the present or absence of errors, whether or not discoverable, all to\n    the greatest extent permissible under applicable law.\n c. Affirmer disclaims responsibility for clearing rights of other persons\n    that may apply to the Work or any use thereof, including without\n    limitation any person's Copyright and Related Rights in the Work.\n    Further, Affirmer disclaims responsibility for obtaining any necessary\n    consents, permissions or other rights required for any use of the\n    Work.\n d. Affirmer understands and acknowledges that Creative Commons is not a\n    party to this document and has no duty or obligation with respect to\n    this CC0 or use of the Work.\n"
  },
  {
    "path": "README.md",
    "content": "# netdata\n\nDockerfile for building and running a netdata deamon for your host instance.\n\nNetdata monitors your server with thoughts of performance and memory usage, providing detailed insight into very recent server metrics. It's nice, and now it's also dockerized.\n\nMore info about project: https://github.com/firehol/netdata\n\n> **Note**: the netdata project includes telemetry. Google Analytics is used to aggregate telemetry data, with IP anonymisation turned on. There is currently\n> no way to opt out, until such a mechanism can be provided at runtime instead of compile time. You can track the upstream [issue #7404](https://github.com/netdata/netdata/issues/7404) if\n> you have privacy concerns. GDPR explicitly allows [processing for statistical purposes, without requiring opt-in](https://github.com/netdata/netdata/issues/7366#issuecomment-560363265) in\n> it's Article 6, and related Article 89(1). Currently, you can only opt out if you build netdata without telemetry.\n>\n> More info about the original telemetry implementation in netdata is on [issue #4735](https://github.com/netdata/netdata/issues/4735), and instructions\n> / documentation, including a way to opt out of telemetry is available here: [anonymous statistics docs page](https://docs.netdata.cloud/docs/anonymous-statistics/).\n\n# More info about me\n\nI'm primarily a full-stack web developer with strong knowledge of Docker, APIs, AWS, PHP, Go, Nginx+LUA, SQL and NoSQL databases, Video Streaming (Wowza Media Server), and handle DevOps/automation for several large scale international clients (High traffic/HA deployments).\n\nIf you need someone with this skillset, please contact me at black@scene-si.org.\n\nI'm also the author of the following books:\n\n* [Advent of Go Microservices](https://leanpub.com/go-microservices)\n* [API Foundations in Go](https://leanpub.com/api-foundations)\n* [12 Factor Applications with Docker and Go](https://leanpub.com/12fa-docker-golang)\n\nConsider buying the books to learn something new and support my open source work.\n\nFor more information, I also write a development-themed blog at [scene-si.org](https://scene-si.org/).\nI occasionally tweet my pursuits (sometimes in Slovenian) on [@TitPetric](https://twitter.com/TitPetric).\n\n# Using\n\n## Statring the container\n\n### Docker CLI\n\n```\ndocker run -d --cap-add SYS_PTRACE \\\n           -v /proc:/host/proc:ro \\\n           -v /sys:/host/sys:ro \\\n           -p 19999:19999 \\\n           --restart unless-stopped \\\n           titpetric/netdata\n```\n\n> **Note:** Remove the `--restart unless-stopped` [parameter](https://docs.docker.com/config/containers/start-containers-automatically/#use-a-restart-policy) if you don't need the netdata container to start automatically on boot.\n\n### Docker Compose\n\nUse the sample [docker-compose.yml](docker-compose.yml) file.\n\n> **Note:** Remove the `restart: unless-stopped` [option](https://docs.docker.com/compose/compose-file/#restart) if you don't need the netdata container to start automatically on boot.\n\n```\nmkdir netdata && cd netdata && wget https://raw.githubusercontent.com/titpetric/netdata/master/docker-compose.yml\ndocker-compose up -d\n```\n\n## Accessing the data\n\nOpen a browser on http://server:19999/ and watch how your server is doing.\n\n# Supported tags and respective Dockerfile links\n\nCheck out for [Docker Hub Tags page for titpetric/netdata](https://cloud.docker.com/repository/docker/titpetric/netdata/tags) if you\nneed to grab an older version. There's an archive of versions going back from 1.4 to the current version.\n\nThe `latest` tag is in line with the upstream and is occasionally prone to failure. As far as older tags go -\nthey will inevitably lack some new features but should provide a more stable version to run.\n\n> Developers note: new tags are not added automatically which means there might be some delay between when a new\n> release of netdata is available and when a new tag is available on docker hub; open an issue if that happens.\n\n# Limiting IP netdata listens to\n\nBy default netdata listens to 0.0.0.0 (any address). You might want to change this if you're running netdata in `--net=host` mode. You can pass the following environment variable:\n\n- NETDATA_IP - the IP that netdata should listen to, e.g. `127.0.0.1` for localhost only.\n\n# Passing custom netdata options\n\nIf you need to pass some custom options to netdata, you can pass the following environment variable:\n\n- NETDATA_ARGS - for example if you don't want to use NETDATA_IP above, you can pass `-e NETDATA_ARGS=\"-i 127.0.0.1\"` for same effect.\n\n# Getting emails on alarms\n\nNetdata supports forwarding alarms to an email address. You can set up msmtp by setting the following ENV variables:\n\n- SMTP_TO - This is the address alarms will be delivered to.\n- SMTP_FROM - This is the address the emails will be from. Defaults to localhost.\n- SMTP_SERVER - This is your SMTP server. Defaults to smtp.gmail.com.\n- SMTP_PORT - This is the SMTP server port. Defaults to 587.\n- SMTP_USER - This is your username for the SMTP server.\n- SMTP_PASS - This is your password for the SMTP server. Use an app password if using Gmail.\n- SMTP_TLS - Use TLS for the connection. Defaults to `on`.\n- SMTP_STARTTLS - Use STARTTLS for the connection. Defaults to `on`.\n\nFor example, using gmail:\n\n```\n-e SMTP_TO=user@gmail.com -e SMTP_USER=user -e SMTP_PASS=password\n```\n\nAlternatively, if you already have s msmtp config, you can use that config with:\n\n~~~\n-v /path/to/msmtprc:/etc/msmtprc:ro\n~~~\n\nSee the following link for details on setting up msmtp: [MSMTP - ArchWiki](https://wiki.archlinux.org/index.php/Msmtp)\n\n> Note: email settings up to version v0.10.0 were different. You can get the [old documentation](https://github.com/titpetric/netdata/blob/master/releases/v0.10.0/README.md) is the corresponding release subfolder.\n\n# Adding custom alarms, charts and configuration overrides\n\nTo add custom alarms, charts or to override any default configuration file, mount a volume to the container to /etc/netdata/override, like `-v /opt/netdata/override:/etc/netdata/override:ro`.  Then, place your config files in the directory as if it was /etc/netdata/.\n\nFor example to create a custom alarm for system temperature, create a `health.d` folder in your local directory (`/opt/netdata/override` in the example above) and place a `sensors.conf` file with your alarm configuration inside the `health.d` directory.\n\n# Getting alarms in Slack\n\nNetdata supports sending alerts to slack via webhooks. You can set that up by setting the following ENV variables:\n\n- SLACK_WEBHOOK_URL - This is your incoming slack webhook\n- SLACK_CHANNEL - This is the default channel that alerts will get sent to\n\nFor example:\n\n```\n-e SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXXX -e SLACK_CHANNEL=alerts\n```\n\n# Getting alarms in Discord\n\nNetdata supports sending alerts to Discord via webhooks. You can set that up by setting the following ENV variables:\n\n- DISCORD_WEBHOOK_URL - This is your incoming Discord webhook\n- DISCORD_RECIPIENT - This is the default channel that alerts will get sent to\n\nFor example:\n\n```\n-e DISCORD_WEBHOOK_URL=https://discordapp.com/api/webhooks/XXXX -e DISCORD_RECIPIENT=alerts\n```\n\n# Getting alarms in Telegram\n\nNetdata supports sending alerts to Telegram via token and chat ID. You can set that up by setting the following ENV variables:\n\n- TELEGRAM_BOT_TOKEN - This is your bot token\n- TELEGRAM_CHAT_ID - This is the chat ID\n\nFor example:\n\n```\n-e TELEGRAM_BOT_TOKEN=22624413:AAGy12TkSMBYVBTe4lQt3BfUYvUs5h7I1jn -e TELEGRAM_CHAT_ID=137165138\n```\n\nFor more details about Telegram alerts, see [this page - GitHub](https://github.com/firehol/netdata/wiki/health-monitoring#telegramorg-messages)\n\n# Getting alarms in Pushbullet\n\nNetdata supports sending alerts to Pushbullet via API token. You can set that up by setting the following ENV variables:\n\n- PUSHBULLET_ACCESS_TOKEN - This is your API token\n- PUSHBULLET_DEFAULT_EMAIL - This is the default email that alerts will get sent to if there is not a Pushbullet account attached to it\n\nFor example:\n\n```\n-e PUSHBULLET_ACCESS_TOKEN=o.l8VuizWhXgbERf2Q78ghtzb1LDCYvbSD -e PUSHBULLET_DEFAULT_EMAIL=your.email@gmail.com\n```\n\nMore details about Pushbullet alerts are provided [here - GitHub](https://github.com/firehol/netdata/wiki/health-monitoring#pushbulletcom-push-notifications)\n\n# Setting up streaming\n\nOn a client netdata set this destination to be the HOST[:PORT] of the\ncentral netdata, and give an `API_KEY` that is secret and only known internally\nto the netdata clients, and netdata central. See [this page - GitHub](https://github.com/firehol/netdata/wiki/Replication-Overview#options-for-the-sending-node)\n\n- NETDATA_STREAM_DESTINATION - `HOST[:PORT]` to stream to\n- NETDATA_STREAM_API_KEY - `API_KEY` to send to central net data\n\n```\n-e NETDATA_STREAM_DESTINATION=netdata.service:19999 -e NETDATA_STREAM_API_KEY=1h213ch12h3rc1289e\n```\n\nOn the central netdata set 1 or more `NETADATA_API_KEY_ENABLE` env variables that matches the `API_KEY`\nthat you used on the client above, this will enable the netdata client node to communicate with the netdata central\n\n- NETADATA_API_KEY_ENABLE_{API_KEY}=1\n\n```\n-e NETDATA_API_KEY_ENABLE_1h213ch12h3rc1289e=1\n```\n\n# Monitoring docker container metrics\n\nNetdata supports fetching container data from `docker.sock`. You can forward it to the netdata container with:\n\n~~~\n-v /var/run/docker.sock:/var/run/docker.sock:ro\n~~~\n\nThis will allow netdata to resolve container names.\n\n> Note: forwarding docker.sock exposes the administrative docker API. If due to some security issue access has been obtained to the container, it will expose full docker API, allowing to stop, create or delete containers, as well as download new images in the host.\n>\n> TL;DR If you care about security, consider forwarding a secure docker socket with [docker-proxy-acl](https://github.com/titpetric/docker-proxy-acl)\n\n# Monitoring docker notes on some systems (Debian jessie)\n\nOn debian jessie only 'cpu' and 'disk' metrics show up under individual docker containers. To get the memory metric, you will have to add `cgroup_enable=memory swapaccount=1` to `/etc/default/grub`, appending the `GRUB_CMDLINE_LINUX_DEFAULT` variable:\n\n~~~\n$ cat /etc/default/grub  | grep GRUB_CMDLINE_LINUX_DEFAULT\nGRUB_CMDLINE_LINUX_DEFAULT=\"quiet cgroup_enable=memory swapaccount=1\"\n~~~\n\nAfter rebooting your linux instance, the memory accounting subsystem of the kernel will be enabled. Netdata will pick up additional metrics for the containers when it starts.\n\n# Environment variables\n\nIt's possible to pass a NETDATA_PORT environment variable with -e, to start up netdata on a different port.\n\n```\ndocker run -e NETDATA_PORT=80 [...]\n```\n\n# Some explanation is in order\n\nDocker needs to run with the SYS_PTRACE capability. Without it, the mapped host/proc filesystem is not fully readable to the netdata deamon, more specifically the \"apps\" plugin:\n\n```\n16-01-12 07:58:16: ERROR: apps.plugin: Cannot process /host/proc/1/io (errno 13, Permission denied)\n```\n\nSee the following link for more details: [/proc/1/environ is unavailable in a container that is not priviledged](https://github.com/docker/docker/issues/6607)\n\n# Limitations\n\nIn addition to the above requirements and limitations, monitoring the complete network interface list of the host is not possible from within the Docker container. If you're running netdata and want to graph all the interfaces available on the host, you will have to use `--net=host` mode.\n\nSee the following link for more details: [network interfaces missing when mounting proc inside a container](https://github.com/docker/docker/issues/13398)\n\n## Work-around\n\nI provided a script called `fakenet.sh` which provides a copy of the `/proc/net` filesystem. You should start this script before you start the netdata container. You can do it like this:\n\n~~~\nwget https://raw.githubusercontent.com/titpetric/netdata/master/fakenet.sh\nchmod a+x fakenet.sh\nnohup ./fakenet.sh >/dev/null 2>&1 &\n~~~\n\nUsing the above command, the fakenet script will start in the background and will keep running there. You can use other tools like `screen` or `tmux` to provide similar capability.\n\nThe script fills out the `/dev/shm/fakenet` location, which you must mount into the container. You *must* mount it into `/fakenet/proc/net` exactly with the option like this:\n\n~~~\n-v /dev/shm/fakenet:/fakenet/proc/net\n~~~\n\nThe script refreshes network information about every 250ms (four times per second). The interval may be increased to give better accuracy of netdata, but CPU usage will also increase. Because of this, the data is not very accurate and some spikes and valleys will occur because of a shifting window between when the reading was taken (fakeproc) and between when the reading was read by netdata. This means the margin for error is whatever data can be collected in ~250ms.\n\nWhile the solution might not fit everybody, it's security-positive because the netdata container can only inspect the fake proc/net location, and can't actually access any of the networks because it runs on a private LAN / custom network which is managed and firewalled by docker. You may even open access via application, like a nginx reverse proxy where you can add authentication etc.\n\nPro/con list:\n\n* + network isolation stays in tact\n* + all network device metrics are available\n* - one more service to provide fakenet\n* - accuracy vs. cpu use is a trade-off\n\n# Additional notes\n\nNetdata provides monitoring via a plugin architecture. This plugin supports many projects that don't provide data over the `/proc` filesystem. When you're running netdata in the container, you will have difficulty providing many of these paths to the netdata container.\n\nWhat you do get (even with the docker version) is:\n\n* Host CPU statististics\n* Host Network I/O, QoS\n* Host Disk I/O\n* Applications monitoring\n* Container surface metrics (cpu/disk per name)\n\nYou will not get detailed application metrics (mysql, ups, etc.) from other containers or from the host if running netdata in a container. It may be possible to get *some* of those metrics, but it might not be easy, and most likely not worth it. For most detailed metrics, netdata needs to share the same environment as the application server it monitors. This means it would need to run either in the same container (not even remotely practical), or in the same virtual machine (no containers).\n\n> Note: if you have some custom hardware like a UPS which is monitored via USB and netdata supports it, you will most likely need to add new software to the netdata docker image to support it. The correct way to do it is to create your own Dockerfile, start with \"FROM titpetric/netdata\" and then add all your installation commands to build your own image which will support your hardware setup. Most likely if it's not a very common setup (i.e. available on most machines), the software will not be added to `titpetric/netdata` - that being said, your use case might be useful for others so feel free to submit issues with your extensions or feature requests in terms of new software. I'll gladly add your project/extension to the README here.\n\n# Changelog\n\n### v1.10.0 -> Latest\n\n* Replaced sSMTP with msmtp, renamed `SSMTP_*` settings as `SMTP_*`, removed `SSMTP_HOSTNAME` setting, renamed `SSMTP_TLS` to `SMTP_STARTTLS` and added `SMTP_TLS`.\n"
  },
  {
    "path": "docker-compose.yml",
    "content": "version: '3.4'\n\nservices:\n  netdata:\n    restart: always\n    hostname: netdata\n    image: titpetric/netdata\n    cap_add:\n      - SYS_PTRACE\n    security_opt:\n      - apparmor:unconfined\n    ports:\n      - 19999:19999\n    volumes:\n      - /proc:/host/proc:ro\n      - /sys:/host/sys:ro\n      - /var/run/docker.sock:/var/run/docker.sock:ro\n"
  },
  {
    "path": "fakenet.sh",
    "content": "#!/bin/bash\n# generate a fake /proc/net with a limited set of files\n# which are used for netdata metrics collection\nOUTPUT=\"/dev/shm/fakenet/\";\n\nif [ ! -d \"$OUTPUT\" ]; then\n\tmkdir -p $OUTPUT/{rpc,stat,ip_vs}\nfi\n\nSOURCES=\"/proc/net/dev\n/proc/net/ip_vs_stats\n/proc/net/ip_vs/stats\n/proc/net/netstat\n/proc/net/rpc/nfs\n/proc/net/rpc/nfsd\n/proc/net/snmp\n/proc/net/snmp6\n/proc/net/softnet_stat\n/proc/net/stat/conntrack\n/proc/net/stat/nf_conntrack\n/proc/net/stat/synproxy\"\n\nNETFILES=\"\"\nfor SOURCE in $SOURCES; do\n\tif [ -f \"$SOURCE\" ]; then\n\t\tNETFILES=\"$NETFILES $SOURCE\"\n\tfi\ndone\n\nwhile [ true ]; do\n\tfor NETFILE in $NETFILES; do\n\t\tOUTFILE=\"${NETFILE:10}\"\n\t\techo \"$(<$NETFILE)\" > $OUTPUT$OUTFILE\n\tdone\n\t##date +%s.%N\n\tsleep 0.23\ndone\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"netdata\",\n  \"version\": \"0.0.10\",\n  \"description\": \"Netdata monitors your server with thoughts of performance and memory usage, providing detailed insight into very recent server metrics.\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/titpetric/netdata.git\"\n  },\n  \"keywords\": [\n    \"netdata\",\n    \"monitoring\",\n    \"statistics\",\n    \"graphs\",\n    \"ganglia\",\n    \"cacti\",\n    \"munin\"\n  ],\n  \"author\": \"Tit Petric\",\n  \"license\": \"GPL3 or later\",\n  \"bugs\": {\n    \"url\": \"https://github.com/titpetric/netdata/issues\"\n  },\n  \"homepage\": \"https://github.com/titpetric/netdata\"\n}\n"
  },
  {
    "path": "releases/dev/Dockerfile.build",
    "content": "FROM debian:jessie\n\nADD scripts/build.sh /build.sh\nRUN chmod +x /build.sh && sync && sleep 1 && /build.sh\n\nWORKDIR /"
  },
  {
    "path": "releases/dev/Dockerfile.run",
    "content": "FROM titpetric/netdata-build\n\nADD scripts/run.sh /run.sh\n\nRUN chmod +x /run.sh && sync && sleep 1\n\nWORKDIR /\n\nENV NETDATA_PORT=19999 SSMTP_TLS=YES SSMTP_SERVER=smtp.gmail.com SSMTP_PORT=587 SSMTP_HOSTNAME=localhost\nEXPOSE $NETDATA_PORT\n\nENTRYPOINT [\"/run.sh\"]\n"
  },
  {
    "path": "releases/dev/Makefile",
    "content": "build:\n\tdocker build --rm --no-cache=true -t titpetric/netdata-build -f Dockerfile.build .\n\nrun:\n\tdocker build --rm --no-cache=true -t titpetric/netdata -f Dockerfile.run .\n\n.PHONY: build run"
  },
  {
    "path": "releases/latest/Dockerfile",
    "content": "FROM debian:stretch\n\nADD git-tag /git-tag\n\nADD scripts/build.sh /build.sh\nADD scripts/run.sh /run.sh\n\nRUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh\n\nWORKDIR /\n\nENV NETDATA_PORT=19999 SMTP_TLS=on SMTP_STARTTLS=on SMTP_SERVER=smtp.gmail.com SMTP_PORT=587 SMTP_FROM=localhost\nEXPOSE $NETDATA_PORT\n\nVOLUME /etc/netdata/override\n\nENTRYPOINT [\"/run.sh\"]\n"
  },
  {
    "path": "releases/latest/git-tag",
    "content": ""
  },
  {
    "path": "releases/latest/scripts/build.sh",
    "content": "#!/bin/bash\nset -e\nDEBIAN_FRONTEND=noninteractive\n\n# some mirrors have issues, i skipped httpredir in favor of an eu mirror\n\necho \"deb http://ftp.nl.debian.org/debian/ stretch main\" > /etc/apt/sources.list\necho \"deb http://security.debian.org/debian-security stretch/updates main\" >> /etc/apt/sources.list\n\n# install dependencies for build\n\napt-get -qq update\napt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq libuv1-dev liblz4-dev libjudy-dev libssl-dev\napt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml libjudydebian1 libuv1 liblz4-1 openssl\napt-get -y install msmtp msmtp-mta apcupsd fping\n\n# fetch netdata\n\ngit clone https://github.com/firehol/netdata.git /netdata.git\ncd /netdata.git\nTAG=$(</git-tag)\nif [ ! -z \"$TAG\" ]; then\n\techo \"Checking out tag: $TAG\"\n\tgit checkout tags/$TAG\nelse\n\techo \"No tag, using master\"\nfi\n\n# use the provided installer\n\n./netdata-installer.sh --dont-wait --dont-start-it\n\n# removed hack on 2017/1/3\n#chown root:root /usr/libexec/netdata/plugins.d/apps.plugin\n#chmod 4755 /usr/libexec/netdata/plugins.d/apps.plugin\n\n# remove build dependencies\n\ncd /\nrm -rf /netdata.git\n\ndpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config libuv1-dev liblz4-dev libjudy-dev libssl-dev\napt-get -y autoremove\napt-get clean\nrm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n\n\n# symlink access log and error log to stdout/stderr\n\nln -sf /dev/stdout /var/log/netdata/access.log\nln -sf /dev/stdout /var/log/netdata/debug.log\nln -sf /dev/stderr /var/log/netdata/error.log\n"
  },
  {
    "path": "releases/latest/scripts/run.sh",
    "content": "#!/bin/bash\n\n# fix permissions due to netdata running as root\nchown root:root /usr/share/netdata/web/ -R\necho -n \"\" > /usr/share/netdata/web/version.txt\n\n# set up msmtp\nif [[ $SMTP_TO ]]; then\ncat << EOF > /etc/msmtprc\naccount default\naliases /etc/msmtp_aliases\nfrom $SMTP_FROM\nhost $SMTP_SERVER\nport $SMTP_PORT\ntls $SMTP_TLS\ntls_starttls $SMTP_STARTTLS\ntls_certcheck off\nEOF\n\ncat << EOF > /etc/msmtp_aliases\nnetdata: $SMTP_TO\nroot: $SMTP_TO\nEOF\nfi\n\nif [[ $SMTP_USER ]]; then\ncat << EOF >> /etc/msmtprc\nauth on\nuser $SMTP_USER\nEOF\nfi\n\nif [[ $SMTP_PASS ]]; then\ncat << EOF >> /etc/msmtprc\npassword $SMTP_PASS\nEOF\nfi\n\n# copy conf from NETDATA_STOCK_CONFIG_DIR (normally under /usr/lib/netdata/conf.d) to NETDATA_USER_CONFIG_DIR (normally under /etc/netdata)\ncp /usr/lib/netdata/conf.d/health_alarm_notify.conf /etc/netdata\n\nif [[ $SLACK_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@SLACK_WEBHOOK_URL=\\\"\\\"@SLACK_WEBHOOK_URL=\\\"${SLACK_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $SLACK_CHANNEL ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_SLACK=\\\"\\\"@DEFAULT_RECIPIENT_SLACK=\\\"${SLACK_CHANNEL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $DISCORD_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@DISCORD_WEBHOOK_URL=\\\"\\\"@DISCORD_WEBHOOK_URL=\\\"${DISCORD_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $DISCORD_RECIPIENT ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_DISCORD=\\\"\\\"@DEFAULT_RECIPIENT_DISCORD=\\\"${DISCORD_RECIPIENT}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_BOT_TOKEN ]]; then\n\tsed -i -e \"s@TELEGRAM_BOT_TOKEN=\\\"\\\"@TELEGRAM_BOT_TOKEN=\\\"${TELEGRAM_BOT_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_CHAT_ID ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_TELEGRAM=\\\"\\\"@DEFAULT_RECIPIENT_TELEGRAM=\\\"${TELEGRAM_CHAT_ID}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_ACCESS_TOKEN ]]; then\n\tsed -i -e \"s@PUSHBULLET_ACCESS_TOKEN=\\\"\\\"@PUSHBULLET_ACCESS_TOKEN=\\\"${PUSHBULLET_ACCESS_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_DEFAULT_EMAIL ]]; then\n\tsed -i -e \"s#DEFAULT_RECIPIENT_PUSHBULLET=\\\"\\\"#DEFAULT_RECIPIENT_PUSHBULLET=\\\"${PUSHBULLET_DEFAULT_EMAIL}\\\"#\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $NETDATA_IP ]]; then\n\tNETDATA_ARGS=\"${NETDATA_ARGS} -i ${NETDATA_IP}\"\nfi\n\n# on a client netdata set this destination to be the [PROTOCOL:]HOST[:PORT] of the\n# central netdata, and give an API_KEY that is secret and only known internally\n# to the netdata clients, and netdata central\nif [[ $NETDATA_STREAM_DESTINATION ]] && [[ $NETDATA_STREAM_API_KEY ]]; then\n\tcat << EOF > /etc/netdata/stream.conf\n[stream]\n\tenabled = yes\n\tdestination = $NETDATA_STREAM_DESTINATION\n\tapi key = $NETDATA_STREAM_API_KEY\nEOF\nfi\n\n# set 1 or more NETADATA_API_KEY_ENABLE env variables, such as NETDATA_API_KEY_ENABLE_1h213ch12h3rc1289e=1\n# that matches the API_KEY that you used on the client above, this will enable the netdata client\n# node to communicate with the netdata central\nif printenv | grep -q 'NETDATA_API_KEY_ENABLE_'; then\n\tprintenv | grep -oe 'NETDATA_API_KEY_ENABLE_[^=]\\+' | sed 's/NETDATA_API_KEY_ENABLE_//' | xargs -n1 -I{} echo '['{}$']\\n\\tenabled = yes' >> /etc/netdata/stream.conf\nfi\n\n# exec custom command\nif [[ $# -gt 0 ]] ; then\n        exec \"$@\"\n        exit\nfi\n\nif [[ -d \"/fakenet/\" ]]; then\n\techo \"Running fakenet config reload in background\"\n\t( sleep 10 ; curl -s http://localhost:${NETDATA_PORT}/netdata.conf | sed -e 's/# filename/filename/g' | sed -e 's/\\/host\\/proc\\/net/\\/fakenet\\/proc\\/net/g' > /etc/netdata/netdata.conf ; pkill -9 netdata ) &\n\t/usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT}\n\t# add some artificial sleep because netdata might think it can't bind to $NETDATA_PORT\n\t# and report things like \"netdata: FATAL: Cannot listen on any socket. Exiting...\"\n\tsleep 1\nfi\n\nfor f in /etc/netdata/override/*; do\n  cp -a $f /etc/netdata/\ndone\n\n# main entrypoint\ntouch /etc/netdata/python.d.conf\nexec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS} \"$@\"\n"
  },
  {
    "path": "releases/v1.10.0/Dockerfile",
    "content": "FROM debian:jessie\n\nADD git-tag /git-tag\n\nADD scripts/build.sh /build.sh\nADD scripts/run.sh /run.sh\n\nRUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh\n\nWORKDIR /\n\nENV NETDATA_PORT=19999 SSMTP_TLS=YES SSMTP_SERVER=smtp.gmail.com SSMTP_PORT=587 SSMTP_HOSTNAME=localhost\nEXPOSE $NETDATA_PORT\n\nVOLUME /etc/netdata/override\n\nENTRYPOINT [\"/run.sh\"]\n"
  },
  {
    "path": "releases/v1.10.0/README.md",
    "content": "# netdata\n\nDockerfile for building and running a netdata deamon for your host instance.\n\nNetdata monitors your server with thoughts of performance and memory usage, providing detailed insight into very recent server metrics. It's nice, and now it's also dockerized.\n\nMore info about project: https://github.com/firehol/netdata\n\n# More info about me\n\nI'm primarily a full-stack web developer with strong knowledge of Docker, APIs, AWS, PHP, Go, Nginx+LUA, SQL and NoSQL databases, Video Streaming (Wowza Media Server), and handle DevOps/automation for several large scale international clients (High traffic/HA deployments).\n\nIf you need someone with this skillset, please contact me at black@scene-si.org.\n\nI'm also the author of the following books:\n\n* [API Foundations in Go](https://leanpub.com/api-foundations)\n* [12 Factor Applications with Docker and Go](https://leanpub.com/12fa-docker-golang)\n\nFor more information, I also write a development-themed blog at [scene-si.org](https://scene-si.org/).\nI occasionally tweet my pursuits (sometimes in Slovenian) on [@TitPetric](https://twitter.com/TitPetric).\n\n# Using\n\n```\ndocker run -d --cap-add SYS_PTRACE \\\n           -v /proc:/host/proc:ro \\\n           -v /sys:/host/sys:ro \\\n           -p 19999:19999 titpetric/netdata\n```\n\nOpen a browser on http://server:19999/ and watch how your server is doing.\n\n# Supported tags and respective Dockerfile links\n\n* `titpetric/netdata:latest` [releases/latest/Dockerfile](https://github.com/titpetric/netdata/tree/master/releases/latest)\n* `titpetric/netdata:1.8` [releases/v1.8.0/Dockerfile](https://github.com/titpetric/netdata/tree/master/releases/v1.8.0)\n* `titpetric/netdata:1.7` [releases/v1.7.0/Dockerfile](https://github.com/titpetric/netdata/tree/master/releases/v1.7.0)\n* `titpetric/netdata:1.6` [releases/v1.6.0/Dockerfile](https://github.com/titpetric/netdata/tree/master/releases/v1.6.0)\n* `titpetric/netdata:1.5` [releases/v1.5.0/Dockerfile](https://github.com/titpetric/netdata/tree/master/releases/v1.5.0)\n* `titpetric/netdata:1.4` [releases/v1.4.0/Dockerfile](https://github.com/titpetric/netdata/tree/master/releases/v1.4.0)\n\nThe tags include builds of netdata, with the same tag in upstream. If there's some need to add older tags, you may\nuse the provided `/releases` folder as reference, and add new tags as a PR. The `latest` tag is in line with the\nupstream and is occasionally prone to failure. As far as older tags go - they will inevitably lack some new features\nbut should provide a more stable version to run.\n\n> Developers note: new tags are not added automatically which means there might be some delay between when a new\n> release of netdata is available and when a new tag is available on docker hub - to add a new release yourself, the procedure is as follows:\n>\n> 1. fork netdata repo,\n> 2. run /update-releases.sh,\n> 3. add, commit, push and submit a PR to `titpetric/netdata`\n>\n> When you will submit a PR, I will also add the new version to the docker hub and thank you profusely.\n\n# Limiting IP netdata listens to\n\nBy default netdata listens to 0.0.0.0 (any address). You might want to change this if you're running netdata in `--net=host` mode. You can pass the following environment variable:\n\n- NETDATA_IP - the IP that netdata should listen to, e.g. `127.0.0.1` for localhost only.\n\n# Passing custom netdata options\n\nIf you need to pass some custom options to netdata, you can pass the following environment variable:\n\n- NETDATA_ARGS - for example if you don't want to use NETDATA_IP above, you can pass `-e NETDATA_ARGS=\"-i 127.0.0.1\"` for same effect.\n\n# Getting emails on alarms\n\nNetdata supports forwarding alarms to an email address. You can set up sSMTP by setting the following ENV variables:\n\n- SSMTP_TO - This is the address alarms will be delivered to.\n- SSMTP_SERVER - This is your SMTP server. Defaults to smtp.gmail.com.\n- SSMTP_PORT - This is the SMTP server port. Defaults to 587.\n- SSMTP_USER - This is your username for the SMTP server.\n- SSMTP_PASS - This is your password for the SMTP server. Use an app password if using Gmail.\n- SSMTP_TLS - Use TLS for the connection. Defaults to YES.\n- SSMTP_HOSTNAME - The hostname mail will come from. Defaults to localhost.\n\nFor example, using gmail:\n\n```\n-e SSMTP_TO=user@gmail.com -e SSMTP_USER=user -e SSMTP_PASS=password\n```\n\nAlternatively, if you already have s sSMTP config, you can use that config with:\n\n~~~\n-v /path/to/config:/etc/ssmtp\n~~~\n\nSee the following link for details on setting up sSMTP: [SSMTP - ArchWiki](https://wiki.archlinux.org/index.php/SSMTP)\n\n# Adding custom alarms, charts and configuration overrides\n\nTo add custom alarms, charts or to override any default configuration file, mount a volume to the container to /etc/netdata/override, like `-v /opt/netdata/overrides:/etc/netdata/override`.  Then, place your config files in the directory as if it was /etc/netdata/.  \n\nFor example to create a custom alarm for system temperature, create a `health.d` folder in your local directory (`/opt/netdata/override` in the example above) and place a `sensors.conf` file with your alarm configuration inside the `health.d` directory.\n\n# Getting alarms in Slack\n\nNetdata supports sending alerts to slack via webhooks. You can set that up by setting the following ENV variables:\n\n- SLACK_WEBHOOK_URL - This is your incoming slack webhook\n- SLACK_CHANNEL - This is the default channel that alerts will get sent to\n\nFor example:\n\n```\n-e SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXXX -e SLACK_CHANNEL=alerts\n```\n\n# Getting alarms in Discord\n\nNetdata supports sending alerts to Discord via webhooks. You can set that up by setting the following ENV variables:\n\n- DISCORD_WEBHOOK_URL - This is your incoming Discord webhook\n- DISCORD_RECIPIENT - This is the default channel that alerts will get sent to\n\nFor example:\n\n```\n-e DISCORD_WEBHOOK_URL=https://discordapp.com/api/webhooks/XXXX -e DISCORD_RECIPIENT=alerts\n```\n\n# Getting alarms in Telegram\n\nNetdata supports sending alerts to Telegram via token and chat ID. You can set that up by setting the following ENV variables:\n\n- TELEGRAM_BOT_TOKEN - This is your bot token\n- TELEGRAM_CHAT_ID - This is the chat ID\n\nFor example:\n\n```\n-e TELEGRAM_BOT_TOKEN=22624413:AAGy12TkSMBYVBTe4lQt3BfUYvUs5h7I1jn -e TELEGRAM_CHAT_ID=137165138\n```\n\nFor more details about Telegram alerts, see [this page - GitHub](https://github.com/firehol/netdata/wiki/health-monitoring#telegramorg-messages)\n\n# Getting alarms in Pushbullet\n\nNetdata supports sending alerts to Pushbullet via API token. You can set that up by setting the following ENV variables:\n\n- PUSHBULLET_ACCESS_TOKEN - This is your API token\n- PUSHBULLET_DEFAULT_EMAIL - This is the default email that alerts will get sent to if there is not a Pushbullet account attached to it\n\nFor example:\n\n```\n-e PUSHBULLET_ACCESS_TOKEN=o.l8VuizWhXgbERf2Q78ghtzb1LDCYvbSD -e PUSHBULLET_DEFAULT_EMAIL=your.email@gmail.com\n```\n\nMore details about Pushbullet alerts are provided [here - GitHub](https://github.com/firehol/netdata/wiki/health-monitoring#pushbulletcom-push-notifications)\n\n# Setting up streaming\n\nOn a client netdata set this destination to be the HOST[:PORT] of the\ncentral netdata, and give an `API_KEY` that is secret and only known internally\nto the netdata clients, and netdata central. See [this page - GitHub](https://github.com/firehol/netdata/wiki/Replication-Overview#options-for-the-sending-node)\n\n- NETDATA_STREAM_DESTINATION - `HOST[:PORT]` to stream to\n- NETDATA_STREAM_API_KEY - `API_KEY` to send to central net data\n\n```\n-e NETDATA_STREAM_DESTINATION=netdata.service:19999 -e NETDATA_STREAM_API_KEY=1h213ch12h3rc1289e\n```\n\nOn the central netdata set 1 or more `NETADATA_API_KEY_ENABLE` env variables that matches the `API_KEY`\nthat you used on the client above, this will enable the netdata client node to communicate with the netdata central\n\n- NETADATA_API_KEY_ENABLE_{API_KEY}=1\n\n```\n-e NETDATA_API_KEY_ENABLE_1h213ch12h3rc1289e=1\n```\n\n# Monitoring docker container metrics\n\nNetdata supports fetching container data from `docker.sock`. You can forward it to the netdata container with:\n\n~~~\n-v /var/run/docker.sock:/var/run/docker.sock\n~~~\n\nThis will allow netdata to resolve container names.\n\n> Note: forwarding docker.sock exposes the administrative docker API. If due to some security issue access has been obtained to the container, it will expose full docker API, allowing to stop, create or delete containers, as well as download new images in the host.\n>\n> TL;DR If you care about security, consider forwarding a secure docker socket with [docker-proxy-acl](https://github.com/titpetric/docker-proxy-acl)\n\n# Monitoring docker notes on some systems (Debian jessie)\n\nOn debian jessie only 'cpu' and 'disk' metrics show up under individual docker containers. To get the memory metric, you will have to add `cgroup_enable=memory swapaccount=1` to `/etc/default/grub`, appending the `GRUB_CMDLINE_LINUX_DEFAULT` variable:\n\n~~~\n$ cat /etc/default/grub  | grep GRUB_CMDLINE_LINUX_DEFAULT\nGRUB_CMDLINE_LINUX_DEFAULT=\"quiet cgroup_enable=memory swapaccount=1\"\n~~~\n\nAfter rebooting your linux instance, the memory accounting subsystem of the kernel will be enabled. Netdata will pick up additional metrics for the containers when it starts.\n\n# Environment variables\n\nIt's possible to pass a NETDATA_PORT environment variable with -e, to start up netdata on a different port.\n\n```\ndocker run -e NETDATA_PORT=80 [...]\n```\n\n# Some explanation is in order\n\nDocker needs to run with the SYS_PTRACE capability. Without it, the mapped host/proc filesystem is not fully readable to the netdata deamon, more specifically the \"apps\" plugin:\n\n```\n16-01-12 07:58:16: ERROR: apps.plugin: Cannot process /host/proc/1/io (errno 13, Permission denied)\n```\n\nSee the following link for more details: [/proc/1/environ is unavailable in a container that is not priviledged](https://github.com/docker/docker/issues/6607)\n\n# Limitations\n\nIn addition to the above requirements and limitations, monitoring the complete network interface list of the host is not possible from within the Docker container. If you're running netdata and want to graph all the interfaces available on the host, you will have to use `--net=host` mode.\n\nSee the following link for more details: [network interfaces missing when mounting proc inside a container](https://github.com/docker/docker/issues/13398)\n\n## Work-around\n\nI provided a script called `fakenet.sh` which provides a copy of the `/proc/net` filesystem. You should start this script before you start the netdata container. You can do it like this:\n\n~~~\nwget https://raw.githubusercontent.com/titpetric/netdata/master/fakenet.sh\nchmod a+x fakenet.sh\nnohup ./fakenet.sh >/dev/null 2>&1 &\n~~~\n\nUsing the above command, the fakenet script will start in the background and will keep running there. You can use other tools like `screen` or `tmux` to provide similar capability.\n\nThe script fills out the `/dev/shm/fakenet` location, which you must mount into the container. You *must* mount it into `/fakenet/proc/net` exactly with the option like this:\n\n~~~\n-v /dev/shm/fakenet:/fakenet/proc/net\n~~~\n\nThe script refreshes network information about every 250ms (four times per second). The interval may be increased to give better accuracy of netdata, but CPU usage will also increase. Because of this, the data is not very accurate and some spikes and valleys will occur because of a shifting window between when the reading was taken (fakeproc) and between when the reading was read by netdata. This means the margin for error is whatever data can be collected in ~250ms.\n\nWhile the solution might not fit everybody, it's security-positive because the netdata container can only inspect the fake proc/net location, and can't actually access any of the networks because it runs on a private LAN / custom network which is managed and firewalled by docker. You may even open access via application, like a nginx reverse proxy where you can add authentication etc.\n\nPro/con list:\n\n* + network isolation stays in tact\n* + all network device metrics are available\n* - one more service to provide fakenet\n* - accuracy vs. cpu use is a trade-off\n\n# Additional notes\n\nNetdata provides monitoring via a plugin architecture. This plugin supports many projects that don't provide data over the `/proc` filesystem. When you're running netdata in the container, you will have difficulty providing many of these paths to the netdata container.\n\nWhat you do get (even with the docker version) is:\n\n* Host CPU statististics\n* Host Network I/O, QoS\n* Host Disk I/O\n* Applications monitoring\n* Container surface metrics (cpu/disk per name)\n\nYou will not get detailed application metrics (mysql, ups, etc.) from other containers or from the host if running netdata in a container. It may be possible to get *some* of those metrics, but it might not be easy, and most likely not worth it. For most detailed metrics, netdata needs to share the same environment as the application server it monitors. This means it would need to run either in the same container (not even remotely practical), or in the same virtual machine (no containers).\n\n> Note: if you have some custom hardware like a UPS which is monitored via USB and netdata supports it, you will most likely need to add new software to the netdata docker image to support it. The correct way to do it is to create your own Dockerfile, start with \"FROM titpetric/netdata\" and then add all your installation commands to build your own image which will support your hardware setup. Most likely if it's not a very common setup (i.e. available on most machines), the software will not be added to `titpetric/netdata` - that being said, your use case might be useful for others so feel free to submit issues with your extensions or feature requests in terms of new software. I'll gladly add your project/extension to the README here.\n"
  },
  {
    "path": "releases/v1.10.0/git-tag",
    "content": "v1.10.0\n"
  },
  {
    "path": "releases/v1.10.0/scripts/build.sh",
    "content": "#!/bin/bash\nset -e\nDEBIAN_FRONTEND=noninteractive\n\n# some mirrors have issues, i skipped httpredir in favor of an eu mirror\n\necho \"deb http://ftp.nl.debian.org/debian/ jessie main\" > /etc/apt/sources.list\necho \"deb http://security.debian.org/debian-security jessie/updates main\" >> /etc/apt/sources.list\n\n# install dependencies for build\n\napt-get -qq update\napt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq\napt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml\napt-get -y install ssmtp mailutils apcupsd fping\n\n# fetch netdata\n\ngit clone https://github.com/firehol/netdata.git /netdata.git\ncd /netdata.git\nTAG=$(</git-tag)\nif [ ! -z \"$TAG\" ]; then\n\techo \"Checking out tag: $TAG\"\n\tgit checkout tags/$TAG\nelse\n\techo \"No tag, using master\"\nfi\n\n# use the provided installer\n\n./netdata-installer.sh --dont-wait --dont-start-it\n\n# removed hack on 2017/1/3\n#chown root:root /usr/libexec/netdata/plugins.d/apps.plugin\n#chmod 4755 /usr/libexec/netdata/plugins.d/apps.plugin\n\n# remove build dependencies\n\ncd /\nrm -rf /netdata.git\n\ndpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config\napt-get -y autoremove\napt-get clean\nrm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n\n\n# symlink access log and error log to stdout/stderr\n\nln -sf /dev/stdout /var/log/netdata/access.log\nln -sf /dev/stdout /var/log/netdata/debug.log\nln -sf /dev/stderr /var/log/netdata/error.log\n"
  },
  {
    "path": "releases/v1.10.0/scripts/run.sh",
    "content": "#!/bin/bash\n\n# fix permissions due to netdata running as root\nchown root:root /usr/share/netdata/web/ -R\necho -n \"\" > /usr/share/netdata/web/version.txt\n\n# set up ssmtp\nif [[ $SSMTP_TO ]]; then\ncat << EOF > /etc/ssmtp/ssmtp.conf\nroot=$SSMTP_TO\nmailhub=$SSMTP_SERVER:$SSMTP_PORT\nUseSTARTTLS=$SSMTP_TLS\nhostname=$SSMTP_HOSTNAME\nFromLineOverride=NO\nEOF\n\ncat << EOF > /etc/ssmtp/revaliases\nnetdata:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nroot:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nEOF\nfi\n\nif [[ $SSMTP_USER ]]; then\ncat << EOF >> /etc/ssmtp/ssmtp.conf\nAuthUser=$SSMTP_USER\nEOF\nfi\n\nif [[ $SSMTP_PASS ]]; then\ncat << EOF >> /etc/ssmtp/ssmtp.conf\nAuthPass=$SSMTP_PASS\nEOF\nfi\n\nif [[ $SLACK_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@SLACK_WEBHOOK_URL=\\\"\\\"@SLACK_WEBHOOK_URL=\\\"${SLACK_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $SLACK_CHANNEL ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_SLACK=\\\"\\\"@DEFAULT_RECIPIENT_SLACK=\\\"${SLACK_CHANNEL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $DISCORD_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@DISCORD_WEBHOOK_URL=\\\"\\\"@DISCORD_WEBHOOK_URL=\\\"${DISCORD_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $DISCORD_RECIPIENT ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_DISCORD=\\\"\\\"@DEFAULT_RECIPIENT_DISCORD=\\\"${DISCORD_RECIPIENT}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_BOT_TOKEN ]]; then\n\tsed -i -e \"s@TELEGRAM_BOT_TOKEN=\\\"\\\"@TELEGRAM_BOT_TOKEN=\\\"${TELEGRAM_BOT_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_CHAT_ID ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_TELEGRAM=\\\"\\\"@DEFAULT_RECIPIENT_TELEGRAM=\\\"${TELEGRAM_CHAT_ID}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_ACCESS_TOKEN ]]; then\n\tsed -i -e \"s@PUSHBULLET_ACCESS_TOKEN=\\\"\\\"@PUSHBULLET_ACCESS_TOKEN=\\\"${PUSHBULLET_ACCESS_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_DEFAULT_EMAIL ]]; then\n\tsed -i -e \"s#DEFAULT_RECIPIENT_PUSHBULLET=\\\"\\\"#DEFAULT_RECIPIENT_PUSHBULLET=\\\"${PUSHBULLET_DEFAULT_EMAIL}\\\"#\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $NETDATA_IP ]]; then\n\tNETDATA_ARGS=\"${NETDATA_ARGS} -i ${NETDATA_IP}\"\nfi\n\n# on a client netdata set this destination to be the [PROTOCOL:]HOST[:PORT] of the\n# central netdata, and give an API_KEY that is secret and only known internally\n# to the netdata clients, and netdata central\nif [[ $NETDATA_STREAM_DESTINATION ]] && [[ $NETDATA_STREAM_API_KEY ]]; then\n\tcat << EOF > /etc/netdata/stream.conf\n[stream]\n\tenabled = yes\n\tdestination = $NETDATA_STREAM_DESTINATION\n\tapi key = $NETDATA_STREAM_API_KEY\nEOF\nfi\n\n# set 1 or more NETADATA_API_KEY_ENABLE env variables, such as NETDATA_API_KEY_ENABLE_1h213ch12h3rc1289e=1\n# that matches the API_KEY that you used on the client above, this will enable the netdata client\n# node to communicate with the netdata central\nif printenv | grep -q 'NETDATA_API_KEY_ENABLE_'; then\n\tprintenv | grep -oe 'NETDATA_API_KEY_ENABLE_[^=]\\+' | sed 's/NETDATA_API_KEY_ENABLE_//' | xargs -n1 -I{} echo '['{}$']\\n\\tenabled = yes' >> /etc/netdata/stream.conf\nfi\n\n# exec custom command\nif [[ $# -gt 0 ]] ; then\n        exec \"$@\"\n        exit\nfi\n\nif [[ -d \"/fakenet/\" ]]; then\n\techo \"Running fakenet config reload in background\"\n\t( sleep 10 ; curl -s http://localhost:${NETDATA_PORT}/netdata.conf | sed -e 's/# filename/filename/g' | sed -e 's/\\/host\\/proc\\/net/\\/fakenet\\/proc\\/net/g' > /etc/netdata/netdata.conf ; pkill -9 netdata ) &\n\t/usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT}\n\t# add some artificial sleep because netdata might think it can't bind to $NETDATA_PORT\n\t# and report things like \"netdata: FATAL: Cannot listen on any socket. Exiting...\"\n\tsleep 1\nfi\n\nfor f in /etc/netdata/override/*; do\n  cp -a $f /etc/netdata/\ndone\n\n# main entrypoint\ntouch /etc/netdata/python.d.conf\nexec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS} \"$@\"\n"
  },
  {
    "path": "releases/v1.4.0/Dockerfile",
    "content": "FROM debian:jessie\n\nADD git-tag /git-tag\n\nADD scripts/build.sh /build.sh\nADD scripts/run.sh /run.sh\n\nRUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh\n\nWORKDIR /\n\nENV NETDATA_PORT=19999 SSMTP_TLS=YES SSMTP_SERVER=smtp.gmail.com SSMTP_PORT=587 SSMTP_HOSTNAME=localhost\nEXPOSE $NETDATA_PORT\n\nENTRYPOINT [\"/run.sh\"]\n"
  },
  {
    "path": "releases/v1.4.0/git-tag",
    "content": "v1.4.0\n"
  },
  {
    "path": "releases/v1.4.0/scripts/build.sh",
    "content": "#!/bin/bash\nset -e\nDEBIAN_FRONTEND=noninteractive\n\n# some mirrors have issues, i skipped httpredir in favor of an eu mirror\n\necho \"deb http://ftp.nl.debian.org/debian/ jessie main\" > /etc/apt/sources.list\necho \"deb http://security.debian.org/debian-security jessie/updates main\" >> /etc/apt/sources.list\n\n# install dependencies for build\n\napt-get -qq update\napt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq\napt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml\napt-get -y install ssmtp mailutils apcupsd\n\n# fetch netdata\n\ngit clone https://github.com/firehol/netdata.git /netdata.git\ncd /netdata.git\nTAG=$(</git-tag)\nif [ ! -z \"$TAG\" ]; then\n\techo \"Checking out tag: $TAG\"\n\tgit checkout tags/$TAG\nelse\n\techo \"No tag, using master\"\nfi\n\n# use the provided installer\n\n./netdata-installer.sh --dont-wait --dont-start-it\n\n# removed hack on 2017/1/3\n#chown root:root /usr/libexec/netdata/plugins.d/apps.plugin\n#chmod 4755 /usr/libexec/netdata/plugins.d/apps.plugin\n\n# remove build dependencies\n\ncd /\nrm -rf /netdata.git\n\ndpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config\napt-get -y autoremove\napt-get clean\nrm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n\n\n# symlink access log and error log to stdout/stderr\n\nln -sf /dev/stdout /var/log/netdata/access.log\nln -sf /dev/stdout /var/log/netdata/debug.log\nln -sf /dev/stderr /var/log/netdata/error.log\n"
  },
  {
    "path": "releases/v1.4.0/scripts/run.sh",
    "content": "#!/bin/bash\n\n# fix permissions due to netdata running as root\nchown root:root /usr/share/netdata/web/ -R\necho -n \"\" > /usr/share/netdata/web/version.txt\n\n# set up ssmtp\nif [[ $SSMTP_TO ]] && [[ $SSMTP_USER ]] && [[ $SSMTP_PASS ]]; then\ncat << EOF > /etc/ssmtp/ssmtp.conf\nroot=$SSMTP_TO\nmailhub=$SSMTP_SERVER:$SSMTP_PORT\nAuthUser=$SSMTP_USER\nAuthPass=$SSMTP_PASS\nUseSTARTTLS=$SSMTP_TLS\nhostname=$SSMTP_HOSTNAME\nFromLineOverride=NO\nEOF\n\ncat << EOF > /etc/ssmtp/revaliases\nnetdata:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nroot:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nEOF\nfi\n\nif [[ $SLACK_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@SLACK_WEBHOOK_URL=\\\"\\\"@SLACK_WEBHOOK_URL=\\\"${SLACK_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $SLACK_CHANNEL ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_SLACK=\\\"\\\"@DEFAULT_RECIPIENT_SLACK=\\\"${SLACK_CHANNEL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_BOT_TOKEN ]]; then\n\tsed -i -e \"s@TELEGRAM_BOT_TOKEN=\\\"\\\"@TELEGRAM_BOT_TOKEN=\\\"${TELEGRAM_BOT_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_CHAT_ID ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_TELEGRAM=\\\"\\\"@DEFAULT_RECIPIENT_TELEGRAM=\\\"${TELEGRAM_CHAT_ID}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_ACCESS_TOKEN ]]; then\n\tsed -i -e \"s@PUSHBULLET_ACCESS_TOKEN=\\\"\\\"@PUSHBULLET_ACCESS_TOKEN=\\\"${PUSHBULLET_ACCESS_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_DEFAULT_EMAIL ]]; then\n\tsed -i -e \"s#DEFAULT_RECIPIENT_PUSHBULLET=\\\"\\\"#DEFAULT_RECIPIENT_PUSHBULLET=\\\"${PUSHBULLET_DEFAULT_EMAIL}\\\"#\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $NETDATA_IP ]]; then\n\tNETDATA_ARGS=\"${NETDATA_ARGS} -i ${NETDATA_IP}\"\nfi\n\n# exec custom command\nif [[ $# -gt 0 ]] ; then\n        exec \"$@\"\n        exit\nfi\n\nif [[ -d \"/fakenet/\" ]]; then\n\techo \"Running fakenet config reload in background\"\n\t( sleep 10 ; curl -s http://localhost:${NETDATA_PORT}/netdata.conf | sed -e 's/# filename/filename/g' | sed -e 's/\\/host\\/proc\\/net/\\/fakenet\\/proc\\/net/g' > /etc/netdata/netdata.conf ; pkill -9 netdata ) &\n\t/usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT}\n\t# add some artificial sleep because netdata might think it can't bind to $NETDATA_PORT\n\t# and report things like \"netdata: FATAL: Cannot listen on any socket. Exiting...\"\n\tsleep 1\nfi\n\n# main entrypoint\nexec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS}\n"
  },
  {
    "path": "releases/v1.5.0/Dockerfile",
    "content": "FROM debian:jessie\n\nADD git-tag /git-tag\n\nADD scripts/build.sh /build.sh\nADD scripts/run.sh /run.sh\n\nRUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh\n\nWORKDIR /\n\nENV NETDATA_PORT=19999 SSMTP_TLS=YES SSMTP_SERVER=smtp.gmail.com SSMTP_PORT=587 SSMTP_HOSTNAME=localhost\nEXPOSE $NETDATA_PORT\n\nENTRYPOINT [\"/run.sh\"]\n"
  },
  {
    "path": "releases/v1.5.0/git-tag",
    "content": "v1.5.0\n"
  },
  {
    "path": "releases/v1.5.0/scripts/build.sh",
    "content": "#!/bin/bash\nset -e\nDEBIAN_FRONTEND=noninteractive\n\n# some mirrors have issues, i skipped httpredir in favor of an eu mirror\n\necho \"deb http://ftp.nl.debian.org/debian/ jessie main\" > /etc/apt/sources.list\necho \"deb http://security.debian.org/debian-security jessie/updates main\" >> /etc/apt/sources.list\n\n# install dependencies for build\n\napt-get -qq update\napt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq\napt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml\napt-get -y install ssmtp mailutils apcupsd\n\n# fetch netdata\n\ngit clone https://github.com/firehol/netdata.git /netdata.git\ncd /netdata.git\nTAG=$(</git-tag)\nif [ ! -z \"$TAG\" ]; then\n\techo \"Checking out tag: $TAG\"\n\tgit checkout tags/$TAG\nelse\n\techo \"No tag, using master\"\nfi\n\n# use the provided installer\n\n./netdata-installer.sh --dont-wait --dont-start-it\n\n# removed hack on 2017/1/3\n#chown root:root /usr/libexec/netdata/plugins.d/apps.plugin\n#chmod 4755 /usr/libexec/netdata/plugins.d/apps.plugin\n\n# remove build dependencies\n\ncd /\nrm -rf /netdata.git\n\ndpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config\napt-get -y autoremove\napt-get clean\nrm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n\n\n# symlink access log and error log to stdout/stderr\n\nln -sf /dev/stdout /var/log/netdata/access.log\nln -sf /dev/stdout /var/log/netdata/debug.log\nln -sf /dev/stderr /var/log/netdata/error.log\n"
  },
  {
    "path": "releases/v1.5.0/scripts/run.sh",
    "content": "#!/bin/bash\n\n# fix permissions due to netdata running as root\nchown root:root /usr/share/netdata/web/ -R\necho -n \"\" > /usr/share/netdata/web/version.txt\n\n# set up ssmtp\nif [[ $SSMTP_TO ]] && [[ $SSMTP_USER ]] && [[ $SSMTP_PASS ]]; then\ncat << EOF > /etc/ssmtp/ssmtp.conf\nroot=$SSMTP_TO\nmailhub=$SSMTP_SERVER:$SSMTP_PORT\nAuthUser=$SSMTP_USER\nAuthPass=$SSMTP_PASS\nUseSTARTTLS=$SSMTP_TLS\nhostname=$SSMTP_HOSTNAME\nFromLineOverride=NO\nEOF\n\ncat << EOF > /etc/ssmtp/revaliases\nnetdata:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nroot:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nEOF\nfi\n\nif [[ $SLACK_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@SLACK_WEBHOOK_URL=\\\"\\\"@SLACK_WEBHOOK_URL=\\\"${SLACK_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $SLACK_CHANNEL ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_SLACK=\\\"\\\"@DEFAULT_RECIPIENT_SLACK=\\\"${SLACK_CHANNEL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_BOT_TOKEN ]]; then\n\tsed -i -e \"s@TELEGRAM_BOT_TOKEN=\\\"\\\"@TELEGRAM_BOT_TOKEN=\\\"${TELEGRAM_BOT_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_CHAT_ID ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_TELEGRAM=\\\"\\\"@DEFAULT_RECIPIENT_TELEGRAM=\\\"${TELEGRAM_CHAT_ID}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_ACCESS_TOKEN ]]; then\n\tsed -i -e \"s@PUSHBULLET_ACCESS_TOKEN=\\\"\\\"@PUSHBULLET_ACCESS_TOKEN=\\\"${PUSHBULLET_ACCESS_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_DEFAULT_EMAIL ]]; then\n\tsed -i -e \"s#DEFAULT_RECIPIENT_PUSHBULLET=\\\"\\\"#DEFAULT_RECIPIENT_PUSHBULLET=\\\"${PUSHBULLET_DEFAULT_EMAIL}\\\"#\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $NETDATA_IP ]]; then\n\tNETDATA_ARGS=\"${NETDATA_ARGS} -i ${NETDATA_IP}\"\nfi\n\n# exec custom command\nif [[ $# -gt 0 ]] ; then\n        exec \"$@\"\n        exit\nfi\n\nif [[ -d \"/fakenet/\" ]]; then\n\techo \"Running fakenet config reload in background\"\n\t( sleep 10 ; curl -s http://localhost:${NETDATA_PORT}/netdata.conf | sed -e 's/# filename/filename/g' | sed -e 's/\\/host\\/proc\\/net/\\/fakenet\\/proc\\/net/g' > /etc/netdata/netdata.conf ; pkill -9 netdata ) &\n\t/usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT}\n\t# add some artificial sleep because netdata might think it can't bind to $NETDATA_PORT\n\t# and report things like \"netdata: FATAL: Cannot listen on any socket. Exiting...\"\n\tsleep 1\nfi\n\n# main entrypoint\nexec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS}\n"
  },
  {
    "path": "releases/v1.6.0/Dockerfile",
    "content": "FROM debian:jessie\n\nADD git-tag /git-tag\n\nADD scripts/build.sh /build.sh\nADD scripts/run.sh /run.sh\n\nRUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh\n\nWORKDIR /\n\nENV NETDATA_PORT=19999 SSMTP_TLS=YES SSMTP_SERVER=smtp.gmail.com SSMTP_PORT=587 SSMTP_HOSTNAME=localhost\nEXPOSE $NETDATA_PORT\n\nENTRYPOINT [\"/run.sh\"]\n"
  },
  {
    "path": "releases/v1.6.0/git-tag",
    "content": "v1.6.0\n"
  },
  {
    "path": "releases/v1.6.0/scripts/build.sh",
    "content": "#!/bin/bash\nset -e\nDEBIAN_FRONTEND=noninteractive\n\n# some mirrors have issues, i skipped httpredir in favor of an eu mirror\n\necho \"deb http://ftp.nl.debian.org/debian/ jessie main\" > /etc/apt/sources.list\necho \"deb http://security.debian.org/debian-security jessie/updates main\" >> /etc/apt/sources.list\n\n# install dependencies for build\n\napt-get -qq update\napt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq\napt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml\napt-get -y install ssmtp mailutils apcupsd\n\n# fetch netdata\n\ngit clone https://github.com/firehol/netdata.git /netdata.git\ncd /netdata.git\nTAG=$(</git-tag)\nif [ ! -z \"$TAG\" ]; then\n\techo \"Checking out tag: $TAG\"\n\tgit checkout tags/$TAG\nelse\n\techo \"No tag, using master\"\nfi\n\n# use the provided installer\n\n./netdata-installer.sh --dont-wait --dont-start-it\n\n# removed hack on 2017/1/3\n#chown root:root /usr/libexec/netdata/plugins.d/apps.plugin\n#chmod 4755 /usr/libexec/netdata/plugins.d/apps.plugin\n\n# remove build dependencies\n\ncd /\nrm -rf /netdata.git\n\ndpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config\napt-get -y autoremove\napt-get clean\nrm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n\n\n# symlink access log and error log to stdout/stderr\n\nln -sf /dev/stdout /var/log/netdata/access.log\nln -sf /dev/stdout /var/log/netdata/debug.log\nln -sf /dev/stderr /var/log/netdata/error.log\n"
  },
  {
    "path": "releases/v1.6.0/scripts/run.sh",
    "content": "#!/bin/bash\n\n# fix permissions due to netdata running as root\nchown root:root /usr/share/netdata/web/ -R\necho -n \"\" > /usr/share/netdata/web/version.txt\n\n# set up ssmtp\nif [[ $SSMTP_TO ]] && [[ $SSMTP_USER ]] && [[ $SSMTP_PASS ]]; then\ncat << EOF > /etc/ssmtp/ssmtp.conf\nroot=$SSMTP_TO\nmailhub=$SSMTP_SERVER:$SSMTP_PORT\nAuthUser=$SSMTP_USER\nAuthPass=$SSMTP_PASS\nUseSTARTTLS=$SSMTP_TLS\nhostname=$SSMTP_HOSTNAME\nFromLineOverride=NO\nEOF\n\ncat << EOF > /etc/ssmtp/revaliases\nnetdata:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nroot:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nEOF\nfi\n\nif [[ $SLACK_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@SLACK_WEBHOOK_URL=\\\"\\\"@SLACK_WEBHOOK_URL=\\\"${SLACK_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $SLACK_CHANNEL ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_SLACK=\\\"\\\"@DEFAULT_RECIPIENT_SLACK=\\\"${SLACK_CHANNEL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_BOT_TOKEN ]]; then\n\tsed -i -e \"s@TELEGRAM_BOT_TOKEN=\\\"\\\"@TELEGRAM_BOT_TOKEN=\\\"${TELEGRAM_BOT_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_CHAT_ID ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_TELEGRAM=\\\"\\\"@DEFAULT_RECIPIENT_TELEGRAM=\\\"${TELEGRAM_CHAT_ID}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_ACCESS_TOKEN ]]; then\n\tsed -i -e \"s@PUSHBULLET_ACCESS_TOKEN=\\\"\\\"@PUSHBULLET_ACCESS_TOKEN=\\\"${PUSHBULLET_ACCESS_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_DEFAULT_EMAIL ]]; then\n\tsed -i -e \"s#DEFAULT_RECIPIENT_PUSHBULLET=\\\"\\\"#DEFAULT_RECIPIENT_PUSHBULLET=\\\"${PUSHBULLET_DEFAULT_EMAIL}\\\"#\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $NETDATA_IP ]]; then\n\tNETDATA_ARGS=\"${NETDATA_ARGS} -i ${NETDATA_IP}\"\nfi\n\n# exec custom command\nif [[ $# -gt 0 ]] ; then\n        exec \"$@\"\n        exit\nfi\n\nif [[ -d \"/fakenet/\" ]]; then\n\techo \"Running fakenet config reload in background\"\n\t( sleep 10 ; curl -s http://localhost:${NETDATA_PORT}/netdata.conf | sed -e 's/# filename/filename/g' | sed -e 's/\\/host\\/proc\\/net/\\/fakenet\\/proc\\/net/g' > /etc/netdata/netdata.conf ; pkill -9 netdata ) &\n\t/usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT}\n\t# add some artificial sleep because netdata might think it can't bind to $NETDATA_PORT\n\t# and report things like \"netdata: FATAL: Cannot listen on any socket. Exiting...\"\n\tsleep 1\nfi\n\n# main entrypoint\nexec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS}\n"
  },
  {
    "path": "releases/v1.7.0/Dockerfile",
    "content": "FROM debian:jessie\n\nADD git-tag /git-tag\n\nADD scripts/build.sh /build.sh\nADD scripts/run.sh /run.sh\n\nRUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh\n\nWORKDIR /\n\nENV NETDATA_PORT=19999 SSMTP_TLS=YES SSMTP_SERVER=smtp.gmail.com SSMTP_PORT=587 SSMTP_HOSTNAME=localhost\nEXPOSE $NETDATA_PORT\n\nENTRYPOINT [\"/run.sh\"]\n"
  },
  {
    "path": "releases/v1.7.0/git-tag",
    "content": "v1.7.0\n"
  },
  {
    "path": "releases/v1.7.0/scripts/build.sh",
    "content": "#!/bin/bash\nset -e\nDEBIAN_FRONTEND=noninteractive\n\n# some mirrors have issues, i skipped httpredir in favor of an eu mirror\n\necho \"deb http://ftp.nl.debian.org/debian/ jessie main\" > /etc/apt/sources.list\necho \"deb http://security.debian.org/debian-security jessie/updates main\" >> /etc/apt/sources.list\n\n# install dependencies for build\n\napt-get -qq update\napt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq\napt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml\napt-get -y install ssmtp mailutils apcupsd\n\n# fetch netdata\n\ngit clone https://github.com/firehol/netdata.git /netdata.git\ncd /netdata.git\nTAG=$(</git-tag)\nif [ ! -z \"$TAG\" ]; then\n\techo \"Checking out tag: $TAG\"\n\tgit checkout tags/$TAG\nelse\n\techo \"No tag, using master\"\nfi\n\n# use the provided installer\n\n./netdata-installer.sh --dont-wait --dont-start-it\n\n# removed hack on 2017/1/3\n#chown root:root /usr/libexec/netdata/plugins.d/apps.plugin\n#chmod 4755 /usr/libexec/netdata/plugins.d/apps.plugin\n\n# remove build dependencies\n\ncd /\nrm -rf /netdata.git\n\ndpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config\napt-get -y autoremove\napt-get clean\nrm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n\n\n# symlink access log and error log to stdout/stderr\n\nln -sf /dev/stdout /var/log/netdata/access.log\nln -sf /dev/stdout /var/log/netdata/debug.log\nln -sf /dev/stderr /var/log/netdata/error.log\n"
  },
  {
    "path": "releases/v1.7.0/scripts/run.sh",
    "content": "#!/bin/bash\n\n# fix permissions due to netdata running as root\nchown root:root /usr/share/netdata/web/ -R\necho -n \"\" > /usr/share/netdata/web/version.txt\n\n# set up ssmtp\nif [[ $SSMTP_TO ]]; then\ncat << EOF > /etc/ssmtp/ssmtp.conf\nroot=$SSMTP_TO\nmailhub=$SSMTP_SERVER:$SSMTP_PORT\nUseSTARTTLS=$SSMTP_TLS\nhostname=$SSMTP_HOSTNAME\nFromLineOverride=NO\nEOF\n\ncat << EOF > /etc/ssmtp/revaliases\nnetdata:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nroot:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nEOF\nfi\n\nif [[ $SSMTP_USER ]]; then\ncat << EOF >> /etc/ssmtp/ssmtp.conf\nAuthUser=$SSMTP_USER\nEOF\nfi\n\nif [[ $SSMTP_PASS ]]; then\ncat << EOF >> /etc/ssmtp/ssmtp.conf\nAuthPass=$SSMTP_PASS\nEOF\nfi\n\nif [[ $SLACK_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@SLACK_WEBHOOK_URL=\\\"\\\"@SLACK_WEBHOOK_URL=\\\"${SLACK_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $SLACK_CHANNEL ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_SLACK=\\\"\\\"@DEFAULT_RECIPIENT_SLACK=\\\"${SLACK_CHANNEL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $DISCORD_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@DISCORD_WEBHOOK_URL=\\\"\\\"@DISCORD_WEBHOOK_URL=\\\"${DISCORD_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $DISCORD_RECIPIENT ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_DISCORD=\\\"\\\"@DEFAULT_RECIPIENT_DISCORD=\\\"${DISCORD_RECIPIENT}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_BOT_TOKEN ]]; then\n\tsed -i -e \"s@TELEGRAM_BOT_TOKEN=\\\"\\\"@TELEGRAM_BOT_TOKEN=\\\"${TELEGRAM_BOT_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_CHAT_ID ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_TELEGRAM=\\\"\\\"@DEFAULT_RECIPIENT_TELEGRAM=\\\"${TELEGRAM_CHAT_ID}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_ACCESS_TOKEN ]]; then\n\tsed -i -e \"s@PUSHBULLET_ACCESS_TOKEN=\\\"\\\"@PUSHBULLET_ACCESS_TOKEN=\\\"${PUSHBULLET_ACCESS_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_DEFAULT_EMAIL ]]; then\n\tsed -i -e \"s#DEFAULT_RECIPIENT_PUSHBULLET=\\\"\\\"#DEFAULT_RECIPIENT_PUSHBULLET=\\\"${PUSHBULLET_DEFAULT_EMAIL}\\\"#\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $NETDATA_IP ]]; then\n\tNETDATA_ARGS=\"${NETDATA_ARGS} -i ${NETDATA_IP}\"\nfi\n\n# on a client netdata set this destination to be the [PROTOCOL:]HOST[:PORT] of the\n# central netdata, and give an API_KEY that is secret and only known internally\n# to the netdata clients, and netdata central\nif [[ $NETDATA_STREAM_DESTINATION ]] && [[ $NETDATA_STREAM_API_KEY ]]; then\n\tcat << EOF > /etc/netdata/stream.conf\n[stream]\n\tenabled = yes\n\tdestination = $NETDATA_STREAM_DESTINATION\n\tapi key = $NETDATA_STREAM_API_KEY\nEOF\nfi\n\n# set 1 or more NETADATA_API_KEY_ENABLE env variables, such as NETDATA_API_KEY_ENABLE_1h213ch12h3rc1289e=1\n# that matches the API_KEY that you used on the client above, this will enable the netdata client\n# node to communicate with the netdata central\nif printenv | grep -q 'NETDATA_API_KEY_ENABLE_'; then\n\tprintenv | grep -oe 'NETDATA_API_KEY_ENABLE_[^=]\\+' | sed 's/NETDATA_API_KEY_ENABLE_//' | xargs -n1 -I{} echo '['{}$']\\n\\tenabled = yes' >> /etc/netdata/stream.conf\nfi\n\n# exec custom command\nif [[ $# -gt 0 ]] ; then\n        exec \"$@\"\n        exit\nfi\n\nif [[ -d \"/fakenet/\" ]]; then\n\techo \"Running fakenet config reload in background\"\n\t( sleep 10 ; curl -s http://localhost:${NETDATA_PORT}/netdata.conf | sed -e 's/# filename/filename/g' | sed -e 's/\\/host\\/proc\\/net/\\/fakenet\\/proc\\/net/g' > /etc/netdata/netdata.conf ; pkill -9 netdata ) &\n\t/usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT}\n\t# add some artificial sleep because netdata might think it can't bind to $NETDATA_PORT\n\t# and report things like \"netdata: FATAL: Cannot listen on any socket. Exiting...\"\n\tsleep 1\nfi\n\nfor f in /etc/netdata/override/*; do\n  cp -a $f /etc/netdata/\ndone\n\n# main entrypoint\nexec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS} \"$@\"\n"
  },
  {
    "path": "releases/v1.8.0/Dockerfile",
    "content": "FROM debian:jessie\n\nADD git-tag /git-tag\n\nADD scripts/build.sh /build.sh\nADD scripts/run.sh /run.sh\n\nRUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh\n\nWORKDIR /\n\nENV NETDATA_PORT=19999 SSMTP_TLS=YES SSMTP_SERVER=smtp.gmail.com SSMTP_PORT=587 SSMTP_HOSTNAME=localhost\nEXPOSE $NETDATA_PORT\n\nENTRYPOINT [\"/run.sh\"]\n"
  },
  {
    "path": "releases/v1.8.0/git-tag",
    "content": "v1.8.0\n"
  },
  {
    "path": "releases/v1.8.0/scripts/build.sh",
    "content": "#!/bin/bash\nset -e\nDEBIAN_FRONTEND=noninteractive\n\n# some mirrors have issues, i skipped httpredir in favor of an eu mirror\n\necho \"deb http://ftp.nl.debian.org/debian/ jessie main\" > /etc/apt/sources.list\necho \"deb http://security.debian.org/debian-security jessie/updates main\" >> /etc/apt/sources.list\n\n# install dependencies for build\n\napt-get -qq update\napt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq\napt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml\napt-get -y install ssmtp mailutils apcupsd\n\n# fetch netdata\n\ngit clone https://github.com/firehol/netdata.git /netdata.git\ncd /netdata.git\nTAG=$(</git-tag)\nif [ ! -z \"$TAG\" ]; then\n\techo \"Checking out tag: $TAG\"\n\tgit checkout tags/$TAG\nelse\n\techo \"No tag, using master\"\nfi\n\n# use the provided installer\n\n./netdata-installer.sh --dont-wait --dont-start-it\n\n# removed hack on 2017/1/3\n#chown root:root /usr/libexec/netdata/plugins.d/apps.plugin\n#chmod 4755 /usr/libexec/netdata/plugins.d/apps.plugin\n\n# remove build dependencies\n\ncd /\nrm -rf /netdata.git\n\ndpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config\napt-get -y autoremove\napt-get clean\nrm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n\n\n# symlink access log and error log to stdout/stderr\n\nln -sf /dev/stdout /var/log/netdata/access.log\nln -sf /dev/stdout /var/log/netdata/debug.log\nln -sf /dev/stderr /var/log/netdata/error.log\n"
  },
  {
    "path": "releases/v1.8.0/scripts/run.sh",
    "content": "#!/bin/bash\n\n# fix permissions due to netdata running as root\nchown root:root /usr/share/netdata/web/ -R\necho -n \"\" > /usr/share/netdata/web/version.txt\n\n# set up ssmtp\nif [[ $SSMTP_TO ]]; then\ncat << EOF > /etc/ssmtp/ssmtp.conf\nroot=$SSMTP_TO\nmailhub=$SSMTP_SERVER:$SSMTP_PORT\nUseSTARTTLS=$SSMTP_TLS\nhostname=$SSMTP_HOSTNAME\nFromLineOverride=NO\nEOF\n\ncat << EOF > /etc/ssmtp/revaliases\nnetdata:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nroot:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nEOF\nfi\n\nif [[ $SSMTP_USER ]]; then\ncat << EOF >> /etc/ssmtp/ssmtp.conf\nAuthUser=$SSMTP_USER\nEOF\nfi\n\nif [[ $SSMTP_PASS ]]; then\ncat << EOF >> /etc/ssmtp/ssmtp.conf\nAuthPass=$SSMTP_PASS\nEOF\nfi\n\nif [[ $SLACK_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@SLACK_WEBHOOK_URL=\\\"\\\"@SLACK_WEBHOOK_URL=\\\"${SLACK_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $SLACK_CHANNEL ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_SLACK=\\\"\\\"@DEFAULT_RECIPIENT_SLACK=\\\"${SLACK_CHANNEL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $DISCORD_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@DISCORD_WEBHOOK_URL=\\\"\\\"@DISCORD_WEBHOOK_URL=\\\"${DISCORD_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $DISCORD_RECIPIENT ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_DISCORD=\\\"\\\"@DEFAULT_RECIPIENT_DISCORD=\\\"${DISCORD_RECIPIENT}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_BOT_TOKEN ]]; then\n\tsed -i -e \"s@TELEGRAM_BOT_TOKEN=\\\"\\\"@TELEGRAM_BOT_TOKEN=\\\"${TELEGRAM_BOT_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_CHAT_ID ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_TELEGRAM=\\\"\\\"@DEFAULT_RECIPIENT_TELEGRAM=\\\"${TELEGRAM_CHAT_ID}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_ACCESS_TOKEN ]]; then\n\tsed -i -e \"s@PUSHBULLET_ACCESS_TOKEN=\\\"\\\"@PUSHBULLET_ACCESS_TOKEN=\\\"${PUSHBULLET_ACCESS_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_DEFAULT_EMAIL ]]; then\n\tsed -i -e \"s#DEFAULT_RECIPIENT_PUSHBULLET=\\\"\\\"#DEFAULT_RECIPIENT_PUSHBULLET=\\\"${PUSHBULLET_DEFAULT_EMAIL}\\\"#\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $NETDATA_IP ]]; then\n\tNETDATA_ARGS=\"${NETDATA_ARGS} -i ${NETDATA_IP}\"\nfi\n\n# on a client netdata set this destination to be the [PROTOCOL:]HOST[:PORT] of the\n# central netdata, and give an API_KEY that is secret and only known internally\n# to the netdata clients, and netdata central\nif [[ $NETDATA_STREAM_DESTINATION ]] && [[ $NETDATA_STREAM_API_KEY ]]; then\n\tcat << EOF > /etc/netdata/stream.conf\n[stream]\n\tenabled = yes\n\tdestination = $NETDATA_STREAM_DESTINATION\n\tapi key = $NETDATA_STREAM_API_KEY\nEOF\nfi\n\n# set 1 or more NETADATA_API_KEY_ENABLE env variables, such as NETDATA_API_KEY_ENABLE_1h213ch12h3rc1289e=1\n# that matches the API_KEY that you used on the client above, this will enable the netdata client\n# node to communicate with the netdata central\nif printenv | grep -q 'NETDATA_API_KEY_ENABLE_'; then\n\tprintenv | grep -oe 'NETDATA_API_KEY_ENABLE_[^=]\\+' | sed 's/NETDATA_API_KEY_ENABLE_//' | xargs -n1 -I{} echo '['{}$']\\n\\tenabled = yes' >> /etc/netdata/stream.conf\nfi\n\n# exec custom command\nif [[ $# -gt 0 ]] ; then\n        exec \"$@\"\n        exit\nfi\n\nif [[ -d \"/fakenet/\" ]]; then\n\techo \"Running fakenet config reload in background\"\n\t( sleep 10 ; curl -s http://localhost:${NETDATA_PORT}/netdata.conf | sed -e 's/# filename/filename/g' | sed -e 's/\\/host\\/proc\\/net/\\/fakenet\\/proc\\/net/g' > /etc/netdata/netdata.conf ; pkill -9 netdata ) &\n\t/usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT}\n\t# add some artificial sleep because netdata might think it can't bind to $NETDATA_PORT\n\t# and report things like \"netdata: FATAL: Cannot listen on any socket. Exiting...\"\n\tsleep 1\nfi\n\nfor f in /etc/netdata/override/*; do\n  cp -a $f /etc/netdata/\ndone\n\n# main entrypoint\nexec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS} \"$@\"\n"
  },
  {
    "path": "releases/v1.9.0/Dockerfile",
    "content": "FROM debian:jessie\n\nADD git-tag /git-tag\n\nADD scripts/build.sh /build.sh\nADD scripts/run.sh /run.sh\n\nRUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh\n\nWORKDIR /\n\nENV NETDATA_PORT=19999 SSMTP_TLS=YES SSMTP_SERVER=smtp.gmail.com SSMTP_PORT=587 SSMTP_HOSTNAME=localhost\nEXPOSE $NETDATA_PORT\n\nVOLUME /etc/netdata/override\n\nENTRYPOINT [\"/run.sh\"]\n"
  },
  {
    "path": "releases/v1.9.0/git-tag",
    "content": "v1.9.0\n"
  },
  {
    "path": "releases/v1.9.0/scripts/build.sh",
    "content": "#!/bin/bash\nset -e\nDEBIAN_FRONTEND=noninteractive\n\n# some mirrors have issues, i skipped httpredir in favor of an eu mirror\n\necho \"deb http://ftp.nl.debian.org/debian/ jessie main\" > /etc/apt/sources.list\necho \"deb http://security.debian.org/debian-security jessie/updates main\" >> /etc/apt/sources.list\n\n# install dependencies for build\n\napt-get -qq update\napt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq\napt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml\napt-get -y install ssmtp mailutils apcupsd\n\n# fetch netdata\n\ngit clone https://github.com/firehol/netdata.git /netdata.git\ncd /netdata.git\nTAG=$(</git-tag)\nif [ ! -z \"$TAG\" ]; then\n\techo \"Checking out tag: $TAG\"\n\tgit checkout tags/$TAG\nelse\n\techo \"No tag, using master\"\nfi\n\n# use the provided installer\n\n./netdata-installer.sh --dont-wait --dont-start-it\n\n# removed hack on 2017/1/3\n#chown root:root /usr/libexec/netdata/plugins.d/apps.plugin\n#chmod 4755 /usr/libexec/netdata/plugins.d/apps.plugin\n\n# remove build dependencies\n\ncd /\nrm -rf /netdata.git\n\ndpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config\napt-get -y autoremove\napt-get clean\nrm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n\n\n# symlink access log and error log to stdout/stderr\n\nln -sf /dev/stdout /var/log/netdata/access.log\nln -sf /dev/stdout /var/log/netdata/debug.log\nln -sf /dev/stderr /var/log/netdata/error.log\n"
  },
  {
    "path": "releases/v1.9.0/scripts/run.sh",
    "content": "#!/bin/bash\n\n# fix permissions due to netdata running as root\nchown root:root /usr/share/netdata/web/ -R\necho -n \"\" > /usr/share/netdata/web/version.txt\n\n# set up ssmtp\nif [[ $SSMTP_TO ]]; then\ncat << EOF > /etc/ssmtp/ssmtp.conf\nroot=$SSMTP_TO\nmailhub=$SSMTP_SERVER:$SSMTP_PORT\nUseSTARTTLS=$SSMTP_TLS\nhostname=$SSMTP_HOSTNAME\nFromLineOverride=NO\nEOF\n\ncat << EOF > /etc/ssmtp/revaliases\nnetdata:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nroot:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT\nEOF\nfi\n\nif [[ $SSMTP_USER ]]; then\ncat << EOF >> /etc/ssmtp/ssmtp.conf\nAuthUser=$SSMTP_USER\nEOF\nfi\n\nif [[ $SSMTP_PASS ]]; then\ncat << EOF >> /etc/ssmtp/ssmtp.conf\nAuthPass=$SSMTP_PASS\nEOF\nfi\n\nif [[ $SLACK_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@SLACK_WEBHOOK_URL=\\\"\\\"@SLACK_WEBHOOK_URL=\\\"${SLACK_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $SLACK_CHANNEL ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_SLACK=\\\"\\\"@DEFAULT_RECIPIENT_SLACK=\\\"${SLACK_CHANNEL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $DISCORD_WEBHOOK_URL ]]; then\n\tsed -i -e \"s@DISCORD_WEBHOOK_URL=\\\"\\\"@DISCORD_WEBHOOK_URL=\\\"${DISCORD_WEBHOOK_URL}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $DISCORD_RECIPIENT ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_DISCORD=\\\"\\\"@DEFAULT_RECIPIENT_DISCORD=\\\"${DISCORD_RECIPIENT}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_BOT_TOKEN ]]; then\n\tsed -i -e \"s@TELEGRAM_BOT_TOKEN=\\\"\\\"@TELEGRAM_BOT_TOKEN=\\\"${TELEGRAM_BOT_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $TELEGRAM_CHAT_ID ]]; then\n\tsed -i -e \"s@DEFAULT_RECIPIENT_TELEGRAM=\\\"\\\"@DEFAULT_RECIPIENT_TELEGRAM=\\\"${TELEGRAM_CHAT_ID}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_ACCESS_TOKEN ]]; then\n\tsed -i -e \"s@PUSHBULLET_ACCESS_TOKEN=\\\"\\\"@PUSHBULLET_ACCESS_TOKEN=\\\"${PUSHBULLET_ACCESS_TOKEN}\\\"@\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $PUSHBULLET_DEFAULT_EMAIL ]]; then\n\tsed -i -e \"s#DEFAULT_RECIPIENT_PUSHBULLET=\\\"\\\"#DEFAULT_RECIPIENT_PUSHBULLET=\\\"${PUSHBULLET_DEFAULT_EMAIL}\\\"#\" /etc/netdata/health_alarm_notify.conf\nfi\n\nif [[ $NETDATA_IP ]]; then\n\tNETDATA_ARGS=\"${NETDATA_ARGS} -i ${NETDATA_IP}\"\nfi\n\n# on a client netdata set this destination to be the [PROTOCOL:]HOST[:PORT] of the\n# central netdata, and give an API_KEY that is secret and only known internally\n# to the netdata clients, and netdata central\nif [[ $NETDATA_STREAM_DESTINATION ]] && [[ $NETDATA_STREAM_API_KEY ]]; then\n\tcat << EOF > /etc/netdata/stream.conf\n[stream]\n\tenabled = yes\n\tdestination = $NETDATA_STREAM_DESTINATION\n\tapi key = $NETDATA_STREAM_API_KEY\nEOF\nfi\n\n# set 1 or more NETADATA_API_KEY_ENABLE env variables, such as NETDATA_API_KEY_ENABLE_1h213ch12h3rc1289e=1\n# that matches the API_KEY that you used on the client above, this will enable the netdata client\n# node to communicate with the netdata central\nif printenv | grep -q 'NETDATA_API_KEY_ENABLE_'; then\n\tprintenv | grep -oe 'NETDATA_API_KEY_ENABLE_[^=]\\+' | sed 's/NETDATA_API_KEY_ENABLE_//' | xargs -n1 -I{} echo '['{}$']\\n\\tenabled = yes' >> /etc/netdata/stream.conf\nfi\n\n# exec custom command\nif [[ $# -gt 0 ]] ; then\n        exec \"$@\"\n        exit\nfi\n\nif [[ -d \"/fakenet/\" ]]; then\n\techo \"Running fakenet config reload in background\"\n\t( sleep 10 ; curl -s http://localhost:${NETDATA_PORT}/netdata.conf | sed -e 's/# filename/filename/g' | sed -e 's/\\/host\\/proc\\/net/\\/fakenet\\/proc\\/net/g' > /etc/netdata/netdata.conf ; pkill -9 netdata ) &\n\t/usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT}\n\t# add some artificial sleep because netdata might think it can't bind to $NETDATA_PORT\n\t# and report things like \"netdata: FATAL: Cannot listen on any socket. Exiting...\"\n\tsleep 1\nfi\n\nfor f in /etc/netdata/override/*; do\n  cp -a $f /etc/netdata/\ndone\n\n# main entrypoint\ntouch /etc/netdata/python.d.conf\nexec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS} \"$@\"\n"
  },
  {
    "path": "update-releases.sh",
    "content": "#!/bin/bash\n#\n# It should go without saying, this script is for development/deployment purposes\n# only. If a new tag is added into `netdata/netdata`, this creates the corresponding\n# directory (symlink) structure. Most likely, it should be deleted because the build\n# steps for netdata have and will change over time. What is symlinked today, will\n# not be accurate in the future, as the Dockerfiles are currently maintained only\n# for the master branch. Results may vary.\n#\n# And of course, there's the small issue to add individual tags manually to Docker Hub.\n#\nrm update-releases.json\nif [ ! -f \"update-releases.json\" ]; then\n\tcurl -s https://api.github.com/repos/netdata/netdata/tags > update-releases.json\nfi\nTAGS=$(cat update-releases.json | jq -r \".[].name\" | grep -v 'rc')\nfor TAG in $TAGS; do\n\tif [ -d \"releases/$TAG\" ]; then\n\t\t# tags are sorted, don't create older than the latest created tag\n\t\techo \"Done, latest tags are up to date\"\n\t\texit\n\tfi\n\n\tTAG=${TAG/v/}\n\tif [ -d \".git/refs/tags/$TAG\" ]; then\n\t\t# tags are sorted, don't create older than the latest created tag\n\t\techo \"Done, latest tags are up to date\"\n\t\texit\n\tfi\n\n\n\techo \"Creating tag: $TAG\"\n\tgit tag $TAG\ndone\n"
  }
]