diff --git a/miner/envs/runner/.env.template b/miner/envs/runner/.env.template index 096addf00..0d2619399 100644 --- a/miner/envs/runner/.env.template +++ b/miner/envs/runner/.env.template @@ -1,5 +1,8 @@ # generate one for yourself, e.g. `python3 -c 'import random; import string; print("".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(50)))'` SECRET_KEY= +# password for user "admin" +# generate one for yourself, e.g. `python3 -c 'import random; import string; print("".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16)))'` +DEFAULT_ADMIN_PASSWORD= # generate one for yourself POSTGRES_PASSWORD= # make sure to unblock access to that port in your firewall diff --git a/miner/envs/runner/README.md b/miner/envs/runner/README.md index 5cf9b1edc..5bbc6baa1 100644 --- a/miner/envs/runner/README.md +++ b/miner/envs/runner/README.md @@ -59,6 +59,17 @@ services: With the `.env` and `docker-compose.yml` already in place, you can start the miner with `docker-compose up -d`. Test if it is running properly with `docker-compose ps`. +## Admin panel + +Your miner exposes an admin panel that allows you to check its health. To access it, use the same address and port as +the ones you expose in your axon. For example, type `http://198.66.65.12.13:8000` in your browser. To log in you need +to set up an admin password, either in .env or manually. + +## Creating an admin user manually (not using DEFAULT_ADMIN_PASSWORD in .env) + +Run `docker-compose exec miner-runner docker-compose exec app python manage.py createsuperuser` and follow +the instructions. + ## How it works The `backenddevelopersltd/compute-horde-miner-runner` docker image contains a `docker-compose.yml` file with all the necessary services to run a miner. diff --git a/validator/envs/runner/README.md b/validator/envs/runner/README.md index c9e6d057d..e8fd88bcb 100644 --- a/validator/envs/runner/README.md +++ b/validator/envs/runner/README.md @@ -45,6 +45,9 @@ services: ``` # generate one for yourself, e.g. `python3 -c 'import random; import string; print("".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(50)))'` SECRET_KEY= +# password for user "admin" +# generate one for yourself, e.g. `python3 -c 'import random; import string; print("".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16)))'` +DEFAULT_ADMIN_PASSWORD= # generate one for yourself, e.g. `python3 -c 'import random; import string; print("".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(15)))'` POSTGRES_PASSWORD= # don't change POSTGRES_PASSWORD after you start your validator for the first time (but you have generate it before that) @@ -85,6 +88,21 @@ ERROR: error while removing network: network ... has active endpoints ``` it is inconsequential, and we will remove it soon. +## Admin panel + +Your validator exposes an admin panel that allows you to check its health. For security purposes, it is only accessible +at 127.0.0.1, so to access it, assuming you have SSH access to that machine do: +`ssh -L 8000:127.0.0.1:80 user@validator_machine`. After that you can access the panel on your local (the machine +on which you ran `ssh ...`) machine at `http://127.0.0.1:8000`. Important! the `80` in `ssh ...` will be different +if you set `HTTP_PORT`. If you don't, then 80 is the default. To log in you need to set up an admin password, either +in .env or manually. + +## Creating an admin user manually (not using DEFAULT_ADMIN_PASSWORD in .env) + +Run `docker-compose exec validator-runner docker-compose exec app python manage.py createsuperuser` and follow +the instructions. + + ## How it works The `backenddevelopersltd/compute-horde-validator-runner` docker image contains a `docker-compose.yml` file with all the necessary services to run a validator.