diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 5352b0b73..7c08bbe4b 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -27,6 +27,7 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers +#include #include #include "include_base_utils.h" using namespace epee; @@ -47,6 +48,8 @@ namespace const command_line::arg_descriptor arg_rpc_bind_port = {"rpc-bind-port", "Sets bind port for server"}; const command_line::arg_descriptor arg_rpc_bind_ip = {"rpc-bind-ip", "Specify ip to bind rpc server", "127.0.0.1"}; const command_line::arg_descriptor arg_user_agent = {"user-agent", "Restrict RPC to clients using this user agent", ""}; + + const command_line::arg_descriptor arg_confirm_external_bind = {"confirm-external-bind", "Confirm rcp-bind-ip value is NOT a loopback (local) IP"}; } namespace tools @@ -84,20 +87,35 @@ namespace tools return epee::http_server_impl_base::run(1, true); } //------------------------------------------------------------------------------------------------------------------------------ - bool wallet_rpc_server::handle_command_line(const boost::program_options::variables_map& vm) - { - m_bind_ip = command_line::get_arg(vm, arg_rpc_bind_ip); - m_port = command_line::get_arg(vm, arg_rpc_bind_port); - m_user_agent = command_line::get_arg(vm, arg_user_agent); - return true; - } - //------------------------------------------------------------------------------------------------------------------------------ bool wallet_rpc_server::init(const boost::program_options::variables_map& vm) { + std::string bind_ip = command_line::get_arg(vm, arg_rpc_bind_ip); + if (!bind_ip.empty()) + { + // always parse IP here for error consistency + boost::system::error_code ec{}; + const auto parsed_ip = boost::asio::ip::address::from_string(bind_ip, ec); + if (ec) + { + LOG_ERROR(tr("Invalid IP address given for rpc-bind-ip argument")); + return false; + } + + if (!parsed_ip.is_loopback() && !command_line::get_arg(vm, arg_confirm_external_bind)) + { + LOG_ERROR( + tr("The rpc-bind-ip value is listening for unencrypted external connections. Consider SSH tunnel or SSL proxy instead. Override with --confirm-external-bind") + ); + return false; + } + } + m_net_server.set_threads_prefix("RPC"); - bool r = handle_command_line(vm); - CHECK_AND_ASSERT_MES(r, false, "Failed to process command line in core_rpc_server"); - return epee::http_server_impl_base::init(m_port, m_bind_ip, m_user_agent); + return epee::http_server_impl_base::init( + command_line::get_arg(vm, arg_rpc_bind_port), + std::move(bind_ip), + command_line::get_arg(vm, arg_user_agent) + ); } //------------------------------------------------------------------------------------------------------------------------------ bool wallet_rpc_server::on_getbalance(const wallet_rpc::COMMAND_RPC_GET_BALANCE::request& req, wallet_rpc::COMMAND_RPC_GET_BALANCE::response& res, epee::json_rpc::error& er) @@ -1115,6 +1133,7 @@ int main(int argc, char** argv) { command_line::add_arg(desc_params, arg_rpc_bind_ip); command_line::add_arg(desc_params, arg_rpc_bind_port); command_line::add_arg(desc_params, arg_user_agent); + command_line::add_arg(desc_params, arg_confirm_external_bind); command_line::add_arg(desc_params, arg_wallet_file); command_line::add_arg(desc_params, arg_from_json); diff --git a/src/wallet/wallet_rpc_server.h b/src/wallet/wallet_rpc_server.h index 7d6f94e56..96ca1af04 100644 --- a/src/wallet/wallet_rpc_server.h +++ b/src/wallet/wallet_rpc_server.h @@ -118,9 +118,6 @@ namespace tools bool on_query_key(const wallet_rpc::COMMAND_RPC_QUERY_KEY::request& req, wallet_rpc::COMMAND_RPC_QUERY_KEY::response& res, epee::json_rpc::error& er); wallet2& m_wallet; - std::string m_port; - std::string m_bind_ip; - std::string m_user_agent; std::atomic m_stop; }; } diff --git a/translations/monero.ts b/translations/monero.ts index 0dcb09d06..f38564244 100644 --- a/translations/monero.ts +++ b/translations/monero.ts @@ -32,109 +32,114 @@ Bitmonero::WalletImpl - + payment id has invalid format, expected 16 or 64 character hex string: - - - daemon is busy. Please try again later. - - - - - - no connection to daemon. Please make sure daemon is running. - - - - - - RPC error: - - - - - - failed to get random outputs to mix + + Failed to add short payment id: - not enough money to transfer, available only %s, sent amount %s + daemon is busy. Please try again later. + + + + + + no connection to daemon. Please make sure daemon is running. + + + + + + RPC error: - not enough money to transfer, available only %s, transaction amount %s = %s + %s (fee) + failed to get random outputs to mix - - - not enough outputs for specified mixin_count - - - - - - output amount - - - - - - found outputs to mix + + + not enough money to transfer, available only %s, sent amount %s - transaction was not constructed + not enough money to transfer, available only %s, transaction amount %s = %s + %s (fee) - - - transaction %s was rejected by daemon with status: + + + not enough outputs for specified mixin_count - one of destinations is zero + output amount - - - failed to find a suitable way to split transactions + + + found outputs to mix - - - unknown transfer error: + + + transaction was not constructed + transaction %s was rejected by daemon with status: + + + + + + one of destinations is zero + + + + + + failed to find a suitable way to split transactions + + + + + + unknown transfer error: + + + + + internal error: - - + + unexpected error: - - + + unknown error @@ -142,63 +147,63 @@ Bitmonero::WalletManagerImpl - + failed to parse txid - - + + failed to parse tx key - + failed to parse address - + failed to get transaction from daemon - + failed to parse transaction from daemon - + failed to validate transaction from daemon - + failed to get the right transaction from daemon - + failed to generate key derivation from supplied parameters - + error: - + received - + in txid - + received nothing in txid @@ -214,628 +219,624 @@ cryptonote::simple_wallet - + Commands: - - - - - - - - - - + + + + + + + + + + failed to read wallet password - - - - - - - - + + + + + + + + invalid password - + start_mining [<number_of_threads>] - Start mining in daemon - + Stop mining in daemon - + Save current blockchain data - + Show current wallet balance - + Show blockchain height - + Show current wallet public address - + Show this help - + set seed: needs an argument. available options: language - + set always-confirm-transfers: needs an argument (0 or 1) - + set: unrecognized argument(s) - + wrong number format, use: set_log <log_level_number_0-4> - + wrong number range, use: set_log <log_level_number_0-4> - + wallet file path not valid: - + Attempting to generate or restore wallet, but specified file(s) exist. Exiting to not risk overwriting. - + PLEASE NOTE: the following 25 words can be used to recover access to your wallet. Please write them down and store them somewhere safe and secure. Please do not store them in your email or on file storage services outside of your immediate control. - + specify a recovery parameter with the --electrum-seed="words list here" - + wallet failed to connect to daemon: - + + Daemon uses a different RPC major version (%u) than the wallet (%u): %s. Either update one of them, or use --allow-mismatched-daemon-version. + + + + List of available languages for your wallet's seed: - + Enter the number corresponding to the language of your choice: - + You had been using a deprecated version of the wallet. Please use the new seed that we provide. - - + + Generated new wallet: - - + + failed to generate new wallet: - + Opened watch-only wallet - + Opened wallet - + You had been using a deprecated version of the wallet. Please proceed to upgrade your wallet. - + You had been using a deprecated version of the wallet. Your wallet file format is being upgraded now. - + failed to load wallet: - + Use "help" command to see the list of available commands. - + Wallet data saved - + Password for the new watch-only wallet - + Enter new password again - + passwords do not match - + invalid arguments. Please use start_mining [<number_of_threads>], <number_of_threads> should be from 1 to - + Mining started in daemon - + mining has NOT been started: - + Mining stopped in daemon - + mining has NOT been stopped: - + Blockchain saved - - - + + + Height - - - + + + transaction - + received - + spent - + unsupported transaction format - + Starting refresh... - + Refresh done, blocks received: - + you have cancelled the transfer request - + failed to get a Monero address from: - + not yet supported: Multiple Monero addresses found for given URL: - + wrong address: - - + + payment id has invalid format, expected 16 or 64 character hex string: - + bad locked_blocks parameter: - + Locked blocks too high, max 1000000 (˜4 yrs) - - + + a single transaction cannot use more than one payment id: - - + + failed to set up payment id, though it was decoded correctly - - + + No payment id is included with this transaction. Is this okay? (Y/Yes/N/No) - - - - - - + + + + + transaction cancelled. - - + Sending %s. - - + Your transaction needs to be split into %llu transactions. This will result in a transaction fee being applied to each transaction, for a total fee of %s - - + The transaction fee is %s - - + , of which %s is dust from change - - - - + + . - - + A total of %s from dust change will be sent to dust address - + . This transaction will unlock on block %llu, in approximately %s days (assuming 2 minutes per block) - - + Is this okay? (Y/Yes/N/No) - - - + + + Failed to write transaction(s) to file - - - + + + Unsigned transaction(s) successfully written to file: - - - - + + + + Not enough money in unlocked balance - - - - + + + + Failed to find a way to create transactions. This is usually due to dust which is so small it cannot pay for itself in fees, or trying to send more money than the unlocked balance, or not leaving enough for fees - - - + + + Reason: - - - + + + failed to find a suitable way to split transactions - + No unmixable outputs found - + No address given - + No outputs found - + Claimed change does not go to a paid address - + Claimed change is larger than payment to the change address - + Change does to more than one address - + sending %s to %s - + with no destinations - + Failed to sign transaction - + Failed to sign transaction: - + Failed to load transaction from file - + daemon is busy. Please try later - - - - - - + + + + + + RPC error: - - - - - + + + + + internal error: - - - - - - + + + + + + unexpected error: - - - - - - + + + + + + unknown error - + refresh failed: - + Blocks received: - + unlocked balance: - - + + amount - + spent - + global index - + tx id - + No incoming transfers - + No incoming available transfers - + No incoming unavailable transfers - + expected at least one payment_id - + payment - + transaction - + height - + unlock time - + No payments with id - - + + failed to get blockchain height: - + wrong number of arguments - + This is a watch only wallet - + DNSSEC validation passed @@ -850,409 +851,399 @@ This transaction will unlock on block %llu, in approximately %s days (assuming 2 - - + + wallet is watch-only and has no seed - - + + wallet is non-deterministic and has no seed - - - - + + + + wallet is watch-only and cannot transfer - - - + + + mixin must be an integer >= 2 - + could not change default mixin - + priority must be 0, 1, 2, or 3 - + priority must be 0, 1, 2, or 3 - + priority must be 0, 1, 2 or 3 - + could not change default priority - + Synchronize transactions and balance - + incoming_transfers [available|unavailable] - Show incoming transfers, all or filtered by availability - + payments <PID_1> [<PID_2> ... <PID_N>] - Show payments for given payment ID[s] - + transfer [<mixin_count>] <addr_1> <amount_1> [<addr_2> <amount_2> ... <addr_N> <amount_N>] [payment_id] - Transfer <amount_1>,... <amount_N> to <address_1>,... <address_N>, respectively. <mixin_count> is the number of extra inputs to include for untraceability (from 2 to maximum available) - + Same as transfer_original, but using a new transaction building algorithm - + locked_transfer [<mixin_count>] <addr> <amount> <lockblocks>(Number of blocks to lock the transaction for, max 1000000) [<payment_id>] - + Send all unmixable outputs to yourself with mixin 0 - + sweep_all [mixin] address [payment_id] - Send all unlocked balance an address - + Sign a transaction from a file - + Submit a signed transaction from a file - + set_log <level> - Change current log detail level, <0-4> - + integrated_address [PID] - Encode a payment ID into an integrated address for the current wallet public address (no argument uses a random payment ID), or decode an integrated address to standard address and payment ID - + Save wallet data - + Save a watch-only keys file - + Display private view key - + Display private spend key - + Display Electrum-style mnemonic seed - + Available options: seed language - set wallet seed language; always-confirm-transfers <1|0> - whether to confirm unsplit txes; store-tx-info <1|0> - whether to store outgoing tx info (destination address, payment ID, tx secret key) for future reference; default-mixin <n> - set default mixin (default is 4); auto-refresh <1|0> - whether to automatically sync new blocks from the daemon; refresh-type <full|optimize-coinbase|no-coinbase|default> - set wallet refresh behaviour; priority [1|2|3] - normal/elevated/priority fee; confirm-missing-payment-id <1|0> - + Rescan blockchain for spent outputs - + Get transaction key (r) for a given <txid> - + Check amount going to <address> in <txid> - + show_transfers [in|out] [<min_height> [<max_height>]] - Show incoming/outgoing transfers within an optional height range - + Rescan blockchain from scratch - + Set an arbitrary string note for a txid - + Get a string note for a txid - + Show wallet status information - + Sign the contents of a file - + Verify a signature on the contents of a file - + Export a signed set of key images - + Import signed key images list and verify their spent status - + Export a set of outputs owned by this wallet - + Import set of outputs owned by this wallet - + set store-tx-info: needs an argument (0 or 1) - + set default-mixin: needs an argument (integer >= 2) - + set auto-refresh: needs an argument (0 or 1) - + set refresh-type: needs an argument: - + full (slowest, no assumptions); optimize-coinbase (fast, assumes the whole coinbase is paid to a single address); no-coinbase (fastest, assumes we receive no coinbase transaction), default (same as optimize-coinbase) - + set priority: needs an argument: 0, 1, 2, or 3 - + set confirm-missing-payment-id: needs an argument (0 or 1) - + usage: set_log <log_level_number_0-4> - + Specify wallet file name (e.g., MyWallet). If the wallet doesn't exist, it will be created. Wallet file name (or Ctrl-C to quit): - + Wallet name not valid. Please try again or use Ctrl-C to quit. - + Wallet and key files found, loading... - + Key file found but not wallet file. Regenerating... - + Key file not found. Failed to open wallet: - + No wallet/key file found with that name. Confirm creation of new wallet named: - + (y)es/(n)o: - + Generating new wallet... - + can't specify more than one of --generate-new-wallet="wallet_name", --wallet-file="wallet_name", --generate-from-view-key="wallet_name", --generate-from-json="jsonfilename" and --generate-from-keys="wallet_name" - + can't specify both --restore-deterministic-wallet and --non-deterministic - + Electrum-style word list failed verification - + bad m_restore_height parameter: - - - - - + + + + + No data supplied, cancelled - - - - + + + + failed to parse address - - + + failed to parse view key secret key - - - - failed to verify view key secret key - - + failed to verify view key secret key + + + + + view key does not match standard address - - - + + + account creation failed - + failed to parse spend key secret key - + failed to verify spend key secret key - + spend key does not match standard address - + failed to open account - + Daemon either is not started or wrong port was passed. Please make sure daemon is running or restart the wallet with the correct daemon address. - - Daemon uses a different RPC version that the wallet: - - - - - Either update one of them, or use --allow-mismatched-daemon-version. - - - - - + + invalid language choice passed. Please try again. - + View key: - + Your wallet has been generated! To start synchronizing with the daemon, use "refresh" command. Use "help" command to see the list of available commands. @@ -1263,509 +1254,509 @@ your wallet again (your wallet keys are NOT at risk in any case). - + You may want to remove the file "%s" and try again - + failed to deinitialize wallet - - + + this command requires a trusted daemon. Enable with --trusted-daemon - + blockchain can't be saved: - - - - - + + + + + daemon is busy. Please try again later. - - - - - + + + + + no connection to daemon. Please make sure daemon is running. - + refresh error: - + Balance: - + pubkey - + key image - - + + unlocked - + ringct - + T - + F - + locked - + RingCT - + - - + payment ID has invalid format, expected 16 or 64 character hex string: - + failed to get spent status - + WARNING: DNSSEC validation was unsuccessful, this address may not be correct! - + For URL: - + Monero Address = - + Is this OK? (Y/n) - + usage: integrated_address [payment ID] - + Integrated address: account %s, payment ID %s - + Standard address: - + failed to parse payment ID or address - + usage: set_tx_note [txid] free text note - + usage: get_tx_note [txid] - + usage: sign <filename> - + wallet is watch-only and cannot sign - - - - + + + + failed to read file - + usage: verify <filename> <address> <signature> - + Bad signature from - + Good signature from - + usage: export_key_images <filename> - + wallet is watch-only and cannot export key images - - + + failed to save file - + Signed key images exported to - + usage: import_key_images <filename> - + usage: export_outputs <filename> - + Outputs exported to - + usage: import_outputs <filename> - + amount is wrong: - + expected number from 0 to - + Money successfully sent, transaction - + no connection to daemon. Please, make sure daemon is running. - - - - + + + + failed to get random outputs to mix - - - - + + + + not enough outputs for specified mixin_count - - - - + + + + output amount - - - - + + + + found outputs to mix - - - - + + + + transaction was not constructed - - - - + + + + transaction %s was rejected by daemon with status: - - - - + + + + one of destinations is zero - + Failed to find a suitable way to split transactions - - - - + + + + unknown transfer error: - + Sweeping - - + + Sweeping %s in %llu transactions for a total fee of %s. Is this okay? (Y/Yes/N/No) - - + + Sweeping %s for a total fee of %s. Is this okay? (Y/Yes/N/No) - - - + + + Money successfully sent, transaction: - + %s change to %s - + no change - + Loaded %lu transactions, for %s, fee %s, %s, %s, with min mixin %lu. %sIs this okay? (Y/Yes/N/No) - + Transaction successfully signed to file - + usage: get_tx_key <txid> - - - - + + + + failed to parse txid - + Tx key: - + no tx keys found for this txid - + usage: check_tx_key <txid> <txkey> <address> - - + + failed to parse tx key - + failed to get transaction from daemon - + failed to parse transaction from daemon - + failed to validate transaction from daemon - + failed to get the right transaction from daemon - + failed to generate key derivation from supplied parameters - + error: - + received - + in txid - + received nothing in txid - + WARNING: this transaction is not yet included in the blockchain! - + This transaction has %u confirmations - + WARNING: failed to determine number of confirmations! - + usage: show_transfers [in|out|all|pending|failed] [<min_height> [<max_height>]] - + bad min_height parameter: - + bad max_height parameter: - + in - - + + out - + failed - + pending - + wallet - + Random payment ID: - + Matching integrated address: @@ -1833,7 +1824,7 @@ your wallet again (your wallet keys are NOT at risk in any case). - + Failed to initialize wallet @@ -1891,86 +1882,86 @@ your wallet again (your wallet keys are NOT at risk in any case). - + failed to read wallet password - + Failed to load file - + Failed to parse JSON - + Version %u too new, we can only grok up to %u - + failed to parse view key secret key - - - + + + failed to verify view key secret key - + failed to parse spend key secret key - - - + + + failed to verify spend key secret key - + Electrum-style word list failed verification - + At least one of Electrum-style word list and private view key must be specified - + Both Electrum-style word list and private key(s) specified - + invalid address - + view key does not match standard address - + spend key does not match standard address - + Cannot create deprecated wallets from JSON - + failed to generate new wallet: @@ -1978,59 +1969,69 @@ your wallet again (your wallet keys are NOT at risk in any case). tools::wallet_rpc_server - + + Invalid IP address given for rpc-bind-ip argument + + + + + The rpc-bind-ip value is listening for unencrypted external connections. Consider SSH tunnel or SSL proxy instead. Override with --confirm-external-bind + + + + Can't specify more than one of --wallet-file and --generate-from-json - + Must specify --wallet-file or --generate-from-json - + Loading wallet... - - + + Storing wallet... - - + + Stored ok - + Loaded ok - + Wallet initialization failed: - + Failed to initialize wallet rpc server - + Starting wallet rpc server - + Stopped wallet rpc server - + Failed to store wallet: @@ -2038,8 +2039,8 @@ your wallet again (your wallet keys are NOT at risk in any case). wallet_args - - + + Wallet options