- Install Python and PIP
sudo apt-get install python3.4 python3-pip
- Clone the repo somewhere
git clone https://github.com/siacs/HttpUploadComponent httpupload
cd httpupload
- Install dependencies
sudo pip3 install -r requirements.txt
- Create config file
cp config.example.yml config.yml
- Edit config file Some of the things I set:
storage_path : /var/lib/prosody/http_upload
# Add all your hosts
whitelist:
- domain.tld
# We use nginx so this can just be
http_address: 127.0.0.1
http_port: 8080
# But the urls must have https
get_url : https://upload.domain.tld
put_url : https://upload.domain.tld
-
Add Prosody config: see
prosody.cfg.lua
-
Restart Prosody:
sudo service prosody restart
-
Configure init script and start:
sudo nano /etc/init.d/httpupload # see `httpupload` file
sudo chmod +x /etc/init.d/httpupload
sudo update-rc.d httpupload defaults
# run httpupload
sudo service httpupload start
-
Configure nginx: see
upload.nginx.conf
file -
Restart nginx:
sudo service nginx reload
-
Then the tricky part that took me long. Since we are serving the files directly from Nginx, we need to set the proper permissions to the directories.
sudo mkdir -p /var/lib/prosody/http_upload
sudo chmod +x -R /var/lib/prosody/
sudo chown prosody:www-data -R /var/lib/prosody/http_upload
sudo chmod 755 -R /var/lib/prosody/http_upload
I guess that's all, hopefully I did not forget something. You can find me on Jabber at steven@roose.ch or e-mail stevenroose@gmail.com.
You don't need the
disco_items
setting if your parent domain matches the upload domain.upload.example.com
matchesexample.com
so it should be discovered automatically.