summaryrefslogtreecommitdiffstats
path: root/tv/2configs/elm-packages-proxy.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-11-23 16:02:06 +0100
committertv <tv@krebsco.de>2020-11-23 16:02:06 +0100
commitfe4d6d217f2e26dca3412b5d682ac830e2ec7141 (patch)
tree9e20362bc6b1ea04941ca3d40093035897cc3bea /tv/2configs/elm-packages-proxy.nix
parentf9e11a96488d5404cab04244b044d7be371eb45e (diff)
tv elm-package-proxy: log uploads
Diffstat (limited to 'tv/2configs/elm-packages-proxy.nix')
-rw-r--r--tv/2configs/elm-packages-proxy.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/tv/2configs/elm-packages-proxy.nix b/tv/2configs/elm-packages-proxy.nix
index cc1e119cb..7961bce37 100644
--- a/tv/2configs/elm-packages-proxy.nix
+++ b/tv/2configs/elm-packages-proxy.nix
@@ -28,6 +28,7 @@ in {
auth_basic "Restricted Area";
auth_basic_user_file ${cfg.htpasswd};
+ proxy_set_header X-User $remote_user;
proxy_set_header X-Author $author;
proxy_set_header X-Package $pname;
proxy_set_header X-Version $version;
@@ -146,6 +147,7 @@ in {
author=$req_x_author
pname=$req_x_package
+ user=$req_x_user
version=$req_x_version
zipball=${cfg.packageDir}/$author/$pname/$version/zipball
@@ -155,6 +157,7 @@ in {
"package already exists: $author/$pname@$version" \
text/plain
else
+ echo "user $user is uploading package $pname@$version" >&2
mkdir -p "$(dirname "$zipball")"
head -c $req_content_length > "$zipball"
string_response 200 OK \