]>
git.ipfire.org Git - pakfire.git/log
Michael Tremer [Wed, 9 Oct 2024 13:53:54 +0000 (13:53 +0000)]
cli: Fix broken include guard
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 9 Oct 2024 13:41:00 +0000 (13:41 +0000)]
xfer: Compile even if cURL does not have support for WebSockets
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 9 Oct 2024 13:38:26 +0000 (13:38 +0000)]
xfer: Support compiling with older versions of cURL
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 9 Oct 2024 13:19:08 +0000 (13:19 +0000)]
transaction: Don't declare anything after the label
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 9 Oct 2024 13:09:18 +0000 (13:09 +0000)]
libpakfire: Set __attribute__((format(...))) wherever needed
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 9 Oct 2024 13:07:26 +0000 (13:07 +0000)]
build: Replace the bitfield with a state enum
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 9 Oct 2024 13:06:56 +0000 (13:06 +0000)]
file: Don't declare hardlink in the switch statement
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Wed, 9 Oct 2024 13:06:29 +0000 (13:06 +0000)]
log stream: Initialize r in case events was zero
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 8 Oct 2024 15:48:16 +0000 (15:48 +0000)]
os: Make more space for the distro information
ArchLinux is using a longer version_id with timestamps which is why we
need some more space here. There is no point in being too tight with
this.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 8 Oct 2024 13:41:43 +0000 (13:41 +0000)]
configure: Drop dependencies on Python modules
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 18:07:35 +0000 (18:07 +0000)]
pty: Don't fail if standard input/output are not TTYs
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 18:07:08 +0000 (18:07 +0000)]
jail: Make it easier to configure the jail as interactive
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 17:48:18 +0000 (17:48 +0000)]
pty: Fallback to the original file descriptor if the clone fails
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 17:38:56 +0000 (17:38 +0000)]
cli: shell: Implement running commands via CLI
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 17:23:38 +0000 (17:23 +0000)]
libpakfire: Remove the shell convenience function
This is not very flexible.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 17:21:34 +0000 (17:21 +0000)]
cli: shell: Make sure packages is always initialized and terminated by NULL
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 17:20:30 +0000 (17:20 +0000)]
cli: Parse the correct option for packages
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 16:57:46 +0000 (16:57 +0000)]
pty: Fix setting raw mode
If the standard input & output share the same inode, we can't overwrite
the attributes and need to take care of this.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 14:58:27 +0000 (14:58 +0000)]
pty: Re-open standard input/output
This is helpful so that we don't have to worry about resetting the
original file descriptors in case we crash unintentionally.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 14:57:44 +0000 (14:57 +0000)]
pty: Reset file-descriptors into blocking mode again when done
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 14:12:13 +0000 (14:12 +0000)]
pty: Don't open standard input in read-only mode
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 14:04:14 +0000 (14:04 +0000)]
pty: Always enable forwarding
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 13:59:09 +0000 (13:59 +0000)]
pty: Terminate if we encountered an error
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 13:54:25 +0000 (13:54 +0000)]
pty: Disconnect as early as possible
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 13:46:21 +0000 (13:46 +0000)]
pty: Implement draining the buffers
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 12:57:10 +0000 (12:57 +0000)]
pty: Handle resizing the terminal window
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 12:47:34 +0000 (12:47 +0000)]
pty: Store events and add a description
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 12:39:09 +0000 (12:39 +0000)]
pty: Be less smart about the forwarding and make it work again
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 6 Oct 2024 12:14:12 +0000 (12:14 +0000)]
jail: Move the PTY into an extra file
The code for this is rather large and makes jail.c almost unreadable.
This patch does not move the entire feature over just yet, but it is a
start.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 17:38:24 +0000 (17:38 +0000)]
jail: Block SIGCHLD
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 17:30:44 +0000 (17:30 +0000)]
jail: Actually call the new event loop
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 17:27:16 +0000 (17:27 +0000)]
jail: Move the timer into the event loop
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 17:15:22 +0000 (17:15 +0000)]
jail: Catch any PID events by the event loop
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 16:56:18 +0000 (16:56 +0000)]
jail: Use new log streamer
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 16:31:32 +0000 (16:31 +0000)]
logging: Create an abstraction to stream log lines from a child process
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 15:34:05 +0000 (15:34 +0000)]
jail: Create a new systemd event loop
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 15:22:01 +0000 (15:22 +0000)]
jail: Remove the legacy logger
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 15:15:45 +0000 (15:15 +0000)]
build: Remove the build and legacy logger
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 14:54:25 +0000 (14:54 +0000)]
cli: build: No longer use the build logger
We have so many loggers and we need to remove a few...
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 14:43:24 +0000 (14:43 +0000)]
ctx: Move the magic context to here
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 14:35:50 +0000 (14:35 +0000)]
python: Remove build/mkimage/shell from the Pakfire object
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 14:32:08 +0000 (14:32 +0000)]
python: Remove the build service implementation wrapper
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 14:28:57 +0000 (14:28 +0000)]
python: Remove the Python daemon implementation
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 14:28:31 +0000 (14:28 +0000)]
job: Fix typo
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 14:18:26 +0000 (14:18 +0000)]
job: Send log messages to the build service
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 14:16:48 +0000 (14:16 +0000)]
util: Implement adding strings with length to a JSON object
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 13:41:54 +0000 (13:41 +0000)]
xfer: Make the WebSocket send callback more sensible
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 13:30:34 +0000 (13:30 +0000)]
job: Buffer log lines in a ring buffer
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 13:29:42 +0000 (13:29 +0000)]
logging: Add a simple ring buffer for buffering log lines
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 12:41:37 +0000 (12:41 +0000)]
job: Pipe any log output back to the parent process
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 10:55:48 +0000 (10:55 +0000)]
job: Create an own independant context for the child process
This prevents us to inherit anything from the parent process and allows
us to run a totally different configuration in the child.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sat, 5 Oct 2024 10:49:56 +0000 (10:49 +0000)]
job: Create scaffolding to run a build
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 18:24:11 +0000 (18:24 +0000)]
job: Fix replace error in flags
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 18:09:06 +0000 (18:09 +0000)]
job: Initialize Pakfire in the child process
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 17:50:29 +0000 (17:50 +0000)]
jobs: Have them monitor themselves and update their state
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 17:41:24 +0000 (17:41 +0000)]
jobs: Automatically launch jobs once it has connected to the build service
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 17:33:23 +0000 (17:33 +0000)]
job: Show what job we are connecting to
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 17:29:56 +0000 (17:29 +0000)]
xfer: Should more detail when a transfer fails
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 17:08:47 +0000 (17:08 +0000)]
daemon: Rename workers to jobs
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 16:45:39 +0000 (16:45 +0000)]
daemon: Remove the worker's own HTTP client and event loop
It makes no sense to duplicate so much code, so the control connection
of the worker will have to run in the main process, too.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 16:01:22 +0000 (16:01 +0000)]
worker: Store a reference to the daemon's HTTP client
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 15:53:59 +0000 (15:53 +0000)]
worker: Fetch the daemon's event loop
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 15:40:29 +0000 (15:40 +0000)]
daemon: Terminate all workers when terminating
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 14:20:37 +0000 (14:20 +0000)]
worker: Initialize the event loop and cURL in the child process
cURL is not multi-threaded and so to avoid any problems, we will
initialize everything in the forked child process.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 13:47:40 +0000 (13:47 +0000)]
worker: Establish a control connection
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 13:32:29 +0000 (13:32 +0000)]
buildservice: Use new URL formatting feature
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 13:23:01 +0000 (13:23 +0000)]
xfer: Make it easier to format URLs
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 12:59:41 +0000 (12:59 +0000)]
worker: Create our own event loop and HTTP client
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Fri, 4 Oct 2024 12:41:30 +0000 (12:41 +0000)]
daemon: Connect the worker with the daemon
The daemon will now process when the worker exits and at least clean up.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 04:56:35 +0000 (04:56 +0000)]
util: Move the clone3() wrapper
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 04:50:29 +0000 (04:50 +0000)]
daemon: Fix format of the stats message
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 04:38:33 +0000 (04:38 +0000)]
daemon: Enable stat submission only when we have a control connection
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 04:17:18 +0000 (04:17 +0000)]
daemon: Build out submitting stats
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 04:15:53 +0000 (04:15 +0000)]
util: Add JSON helper function for unsigned integers
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 04:12:44 +0000 (04:12 +0000)]
util: Rename JSON function to add integers to int64
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 04:12:09 +0000 (04:12 +0000)]
util: Add new helper function to add double values to JSON objects
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 04:03:50 +0000 (04:03 +0000)]
util: Don't require a reference to pakfire for the JSON functions
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 03:40:57 +0000 (03:40 +0000)]
_pakfire: buildservice: Remove submit_stats()
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 03:40:34 +0000 (03:40 +0000)]
daemon: Keep the stats timer running continuously
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 03:37:33 +0000 (03:37 +0000)]
daemon: Send dummy stats using the event loop
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 03:36:58 +0000 (03:36 +0000)]
xfer: Implement sending a WebSocket message
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 03:20:47 +0000 (03:20 +0000)]
buildservice: Remove the event loop
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 03:15:34 +0000 (03:15 +0000)]
daemon: Remove the buildservice
It is becoming too complicated to make the buildservice event-driven
when it does not need to be. It can live as a single request abstraction
model.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 02:54:01 +0000 (02:54 +0000)]
buildservice: Remove holding the base URL
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 02:53:19 +0000 (02:53 +0000)]
httpclient: Set the base URL for new xfers
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 02:52:53 +0000 (02:52 +0000)]
httpclient: Add option to set a base URL
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 02:37:17 +0000 (02:37 +0000)]
daemon: Submit stats regularly
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 02:36:36 +0000 (02:36 +0000)]
buildservice: Tidy up creating the daemon control connection
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Sun, 15 Sep 2024 02:16:01 +0000 (02:16 +0000)]
buildservice: Enable authentication when uploading the payload
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 13 Aug 2024 19:36:31 +0000 (19:36 +0000)]
daemon: Register any workers
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 13 Aug 2024 19:29:55 +0000 (19:29 +0000)]
daemon: Split stuff into a new worker thing
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 13 Aug 2024 19:11:03 +0000 (19:11 +0000)]
xfer: Ignore CURLE_AGAIN
This is happening when the server is sending a ping over WebSocket which
triggers the socket, but there is no data for us to deal with as it has
already been handled by cURL.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 13 Aug 2024 18:54:15 +0000 (18:54 +0000)]
xfer: Fail if the connection was unexpectedly closed
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 13 Aug 2024 18:53:56 +0000 (18:53 +0000)]
xfer: Free the allocated buffer
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 13 Aug 2024 18:47:55 +0000 (18:47 +0000)]
daemon: Parse the received job
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 13 Aug 2024 18:04:29 +0000 (18:04 +0000)]
daemon: Automatically try to reconnect when the connection gets lost
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 13 Aug 2024 17:32:26 +0000 (17:32 +0000)]
xfer: Refactor handling any transfer problems and call the close callback
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 13 Aug 2024 17:18:05 +0000 (17:18 +0000)]
buildservice: Move daemon stuff to the daemon
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Tue, 13 Aug 2024 16:54:58 +0000 (16:54 +0000)]
httpclient: Implement basic WebSocket communication
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Michael Tremer [Mon, 12 Aug 2024 17:23:14 +0000 (17:23 +0000)]
xfer: Send authentication headers straight away when asked to
We don't need to check whether the server does not require
authentication first.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>