diff --git a/install-paperless-ng.sh b/install-paperless-ng.sh new file mode 100755 index 000000000..ad992fe8c --- /dev/null +++ b/install-paperless-ng.sh @@ -0,0 +1,223 @@ +#!/bin/bash + +set -e + +ask() { + while true ; do + if [[ -z $3 ]] ; then + read -p "$1 [$2]: " result + else + read -p "$1 ($3) [$2]: " result + fi + if [[ -z $result ]]; then + ask_result=$2 + return + fi + array=$3 + if [[ -z $3 || " ${array[@]} " =~ " ${result} " ]]; then + ask_result=$result + return + else + echo "Invalid option: $result" + fi + done +} + +echo "" +echo "############################################" +echo "### Paperless-ng docker installation ###" +echo "############################################" +echo "" +echo "This script will download, configure and start paperless-ng." + +echo "" +echo "1. Folder configuration" +echo "=======================" +echo "" +echo "The target folder is used to store the configuration files of " +echo "paperless. You can move this folder around after installing paperless." +echo "You will need this folder whenever you want to start, stop, update or " +echo "maintain your paperless instance." +echo "" + +ask "Target folder" "$(pwd)/paperless-ng" +TARGET_FOLDER=$ask_result + +echo "" +echo "The consume folder is where paperles will search for new documents." +echo "Point this to a folder where your scanner is able to put your scanned" +echo "documents." +echo "" +echo "HINT: If paperless is unable to pick up any files from this directory after" +echo "installation, you might need to configure PAPERLESS_CONSUMER_POLLING." +echo "See the documentation for details." +echo "" +echo "CAUTION: You must specify an absolute path starting with /" +echo "" + +ask "Consume folder" "$TARGET_FOLDER/consume" +CONSUME_FOLDER=$ask_result + +echo "" +echo "The media folder is where paperless stores your documents." +echo "Leave empty and docker will manage this folder for you." +echo "Docker usually stores managed folders in /var/lib/docker/volumes." +echo "" +echo "CAUTION: If specified, you must specify an absolute path starting with /" +echo "" + +ask "Media folder" "" +MEDIA_FOLDER=$ask_result + +echo "" +echo "The data folder is where paperless stores other data, such as your" +echo "SQLite database (if used), the search index and other data." +echo "As with the media folder, leave empty to have this managed by docker." +echo "" + +ask "Data folder" "" +DATA_FOLDER=$ask_result + +echo "" +echo "2. Application configuration" +echo "============================" + +echo "" +echo "The port on which the paperless webserver will listen for incoming" +echo "connections." +echo "" + +ask "Port" "8000" +PORT=$ask_result + +echo "" +echo "Database backend: PostgreSQL and SQLite are available. Use PostgreSQL" +echo "if unsure. If you're running on a low-power device such as Raspberry" +echo "Pi, use SQLite to save resources." +echo "" + +ask "Database backend" "postgres" "postgres sqlite" +DATABASE_BACKEND=$ask_result + +echo "" +echo "Paperless is able to use Apache Tika to support Office documents such as" +echo "Word, Excel, Powerpoint, and Libreoffice equivalents. This feature" +echo "requires more resources due to the required services." +echo "" + +ask "Enable Apache Tika?" "no" "yes no" +TIKA_ENABLED=$ask_result + +echo "" +echo "Specify the default language that most of your documents are written in." +echo "Use ISO 639-2, (T) variant language codes: " +echo "https://www.loc.gov/standards/iso639-2/php/code_list.php" +echo "Common values: eng (English) deu (German) nld (Dutch) fra (French)" +echo "" + +ask "OCR language" "eng" +OCR_LANGUAGE=$ask_result + +echo "" +echo "Specify the user id and group id you wish to run paperless as." +echo "Paperless will also change ownership on the data, media and consume" +echo "folder to the specified values, so it's a good idea to supply the user id" +echo "and group id of your unix user account." +echo "If unsure, leave default." +echo "" + +ask "User ID" "$(id -u)" +USERMAP_UID=$ask_result + +ask "Group ID" "$(id -g)" +USERMAP_GID=$ask_result + +echo "" +echo "3. Login credentials" +echo "====================" +echo "" +echo "Specify initial login credentials. You can change these later." +echo "A mail address is required, however it is not used in paperless. You don't" +echo "need to provide an actual mail address." +echo "" + +ask "Paperless username" "$(whoami)" +USERNAME=$ask_result + +while true; do + read -sp "Paperless password: " PASSWORD + echo "" + + if [[ -z $PASSWORD ]] ; then + echo "Password cannot be empty." + continue + fi + + read -sp "Paperless password (again): " PASSWORD_REPEAT + echo "" + + if [[ ! "$PASSWORD" == "$PASSWORD_REPEAT" ]] ; then + echo "Passwords did not match" + else + break + fi +done + +ask "Email" "$USERNAME@localhost" +EMAIL=$ask_result + +echo "Done collecting data. Press any key to install." +read + +echo "" +echo "Installing paperless..." +echo "" + +mkdir -p "$TARGET_FOLDER" + +cd "$TARGET_FOLDER" + +DOCKER_COMPOSE_VERSION=$DATABASE_BACKEND + +if [[ $TIKA_ENABLED == "yes" ]] ; then + DOCKER_COMPOSE_VERSION="$DOCKER_COMPOSE_VERSION-tika" +fi + +wget "https://raw.githubusercontent.com/jonaswinkler/paperless-ng/master/docker/compose/docker-compose.$DOCKER_COMPOSE_VERSION.yml" -O docker-compose.yml +wget "https://raw.githubusercontent.com/jonaswinkler/paperless-ng/master/docker/compose/.env" -O .env + +SECRET_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1) + +DEFAULT_LANGUAGES="deu eng fra ita spa" + +{ + if [[ ! $USERMAP_UID == "1000" ]] ; then + echo "USERMAP_UID=$USERMAP_UID" + fi + if [[ ! $USERMAP_GID == "1000" ]] ; then + echo "USERMAP_GID=$USERMAP_GID" + fi + echo "PAPERLESS_OCR_LANGUAGE=$OCR_LANGUAGE" + echo "PAPERLESS_SECRET_KEY=$SECRET_KEY" + if [[ ! " ${DEFAULT_LANGUAGES[@]} " =~ " ${OCR_LANGUAGE} " ]] ; then + echo "PAPERLESS_OCR_LANGUAGES=$OCR_LANGUAGE" + fi +} > docker-compose.env + +sed -i "s/- 8000:8000/- $PORT:8000/g" docker-compose.yml + +sed -i "s#- \./consume:/usr/src/paperless/consume#- $CONSUME_FOLDER:/usr/src/paperless/consume#g" docker-compose.yml + +if [[ -n $MEDIA_FOLDER ]] ; then + sed -i "s#- data:/usr/src/paperless/media#- $MEDIA_FOLDER:/usr/src/paperless/media#g" docker-compose.yml +fi + +if [[ -n $DATA_FOLDER ]] ; then + sed -i "s#- data:/usr/src/paperless/data#- $DATA_FOLDER:/usr/src/paperless/data#g" docker-compose.yml +fi + +docker-compose pull + +docker-compose run --rm -e DJANGO_SUPERUSER_PASSWORD="$PASSWORD" webserver createsuperuser --noinput --username "$USERNAME" --email "$EMAIL" + +docker-compose up -d diff --git a/src/locale/fr/LC_MESSAGES/django.po b/src/locale/fr/LC_MESSAGES/django.po index 7ab8aa45f..e956642d4 100644 --- a/src/locale/fr/LC_MESSAGES/django.po +++ b/src/locale/fr/LC_MESSAGES/django.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-01-10 21:41+0000\n" +"POT-Creation-Date: 2021-01-28 22:02+0100\n" "PO-Revision-Date: 2020-12-30 19:27+0000\n" "Last-Translator: Philmo67, 2021\n" "Language-Team: French (https://www.transifex.com/paperless/teams/115905/fr/)\n" @@ -26,64 +26,64 @@ msgstr "" msgid "Documents" msgstr "Documents" -#: documents/models.py:32 +#: documents/models.py:33 msgid "Any word" msgstr "Un des mots" -#: documents/models.py:33 +#: documents/models.py:34 msgid "All words" msgstr "Tous les mots" -#: documents/models.py:34 +#: documents/models.py:35 msgid "Exact match" msgstr "Concordance exacte" -#: documents/models.py:35 +#: documents/models.py:36 msgid "Regular expression" msgstr "Expression régulière" -#: documents/models.py:36 +#: documents/models.py:37 msgid "Fuzzy word" msgstr "Mot approximatif" -#: documents/models.py:37 +#: documents/models.py:38 msgid "Automatic" msgstr "Automatique" -#: documents/models.py:41 documents/models.py:354 paperless_mail/models.py:25 +#: documents/models.py:42 documents/models.py:352 paperless_mail/models.py:25 #: paperless_mail/models.py:109 msgid "name" msgstr "nom" -#: documents/models.py:45 +#: documents/models.py:46 msgid "match" msgstr "rapprochement" -#: documents/models.py:49 +#: documents/models.py:50 msgid "matching algorithm" msgstr "algorithme de rapprochement" -#: documents/models.py:55 +#: documents/models.py:56 msgid "is insensitive" msgstr "est insensible à la casse" -#: documents/models.py:80 documents/models.py:140 +#: documents/models.py:75 documents/models.py:135 msgid "correspondent" msgstr "correspondant" -#: documents/models.py:81 +#: documents/models.py:76 msgid "correspondents" msgstr "correspondants" -#: documents/models.py:103 +#: documents/models.py:98 msgid "color" msgstr "couleur" -#: documents/models.py:107 +#: documents/models.py:102 msgid "is inbox tag" msgstr "est une étiquette de boîte de réception" -#: documents/models.py:109 +#: documents/models.py:104 msgid "" "Marks this tag as an inbox tag: All newly consumed documents will be tagged " "with inbox tags." @@ -91,39 +91,39 @@ msgstr "" "Marque cette étiquette comme étiquette de boîte de réception : ces " "étiquettes sont affectées à tous les documents nouvellement traités." -#: documents/models.py:114 +#: documents/models.py:109 msgid "tag" msgstr "étiquette" -#: documents/models.py:115 documents/models.py:171 +#: documents/models.py:110 documents/models.py:166 msgid "tags" msgstr "étiquettes" -#: documents/models.py:121 documents/models.py:153 +#: documents/models.py:116 documents/models.py:148 msgid "document type" msgstr "type de document" -#: documents/models.py:122 +#: documents/models.py:117 msgid "document types" msgstr "types de document" -#: documents/models.py:130 +#: documents/models.py:125 msgid "Unencrypted" msgstr "Non chiffré" -#: documents/models.py:131 +#: documents/models.py:126 msgid "Encrypted with GNU Privacy Guard" msgstr "Chiffré avec GNU Privacy Guard" -#: documents/models.py:144 +#: documents/models.py:139 msgid "title" msgstr "titre" -#: documents/models.py:157 +#: documents/models.py:152 msgid "content" msgstr "contenu" -#: documents/models.py:159 +#: documents/models.py:154 msgid "" "The raw, text-only data of the document. This field is primarily used for " "searching." @@ -131,223 +131,228 @@ msgstr "" "Les données brutes du document, en format texte uniquement. Ce champ est " "principalement utilisé pour la recherche." -#: documents/models.py:164 +#: documents/models.py:159 msgid "mime type" msgstr "type mime" -#: documents/models.py:175 +#: documents/models.py:170 msgid "checksum" msgstr "somme de contrôle" -#: documents/models.py:179 +#: documents/models.py:174 msgid "The checksum of the original document." msgstr "La somme de contrôle du document original." -#: documents/models.py:183 +#: documents/models.py:178 msgid "archive checksum" msgstr "somme de contrôle de l'archive" -#: documents/models.py:188 +#: documents/models.py:183 msgid "The checksum of the archived document." msgstr "La somme de contrôle du document archivé." -#: documents/models.py:192 documents/models.py:332 +#: documents/models.py:187 documents/models.py:330 msgid "created" msgstr "créé le" -#: documents/models.py:196 +#: documents/models.py:191 msgid "modified" msgstr "modifié" -#: documents/models.py:200 +#: documents/models.py:195 msgid "storage type" msgstr "forme d'enregistrement :" -#: documents/models.py:208 +#: documents/models.py:203 msgid "added" msgstr "date d'ajout" -#: documents/models.py:212 +#: documents/models.py:207 msgid "filename" msgstr "nom du fichier" -#: documents/models.py:217 +#: documents/models.py:212 msgid "Current filename in storage" msgstr "Nom du fichier courant en base de données" -#: documents/models.py:221 +#: documents/models.py:216 msgid "archive serial number" msgstr "numéro de série de l'archive" -#: documents/models.py:226 +#: documents/models.py:221 msgid "The position of this document in your physical document archive." msgstr "" "Le classement de ce document dans votre archive de documents physiques." -#: documents/models.py:232 +#: documents/models.py:227 msgid "document" msgstr "document" -#: documents/models.py:233 +#: documents/models.py:228 msgid "documents" msgstr "documents" -#: documents/models.py:315 +#: documents/models.py:313 msgid "debug" msgstr "débogage" -#: documents/models.py:316 +#: documents/models.py:314 msgid "information" msgstr "information" -#: documents/models.py:317 +#: documents/models.py:315 msgid "warning" msgstr "avertissement" -#: documents/models.py:318 +#: documents/models.py:316 msgid "error" msgstr "erreur" -#: documents/models.py:319 +#: documents/models.py:317 msgid "critical" msgstr "critique" -#: documents/models.py:323 +#: documents/models.py:321 msgid "group" msgstr "groupe" -#: documents/models.py:326 +#: documents/models.py:324 msgid "message" msgstr "message" -#: documents/models.py:329 +#: documents/models.py:327 msgid "level" msgstr "niveau" -#: documents/models.py:336 +#: documents/models.py:334 msgid "log" msgstr "rapport" -#: documents/models.py:337 +#: documents/models.py:335 msgid "logs" msgstr "rapports" -#: documents/models.py:348 documents/models.py:398 +#: documents/models.py:346 documents/models.py:396 msgid "saved view" msgstr "vue enregistrée" -#: documents/models.py:349 +#: documents/models.py:347 msgid "saved views" msgstr "vues enregistrées" -#: documents/models.py:352 +#: documents/models.py:350 msgid "user" msgstr "utilisateur" -#: documents/models.py:358 +#: documents/models.py:356 msgid "show on dashboard" msgstr "montrer sur le tableau de bord" -#: documents/models.py:361 +#: documents/models.py:359 msgid "show in sidebar" msgstr "montrer dans la barre latérale" -#: documents/models.py:365 +#: documents/models.py:363 msgid "sort field" msgstr "champ de tri" -#: documents/models.py:368 +#: documents/models.py:366 msgid "sort reverse" msgstr "tri inverse" -#: documents/models.py:374 +#: documents/models.py:372 msgid "title contains" msgstr "le titre contient" -#: documents/models.py:375 +#: documents/models.py:373 msgid "content contains" msgstr "le contenu contient" -#: documents/models.py:376 +#: documents/models.py:374 msgid "ASN is" msgstr "le NSA est" -#: documents/models.py:377 +#: documents/models.py:375 msgid "correspondent is" msgstr "le correspondant est" -#: documents/models.py:378 +#: documents/models.py:376 msgid "document type is" msgstr "le type de document est" -#: documents/models.py:379 +#: documents/models.py:377 msgid "is in inbox" msgstr "est dans la boîte de réception" -#: documents/models.py:380 +#: documents/models.py:378 msgid "has tag" msgstr "porte l'étiquette" -#: documents/models.py:381 +#: documents/models.py:379 msgid "has any tag" msgstr "porte l'une des étiquettes" -#: documents/models.py:382 +#: documents/models.py:380 msgid "created before" msgstr "créé avant" -#: documents/models.py:383 +#: documents/models.py:381 msgid "created after" msgstr "créé après" -#: documents/models.py:384 +#: documents/models.py:382 msgid "created year is" msgstr "l'année de création est" -#: documents/models.py:385 +#: documents/models.py:383 msgid "created month is" msgstr "le mois de création est" -#: documents/models.py:386 +#: documents/models.py:384 msgid "created day is" msgstr "le jour de création est" -#: documents/models.py:387 +#: documents/models.py:385 msgid "added before" msgstr "ajouté avant" -#: documents/models.py:388 +#: documents/models.py:386 msgid "added after" msgstr "ajouté après" -#: documents/models.py:389 +#: documents/models.py:387 msgid "modified before" msgstr "modifié avant" -#: documents/models.py:390 +#: documents/models.py:388 msgid "modified after" msgstr "modifié après" -#: documents/models.py:391 +#: documents/models.py:389 msgid "does not have tag" msgstr "ne porte pas d'étiquette" -#: documents/models.py:402 +#: documents/models.py:400 msgid "rule type" msgstr "type de règle" -#: documents/models.py:406 +#: documents/models.py:404 msgid "value" msgstr "valeur" -#: documents/models.py:412 +#: documents/models.py:410 msgid "filter rule" msgstr "règle de filtrage" -#: documents/models.py:413 +#: documents/models.py:411 msgid "filter rules" msgstr "règles de filtrage" +#: documents/serialisers.py:383 +#, python-format +msgid "File type %(type)s not supported" +msgstr "Type de fichier %(type)s non pris en charge" + #: documents/templates/index.html:20 msgid "Paperless-ng is loading..." msgstr "Paperless-ng est en cours de chargement..." @@ -390,23 +395,23 @@ msgstr "Mot de passe" msgid "Sign in" msgstr "S'identifier" -#: paperless/settings.py:268 +#: paperless/settings.py:286 msgid "English" msgstr "Anglais" -#: paperless/settings.py:269 +#: paperless/settings.py:287 msgid "German" msgstr "Allemand" -#: paperless/settings.py:270 +#: paperless/settings.py:288 msgid "Dutch" msgstr "Néerlandais" -#: paperless/settings.py:271 +#: paperless/settings.py:289 msgid "French" msgstr "Français" -#: paperless/urls.py:108 +#: paperless/urls.py:114 msgid "Paperless-ng administration" msgstr "Administration de Paperless-ng"