Merge pull request #178 from tydal-borge/dev_antminer_customauth
bug: Add custom auth to Digest of AntMiner model check
This commit is contained in:
@@ -255,7 +255,7 @@ if __name__ == "__main__":
|
|||||||
```python
|
```python
|
||||||
from pyasic import settings
|
from pyasic import settings
|
||||||
|
|
||||||
settings.update("default_antminer_password", "my_pwd")
|
settings.update("default_antminer_web_password", "my_pwd")
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Default values:
|
##### Default values:
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ if __name__ == "__main__":
|
|||||||
```python
|
```python
|
||||||
from pyasic import settings
|
from pyasic import settings
|
||||||
|
|
||||||
settings.update("default_antminer_password", "my_pwd")
|
settings.update("default_antminer_web_password", "my_pwd")
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Default values:
|
##### Default values:
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ Settings options:
|
|||||||
- `antminer_mining_mode_as_str`
|
- `antminer_mining_mode_as_str`
|
||||||
- `default_whatsminer_password`
|
- `default_whatsminer_password`
|
||||||
- `default_innosilicon_password`
|
- `default_innosilicon_password`
|
||||||
- `default_antminer_password`
|
- `default_antminer_web_password`
|
||||||
|
- `default_antminer_ssh_password`
|
||||||
- `default_bosminer_password`
|
- `default_bosminer_password`
|
||||||
- `default_vnish_password`
|
- `default_vnish_password`
|
||||||
- `default_goldshell_password`
|
- `default_goldshell_password`
|
||||||
|
|||||||
@@ -189,7 +189,6 @@ class BOSMiner(BraiinsOSFirmware):
|
|||||||
|
|
||||||
async def send_config(self, config: MinerConfig, user_suffix: str = None) -> None:
|
async def send_config(self, config: MinerConfig, user_suffix: str = None) -> None:
|
||||||
self.config = config
|
self.config = config
|
||||||
print(config)
|
|
||||||
parsed_cfg = config.as_bosminer(user_suffix=user_suffix)
|
parsed_cfg = config.as_bosminer(user_suffix=user_suffix)
|
||||||
|
|
||||||
toml_conf = toml.dumps(
|
toml_conf = toml.dumps(
|
||||||
|
|||||||
@@ -833,7 +833,9 @@ class MinerFactory:
|
|||||||
|
|
||||||
async def _get_model_antminer_web(self, ip: str) -> str | None:
|
async def _get_model_antminer_web(self, ip: str) -> str | None:
|
||||||
# last resort, this is slow
|
# last resort, this is slow
|
||||||
auth = httpx.DigestAuth("root", "root")
|
auth = httpx.DigestAuth(
|
||||||
|
"root", settings.get("default_antminer_web_password", "root")
|
||||||
|
)
|
||||||
web_json_data = await self.send_web_command(
|
web_json_data = await self.send_web_command(
|
||||||
ip, "/cgi-bin/get_system_info.cgi", auth=auth
|
ip, "/cgi-bin/get_system_info.cgi", auth=auth
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user