Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Implementation of basic API authentication #1228

Merged
merged 7 commits into from
Jun 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

### Added

- Basic API authentication to protect exposure of API port to the internet [#1228](https://github.com/ethereum-mining/ethminer/pull/1228).

## 0.15.0rc1

Expand Down
8 changes: 7 additions & 1 deletion ethminer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ class MinerCLI
->group(APIGroup)
->check(CLI::Range(-65535, 65535));

app.add_option("--api-password", m_api_password,
"Set the password to protect interaction with Api server. If not set any connection is granted access."
"Be advised passwords are sent unencrypted over plain tcp !!")
->group(APIGroup);

app.add_option("--http-port", m_http_port,
"Set the web api port, the miner should listen to. Use 0 to disable. Data shown depends on hwmon setting", true)
->group(APIGroup)
Expand Down Expand Up @@ -710,7 +715,7 @@ class MinerCLI

#if API_CORE

ApiServer api(m_io_service, abs(m_api_port), (m_api_port < 0) ? true : false, f);
ApiServer api(m_io_service, abs(m_api_port), (m_api_port < 0) ? true : false, m_api_password, f);
api.start();

http_server.run(m_http_port, &f, m_show_hwmonitors, m_show_power);
Expand Down Expand Up @@ -817,6 +822,7 @@ class MinerCLI

#if API_CORE
int m_api_port = 0;
string m_api_password;
unsigned m_http_port = 0;
#endif

Expand Down
Loading