mivirl [Sun, 2 Jun 2024 17:55:26 +0000 (12:55 -0500)]
server,client: Implement ssl/tls encryption
The server and client now use ssl to communicate, with certificates
generated by `cert-server.pl`.
Clients connect to the cert-server to request a certificate using a
password. After receiving a certificate they can connect to the server
and start sending logs.
Rewrote the server in perl to facilitate use of encryption.
Removed use of actually portable perl due to the prebuilt binary not
including IO::Socket::SSL and Net::SSLeay. Rebuilding the perl binary
would be required to use encryption, so the system perl will be used
instead.
mivirl [Sun, 3 Mar 2024 01:06:49 +0000 (19:06 -0600)]
server: Add retries with random backoff for file uploads
When binding a port on the server side, there's a chance that another
process has already bound the port. Retries a few times with a random
backoff to reduce the number of collisions
Future versions will reduce the number of ports used by the server,
and this change makes it possible with fewer issues.
mivirl [Wed, 7 Feb 2024 16:57:01 +0000 (10:57 -0600)]
server: Remove .log and .cmdlog suffixes
Removed suffixes from uploaded files since the prefixes already identify
the type of file, and many logs already have the .log suffix which
results in names like "L__service.log.log".
mivirl [Wed, 7 Feb 2024 16:24:44 +0000 (10:24 -0600)]
client: Don't monitor non-text logs
When recursively adding logs from /var/log , logs that appear to be
binary files will not be continuously monitored, only uploaded once.
Otherwise files that aren't append-only may be corrupted
mivirl [Fri, 26 Jan 2024 01:16:14 +0000 (19:16 -0600)]
Add recursive file function
- Added function to get all files in directory recursively
- Add default monitoring to files in /var/log/
- Increase maximum number of concurrent connections to server
mivirl [Thu, 25 Jan 2024 18:41:17 +0000 (12:41 -0600)]
Use client-specified hostname
Use client-specified hostname when the server gives a name to the
client. The name is stripped to only contain a-zA-Z and limited to
a length of 16 characters.
mivirl [Thu, 25 Jan 2024 05:19:35 +0000 (23:19 -0600)]
Send filepaths to server
Send a unicode character to replace the / when sending filepaths for logs and other files. Gives more descriptive filenames which can be displayed at the same directory level.
mivirl [Thu, 25 Jan 2024 05:15:40 +0000 (23:15 -0600)]
Add file existence checks; forking -> exit; fork for inotifywatch
- Added checks for file existence before attempting to upload, which can in theory esult in race conditions, but in this case doesn't matter that much.
- Changed forking subroutines to exit instead of return, to prevent forked versions of the script from re-running the same commands
- Changed inotifywatch subroutine to fork
mivirl [Thu, 25 Jan 2024 05:06:35 +0000 (23:06 -0600)]
Update start-server script
- Removed file server, since it's not currently used
- Fixed tcpsvd listen ip to accept connections from other machines
- Changed shebang to use busybox