summaryrefslogtreecommitdiff
path: root/src/ostree/ostree-trivial-httpd.c
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* ostree/trivial-httpd: Add Last-Modified/ETag supportPhilip Withnall2020-10-221-18/+80
| | | | | | | | | This is basic support for the Last-Modified/ETag/If-Modified-Since/If-None-Match headers. It’s not high performance, and doesn’t support all of the related caching features (like the If-Match header, etc.). Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* ostree/trivial-httpd: Add log message for autoexitDan Nicholson2020-01-241-0/+1
| | | | | This is useful when checking if the daemon actually exited since we don't store the child PID anywhere.
* ostree/trivial-httpd: Fix --autoexit with --daemonize and --log-fileDan Nicholson2020-01-241-31/+110
| | | | | | | | | | | | | | | | | | | | When --autoexit is used with --daemonize and --log-file, the program never exits when the root directory is deleted. I believe what happens is that g_file_new_for_path triggers the glib worker context to be started to talk to GVfs. Once the program forks, the parent exits and the thread iterating the worker context is gone. The file monitor then never receives any events because the inotify helper also runs from the worker context. Move the fork earlier just after parsing and validating the command line arguments. In order to handle setup errors in the child, a pipe is opened and the parents waits until the child writes a status byte to it. If the byte is 0, the parent considers the child setup successful and exits and the child carries on as a daemon. Notably, the child doesn't reopen stderr to /dev/null until after this so that it can send error messages there. Fixes: #1941
* pull: Add support for basic authColin Walters2019-12-021-0/+18
| | | | | This has been requested a few times for people delivering OSTree content and wanting to do access control.
* ostree/trivial-httpd: Add --random-408s command line optionPhilip Withnall2018-05-301-0/+20
| | | | | | | | | | | | | | This is exactly like the --random-500s option, except that it will cause error 408 (request timeout) to be returned, rather than error 500 (internal server error). This will be used in a following commit to test pull behaviour when timeouts occur. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1594 Approved by: jlebon
* main, status: Factor out deployment printing into helperColin Walters2018-03-191-9/+4
| | | | | | | | | | | | | Prep for staged deployments; they won't be in the primary deployment list, and we want to print them first. Also pull in some code from rpm-ostree for the red/bold bits and use that tree-wide. Update submodule: libglnx Closes: #1504 Approved by: jlebon
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* tree-wide: Update to new libglnx fd APIsColin Walters2017-10-111-1/+1
| | | | | | | | | | | | | | | | | | | This ends up a lot better IMO. This commit is *mostly* just `s/glnx_close_fd/glnx_autofd`, but there's also a number of hunks like: ``` - if (self->sysroot_fd != -1) - { - (void) close (self->sysroot_fd); - self->sysroot_fd = -1; - } + glnx_close_fd (&self->sysroot_fd); ``` Update submodule: libglnx Closes: #1259 Approved by: jlebon
* tree-wide: Remove Emacs modelinesColin Walters2017-09-211-2/+1
| | | | | | | | | We added a `.dir-locals.el` in commit: 9a77017d87b74c5e2895cdd64ad098018929403f There's no need to have it per-file, with that people might think to add other editors, which is the wrong direction. Closes: #1206 Approved by: jlebon
* ostree: Add naggy comments to help keep options in syncMatthew Barnes2017-08-151-0/+5
| | | | | | | | | | /* ATTENTION: * Please remember to update the bash-completion script (bash/ostree) and * man page (man/ostree-$COMMANDNAME.xml) when changing the option list. */ Closes: #1080 Approved by: cgwalters
* tests: Add some return value checking to pacify CoverityColin Walters2017-08-021-1/+1
| | | | | | | | | | | No real problems here, but Coverity likes to see consistent checking of return values, and I agree with it. Coverity CID: 1452213 Coverity CID: 1452211 Closes: #1037 Approved by: jlebon
* tree-wide: Switch tabs ⭾ in various files over to spaces ␠Colin Walters2017-05-111-4/+4
| | | | | | | | | | | | As $DEITY intended. I was reading the `prepare-root.c` code and the indentation damage was distracting. Squash tabs that have leaked into various places in the code. I didn't yet touch the `src/libostree` bits as that has higher potential for conflict. Closes: #852 Approved by: jlebon
* tree-wide: Squash noncritical compiler warningsColin Walters2017-02-241-4/+7
| | | | | | | | | | | | | | | Should fix everything from <https://kojipkgs.fedoraproject.org//packages/ostree/2017.2/3.fc25/data/logs/x86_64/build.log> Anything that uses autocleanups should *always* be initialized directly I think, even if a few lines down we directly assign, since this way it's more robust against refactoring. And the `freopen()` warnings are right - IMO we should *always* check return values. Closes: #711 Approved by: jlebon
* trivial-httpd: trivial option help string fixesJonathan Lebon2017-01-261-2/+2
| | | | | | | | | | Add an arg description for -P, otherwise it's not immediately obvious that it takes an argument. Mention that - is supported for --log-file. Closes: #657 Approved by: cgwalters
* trivial-httpd: Daemonize betterColin Walters2017-01-121-2/+6
| | | | | | | | | | | I was trying to debug `test-pull-c`, and typing `Ctrl-C` in gdb ended up sending `SIGINT` to trivial-httpd as well, killing it. Daemonize a bit more properly to avoid this. I also followed the standard `/dev/null` guidelines. Closes: #643 Approved by: jlebon
* Split trivial-httpd into separate binaryColin Walters2017-01-041-0/+683
Working on the libcurl backend, I hit the issue that the trivial-httpd program depends on libsoup. I briefly considered having two versions, but libcurl is client only, and moreover trivial-httpd is no longer trivial - it has various features which are used by the test suite extensively. Hence, what we'll do is build it as a separate binary which links to libsoup, and use it during the tests. We *also* currently still provide `ostree trivial-httpd` since some things use it like `rpm-ostree-toolbox` and the Cockpit tests. After those are ported to use some other webserver, I plan to add a build-time option to drop it. Closes: #636 Approved by: jlebon