-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure for clean installations and centralize configuration (#5)
* add an email so at least example is complete * Add a redirect: /node-red ==> /node-red/ * Add wrappers for cleaner dashboard installation * Get things working. Now all configuration is centralized in .env (but still .env and setup are tricky) * Fix typos in SETUP.md * Ignore the .env file * Improve README.md * Rough touch-up of SETUP.md * Rough touch-up for TODO.md
- Loading branch information
1 parent
4fe2e3f
commit 43db312
Showing
14 changed files
with
207 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
node-red/data | ||
*.swp | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,50 @@ | ||
1. in `./apache/certbot-config.sh`, change the FQDN to the FQDN of this server. | ||
1. Make sure that you have the following tools installed on the host server. | ||
|
||
2. in `./apache/certbot-config.sh`, add CERTBOT\_EMAIL with the right email address for use with certbot certificate requests. | ||
Tool|On Ubuntu|On CentOS 7 | ||
----|---------|----------- | ||
`htpasswd`|`sudo apt-get install apache2-utils`|`sudo yum install httpd-tools` | ||
|
||
3. Be aware that the grafana env admin\_password doesn't take unless it's correct **on the | ||
2. get a fully-qualified domain name for your server, for which you control DNS. Call this the "FQDN" (fully-qualified domain name). | ||
|
||
3. Createa a `.env` file as instructed in README.md. | ||
|
||
4. Be aware that the grafana env admin\_password is ignored **except on the | ||
first boot**. | ||
|
||
4. get a fully-qualified domain name for your server, for which you control DNS. Call this the "FQDN" (fully-qualified domain name). | ||
5. Follow the instructions from README.md to get grafana working and to get the server up. | ||
|
||
5. in `./apache/proxy-*.sh`, change all the FQDNs to the FQDN of this server. | ||
6. verify that grafana is working at https://{FQDN}/ and https://{FQDN}/grafana | ||
|
||
6. using `docker-compose apache run /bin/bash`, | ||
7. using `docker-compose apache run /bin/bash`, | ||
|
||
1. add {APACHE}/etc/apache2/authdata as user www-data | ||
1. add Apache's /etc/apache2/authdata as user www-data | ||
```sh | ||
mkdir /etc/apache2/authdata | ||
chown www-data /etc/apache2/authdata | ||
``` | ||
2. add {APACHE}/etc/apache2/authdata/.htpasswd as user www-data | ||
2. add Apache's /etc/apache2/authdata/.htpasswd as user www-data | ||
```sh | ||
touch /etc/apache2/authdata/.htpasswd | ||
chown www-data /etc/apache2/.htpasswd | ||
chown www-data /etc/apache2/authdata/.htpasswd | ||
``` | ||
3. Add user logins for influxdb, queries, node-red. Make `USERS` be a list of login IDs. | ||
```sh | ||
export USERS="tmm amy josh" | ||
for each USER in $USERS ; do | ||
htpasswd /etc/apache2/authdata/.htpasswd $USER | ||
>>>>enter password twice | ||
done | ||
``` | ||
4. add {APACHE}/etc/apache2/authdata/.htgroup (owned by www-data) | ||
4. add Apache's /etc/apache2/authdata/.htgroup (owned by www-data) | ||
```sh | ||
# this assumes USERS is still set from previous step. | ||
touch /etc/apache2/authdata/.htgroup | ||
chown www-data /etc/apache2/authdata/.htgroup | ||
echo "node-red: ${USERS}" >>/etc/apache2/authdata/.htgroup | ||
echo "admin: ${USERS}" >>/etc/apache2/authdata/.htgroup | ||
echo "group: ${USERS}" >>/etc/apache2/authdata/.htgroup | ||
echo "query: ${USERS}" >>/etc/apache2/authdata/.htgroup | ||
``` | ||
|
||
7. verify that grafana is working at https://{FQDN}/ and https://{FQDN}/grafana | ||
|
||
8. verify that you can log in as https://{FQDN}/node-red/ and | ||
https://{FQDN}/influxdb/ | ||
|
||
9. In influxdb UI, change the query URL to https://{FQDN}/influxdb, [x] SSL, | ||
don't fill in user name here, just press save. Browser will ask for credentials; provide credentials. | ||
|
||
8. verify that you can log in as https://{FQDN}/node-red/. | ||
|
||
9. Current versions of influxdb may support an administrative interface at https://{FQDN}/influxdb/. If so, in the influxdb UI, change the query URL to https://{FQDN}/influxdb, [x] SSL. Don't fill in user name here, just press save. Browser will ask for credentials; provide credentials. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
1. Convert to [phusion](https://github.com/phusion/baseimage-docker); documents are [here](http://phusion.github.io/baseimage-docker/) | ||
|
||
2. Prepare a script that queries the user during the setup and sets the grafana admin user name and initial password (seeding grafana/.env, or overriding it). Also set name of influxdb database (change from demo). And change all the FQDNs.And change the email address in certbot-config.sh. | ||
2. Prepare a script that queries the user during the setup and sets the `.env` file. | ||
|
||
3. don't forget to exclude grafana/.env from the git repo, so there are no passwords at all. | ||
|
||
4. The grafana instance had better be customized to remove the admin password (or have a reset step) so if the user changes GRAFANA\_ENV\_ADMIN\_PASSWORD after the image has been launched once, it wil be reset. This might be a maintenance script and/or a makefile so that the system detects edits and does the right thing. | ||
4. Figure out what to do if the user changes GRAFANA\_ENV\_ADMIN\_PASSWORD after the image has been launched once, it wil be reset. This might be a maintenance script and/or a makefile so that the system detects edits and does the right thing. | ||
|
||
4. the script should also get names and roles for access to node-red and influxdb. It then will seed .hgaccess and .htgroup. | ||
|
||
5. same script should be able to show user-by-user roles, and adjust them. | ||
|
||
6. Add the auto-update cron script. | ||
|
||
7. See if there's a way to make the docker-compose print a message and stop if the configuration operation hasn't been done. | ||
|
||
8. integrate the other things from SETUP.txt | ||
7. integrate the other things from SETUP.txt | ||
|
||
9. Add scripts to backup and restore the user's data directories. Backup should run offline (unless there's a very good way to backup the datasets from all the servers while they're up). restore must run offline. Scripts should do the necessary to ensure that the servers are in fact stopped. | ||
8. Add scripts to backup and restore the user's data directories. Backup should run offline (unless there's a very good way to backup the datasets from all the servers while they're up). restore must run offline. Scripts should do the necessary to ensure that the servers are in fact stopped. | ||
|
||
10. update the README.md (again) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.