Home

Awesome

Wagtail Secret Sharing

Version CI

A secure sharing app for Wagtail using django-secret-sharing.

Features

Requirements

Installation

Install the package

pip install wagtail-secret-sharing

Add wagtail.contrib.routable_page, django_secret_sharing and wagtail_secret_sharing to your INSTALLED_APPS

INSTALLED_APPS = [
    ...
    "wagtail.contrib.routable_page",
    "django_secret_sharing,
    "wagtail_secret_sharing",
]

Extend the AbstractSecretsPage

from wagtail_secret_sharing.models import AbstractSecretsPage

class SecretsPage(AbstractSecretsPage):
    ...

Add the urls (api_urls not needed when you don't use file transfers or any other API features)

urlpatterns = [
  ...
  path("api/secrets/", include("django_secret_sharing.api_urls"),),
]

Run migrate

python manage.py migrate

Templates

Override the default templates with your own

wagtail_secret_sharing/create.html

{% load wagtailroutablepage_tags %}

{% if secret_url %}
    <p>{{ secret_url }}</p>
    <a href="{% routablepageurl page 'create' %}">Create</a>
{% else %}
  <form id="secret_form" action="{% routablepageurl page 'create' %}" method="post">
      {% csrf_token %}
      {{ form }}
      <div id="files"></div>
      <button type="button" id="add_file">Add file</button>
      <input type="submit" value="Submit">
  </form>
{% endif %}

{% block scripts %}
{% include "django_secret_sharing/file_transfer_simple.html" %}
{% include "django_secret_sharing/file_transfer_scripts.html" %}
{% endblock %}

wagtail_secret_sharing/retrieve.html

{% load wagtailroutablepage_tags %}

<a href="{% routablepageurl page 'view' url_part %}">View</a>

wagtail_secret_sharing/view.html

{% load wagtailroutablepage_tags %}

<textarea disabled>{{ value }}</textarea>
<a href="{% routablepageurl page 'create' %}">Create</a>

File transfers

For more information how to use file transfers we suggest you to read the (https://github.com/vicktornl/django-secret-sharing#file-transfers)[documentation] of django-secret-sharing.