From 35d62e92e984781b5e56b26fbe9f9435de515526 Mon Sep 17 00:00:00 2001 From: tavo-wasd Date: Sun, 25 Aug 2024 11:55:37 -0600 Subject: [PATCH] dropbox --- X11/xinitrc | 1 + nginx/dropbox.conf | 17 +++++++++++++++++ scripts/dropbox | 9 +++++++++ 3 files changed, 27 insertions(+) create mode 100644 nginx/dropbox.conf create mode 100755 scripts/dropbox diff --git a/X11/xinitrc b/X11/xinitrc index 6406bc1..7924307 100644 --- a/X11/xinitrc +++ b/X11/xinitrc @@ -30,6 +30,7 @@ clear & #xrandr --output DVI-D-0 --right-of HDMI-0 hsetroot -cover /home/tavo/Pictures/Backgrounds/default.jpg & emacs --daemon & +dropbox & sleep 0.2 while true; do diff --git a/nginx/dropbox.conf b/nginx/dropbox.conf new file mode 100644 index 0000000..f12e970 --- /dev/null +++ b/nginx/dropbox.conf @@ -0,0 +1,17 @@ +# apt install apache2-utils +# Note: Omit -c of .htpasswd already exists +# sudo htpasswd -c /etc/apache2/.htpasswd user + +server { + server_name cloud.tavo.one; + + location / { + proxy_pass http://localhost:5000/; + + # proxy_max_temp_file_size 0; + # proxy_buffering off; + + auth_basic "Dropbox"; + auth_basic_user_file /etc/apache2/.htpasswd; + } +} diff --git a/scripts/dropbox b/scripts/dropbox new file mode 100755 index 0000000..a6df8ed --- /dev/null +++ b/scripts/dropbox @@ -0,0 +1,9 @@ +#!/bin/sh + +DROPFOLDER="/home/tavo/Public/dropbox" +PYTHON="python" +PORT=5000 + +if [ -d "${DROPFOLDER}" ] ; then + (cd "${DROPFOLDER}" && "${PYTHON}" -m http.server "${PORT}") +fi