Skip to content

Instantly share code, notes, and snippets.

@mt7479
Created March 31, 2016 12:50
Show Gist options
  • Save mt7479/5f8fdbd1d9fc25172c1aea6159fbbe2b to your computer and use it in GitHub Desktop.
Save mt7479/5f8fdbd1d9fc25172c1aea6159fbbe2b to your computer and use it in GitHub Desktop.

Some short instructions for the people struggling with the installation (debian/ubuntu). This will install the dependencies inside a python virtualenv.

install python 3.4 and virutalenv

sudo apt-get install python3.4 python-virtualenv

clone the repository

git clone https://github.com/siacs/HttpUploadComponent httpupload
cd httpupload

create virtualenv and install dependencies

virtualenv -p /usr/bin/python3.4 venv
source venv/bin/activate
pip install -r requirements.txt

For more info see: http://docs.python-guide.org/en/latest/dev/virtualenvs

create config

cp config.example.yml config.yml

Open the config file with your favourite editor and change to your needs.

use it

At this point you should be able to start the server with: python httpupload/server.py

After you're done testing exit the virtualenv with deactivate

systemd service file

Since httpuploadcomponent is running in a virtualenv you will a need a slightly different service file then the one provided in the contrib directory.

[Unit]
Description=XMPP component for HTTP file uploads
After=network.target

[Service]
Type=simple
Restart=always

Environment=VIRTUAL_ENV=/opt/httpupload/venv
Environment=PATH=$VIRTUAL_ENV/bin:$PATH

ExecStart=/opt/httpupload/venv/bin/python /opt/httpupload/httpupload/server.py
WorkingDirectory=/opt/httpupload

User=www-data

[Install]
WantedBy=multi-user.target

If you cloned the repository somewhere else be sure to adopt to your path.

I assume you're are going to proxy file uploads/downloads through a web server hence the www-data user.

This should leave you with a working installation of httpuploadcomponent. You still will have to tell your xmpp server about the component and configure your web server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment