diff --git a/INSTALL.md b/INSTALL.md index 9f9abb1..25ec6c9 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -36,6 +36,7 @@ You can edit the `docker-compose.jsonnet` file to set the configuration options. * `segments_path`, the local path to save segments to. * `db_args`, the arguments for connecting to the wubloader database. You will likely need to update the `user`, `password` and `host` to match the database node that you are connecting to. * `ports`, the ports to expose each service on. Only the `nginx` port (default on port 80) needs to be externally accessible for a non-database node as all the other services are routed through `nginx`. +* `localhost`, the name of the local machine as it appears in the database `nodes` table. This is prevent the node from backfilling from itself. To generate the `docker-compose.yml` file used by `docker-compose`, run `generate-docker-compose` diff --git a/backfiller/backfiller/main.py b/backfiller/backfiller/main.py index 66a8b89..412b791 100644 --- a/backfiller/backfiller/main.py +++ b/backfiller/backfiller/main.py @@ -242,9 +242,9 @@ class BackfillerManager(object): only the URL is provided, the node name is taken from the hostname. Third, node names and URLs can be requested from the database given by --node-database. If multiple nodes URLs with the same name are found, - only the last is retained and any nodes matching the local hostname - (given by the --hostname argument) are ignored to try to prevent this - node from backfilling from itself.""" + only the last is retained and any nodes with names matching the + localhost name (given by the --localhost argument) are ignored to try + to prevent this node from backfilling from itself.""" nodes = {urlparse.urlparse(node).hostname:node for node in self.static_nodes} @@ -269,7 +269,6 @@ class BackfillerManager(object): WHERE backfill_from""") for row in results: nodes[row.name] = row.url - nodes = {key:val for key, val in nodes.items() if val != self.localhost} nodes.pop(self.localhost, None) return nodes.values() diff --git a/docker-compose.jsonnet b/docker-compose.jsonnet index c29f29a..39f6663 100644 --- a/docker-compose.jsonnet +++ b/docker-compose.jsonnet @@ -62,7 +62,7 @@ peers:: [ ], - localhost:: "http://example.com", // the name or URL of this node as it appears in the nodes table of the database + localhost:: "http://example.com", // the name in the nodes table of the database authentication:: true, // set to false to disable auth in thrimshim thrimbletrimmer:: true, // set to false to not have nginx serve thrimbletrimmer pages.