From commits-return-21500-archive-asf-public=cust-asf.ponee.io@airavata.apache.org Wed Oct 16 19:15:34 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 159E218067E for ; Wed, 16 Oct 2019 21:15:33 +0200 (CEST) Received: (qmail 87616 invoked by uid 500); 16 Oct 2019 19:15:33 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 87533 invoked by uid 99); 16 Oct 2019 19:15:33 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Oct 2019 19:15:33 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id ABBF6811CC; Wed, 16 Oct 2019 19:15:32 +0000 (UTC) Date: Wed, 16 Oct 2019 19:15:34 +0000 To: "commits@airavata.apache.org" Subject: [airavata-django-portal] 02/02: AIRAVATA-3081 docs: tusd installation notes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: machristie@apache.org In-Reply-To: <157125333221.28290.14256209697733023043@gitbox.apache.org> References: <157125333221.28290.14256209697733023043@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: airavata-django-portal X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: daefdb43a5849aa7388aa4ba2ebc5b0b1dc00dc7 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20191016191532.ABBF6811CC@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. machristie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git commit daefdb43a5849aa7388aa4ba2ebc5b0b1dc00dc7 Author: Marcus Christie AuthorDate: Wed Oct 16 15:13:21 2019 -0400 AIRAVATA-3081 docs: tusd installation notes --- django_airavata/settings_local.py.sample | 6 +++ docs/admin/tusd.md | 85 ++++++++++++++++++++++++++++++++ mkdocs.yml | 2 + 3 files changed, 93 insertions(+) diff --git a/django_airavata/settings_local.py.sample b/django_airavata/settings_local.py.sample index 8a15edd..d36b38c 100644 --- a/django_airavata/settings_local.py.sample +++ b/django_airavata/settings_local.py.sample @@ -97,6 +97,12 @@ SHARING_API_SECURE = False # Portal settings PORTAL_TITLE = 'Django Airavata Gateway' +# Tus upload - uncomment the following to enable tus uploads +# Override and set to a valid tus endpoint +# TUS_ENDPOINT = "https://tus.domainname.org/files/" +# Override and set to the directory where tus uploads will be stored. +# TUS_DATA_DIR = "/path/to/tus-temp-dir" + # Logging configuration. Uncomment following to override default log configuration # LOGGING = { # 'version': 1, diff --git a/docs/admin/tusd.md b/docs/admin/tusd.md new file mode 100644 index 0000000..774ffdc --- /dev/null +++ b/docs/admin/tusd.md @@ -0,0 +1,85 @@ +# tusd + +[tusd](https://github.com/tus/tusd) is the reference implementation of the +[tus resumable upload protocol](https://tus.io/). The Airavata Django Portal +integrates with tus to provide better support for large file uploads. Installing +tusd and integrating with the Airavata Django Portal is entirely optional but is +highly recommended if your users will be uploading files larger than, say, 1 GB. + +## Installation Notes + +!!! note + + Version 1.0 of tusd introduces some breaking changes. The Airavata Django + Portal has been tested with version 0.13 of tusd. + +Install +[version 0.13.3 of tusd](https://github.com/tus/tusd/releases/tag/0.13.3) from +the GitHub releases page. + +How you install tusd is up to you, but here are some notes on a specific way to +deploy it. + +### Reverse proxy behind Apache httpd + +Create a virtual host config file, for example in `/etc/httpd/conf.d/tus.conf`. +(Actual location of config files is OS dependent.) + +Contents of tus.conf: + +```xml + + ServerName tus.domainname.org + SSLEngine on + + SSLCertificateChainFile /etc/letsencrypt/live/tus.domainname.org/fullchain.pem + SSLCertificateFile /etc/letsencrypt/live/tus.domainname.org/cert.pem + SSLCertificateKeyFile /etc/letsencrypt/live/tus.domainname.org/privkey.pem + + RequestHeader set X-Forwarded-Proto "https" + ProxyPreserveHost on + + ProxyPass /files http://localhost:10080/files + ProxyPassReverse /files http://localhost:10080/files + +``` + +Note this example assumes that the tus server willl be proxied behind an SSL +connection and specifically that the SSL certificate will be generated with +Let's Encrypt. + +With this configuration the **TUS_ENDPOINT** will be +`https://tus.domainname.org/files/` + +### Systemd unit file + +Add the following `tus.service` file to `/etc/systemd/system/`. + +```ini +[Unit] +Description=Tusd + +[Service] +ExecStart=/home/PORTALUSER/tusd_linux_amd64/tusd -dir /path/to/tus-temp-dir -port 10080 -behind-proxy +User=PORTALUSER +Group=PORTALUSER + +[Install] +WantedBy=multi-user.target +``` + +Replace `PORTALUSER` with the username of the user under which the Django portal +runs. + +With this configuration, the **TUS_DATA_DIR** will be `/path/to/tus-temp-dir` + +## settings_local.py configuration + +Uncomment and set the following settings in settings_local.py, assuming you +created the settings_local.py file by first copying settings_local.py.sample. + +- **TUS_ENDPOINT** - this should be the tus url. Keeping with the example + above this would be `https://tus.domainname.org/files/` +- **TUS_DATA_DIR** - this is the directory where tus upload files and metadata + will be stored. This settings assumes that tusd the tus server used and so + it assumes that file naming conventions will follow the tusd implementation. diff --git a/mkdocs.yml b/mkdocs.yml index 5294472..af6dfd8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,6 +11,8 @@ nav: - Adding a Custom Django App: dev/custom_django_app.md - Developing the Frontend: dev/developing_frontend.md - Developing the Backend: dev/developing_backend.md + - Administrator Guide: + - Tusd Installation: admin/tusd.md - Tutorials: - Gateways 2019: tutorial/gateways2019_tutorial.md