diff --git a/actions/coquelicot b/actions/coquelicot deleted file mode 100755 index aa46115c6..000000000 --- a/actions/coquelicot +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/python3 -# -*- mode: python -*- -# SPDX-License-Identifier: AGPL-3.0-or-later -""" -Configuration helper for coquelicot. -""" - -import argparse -import hashlib -import os -import sys - -import yaml - -from plinth import action_utils - -SETTINGS_FILE = '/etc/coquelicot/settings.yml' - - -def parse_arguments(): - """Return parsed command line arguments as dictionary.""" - parser = argparse.ArgumentParser() - subparsers = parser.add_subparsers(dest='subcommand', help='Sub command') - - subparsers.add_parser('setup', - help='Post-installation operations for coquelicot') - - subparsers.add_parser( - 'set-upload-password', - help='Set a new global, pre-shared password for uploading files') - - max_file_size = subparsers.add_parser( - 'set-max-file-size', - help='Change the maximum size of the files that can be uploaded to ' - 'Coquelicot') - max_file_size.add_argument('size', type=int, help='upload file size in MB') - - subparsers.add_parser( - 'get-max-file-size', - help='Print the maximum size of the files that can be uploaded to ' - 'Coquelicot') - - subparsers.required = True - return parser.parse_args() - - -def subcommand_setup(_): - """Perform post-installation operations for coquelicot.""" - settings = read_settings() - settings['path'] = "/coquelicot" - settings['max_file_size'] = mebibytes(1024) - write_settings(settings) - action_utils.service_restart('coquelicot') - - -def subcommand_set_upload_password(arguments): - """Set a new upload password for Coquelicot.""" - upload_password = ''.join(sys.stdin) - settings = read_settings() - hashed_pw = hashlib.sha1(upload_password.encode()).hexdigest() - settings['authentication_method']['upload_password'] = hashed_pw - write_settings(settings) - action_utils.service_try_restart('coquelicot') - - -def subcommand_set_max_file_size(arguments): - """Set a new maximum file size for Coquelicot.""" - size_in_bytes = mebibytes(arguments.size) - settings = read_settings() - settings['max_file_size'] = size_in_bytes - write_settings(settings) - action_utils.service_try_restart('coquelicot') - - -def subcommand_get_max_file_size(_): - """Print the maximum file size to stdout.""" - if os.path.exists(SETTINGS_FILE): - settings = read_settings() - print(int(settings['max_file_size'] / (1024 * 1024))) - else: - print(-1) - - -def read_settings(): - with open(SETTINGS_FILE, 'rb') as settings_file: - return yaml.load(settings_file) - - -def write_settings(settings): - with open(SETTINGS_FILE, 'w') as settings_file: - yaml.dump(settings, settings_file) - - -def main(): - """Parse arguments and perform all duties.""" - arguments = parse_arguments() - - subcommand = arguments.subcommand.replace('-', '_') - subcommand_method = globals()['subcommand_' + subcommand] - subcommand_method(arguments) - - -def mebibytes(size): - """Return the given size of mebibytes in bytes.""" - return size * 1024 * 1024 - - -if __name__ == '__main__': - main() diff --git a/debian/copyright b/debian/copyright index 64e4126f9..f12e00e7a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -5,8 +5,7 @@ Files: * Copyright: 2011-2020 FreedomBox Authors License: AGPL-3+ -Files: static/themes/default/icons/coquelicot.svg - static/themes/default/icons/jsxc.png +Files: static/themes/default/icons/jsxc.png static/themes/default/icons/jsxc.svg static/themes/default/icons/mldonkey.svg Copyright: 2011-2019 FreedomBox Authors diff --git a/debian/freedombox.maintscript b/debian/freedombox.maintscript index aea3d40da..d9b3a7b5e 100644 --- a/debian/freedombox.maintscript +++ b/debian/freedombox.maintscript @@ -12,3 +12,4 @@ rm_conffile /etc/plinth/modules-enabled/repro 20.1~ rm_conffile /etc/apt/preferences.d/50freedombox3.pref 20.5~ rm_conffile /etc/plinth/plinth.config 20.12~ rm_conffile /etc/plinth/custom-shortcuts.json 20.12~ +rm_conffile /etc/plinth/modules-enabled/coquelicot 20.14~ diff --git a/doc/manual/en/Coquelicot.raw.xml b/doc/manual/en/Coquelicot.raw.xml deleted file mode 100644 index 15658957c..000000000 --- a/doc/manual/en/Coquelicot.raw.xml +++ /dev/null @@ -1 +0,0 @@ -
FreedomBox/Manual/Coquelicot112020-05-30 17:57:45SunilMohanAdapaUpdate the title to emphasize app name over its generic name102020-05-23 19:51:30JamesValleroyadd TableOfContents92020-05-23 17:03:10JamesValleroyrename plinth -> freedombox82020-04-12 16:01:36JamesValleroyadd links back to top level pages72019-09-11 09:45:09fioddorCategory Deduplicated62018-12-30 19:59:56DrahtseilBasic priniciple52018-03-05 09:15:01JosephNuthalapaticoquelicot: Fix broken links42018-02-26 17:14:51JamesValleroyincluded in 0.2432018-02-12 23:48:10JamesValleroybump version22018-02-12 23:47:14JamesValleroyreplace fancy quote characters with plain quote characters12018-02-10 03:14:55JosephNuthalapatiCreate new page for Coquelicot
Coquelicot (File Sharing)
About CoquelicotCoquelicot is a "one-click" file sharing web application with a focus on protecting users' privacy. The basic principle is simple: users can upload a file to the server, in return they get a unique URL which can be shared with others in order to download the file. A download password can be defined. After the upload you get a unique link that can be shared to your partners in order to Read more about Coquelicot at the Coquelicot README Available since: version 0.24.0
When to use CoquelicotCoquelicot is best used to quickly share a single file. If you want to share a folder, for a single use, compress the folder and share it over Coquelicot which must be kept synchronized between computers, use Syncthing instead Coquelicot can only provide a reasonable degree of privacy. If anonymity is required, you should consider using the desktop application Onionshare instead. Since Coquelicot fully uploads the file to the server, your FreedomBox will incur both upload and download bandwidth costs. For very large files, consider sharing them using BitTorrent by creating a private torrent file. If anonymity is required, use Onionshare. It is P2P and doesn't require a server.
Coquelicot on FreedomBoxWith Coquelicot installed, you can upload files to your FreedomBox server and privately share them. Post installation, the Coquelicot page offers two settings. Upload Password: Coquelicot on FreedomBox is currently configured to use simple password authentication for ease of use. Remember that it's one global password for this Coquelicot instance and not your user password for FreedomBox. You need not remember this password. You can set a new one from the FreedomBox interface anytime. Maximum File Size: You can alter the maximum size of the file that can be transferred through Coquelicot using this setting. The size is in Mebibytes. The maximum file size is only limited by the disk size of your FreedomBox.
PrivacySomeone monitoring your network traffic might find out that some file is being transferred through your FreedomBox and also possibly its size, but will not know the file name. Coquelicot encrypts files on the server and also fills the file contents with 0s when deleting them. This eliminates the risk of file contents being revealed in the event of your FreedomBox being confiscated or stolen. The real risk to mitigate here is a third-party also downloading your file along with the intended recipient.
Sharing over instant messengersSome instant messengers which have previews for websites might download your file in order to show a preview in the conversation. If you set the option of one-time download on a file, you might notice that the one download will be used up by the instant messenger. If sharing over such messengers, please use a download password in combination with a one-time download option.
Sharing download links privatelyIt is recommended to share your file download links and download passwords over encrypted channels. You can simply avoid all the above problems with instant messenger previews by using instant messengers that support encrypted conversations like Riot with Matrix Synapse or XMPP (ejabberd server on FreedomBox) with clients that support end-to-end encryption. Send the download link and the download password in two separate messages (helps if your messenger supports perfect forward secrecy like XMPP with OTR). You can also share your links over PGP-encrypted email using Thunderbird. Back to Features introduction or manual pages. InformationSupportContributeReportsPromoteOverview Hardware Live Help Where To Start Translate Calls Talks Features Vision Q&A Design To Do Releases Press Download Manual Code Contributors Blog FreedomBox for Communities FreedomBox Developer Manual HELP & DISCUSSIONS: Discussion Forum - Mailing List - #freedombox irc.debian.org | CONTACT Foundation | JOIN Project Next call: Sunday, July 26th at 17:00 UTC Latest news: Announcing Pioneer FreedomBox Kits - 2019-03-26 This page is copyright its contributors and is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license. CategoryFreedomBox
\ No newline at end of file diff --git a/doc/manual/es/Coquelicot.raw.xml b/doc/manual/es/Coquelicot.raw.xml deleted file mode 100644 index ce8731dd7..000000000 --- a/doc/manual/es/Coquelicot.raw.xml +++ /dev/null @@ -1 +0,0 @@ -
es/FreedomBox/Manual/Coquelicot52020-05-30 19:32:53SunilMohanAdapaUpdate the title to emphasize app name over its generic name42020-05-24 06:45:44fioddorSe alinea con la versión 10 en inglés del 23 de mayo de 202032020-04-13 16:17:26fioddorSe alinea con la versión 08 en inglés del 12 de abril de 202022019-09-11 10:34:42fioddorCorrecciones menores.12019-09-11 10:27:55fioddorSe crea la versión española.
Coquelicot (Compartición de Archivos)
Acerca de CoquelicotCoquelicot es aplicación web para compartir archivos enfocada a proteger la privacidad de sus usuarios. El principio básico es simple: los usuarios pueden subir un archivo al servidor y a cambio reciben una URL única para descargarlo que se puede compartir con terceros. Además se puede establecer una contraseña para reforzar el acceso. Más información acerca de Coquelicot en su LEEME Disponible desde: versión 0.24.0
Cuando usar CoquelicotEl mejor uso de Coquelicot es para compartir rápidamente un archivo suelto. Si quieres compartir una carpeta... ...para usar y tirar, comprime la carpeta y compartela como archivo con Coquelicot ...que deba mantenerse sincronizada entre ordenadores usa mejor Syncthing Coquelicot también puede proporcionar un grado de privacidad razonable. Si se necesita anonimato mejor sopesas emplear la aplicación de escritorio Onionshare. Como Coquelicot carga todo el archivo al servidor tu FreedomBox consumirá ancho de banda tanto para la subida como para la descarga. Para archivos muy grandes sopesa compartirlos creando un fichero BitTorrent privado. Si se necesita anonimato usa Onionshare. Es P2P y no necesita servidor.
Coquelicot en FreedomBoxCon Coquelicot instalado puedes subir archivos a tu servidor FreedomBox y compartirlos en privado. Tras la instalación la página de Coquelicot ofrece 2 preferencias. Contraseña de Subida: Actualmente y por facilidad de uso Coquelicot está configurado en FreedomBox para usar autenticación simple por contraseña. Recuerda que se trata de una contraseña global para esta instancia de Coquelicot y no tu contraseña de usuario para FreedomBox. Tienes que acordarte de esta contraseña. Puedes establecer otra en cualquier momento desde el interfaz de FreedomBox. Tamaño Máximo de Archivo: Puedes alterar el tamaño máximo de los archivos a transferir mediante Coquelicot usando esta preferencia. El tamaño se expresa en Mebibytes y el máximo solo está limitado por el espacio en disco de tu FreedomBox.
PrivacidadAlguien que monitorice tu tráfico de red podría averiguar que se está transfiriendo un archivo en tu FreedomBox y posiblemente también su tamaño pero no sabrá su nombre. Coquelicot cifra los archivos en el servidor y sobrescribe los contenidos con 0s al borrarlos, eliminando el riesgo de que se desvelen los contenidos del fichero si tu FreedomBox resultara confiscada o robada. El riesgo real que hay que mitigar es que además del destinatario legítimo un tercero también descargue tu fichero.
Compartir mediante mensajería instantáneaAlgunas aplicaciones de mensajería instantánea con vista previa de sitios web podrían descargar tu fichero para mostrarla (su vista previa) en la conversación. Si configuras la opción de descarga única para un archivo podrías notar que la aplicación de mensajería consume la única descarga. Si compartes mediante estas aplicaciones usa una contraseña de descarga en combinación con la opción de descarga única.
Compartir en privado enlaces de descargaSe recomienda compartir las contraseñas y los enlaces de descarga de tus archivos por canales cifrados. Puedes evitar todos los problemas anteriores con las vistas previas de la mensajería instantánea símplemente empleando aplicaciones de mensajería que soporten conversaciones cifradas como Riot con Matrix Synapse o XMPP (servidor ejabberd en FreedomBox) con clientes que soporten cifrado punto a punto. Envía la contraseña y el enlace de descarga separados en 2 mensajes distintos (ayuda que tu aplicación de mensajería soporte perfect forward secrecy como XMPP con OTR). También puedes compartir tus enlaces por correo electrónico cifrado con PGP usando Thunderbird. Volver a la descripción de Funcionalidades o a las páginas del manual. InformaciónSoporteContribuyeInformesPromueveIntroducción Hardware Ayuda en línea Dónde empezar Traduce Reuniones Charlas Funcionalidades Visión Preguntas y Respuestas Diseño Por hacer Releases Prensa Descargas Manual Codigo Fuente Contribuyentes Blog FreedomBox para Comunidades Manual del Desarrolador de FreedomBox AYUDA y DEBATES: Foro de Debate - Lista de Correo - #freedombox irc.debian.org | CONTACTO Fundación | PARTICIPA Proyecto Next call: Sunday, July 26th at 17:00 UTC Latest news: Announcing Pioneer FreedomBox Kits - 2019-03-26 Esta página está sujeta a copyright y sus autores la publican bajo la licencia pública Creative Commons Atribución-CompartirIgual 4.0 Internacional (CC BY-SA 4.0). CategoryFreedomBox
\ No newline at end of file diff --git a/plinth/modules/coquelicot/__init__.py b/plinth/modules/coquelicot/__init__.py deleted file mode 100644 index 291e0bf95..000000000 --- a/plinth/modules/coquelicot/__init__.py +++ /dev/null @@ -1,86 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -""" -Plinth module to configure coquelicot. -""" - -from django.utils.translation import ugettext_lazy as _ - -from plinth import actions -from plinth import app as app_module -from plinth import frontpage, menu -from plinth.daemon import Daemon -from plinth.modules.apache.components import Webserver -from plinth.modules.firewall.components import Firewall - -from .manifest import backup, clients # noqa, pylint: disable=unused-import - -version = 1 - -managed_services = ['coquelicot'] - -managed_packages = ['coquelicot'] - -_description = [ - _('Coquelicot is a "one-click" file sharing web application with a focus ' - 'on protecting users\' privacy. It is best used for quickly sharing a ' - 'single file. '), - _('This Coquelicot instance is exposed to the public but requires an ' - 'upload password to prevent unauthorized access. You can set a new ' - 'upload password in the form that will appear below after installation. ' - 'The default upload password is "test".') -] - -app = None - - -class CoquelicotApp(app_module.App): - """FreedomBox app for Coquelicot.""" - - app_id = 'coquelicot' - - def __init__(self): - """Create components for the app.""" - super().__init__() - info = app_module.Info(app_id=self.app_id, version=version, - name=_('Coquelicot'), - icon_filename='coquelicot', - short_description=_('File Sharing'), - description=_description, - manual_page='Coquelicot', clients=clients) - self.add(info) - - menu_item = menu.Menu('menu-coquelicot', info.name, - info.short_description, info.icon_filename, - 'coquelicot:index', parent_url_name='apps') - self.add(menu_item) - - shortcut = frontpage.Shortcut('shortcut-coquelicot', info.name, - short_description=info.short_description, - icon='coquelicot', url='/coquelicot', - clients=info.clients, - login_required=True) - self.add(shortcut) - - firewall = Firewall('firewall-coquelicot', info.name, - ports=['http', 'https'], is_external=True) - self.add(firewall) - - webserver = Webserver('webserver-coquelicot', 'coquelicot-freedombox', - urls=['https://{host}/coquelicot']) - self.add(webserver) - - daemon = Daemon('daemon-coquelicot', managed_services[0]) - self.add(daemon) - - -def setup(helper, old_version=None): - """Install and configure the module.""" - helper.install(managed_packages) - helper.call('post', actions.superuser_run, 'coquelicot', ['setup']) - helper.call('post', app.enable) - - -def get_current_max_file_size(): - """Get the current value of maximum file size.""" - size = actions.superuser_run('coquelicot', ['get-max-file-size']) - return int(size.strip()) diff --git a/plinth/modules/coquelicot/data/etc/apache2/conf-available/coquelicot-freedombox.conf b/plinth/modules/coquelicot/data/etc/apache2/conf-available/coquelicot-freedombox.conf deleted file mode 100644 index 0fe851e83..000000000 --- a/plinth/modules/coquelicot/data/etc/apache2/conf-available/coquelicot-freedombox.conf +++ /dev/null @@ -1,5 +0,0 @@ - - ProxyPass http://127.0.0.1:51161/coquelicot - SetEnv proxy-sendchunks 1 - RequestHeader set X-Forwarded-SSL "on" - diff --git a/plinth/modules/coquelicot/data/etc/plinth/modules-enabled/coquelicot b/plinth/modules/coquelicot/data/etc/plinth/modules-enabled/coquelicot deleted file mode 100644 index fa55f19dc..000000000 --- a/plinth/modules/coquelicot/data/etc/plinth/modules-enabled/coquelicot +++ /dev/null @@ -1 +0,0 @@ -#plinth.modules.coquelicot diff --git a/plinth/modules/coquelicot/forms.py b/plinth/modules/coquelicot/forms.py deleted file mode 100644 index b418b844c..000000000 --- a/plinth/modules/coquelicot/forms.py +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -""" -Plinth form for configuring Coquelicot. -""" - -from django import forms -from django.utils.translation import ugettext_lazy as _ - - -class CoquelicotForm(forms.Form): # pylint: disable=W0232 - """Coquelicot configuration form.""" - upload_password = forms.CharField( - label=_('Upload Password'), - help_text=_('Set a new upload password for Coquelicot. ' - 'Leave this field blank to keep the current password.'), - required=False, widget=forms.PasswordInput) - max_file_size = forms.IntegerField( - label=_("Maximum File Size (in MiB)"), help_text=_( - 'Set the maximum size of the files that can be uploaded to ' - 'Coquelicot.'), required=False, min_value=0) diff --git a/plinth/modules/coquelicot/manifest.py b/plinth/modules/coquelicot/manifest.py deleted file mode 100644 index c128a3fbf..000000000 --- a/plinth/modules/coquelicot/manifest.py +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later - -from django.utils.translation import ugettext_lazy as _ - -from plinth.clients import validate -from plinth.modules.backups.api import validate as validate_backups - -clients = validate([{ - 'name': _('coquelicot'), - 'platforms': [{ - 'type': 'web', - 'url': '/coquelicot' - }] -}]) - -backup = validate_backups({ - 'data': { - 'directories': ['/var/lib/coquelicot'] - }, - 'secrets': { - 'files': ['/etc/coquelicot/settings.yml'] - }, - 'services': ['coquelicot'] -}) diff --git a/plinth/modules/coquelicot/tests/__init__.py b/plinth/modules/coquelicot/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/plinth/modules/coquelicot/tests/coquelicot.feature b/plinth/modules/coquelicot/tests/coquelicot.feature deleted file mode 100644 index f15c4788c..000000000 --- a/plinth/modules/coquelicot/tests/coquelicot.feature +++ /dev/null @@ -1,57 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later - -@apps @coquelicot @backups @skip -Feature: Coquelicot File Sharing - Run Coquelicot File Sharing server. - -Background: - Given I'm a logged in user - Given the coquelicot application is installed - -Scenario: Enable coquelicot application - Given the coquelicot application is disabled - When I enable the coquelicot application - Then the coquelicot service should be running - -Scenario: Modify maximum upload size - Given the coquelicot application is enabled - When I modify the maximum file size of coquelicot to 256 - Then the maximum file size of coquelicot should be 256 - -Scenario: Modify upload password - Given the coquelicot application is enabled - When I modify the coquelicot upload password to whatever123 - Then I should be able to login to coquelicot with password whatever123 - -Scenario: Modify maximum upload size in disabled case - Given the coquelicot application is disabled - When I modify the maximum file size of coquelicot to 123 - Then the coquelicot service should not be running - -Scenario: Upload a file to coquelicot - Given the coquelicot application is enabled - And a sample local file - When I modify the coquelicot upload password to whatever123 - And I upload the sample local file to coquelicot with password whatever123 - And I download the uploaded file from coquelicot - Then contents of downloaded sample file should be same as sample local file - -Scenario: Backup and restore coquelicot - Given the coquelicot application is enabled - When I modify the coquelicot upload password to beforebackup123 - And I modify the maximum file size of coquelicot to 128 - And I upload the sample local file to coquelicot with password beforebackup123 - And I create a backup of the coquelicot app data with name test_coquelicot - And I modify the coquelicot upload password to afterbackup123 - And I modify the maximum file size of coquelicot to 64 - And I restore the coquelicot app data backup with name test_coquelicot - And I download the uploaded file from coquelicot - Then the coquelicot service should be running - And I should be able to login to coquelicot with password beforebackup123 - And the maximum file size of coquelicot should be 128 - And contents of downloaded sample file should be same as sample local file - -Scenario: Disable coquelicot application - Given the coquelicot application is enabled - When I disable the coquelicot application - Then the coquelicot service should not be running diff --git a/plinth/modules/coquelicot/tests/test_functional.py b/plinth/modules/coquelicot/tests/test_functional.py deleted file mode 100644 index e8c8a08fe..000000000 --- a/plinth/modules/coquelicot/tests/test_functional.py +++ /dev/null @@ -1,126 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -""" -Functional, browser based tests for coquelicot app. -""" - -import random -import tempfile - -from pytest_bdd import given, parsers, scenarios, then, when -from selenium.webdriver.common.action_chains import ActionChains -from selenium.webdriver.common.keys import Keys - -from plinth.tests import functional - -scenarios('coquelicot.feature') - - -@given('a sample local file') -def sample_local_file(): - file_path, contents = _create_sample_local_file() - return dict(file_path=file_path, contents=contents) - - -@when(parsers.parse('I modify the maximum file size of coquelicot to {size:d}') - ) -def modify_max_file_size(session_browser, size): - _modify_max_file_size(session_browser, size) - - -@then(parsers.parse('the maximum file size of coquelicot should be {size:d}')) -def assert_max_file_size(session_browser, size): - assert _get_max_file_size(session_browser) == size - - -@when(parsers.parse('I modify the coquelicot upload password to {password:w}')) -def modify_upload_password(session_browser, password): - _modify_upload_password(session_browser, password) - - -@then( - parsers.parse( - 'I should be able to login to coquelicot with password {password:w}')) -def verify_upload_password(session_browser, password): - _verify_upload_password(session_browser, password) - - -@when( - parsers.parse('I upload the sample local file to coquelicot with password ' - '{password:w}')) -def coquelicot_upload_file(session_browser, sample_local_file, password): - url = _upload_file(session_browser, sample_local_file['file_path'], - password) - sample_local_file['upload_url'] = url - - -@when('I download the uploaded file from coquelicot') -def coquelicot_download_file(sample_local_file): - file_path = functional.download_file_outside_browser( - sample_local_file['upload_url']) - sample_local_file['download_path'] = file_path - - -@then('contents of downloaded sample file should be same as sample local file') -def coquelicot_compare_upload_download_files(sample_local_file): - _compare_files(sample_local_file['file_path'], - sample_local_file['download_path']) - - -def _create_sample_local_file(): - """Create a sample file for upload using browser.""" - contents = bytearray(random.getrandbits(8) for _ in range(64)) - with tempfile.NamedTemporaryFile(delete=False) as temp_file: - temp_file.write(contents) - - return temp_file.name, contents - - -def _verify_upload_password(browser, password): - functional.visit(browser, '/coquelicot') - # ensure the password form is scrolled into view - browser.execute_script('window.scrollTo(100, 0)') - browser.find_by_id('upload_password').fill(password) - actions = ActionChains(browser.driver) - actions.send_keys(Keys.RETURN) - actions.perform() - assert functional.eventually(browser.is_element_present_by_css, - args=['div[style*="display: none;"]']) - - -def _upload_file(browser, file_path, password): - """Upload a local file from disk to coquelicot.""" - _verify_upload_password(browser, password) - browser.attach_file('file', file_path) - functional.submit(browser) - assert functional.eventually(browser.is_element_present_by_css, - args=['#content .url']) - url_textarea = browser.find_by_css('#content .url textarea').first - return url_textarea.value - - -def _modify_max_file_size(browser, size): - """Change the maximum file size of coquelicot to the given value""" - functional.visit(browser, '/plinth/apps/coquelicot/') - browser.find_by_id('id_max_file_size').fill(size) - functional.submit(browser, form_class='form-configuration') - - -def _get_max_file_size(browser): - """Get the maximum file size of coquelicot""" - functional.visit(browser, '/plinth/apps/coquelicot/') - return int(browser.find_by_id('id_max_file_size').value) - - -def _modify_upload_password(browser, password): - """Change the upload password for coquelicot to the given value""" - functional.visit(browser, '/plinth/apps/coquelicot/') - browser.find_by_id('id_upload_password').fill(password) - functional.submit(browser, form_class='form-configuration') - - -def _compare_files(file1, file2): - """Assert that the contents of two files are the same.""" - file1_contents = open(file1, 'rb').read() - file2_contents = open(file2, 'rb').read() - - assert file1_contents == file2_contents diff --git a/plinth/modules/coquelicot/urls.py b/plinth/modules/coquelicot/urls.py deleted file mode 100644 index a08863c94..000000000 --- a/plinth/modules/coquelicot/urls.py +++ /dev/null @@ -1,12 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -""" -URLs for the coquelicot module. -""" - -from django.conf.urls import url - -from .views import CoquelicotAppView - -urlpatterns = [ - url(r'^apps/coquelicot/$', CoquelicotAppView.as_view(), name='index'), -] diff --git a/plinth/modules/coquelicot/views.py b/plinth/modules/coquelicot/views.py deleted file mode 100644 index 46d9aed0e..000000000 --- a/plinth/modules/coquelicot/views.py +++ /dev/null @@ -1,52 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -""" -Plinth views for Coquelicot. -""" - -from django.contrib import messages -from django.utils.translation import ugettext as _ - -from plinth import actions, views -from plinth.errors import ActionError -from plinth.modules.coquelicot import get_current_max_file_size - -from .forms import CoquelicotForm - - -class CoquelicotAppView(views.AppView): - """Serve configuration page.""" - app_id = 'coquelicot' - form_class = CoquelicotForm - - def get_initial(self): - """Return the status of the service to fill in the form.""" - initial = super().get_initial() - initial['max_file_size'] = get_current_max_file_size() - return initial - - def form_valid(self, form): - """Apply the changes submitted in the form.""" - form_data = form.cleaned_data - - if form_data['upload_password']: - try: - actions.superuser_run( - 'coquelicot', ['set-upload-password'], - input=form_data['upload_password'].encode()) - messages.success(self.request, _('Upload password updated')) - except ActionError: - messages.error(self.request, - _('Failed to update upload password')) - - max_file_size = form_data['max_file_size'] - if max_file_size and max_file_size != get_current_max_file_size(): - try: - actions.superuser_run( - 'coquelicot', ['set-max-file-size', - str(max_file_size)]) - messages.success(self.request, _('Maximum file size updated')) - except ActionError: - messages.error(self.request, - _('Failed to update maximum file size')) - - return super().form_valid(form) diff --git a/pytest.ini b/pytest.ini index f557054cf..e95adc2ab 100644 --- a/pytest.ini +++ b/pytest.ini @@ -5,7 +5,6 @@ markers = functional backups bind configuration - coquelicot date_and_time deluge dynamicdns diff --git a/setup.py b/setup.py index 1eaead35e..52e46fd7f 100755 --- a/setup.py +++ b/setup.py @@ -37,6 +37,7 @@ ENABLED_APPS_PATH = "/etc/plinth/modules-enabled/" DISABLED_APPS_TO_REMOVE = [ 'apps', + 'coquelicot', 'diaspora', 'owncloud', 'system', @@ -110,6 +111,7 @@ class CustomBuild(build): class CustomClean(clean): """Override clean command to clean doc, locales, and egg-info.""" + def run(self): """Execute clean command""" subprocess.check_call(['rm', '-rf', 'Plinth.egg-info/']) @@ -127,6 +129,7 @@ class CustomClean(clean): class CustomInstall(install): """Override install command.""" + def run(self): for app in DISABLED_APPS_TO_REMOVE: file_path = pathlib.Path(ENABLED_APPS_PATH) / app @@ -144,6 +147,7 @@ class CustomInstall(install): class CustomInstallData(install_data): """Override install command to allow directory creation and copy""" + def _run_doc_install(self): """Install documentation""" command = ['make', '-j', '8', '-C', 'doc', 'install'] diff --git a/static/themes/default/icons/coquelicot.png b/static/themes/default/icons/coquelicot.png deleted file mode 100644 index 9bb173f83..000000000 Binary files a/static/themes/default/icons/coquelicot.png and /dev/null differ diff --git a/static/themes/default/icons/coquelicot.svg b/static/themes/default/icons/coquelicot.svg deleted file mode 100644 index 3a252b8b4..000000000 --- a/static/themes/default/icons/coquelicot.svg +++ /dev/null @@ -1,648 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -