--- /dev/null
+#!/bin/sh
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+. /etc/environment
+
+# Kill authentication server if already present.
+[ ! -z $(pgrep --full ".*gdrive_knife.*") ] && pkill --full ".*gdrive_knife.*"
+
+. ./auth.sh || exit 0
+
+FILES=$(python3 -u -m gdrive_knife 2>&1 list --token ${gdrive_auth_token})
+
+format_files() {
+ echo ${FILES} | xargs --replace={} --delimiter=" " echo "${1}"
+}
+
+echo "HTTP/1.1 200 OK"
+echo "Content-type: text/html"
+echo "
+<!DOCTYPE html>
+<html>
+<head>
+ <title>GdriveProxy</title>
+ <style>
+ body {
+ border: ridge 5px;
+ max-width: max-content;
+ }
+ .container {
+ background-color: PowderBlue;
+ padding: 7px;
+ }
+ form {
+ display: flex;
+ flex-direction: column;
+ row-gap: 10px;
+ }
+ button {
+ align-self: end;
+ }
+ </style>
+</head>
+<body>
+ <div class='container'>
+ <h3>Upload</h3>
+ <form action='/upload' method='post' enctype='multipart/form-data'>
+ <input type='file' name='file' required />
+ <input type='text' name='name' pattern='[a-zA-Z0-9_\/]*' required
+ placeholder='Name on drive' />
+ <button type='submit'>Upload</button>
+ </form>
+
+ <hr />
+
+ <h3>Download</h3>
+ <form action='/download'>
+ <select id='name' name='name'>
+ $(format_files "<option value='{}'>{}</option>")
+ </select>
+ <button type='submit'>Download</button>
+ </form>
+
+ <hr />
+
+ <h3>Delete</h3>
+ <form action='/delete'>
+ <select id='name' name='name'>
+ $(format_files "<option value='{}'>{}</option>")
+ </select>
+ <button type='submit'>Delete</button>
+ </form>
+ </div>
+</body>
+</html>"