Commit graph

95 commits

Author SHA1 Message Date
zveda 8d4674bd85 This file is for rlwrap for monero 0.10 2016-09-25 00:41:45 +10:00
moneromooo-monero eeb2bbc0fc
epee: optionally restrict HTTP service to a configurable user agent
This is intended to catch traffic coming from a web browser,
so we avoid issues with a web page sending a transfer RPC to
the wallet. Requiring a particular user agent can act as a
simple password scheme, while we wait for 0MQ and proper
authentication to be merged.
2016-09-18 20:32:02 +01:00
redfish 06bb6923c3 cmake: support BUILD_SHARED_LIBS built-in option
Support building internal libraries as shared. This reduces
development time by eliminating the need to re-link all
binaries every time non-interface code in the library changes.
Instead, can hack on libxyz, then `make libxyz`, and re-run
monerod.

By default BUILD_SHARED_LIBS is OFF in release build type,
and ON in debug build type, but can be overriden with -D.
2016-09-18 02:56:26 -04:00
Casey Marshall 823843eadb Fix portability issues discovered with fresh snap install.
ARCH=native fixes SIGILL issues on other amd64 processors.
Static library dependencies where supported.
Package libunbound2 in the snap.
2016-09-11 18:14:38 -05:00
Casey Marshall 0a56d83d3d Add snap packaging.
This adds [snap](https://snapcraft.io) packaging to the project. See the
link for more information on snaps. Snap packages install on all Linux
distributions. On Ubuntu, snap confinement with apparmor and seccomp
provide an additional layer of security.

This snap sets up monerod as a systemd service, which should start
immediately on install. To access the wallet CLI, simply run `monero`
(/snap/bin/monero). I think it's a really quick & easy way to get
started with monero.

I've made some opinionated decisions in the packaging just to kick this
off, but I'm happy to iterate on this stuff.
2016-09-11 11:17:12 -05:00
moneromooo-monero 0d7ce00793
epee: do not try network resolution if loopback worked
Fixes the wallet being unable to connect to the daemon
when there is no NIC.
2016-09-01 18:12:39 +01:00
Riccardo Spagni 18fa01c092
Merge pull request #884
c2ad9ca allow peers without port (moneromooo-monero)
2016-07-06 18:20:17 +02:00
moneromooo-monero c2ad9caf01
allow peers without port
The default port is then used
2016-07-03 12:51:12 +01:00
redfish 72287d121a contrib: epee: add missing noexcept spec to class decl
The noexcept specs were added to make GCC 6.1.1 happy (#846), but this
one was missing (because GCC did not complain about it on Linux, but
does complain on OSX).
2016-06-22 09:05:53 -04:00
Riccardo Spagni 2072c642d1
Merge pull request #862
5dc09f2 wallet_rpc_server: fix some string values being returned between <> (moneromooo-monero)
f8213c0 Require 64/16 characters for payment ids (moneromooo-monero)
2016-06-19 21:51:32 +02:00
moneromooo-monero f8213c0644
Require 64/16 characters for payment ids
The default behavior for hex string parsing would allow the
last digit to be made from a single hexadecimal character,
which is correct, but we typically do not want that as it
gets confusing and easy to not spot wrong input size.
2016-06-19 17:52:39 +01:00
redfish c2d7300d2e contrib: epee: add exception spec to throwing destructors
The destructors get a noexcept(true) spec by default, but these
destructors in fact throw exceptions. An alternative fix might be to not
throw (most if not all of these throws are non-essential
error-reporting/logging).
2016-05-18 01:02:27 -04:00
Riccardo Spagni f03def87ad
Merge pull request #840
1c0bffb Restrict also 'get_connections' and 'getbans' APIs. (osensei)
9f8bc49 Don't allow 'flush_txpool' and 'setbans' JSON_RPC methods when running in restricted mode. (osensei)
2016-05-17 19:09:11 +02:00
osensei 9f8bc4946b Don't allow 'flush_txpool' and 'setbans' JSON_RPC methods when running in restricted mode. 2016-05-14 03:06:04 -03:00
moneromooo-monero d6bce4be36
core: move tx_extra parsing errors to log level 1
They're not fatal, though indicate something wrong
2016-05-01 11:35:06 +01:00
moneromooo-monero 3102feb56c
abstract_tcp_server2: fix send queue limit warning spam
When the send queue limit is reached, it is likely to not drain
any time soon. If we call close on the connection, it will stay
alive, waiting for the queue to drain before actually closing,
and will hit that check again and again. Since the queue size
limit is the reason we're closing in the first place, we call
shutdown directly.
2016-04-17 11:47:22 +01:00
moneromooo-monero 6bca9a8ef4
abstract_tcp_server2: avoid deadlock waiting for send queue to drain
If we reach the send queue size limit, we need to release the lock,
or we will deadlock and it will never drain.

If we reach that limit, it's likely there's another problem in the
first place though, so it will probably not drain in practice either,
unless some kind of transient network timeout.
2016-04-17 11:45:38 +01:00
Riccardo Spagni abea280dd3
Merge pull request #799
aaaf9e2 Fix get_tick_count() on Windows (Howard Chu)
2016-04-06 12:21:14 +09:00
Howard Chu aaaf9e2e6d Fix get_tick_count() on Windows
GetTickCount used in 52056dcfc4
only has ~10-16ms resolution. Use higher rez timer to get 1ms rez.
2016-04-06 03:41:52 +01:00
moneromooo-monero b1aaf20e57
epee: flush output after a message
This is equivalent to line buffering, as C++ seems to lack
a setvbuf equivalent which alows line buffering.
2016-04-02 20:59:24 +01:00
moneromooo-monero 43962f4103
abstract_tcp_server2: possible fix for exception in handle_accept 2016-03-27 12:53:20 +01:00
Riccardo Spagni 51a56e78ae
remove unecessary and bad std::move from portable_storage_template_helper.h 2016-03-25 14:33:58 +02:00
moneromooo-monero f7301c3563
Revert "Print stack trace upon exceptions"
Ain't nobody got time for link/cmake skullduggery.

This reverts commit fff238ec94.
2016-03-21 10:12:23 +00:00
Riccardo Spagni f6317ec1c0
Merge pull request #736
2b4cab3 epee: fix potential hang on exit (moneromooo-monero)
2016-03-20 21:28:11 +02:00
moneromooo-monero 2b4cab30fc
epee: fix potential hang on exit
Also close sockets on failure, just in case
2016-03-20 12:05:55 +00:00
moneromooo-monero fff238ec94
Print stack trace upon exceptions
Useful for debugging users' logs
2016-03-19 21:48:36 +00:00
moneromooo-monero e98b26a87e
epee: fix bug deleting more than one connection at once 2016-03-12 15:36:18 +00:00
Riccardo Spagni dfd0e9c97d
Merge pull request #712
66c2fc7 Need to link boost::chrono in more places now (Howard Chu)
b937a2c Use boost::thread instead of std::thread (Howard Chu)
2016-03-11 20:15:10 +02:00
Howard Chu 52056dcfc4 WIN32 thread_id is OS-dependent not compiler-dependent 2016-03-11 15:46:09 +00:00
Howard Chu b937a2c915 Use boost::thread instead of std::thread
and all other associated IPC
2016-03-11 15:09:50 +00:00
Howard Chu 87d39f39b3 WIN32: Need getpid() declaration 2016-03-11 13:32:50 +00:00
moneromooo-monero 5e3557d2c3
move g_test_dbg_lock_sleep from a global to a function level static
This avoids the need to define that variable in every program
which uses epee.
2016-02-22 19:34:09 +00:00
Howard Chu 11d555cebe Fix crash in std::map for connections_map
Use boost::unordered_map instead.
2016-02-18 21:31:30 +00:00
Howard Chu 014f8868f2 std::condvar is broken on Win32 with gcc/g++ 4.8 too
Use boost...
2016-02-18 21:31:21 +00:00
Howard Chu 7c86c5997d Use boost::thread instead of std::thread
std::thread crashes on (at least) ARMv6 g++ 4.8/4.9
2016-02-18 21:30:10 +00:00
moneromooo-monero 1402a526af
epee: always call the PRNG through the locked API 2016-02-13 20:00:44 +00:00
moneromooo-monero d97582cf95
epee: use generate_random_bytes for new random uuids
Instead of using boost::uuids::generate_random, which uses
uninitialized stuff *on purpose*, just to annoy people who
use valgrind
2016-01-30 18:45:53 +00:00
moneromooo-monero 17c7c9caed
epee: remove dodgy random code that nobody uses
in case someone might want to use it
2016-01-30 18:45:22 +00:00
Riccardo Spagni 153fe0cb75
Merge pull request #622
e514f0a even more typos (Henning Kopp)
9abc4b8 more typos fixed (Henning Kopp)
0693f3c fixed typo (Henning Kopp)
2016-01-25 19:39:07 +02:00
Henning Kopp 9abc4b831b more typos fixed 2016-01-25 13:42:44 +01:00
me0wmix 28f95eb001 OpenBSD support for Monero. 2016-01-21 11:18:26 -07:00
Howard Chu a561afa18b ARM chars are unsigned 2016-01-03 11:57:35 +00:00
Howard Chu ee6f2cb71f IP_TOS not supported before Windows7 2016-01-02 03:10:41 +00:00
Riccardo Spagni de03926850
updated copyright year 2015-12-31 08:39:56 +02:00
moneromooo-monero 22581a0441
epee: regularly cleanup connections we kept a reference to
Since connections from the ::connect method are now kept in
a deque to be able to cancel them on exit, this leaks both
memory and a file descriptor. Here, we clean those up after
30 seconds, to avoid this. 30 seconds is higher then the
5 second timeout used in the async code, so this should be
safe. However, this is an assumption which would break if
that async code was to start relying on longer timeouts.
2015-12-23 11:19:16 +00:00
moneromooo-monero 1e2f2d7da0
epee: fix hang on exit
When the boost ioservice is stopped, pending work notifications
will not happen. This includes deadline timers, which would
otherwise time out the now cancelled I/O operations. When this
happens just after starting a new connect operation, this can
leave that operations in a state where it won't receive either
the completion notification nor a timeout, causing a hang.

This is fixed by keeping a list of connections corresponding
to the connect operations, and cancelling them before stopping
the boost ioservice.

Note that the list of these connections can grow unbounded, as
they're never cleaned up. Cleaning them up would involve
working out which connections do not have any pending work,
and it's not quite clear yet how to go about this.
2015-12-22 12:39:02 +00:00
moneromooo-monero 760331b427
epee: make log macros behave like statements
In particular, make this kind of thing do what one expects
it to do:

if (x) LOG_PRINT("True"); else LOG_PRINT("No");
2015-12-19 14:48:52 +00:00
moneromooo-monero 4cede1830e
console_handler: catch exception inside the input loop
This prevents an exception from existing the loop without
calling the exit handler, if one is defined.
The daemon defines one, which stops the p2p layer, and will
only exit once the p2p layer is shut down. This would cause
a hang upon an exception, as the input thread would have
exited and the daemon would wait forever with no console
user input.
2015-12-06 22:03:53 +00:00
Riccardo Spagni bc1bc4adb2
Merge pull request #507
62e49a5 wallet: optional automatic refresh from the daemon (moneromooo-monero)
2015-11-30 00:19:47 +02:00
moneromooo-monero 62e49a5f02
wallet: optional automatic refresh from the daemon
The daemon will be polled every 90 seconds for new blocks.
It is enabled by default, and can be turned on/off with
set auto-refresh 1 and set auto-refresh 0 in the wallet.
2015-11-28 12:41:06 +00:00