Enable hot-reloading of web configuration (pinned repos, avatar, banner,
description) by sending SIGHUP to the process, eliminating the need for
server restarts when updating these settings.
Co-authored-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Try to determine the mime type of a file first based on its path, then
based on its content.
The previous behavior (looking only at the file content) inferred a
mime type of `text/xml` for `.svg` files (instead of `image/svg+xml`)
which prevented them from being shown when embedded e.g. in a markdown
document.
Required:
- removing the #[async_trait] declarations since that has been
stabilized in rust.
- axum 0.8.0 introduced new endpoints declarations with curly brackets.
This seems to be helping since GitHub changed the behavior of the rustup
toolchain install from the default profile to a minimal which excludes
fmt and clippy
source: https://github.com/rust-lang/rustup/issues/4337
Instead of hardcoding the version of the Rust alpine file, introduce an
`ARG` in
the `Dockerfile`. In `build/build`, we determine the version by
inspecting
`rust-toolchain.toml`, and pass this value in. This ensures that the
binaries
are built using the same toolchain that we develop with.
Co-authored-by: Fintan Halpenny <fintan.halpenny@gmail.com>
The `-c` argument (and its corresponding value) must come *before* the
first subcommand to be effective. This error was introduced in commit
5f22e1bb77.
1. When `git archive` errors, do not require an exit code, but just use
the `ExitStatus` we already have. This requires less unwrapping.
Also, the previous default of 0 was misleading, since 0 is returned
upon successful termination.
2. Use "refname" instead of "refspec" as these are different concepts.
Refer to <https://git-scm.com/docs/git-check-ref-format> and in
particular
<https://git-scm.com/docs/git-check-ref-format#Documentation/git-check-ref-format.txt---refspec-pattern>.
3. Only allow appending ".tar.gz" to commit IDs, not to refnames,
because refnames may contain the suffix ".tar.gz". It might look
weird, but it is not forbidden to do `git branch foo.tar.gz`.
4. `char::is_ascii` does not help sanitize refnames to file names. In
particular we have `'/'.is_ascii() == true`. Replace forward slashes
with two underscores.
Instead of panicking when trying to handle non utf8 lines we should
return `null` as line output.
This way we can on the frontend detect if a file has any lines the api
wasn't able to parse and fallback to show a file as a `Binary File`
Turns out "content-type: text; charset=utf-8" wasn't valid, it had to be
"content-type: text/plain; charset=utf-8" for browsers to recognise it
properly.