diff --git a/.github/workflows/ansible.yml b/.github/workflows/ansible.yml index 05419d5e8..7467806c9 100644 --- a/.github/workflows/ansible.yml +++ b/.github/workflows/ansible.yml @@ -47,8 +47,9 @@ jobs: molecule converge molecule idempotence molecule verify - molecule destroy working-directory: "${{ github.repository }}" + env: + TARGET_GITHUB_SHA: "${{ github.event.pull_request.head.sha }}" # # https://galaxy.ansible.com/docs/contributing/importing.html # release: # runs-on: ubuntu-latest diff --git a/Pipfile b/Pipfile index 29a91ece3..4d9836e68 100644 --- a/Pipfile +++ b/Pipfile @@ -9,12 +9,12 @@ verify_ssl = true name = "piwheels" [packages] -dateparser = "~=0.7.6" +dateparser = "~=1.0.0" django = "~=3.1.3" django-cors-headers = "*" django-extensions = "*" django-filter = "~=2.4.0" -django-q = "~=1.3.4" +django-q = "==1.3.4" djangorestframework = "~=3.12.2" filelock = "*" fuzzywuzzy = {extras = ["speedup"], version = "*"} @@ -53,7 +53,7 @@ concurrent-log-handler = "*" # uvloop 0.15+ incompatible with python 3.6 uvloop = "~=0.14.0" # TODO: keep an eye on piwheel builds and update this once available (https://www.piwheels.org/project/cryptography/) -cryptography = "~=3.3.2" +cryptography = "~=3.4" "pdfminer.six" = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index eefaeeecd..98d8655eb 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "71959eb287fc97969263be5e3a1b1f4f369b7a5ace85bd1947a25b9b92e17e8a" + "sha256": "49f8a0718a7982bc4ca7e1315c17849523b0d29c38f13cff88f8f883e0e9943a" }, "pipfile-spec": 6, "requires": {}, @@ -28,11 +28,11 @@ }, "arrow": { "hashes": [ - "sha256:e098abbd9af3665aea81bdd6c869e93af4feb078e98468dd351c383af187aac5", - "sha256:ff08d10cda1d36c68657d6ad20d74fbea493d980f8b2d45344e00d6ed2bf6ed4" + "sha256:7909d9fd30d32fa8fd173fdeb3f7125aaf6dedd1a837276fe1d8cea2c0e86d76", + "sha256:b1e106a0ab754e540f4aeb08747900830b688adef02d81240e65afc0e781a870" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==0.17.0" + "markers": "python_version >= '3.6'", + "version": "==1.0.1" }, "asgiref": { "hashes": [ @@ -60,11 +60,11 @@ }, "autobahn": { "hashes": [ - "sha256:41a3a3f89cde48643baf4e105d9491c566295f9abee951379e59121784044b8b", - "sha256:7e6b1bf95196b733978bab2d54a7ab8899c16ce11be369dc58422c07b7eea726" + "sha256:884f79c50fdc55ade2c315946a9caa145e8b10075eee9d2c2594ea5e8f5226aa", + "sha256:bf7a9d302a34d0f719d43c57f65ca1f2f5c982dd6ea0c11e1e190ef6f43710fe" ], - "markers": "python_version >= '3.6'", - "version": "==21.2.1" + "markers": "python_version >= '3.7'", + "version": "==21.2.2" }, "automat": { "hashes": [ @@ -76,10 +76,10 @@ }, "blessed": { "hashes": [ - "sha256:0a74a8d3f0366db600d061273df77d44f0db07daade7bb7a4d49c8bc22ed9f74", - "sha256:580429e7e0c6f6a42ea81b0ae5a4993b6205c6ccbb635d034b4277af8175753e" + "sha256:1312879f971330a1b7f2c6341f2ae7e2cbac244bfc9d0ecfbbecd4b0293bc755", + "sha256:5b5e2f0563d5a668c282f3f5946f7b1abb70c85829461900e607e74d7725106e" ], - "version": "==1.17.12" + "version": "==1.18.0" }, "certifi": { "hashes": [ @@ -190,24 +190,22 @@ }, "cryptography": { "hashes": [ - "sha256:0d7b69674b738068fa6ffade5c962ecd14969690585aaca0a1b1fc9058938a72", - "sha256:1bd0ccb0a1ed775cd7e2144fe46df9dc03eefd722bbcf587b3e0616ea4a81eff", - "sha256:3c284fc1e504e88e51c428db9c9274f2da9f73fdf5d7e13a36b8ecb039af6e6c", - "sha256:49570438e60f19243e7e0d504527dd5fe9b4b967b5a1ff21cc12b57602dd85d3", - "sha256:541dd758ad49b45920dda3b5b48c968f8b2533d8981bcdb43002798d8f7a89ed", - "sha256:5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed", - "sha256:7951a966613c4211b6612b0352f5bf29989955ee592c4a885d8c7d0f830d0433", - "sha256:922f9602d67c15ade470c11d616f2b2364950602e370c76f0c94c94ae672742e", - "sha256:a0f0b96c572fc9f25c3f4ddbf4688b9b38c69836713fb255f4a2715d93cbaf44", - "sha256:a777c096a49d80f9d2979695b835b0f9c9edab73b59e4ceb51f19724dda887ed", - "sha256:a9a4ac9648d39ce71c2f63fe7dc6db144b9fa567ddfc48b9fde1b54483d26042", - "sha256:aa4969f24d536ae2268c902b2c3d62ab464b5a66bcb247630d208a79a8098e9b", - "sha256:c7390f9b2119b2b43160abb34f63277a638504ef8df99f11cb52c1fda66a2e6f", - "sha256:ddd06e71c449a4fe10d0c60846280ee35d69ce49e3e413ce46d5f129e1468083", - "sha256:e18e6ab84dfb0ab997faf8cca25a86ff15dfea4027b986322026cc99e0a892da" + "sha256:066bc53f052dfeda2f2d7c195cf16fb3e5ff13e1b6b7415b468514b40b381a5b", + "sha256:0923ba600d00718d63a3976f23cab19aef10c1765038945628cd9be047ad0336", + "sha256:2d32223e5b0ee02943f32b19245b61a62db83a882f0e76cc564e1cec60d48f87", + "sha256:4169a27b818de4a1860720108b55a2801f32b6ae79e7f99c00d79f2a2822eeb7", + "sha256:57ad77d32917bc55299b16d3b996ffa42a1c73c6cfa829b14043c561288d2799", + "sha256:5ecf2bcb34d17415e89b546dbb44e73080f747e504273e4d4987630493cded1b", + "sha256:600cf9bfe75e96d965509a4c0b2b183f74a4fa6f5331dcb40fb7b77b7c2484df", + "sha256:66b57a9ca4b3221d51b237094b0303843b914b7d5afd4349970bb26518e350b0", + "sha256:926ae3dfd160050158b9ca25d419fb7ee658974564b01aa10c059a75dffab7e8", + "sha256:93cfe5b7ff006de13e1e89830810ecbd014791b042cbe5eec253be11ac2b28f3", + "sha256:9e98b452132963678e3ac6c73f7010fe53adf72209a32854d55690acac3f6724", + "sha256:df186fcbf86dc1ce56305becb8434e4b6b7504bc724b71ad7a3239e0c9d14ef2", + "sha256:fec7fb46b10da10d9e1d078d1ff8ed9e05ae14f431fdbd11145edd0550b9a964" ], "index": "pypi", - "version": "==3.3.2" + "version": "==3.4.6" }, "daphne": { "hashes": [ @@ -219,11 +217,11 @@ }, "dateparser": { "hashes": [ - "sha256:7552c994f893b5cb8fcf103b4cd2ff7f57aab9bfd2619fdf0cf571c0740fd90b", - "sha256:e875efd8c57c85c2d02b238239878db59ff1971f5a823457fcc69e493bf6ebfa" + "sha256:159cc4e01a593706a15cd4e269a0b3345edf3aef8bf9278a57dac8adf5bf1e4a", + "sha256:17202df32c7a36e773136ff353aa3767e987f8b3e27374c39fd21a30a803d6f8" ], "index": "pypi", - "version": "==0.7.6" + "version": "==1.0.0" }, "django": { "hashes": [ @@ -415,11 +413,11 @@ }, "imap-tools": { "hashes": [ - "sha256:0eaa9b990fae336601dd44f353fac2d35ea25ca3b1b682a83700511635fc30ae", - "sha256:1c809e286d439e41fbe796c522ad4e565fd47a4260253343fa1b1045b6bfe8b1" + "sha256:44641716f0c5c07df78c5713405675fac50220d4f8e2906c9ed4aabd9c356fa8", + "sha256:bab9a6edf848a58bdd3959ba55e0eb75039ff188a3779371d0b8db674a4945e8" ], "index": "pypi", - "version": "==0.37.0" + "version": "==0.38.1" }, "img2pdf": { "hashes": [ @@ -591,11 +589,11 @@ }, "ocrmypdf": { "hashes": [ - "sha256:0f624456a50be0b0bc8c0b59704d159f637616c093a1cabe8bb383706561bcf7", - "sha256:b829ad640a6160423162012e094ee2f7cd074ec99efadd7f7486954ec9182985" + "sha256:2fca4046e3a33e5902dd89c3003a3f31c7d584dc43f14c7c97f57fce20d2e469", + "sha256:5c386fcf2c0f2635533c2bad0edcd2d455f667a134d180dc61cbb3d4d5f0c8e2" ], "index": "pypi", - "version": "==11.6.2" + "version": "==11.7.0" }, "pathvalidate": { "hashes": [ @@ -784,14 +782,6 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.20" }, - "pyhamcrest": { - "hashes": [ - "sha256:412e00137858f04bde0729913874a48485665f2d36fe9ee449f26be864af9316", - "sha256:7ead136e03655af85069b6f47b23eb7c3e5c221aa9f022a4fbb499f5b7308f29" - ], - "markers": "python_version >= '3.5'", - "version": "==2.0.2" - }, "pyopenssl": { "hashes": [ "sha256:4c231c759543ba02560fcd2480c48dcec4dae34c9da7d3747c508227e0624b51", @@ -1097,45 +1087,22 @@ }, "tqdm": { "hashes": [ - "sha256:65185676e9fdf20d154cffd1c5de8e39ef9696ff7e59fe0156b1b08e468736af", - "sha256:70657337ec104eb4f3fb229285358f23f045433f6aea26846cdd55f0fd68945c" + "sha256:2c44efa73b8914dba7807aefd09653ac63c22b5b4ea34f7a80973f418f1a3089", + "sha256:c23ac707e8e8aabb825e4d91f8e17247f9cc14b0d64dd9e97be0781e9e525bba" ], "index": "pypi", - "version": "==4.57.0" + "version": "==4.58.0" }, "twisted": { "extras": [ "tls" ], "hashes": [ - "sha256:0150dae5adc962d15e00054cc6926f1e64763fb8dd26e1632593ac06e592104b", - "sha256:040eb6641125d2a9a09cf198ec7b83dd8858c6f51f6770325ed9959c00f5098f", - "sha256:147780b8caf21ba2aef3688628eaf13d7e7fe02a86747cd54bfaf2140538f042", - "sha256:158ddb80719a4813d292293ac44ba41d8b56555ed009d90994a278237ee63d2c", - "sha256:15e52271f08f62e2230ff093e0278aa01c9dac057c4557cadadd2429eed86a3e", - "sha256:2182000d6ffc05d269e6c03bfcec8b57e20259ca1086180edaedec3f1e689292", - "sha256:25ffcf37944bdad4a99981bc74006d735a678d2b5c193781254fbbb6d69e3b22", - "sha256:3281d9ce889f7b21bdb73658e887141aa45a102baf3b2320eafcfba954fcefec", - "sha256:356e8d8dd3590e790e3dba4db139eb8a17aca64b46629c622e1b1597a4a92478", - "sha256:70952c56e4965b9f53b180daecf20a9595cf22b8d0935cd3bd664c90273c3ab2", - "sha256:7408c6635ee1b96587289283ebe90ee15dbf9614b05857b446055116bc822d29", - "sha256:7c547fd0215db9da8a1bc23182b309e84a232364cc26d829e9ee196ce840b114", - "sha256:894f6f3cfa57a15ea0d0714e4283913a5f2511dbd18653dd148eba53b3919797", - "sha256:94ac3d55a58c90e2075c5fe1853f2aa3892b73e3bf56395f743aefde8605eeaa", - "sha256:a58e61a2a01e5bcbe3b575c0099a2bcb8d70a75b1a087338e0c48dd6e01a5f15", - "sha256:c09c47ff9750a8e3aa60ad169c4b95006d455a29b80ad0901f031a103b2991cd", - "sha256:ca3a0b8c9110800e576d89b5337373e52018b41069bc879f12fa42b7eb2d0274", - "sha256:cd1dc5c85b58494138a3917752b54bb1daa0045d234b7c132c37a61d5483ebad", - "sha256:cdbc4c7f0cd7a2218b575844e970f05a1be1861c607b0e048c9bceca0c4d42f7", - "sha256:d267125cc0f1e8a0eed6319ba4ac7477da9b78a535601c49ecd20c875576433a", - "sha256:d72c55b5d56e176563b91d11952d13b01af8725c623e498db5507b6614fc1e10", - "sha256:d95803193561a243cb0401b0567c6b7987d3f2a67046770e1dccd1c9e49a9780", - "sha256:e92703bed0cc21d6cb5c61d66922b3b1564015ca8a51325bd164a5e33798d504", - "sha256:f058bd0168271de4dcdc39845b52dd0a4a2fecf5f1246335f13f5e96eaebb467", - "sha256:f3c19e5bd42bbe4bf345704ad7c326c74d3fd7a1b3844987853bef180be638d4" + "sha256:77544a8945cf69b98d2946689bbe0c75de7d145cdf11f391dd487eae8fc95a12", + "sha256:aab38085ea6cda5b378b519a0ec99986874921ee8881318626b0a3414bb2631e" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==20.3.0" + "markers": "python_full_version >= '3.5.4'", + "version": "==21.2.0" }, "txaio": { "hashes": [ @@ -1490,11 +1457,11 @@ }, "faker": { "hashes": [ - "sha256:31a58ec5a8f4672f24da3b5ddea02c82a712de1de3179b432948e5c34d787aca", - "sha256:aadfe0efe11ecbbbc5b3b0b0fab050c2acbd2d8e5201769546d43d236bfff663" + "sha256:90b69e9e05d622edb2fa5ebfda7bef41c88675cace85e72689fde5b8723d00a3", + "sha256:da395fe545f40d4366b82b1a02448847a4586bd2b28af393b3edbd1e45d1e0fc" ], "markers": "python_version >= '3.6'", - "version": "==6.4.1" + "version": "==6.5.0" }, "filelock": { "hashes": [ diff --git a/README.md b/README.md index b21173ba5..e59535af4 100644 --- a/README.md +++ b/README.md @@ -104,9 +104,13 @@ Paperless has been around a while now, and people are starting to build stuff on These projects also exist, but their status and compatibility with paperless-ng is unknown. -* [Paperless Desktop](https://github.com/thomasbrueggemann/paperless-desktop): A desktop UI for your Paperless installation. Runs on Mac, Linux, and Windows. * [paperless-cli](https://github.com/stgarf/paperless-cli): A golang command line binary to interact with a Paperless instance. +This project also exists, but needs updates to be compatile with paperless-ng. + +* [Paperless Desktop](https://github.com/thomasbrueggemann/paperless-desktop): A desktop UI for your Paperless installation. Runs on Mac, Linux, and Windows. + Known issues on Mac: (Could not load reminders and documents) + # Important Note Document scanners are typically used to scan sensitive documents. Things like your social insurance number, tax records, invoices, etc. Everything is stored in the clear without encryption. This means that Paperless should never be run on an untrusted host. Instead, I recommend that if you do want to use it, run it locally on a server in your own home. diff --git a/ansible/defaults/main.yml b/ansible/defaults/main.yml index f1cbb8f88..0a5824608 100644 --- a/ansible/defaults/main.yml +++ b/ansible/defaults/main.yml @@ -18,8 +18,9 @@ paperlessng_directory: /opt/paperless-ng paperlessng_consumption_dir: "{{ paperlessng_directory }}/consumption" paperlessng_data_dir: "{{ paperlessng_directory }}/data" paperlessng_media_root: "{{ paperlessng_directory }}/media" -paperlessng_static_dir: "{{ paperlessng_directory }}/static" +paperlessng_staticdir: "{{ paperlessng_directory }}/static" paperlessng_filename_format: +paperlessng_logging_dir: "{{ paperlessng_data_dir }}/log" paperlessng_virtualenv: "{{ paperlessng_directory }}/.venv" # Hosting & Security @@ -36,12 +37,15 @@ paperlessng_enable_http_remote_user: False paperlessng_ocr_languages: - eng paperlessng_ocr_mode: skip +paperlessng_ocr_clean: clean +paperlessng_ocr_deskew: True +paperlessng_ocr_rotate_pages: True +paperlessng_ocr_rotate_pages_threshold: 12 paperlessng_ocr_output_type: pdfa paperlessng_ocr_pages: 0 paperlessng_ocr_image_dpi: # see https://ocrmypdf.readthedocs.io/en/latest/api.html#ocrmypdf.ocr paperlessng_ocr_user_args: - #- "deskew": True # https://github.com/jonaswinkler/paperless-ng/issues/231 - "optimize": 1 paperlessng_use_jbig2enc: True paperlessng_big2enc_lossy: False @@ -57,10 +61,11 @@ paperlessng_consumer_polling: 0 paperlessng_consumer_delete_duplicates: False paperlessng_consumer_recursive: False paperlessng_consumer_subdirs_as_tags: False +paperlessng_convert_memory_limit: 0 +paperlessng_convert_tmpdir: paperlessng_optimize_thumbnails: True paperlessng_post_consume_script: paperlessng_filename_date_order: -paperlessng_filename_parse_transforms: paperlessng_thumbnail_font_name: /usr/share/fonts/liberation/LiberationSerif-Regular.ttf paperlessng_ignore_dates: "" diff --git a/ansible/molecule/default/converge.yml b/ansible/molecule/default/converge.yml index 1ae260bac..c7f43c877 100644 --- a/ansible/molecule/default/converge.yml +++ b/ansible/molecule/default/converge.yml @@ -4,7 +4,7 @@ tasks: - name: set current github commit as version when available set_fact: - paperlessng_version: "{{ lookup('env', 'GITHUB_SHA') | default('master', True) }}" + paperlessng_version: "{{ lookup('env', 'TARGET_GITHUB_SHA') | default('master', True) }}" - name: update to newest paperless-ng release include_role: name: ansible diff --git a/ansible/tasks/main.yml b/ansible/tasks/main.yml index bfaf8df17..92eb92032 100644 --- a/ansible/tasks/main.yml +++ b/ansible/tasks/main.yml @@ -43,7 +43,7 @@ - name: install ocr languages apt: - pkg: "{{ paperlessng_ocr_languages | map('regex_replace', '^(.*)$', 'tesseract-ocr-\\1') | list }}" + pkg: "{{ paperlessng_ocr_languages | map('regex_replace', '^(.*)$', 'tesseract-ocr-\\1') | map('replace', '_', '-') | list }}" - name: set up notesalexp repository key (for jbig2enc) apt_key: @@ -256,7 +256,7 @@ - "{{ paperlessng_consumption_dir }}" - "{{ paperlessng_data_dir }}" - "{{ paperlessng_media_root }}" - - "{{ paperlessng_static_dir }}" + - "{{ paperlessng_staticdir }}" - name: rename initial config command: @@ -280,9 +280,11 @@ - regexp: PAPERLESS_MEDIA_ROOT line: "PAPERLESS_MEDIA_ROOT={{ paperlessng_media_root }}" - regexp: PAPERLESS_STATICDIR - line: "PAPERLESS_STATICDIR={{ paperlessng_static_dir }}" + line: "PAPERLESS_STATICDIR={{ paperlessng_staticdir }}" - regexp: PAPERLESS_FILENAME_FORMAT line: "PAPERLESS_FILENAME_FORMAT={{ paperlessng_filename_format }}" + - regexp: PAPERLESS_LOGGING_DIR + line: "PAPERLESS_LOGGING_DIR={{ paperlessng_logging_dir }}" # Hosting & Security - regexp: PAPERLESS_SECRET_KEY line: "PAPERLESS_SECRET_KEY={{ paperlessng_secret_key }}" @@ -302,9 +304,17 @@ line: "PAPERLESS_ENABLE_HTTP_REMOTE_USER={{ paperlessng_enable_http_remote_user }}" # OCR settings - regexp: PAPERLESS_OCR_LANGUAGE - line: "PAPERLESS_OCR_LANGUAGE={{ paperlessng_ocr_languages | join('+') }}" + line: "PAPERLESS_OCR_LANGUAGE={{ paperlessng_ocr_languages | join('+') | replace('-','_') }}" - regexp: PAPERLESS_OCR_MODE line: "PAPERLESS_OCR_MODE={{ paperlessng_ocr_mode }}" + - regexp: PAPERLESS_OCR_CLEAN + line: "PAPERLESS_OCR_CLEAN={{ paperlessng_ocr_clean }}" + - regexp: PAPERLESS_OCR_DESKEW + line: "PAPERLESS_OCR_DESKEW={{ paperlessng_ocr_deskew }}" + - regexp: PAPERLESS_OCR_ROTATE_PAGES + line: "PAPERLESS_OCR_ROTATE_PAGES={{ paperlessng_ocr_rotate_pages }}" + - regexp: PAPERLESS_OCR_ROTATE_PAGES_THRESHOLD + line: "PAPERLESS_OCR_ROTATE_PAGES_THRESHOLD={{ paperlessng_ocr_rotate_pages_threshold }}" - regexp: PAPERLESS_OCR_OUTPUT_TYPE line: "PAPERLESS_OCR_OUTPUT_TYPE={{ paperlessng_ocr_output_type }}" - regexp: PAPERLESS_OCR_PAGES @@ -331,6 +341,10 @@ line: "PAPERLESS_CONSUMER_RECURSIVE={{ paperlessng_consumer_recursive }}" - regexp: PAPERLESS_CONSUMER_SUBDIRS_AS_TAGS line: "PAPERLESS_CONSUMER_SUBDIRS_AS_TAGS={{ paperlessng_consumer_subdirs_as_tags }}" + - regexp: PAPERLESS_CONVERT_MEMORY_LIMIT + line: "PAPERLESS_CONVERT_MEMORY_LIMIT={{ paperlessng_convert_memory_limit }}" + - regexp: PAPERLESS_CONVERT_TMPDIR + line: "PAPERLESS_CONVERT_TMPDIR={{ paperlessng_convert_tmpdir }}" - regexp: PAPERLESS_OPTIMIZE_THUMBNAILS line: "PAPERLESS_OPTIMIZE_THUMBNAILS={{ paperlessng_optimize_thumbnails }}" - regexp: PAPERLESS_POST_CONSUME_SCRIPT diff --git a/docs/administration.rst b/docs/administration.rst index c91f501bd..19ab1e73f 100644 --- a/docs/administration.rst +++ b/docs/administration.rst @@ -184,17 +184,17 @@ Downgrades are possible. However, some updates also contain database migrations In order to move back from a version that applied database migrations, you'll have to revert the database migration *before* downgrading, and then downgrade paperless. -This table lists the most recent database migrations for each versions: +This table lists the compatible versions for each database migration number. -+---------+-------------------------+ -| Version | Latest migration number | -+---------+-------------------------+ -| 1.0.0 | 1011 | -+---------+-------------------------+ -| 1.1.0 | 1011 | -+---------+-------------------------+ -| 1.1.1 | 1012 | -+---------+-------------------------+ ++------------------+-----------------+ +| Migration number | Version range | ++------------------+-----------------+ +| 1011 | 1.0.0 | ++------------------+-----------------+ +| 1012 | 1.1.0 - 1.2.1 | ++------------------+-----------------+ +| 1013 | 1.3.0 - current | ++------------------+-----------------+ Execute the following management command to migrate your database: diff --git a/docs/api.rst b/docs/api.rst index cff72a970..c2120b20f 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -284,3 +284,53 @@ The endpoint supports the following optional form fields: The endpoint will immediately return "OK" if the document consumption process was started successfully. No additional status information about the consumption process itself is available, since that happens in a different process. + + +.. _api-versioning: + +API Versioning +############## + +The REST API is versioned since Paperless-ng 1.3.0. + +* Versioning ensures that changes to the API don't break older clients. +* Clients specify the specific version of the API they wish to use with every request and Paperless will handle the request using the specified API version. +* Even if the underlying data model changes, older API versions will always serve compatible data. +* If no version is specified, Paperless will serve version 1 to ensure compatibility with older clients that do not request a specific API version. + +API versions are specified by submitting an additional HTTP ``Accept`` header with every request: + +.. code:: + + Accept: application/json; version=6 + +If an invalid version is specified, Paperless 1.3.0 will respond with "406 Not Acceptable" and an error message in the body. +Earlier versions of Paperless will serve API version 1 regardless of whether a version is specified via the ``Accept`` header. + +If a client wishes to verify whether it is compatible with any given server, the following procedure should be performed: + +1. Perform an *authenticated* request against any API endpoint. If the server is on version 1.3.0 or newer, the server will + add two custom headers to the response: + + .. code:: + + X-Api-Version: 2 + X-Version: 1.3.0 + +2. Determine whether the client is compatible with this server based on the presence/absence of these headers and their values if present. + + +API Changelog +============= + +Version 1 +--------- + +Initial API version. + +Version 2 +--------- + +* Added field ``Tag.color``. This read/write string field contains a hex color such as ``#a6cee3``. +* Added read-only field ``Tag.text_color``. This field contains the text color to use for a specific tag, which is either black or white depending on the brightness of ``Tag.color``. +* Removed field ``Tag.colour``. diff --git a/docs/changelog.rst b/docs/changelog.rst index 137fa2fd2..0c8056266 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,10 +5,31 @@ Changelog ********* +paperless-ng 1.3.0 +################## + +This release contains new database migrations. + +* Added a color picker for tag colors. + +* Added translations into Italian and Romanian. Thank you! + +* Close individual documents from the sidebar. + +* `BolkoSchreiber `_ added an option to disable/enable thumbnail inversion in dark mode. + +* Fixed an issue with the auto matching algorithm when more than 256 tags were used. + +* `Simon Taddiken `_ added the ability to customize the header used for remote user authentication with SSO applications. + +* The REST API is versioned from this point onwards. See the documentation about :ref:`api-versioning` for details. + + + paperless-ng 1.2.1 ################## -* `Rodrigo Avelino `_ translated Paperless into Portuguese (Brazil). +* `Rodrigo Avelino `_ translated Paperless into Portuguese (Brazil)! * The date input fields now respect the currently selected date format. @@ -16,6 +37,8 @@ paperless-ng 1.2.1 * When using regular expression matching, the regular expression is now validated before saving the tag/correspondent/type. +* Regression fix: Dates on the front end did not respect date locale settings in some cases. + paperless-ng 1.2.0 ################## diff --git a/docs/configuration.rst b/docs/configuration.rst index e26180382..48b09213d 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -191,8 +191,28 @@ PAPERLESS_ENABLE_HTTP_REMOTE_USER= Allows authentication via HTTP_REMOTE_USER which is used by some SSO applications. - Defaults to `false` which disables this feature. + .. warning:: + This will allow authentication by simply adding a ``Remote-User: `` header + to a request. Use with care! You especially *must* ensure that any such header is not + passed from your proxy server to paperless. + + If you're exposing paperless to the internet directly, do not use this. + + Also see the warning `in the official documentation `. + + Defaults to `false` which disables this feature. + +PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME= + If `PAPERLESS_ENABLE_HTTP_REMOTE_USER` is enabled, this property allows to + customize the name of the HTTP header from which the authenticated username + is extracted. Values are in terms of + [HttpRequest.META](https://docs.djangoproject.com/en/3.1/ref/request-response/#django.http.HttpRequest.META). + Thus, the configured value must start with `HTTP_` followed by the + normalized actual header name. + + Defaults to `HTTP_REMOTE_USER`. + .. _configuration-ocr: OCR settings diff --git a/docs/extending.rst b/docs/extending.rst index 860106258..54a0d061e 100644 --- a/docs/extending.rst +++ b/docs/extending.rst @@ -5,29 +5,82 @@ Paperless development This section describes the steps you need to take to start development on paperless-ng. -1. Check out the source from github. The repository is organized in the following way: +Check out the source from github. The repository is organized in the following way: - * ``master`` always represents the latest release and will only see changes - when a new release is made. - * ``dev`` contains the code that will be in the next release. - * ``feature-X`` contain bigger changes that will be in some release, but not - necessarily the next one. - - Apart from that, the folder structure is as follows: +* ``master`` always represents the latest release and will only see changes + when a new release is made. +* ``dev`` contains the code that will be in the next release. +* ``feature-X`` contain bigger changes that will be in some release, but not + necessarily the next one. - * ``docs/`` - Documentation. - * ``src-ui/`` - Code of the front end. - * ``src/`` - Code of the back end. - * ``scripts/`` - Various scripts that help with different parts of development. - * ``docker/`` - Files required to build the docker image. +When making functional changes to paperless, *always* make your changes on the ``dev`` branch. -2. Install some dependencies. +Apart from that, the folder structure is as follows: - * Python 3.6. - * All dependencies listed in the :ref:`Bare metal route ` - * redis. You can either install redis or use the included scritps/start-services.sh - to use docker to fire up a redis instance (and some other services such as tika, - gotenberg and a postgresql server). +* ``docs/`` - Documentation. +* ``src-ui/`` - Code of the front end. +* ``src/`` - Code of the back end. +* ``scripts/`` - Various scripts that help with different parts of development. +* ``docker/`` - Files required to build the docker image. + +Initial setup and first start +============================= + +After you forked and cloned the code from github you need to perform a first-time setup. +To do the setup you need to perform the steps from the following chapters in a certain order: + +1. Install prerequisites + pipenv as mentioned in :ref:`Bare metal route ` +2. Copy ``paperless.conf.example`` to ``paperless.conf`` and enable debug mode. +3. Install the Angular CLI interface: + + .. code:: shell-session + + $ npm install -g @angular/cli + +4. Create ``consume`` and ``media`` folders in the cloned root folder. + + .. code:: shell-session + + mkdir -p consume media + +5. You can now either ... + + * install redis or + * use the included scripts/start-services.sh to use docker to fire up a redis instance (and some other services such as tika, gotenberg and a postgresql server) or + * spin up a bare redis container + + .. code:: shell-session + + docker run -d -p 6379:6379 -restart unless-stopped redis:latest + +6. Install the python dependencies by performing in the src/ directory. + + .. code:: shell-session + + pipenv install --dev + +7. Generate the static UI so you can perform a login to get session that is required for frontend development (this needs to be done one time only). From root folder: + + .. code:: shell-session + + compile-frontend.sh + +8. Apply migrations and create a superuser for your dev instance: + + .. code:: shell-session + + python3 manage.py migrate + python3 manage.py createsuperuser + +9. Now spin up the dev backend. Depending on which part of paperless you're developing for, you need to have some or all of them running. + + .. code:: shell-session + + python3 manage.py runserver & python3 manage.py document_consumer & python3 manage.py qcluster + +10. Login with the superuser credentials provided in step 8 at ``http://localhost:8000`` to create a session that enables you to use the backend. + +Backend development environment is now ready, to start Frontend development go to ``/src-ui`` and run ``ng serve``. From there you can use ``http://localhost:4200`` for a preview. Back end development ==================== @@ -35,21 +88,18 @@ Back end development The backend is a django application. I use PyCharm for development, but you can use whatever you want. -Install the python dependencies by performing ``pipenv install --dev`` in the src/ directory. -This will also create a virtual environment, which you can enter with ``pipenv shell`` or -execute one-shot commands in with ``pipenv run``. - -Copy ``paperless.conf.example`` to ``paperless.conf`` and enable debug mode. - Configure the IDE to use the src/ folder as the base source folder. Configure the following launch configurations in your IDE: * python3 manage.py runserver * python3 manage.py qcluster -* python3 manage.py consumer +* python3 manage.py document_consumer -Depending on which part of paperless you're developing for, you need to have some or all of -them running. +To start them all: + +.. code:: shell-session + + python3 manage.py runserver & python3 manage.py document_consumer & python3 manage.py qcluster Testing and code style: @@ -62,7 +112,7 @@ Testing and code style: The line length rule E501 is generally useful for getting multiple source files next to each other on the screen. However, in some cases, its just not possible - to make some lines fit, especially complicated IF cases. Append `` # NOQA: E501`` + to make some lines fit, especially complicated IF cases. Append ``# NOQA: E501`` to disable this check for certain lines. Front end development @@ -109,6 +159,92 @@ This will build the front end and put it in a location from which the Django ser it as static content. This way, you can verify that authentication is working. +Localization +============ + +Paperless is available in many different languages. Since paperless consists both of a django +application and an Angular front end, both these parts have to be translated separately. + +Front end localization +---------------------- + +* The Angular front end does localization according to the `Angular documentation `_. +* The source language of the project is "en_US". +* The source strings end up in the file "src-ui/messages.xlf". +* The translated strings need to be placed in the "src-ui/src/locale/" folder. +* In order to extract added or changed strings from the source files, call ``ng xi18n --ivy``. + +Adding new languages requires adding the translated files in the "src-ui/src/locale/" fodler and adjusting a couple files. + +1. Adjust "src-ui/angular.json": + + .. code:: json + + "i18n": { + "sourceLocale": "en-US", + "locales": { + "de": "src/locale/messages.de.xlf", + "nl-NL": "src/locale/messages.nl_NL.xlf", + "fr": "src/locale/messages.fr.xlf", + "en-GB": "src/locale/messages.en_GB.xlf", + "pt-BR": "src/locale/messages.pt_BR.xlf", + "language-code": "language-file" + } + } + +2. Add the language to the available options in "src-ui/src/app/services/settings.service.ts": + + .. code:: typescript + + getLanguageOptions(): LanguageOption[] { + return [ + {code: "en-us", name: $localize`English (US)`, englishName: "English (US)", dateInputFormat: "mm/dd/yyyy"}, + {code: "en-gb", name: $localize`English (GB)`, englishName: "English (GB)", dateInputFormat: "dd/mm/yyyy"}, + {code: "de", name: $localize`German`, englishName: "German", dateInputFormat: "dd.mm.yyyy"}, + {code: "nl", name: $localize`Dutch`, englishName: "Dutch", dateInputFormat: "dd-mm-yyyy"}, + {code: "fr", name: $localize`French`, englishName: "French", dateInputFormat: "dd/mm/yyyy"}, + {code: "pt-br", name: $localize`Portuguese (Brazil)`, englishName: "Portuguese (Brazil)", dateInputFormat: "dd/mm/yyyy"} + // Add your new language here + ] + } + + ``dateInputFormat`` is a special string that defines the behavior of the date input fields and absolutely needs to contain "dd", "mm" and "yyyy". + +3. Import and register the Angular data for this locale in "src-ui/src/app/app.module.ts": + + .. code:: typescript + + import localeDe from '@angular/common/locales/de'; + registerLocaleData(localeDe) + +Back end localization +--------------------- + +A majority of the strings that appear in the back end appear only when the admin is used. However, +some of these are still shown on the front end (such as error messages). + +* The django application does localization according to the `django documentation `_. +* The source language of the project is "en_US". +* Localization files end up in the folder "src/locale/". +* In order to extract strings from the application, call ``python3 manage.py makemessages -l en_US``. This is important after making changes to translatable strings. +* The message files need to be compiled for them to show up in the application. Call ``python3 manage.py compilemessages`` to do this. The generated files don't get + committed into git, since these are derived artifacts. The build pipeline takes care of executing this command. + +Adding new languages requires adding the translated files in the "src/locale/" folder and adjusting the file "src/paperless/settings.py" to include the new language: + +.. code:: python + + LANGUAGES = [ + ("en-us", _("English (US)")), + ("en-gb", _("English (GB)")), + ("de", _("German")), + ("nl-nl", _("Dutch")), + ("fr", _("French")), + ("pt-br", _("Portuguese (Brazil)")), + # Add language here. + ] + + Building the documentation ========================== diff --git a/docs/setup.rst b/docs/setup.rst index 69cb2bc97..98e055a07 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -284,6 +284,12 @@ writing. Windows is not and will never be supported. * ``libmagic-dev`` for mime type detection * ``mime-support`` for mime type detection + Use this list for your preferred package management: + + .. code:: + + python3 python3-pip python3-dev imagemagick fonts-liberation optipng gnupg libpq-dev libmagic-dev mime-support + These dependencies are required for OCRmyPDF, which is used for text recognition. * ``unpaper`` @@ -297,6 +303,12 @@ writing. Windows is not and will never be supported. * ``tesseract-ocr`` >= 4.0.0 for OCR * ``tesseract-ocr`` language packs (``tesseract-ocr-eng``, ``tesseract-ocr-deu``, etc) + Use this list for your preferred package management: + + .. code:: + + unpaper ghostscript icc-profiles-free qpdf liblept5 libxml2 pngquant zlib1g tesseract-ocr + On Raspberry Pi, these libraries are required as well: * ``libatlas-base-dev`` diff --git a/requirements.txt b/requirements.txt index 2df1b29ae..947a30350 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,13 +8,13 @@ -i https://pypi.python.org/simple --extra-index-url https://www.piwheels.org/simple aioredis==1.3.1 -arrow==0.17.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' +arrow==1.0.1; python_version >= '3.6' asgiref==3.3.1; python_version >= '3.5' async-timeout==3.0.1; python_full_version >= '3.5.3' attrs==20.3.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -autobahn==21.2.1; python_version >= '3.6' +autobahn==21.2.2; python_version >= '3.7' automat==20.2.0 -blessed==1.17.12 +blessed==1.18.0 certifi==2020.12.5 cffi==1.14.5 channels-redis==3.2.0 @@ -24,9 +24,9 @@ click==7.1.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, coloredlogs==15.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' concurrent-log-handler==0.9.19 constantly==15.1.0 -cryptography==3.3.2 +cryptography==3.4.6 daphne==3.0.1; python_version >= '3.6' -dateparser==0.7.6 +dateparser==1.0.0 django-cors-headers==3.7.0 django-extensions==3.1.1 django-filter==2.4.0 @@ -43,7 +43,7 @@ httptools==0.1.1 humanfriendly==9.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' hyperlink==21.0.0 idna==2.10; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -imap-tools==0.37.0 +imap-tools==0.38.1 img2pdf==0.4.0 incremental==17.5.0 inotify-simple==1.3.5; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' @@ -53,7 +53,7 @@ langdetect==1.0.8 lxml==4.6.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' msgpack==1.0.2 numpy==1.19.5 -ocrmypdf==11.6.2 +ocrmypdf==11.7.0 pathvalidate==2.3.2 pdfminer.six==20201018 pikepdf==2.5.2 @@ -64,7 +64,6 @@ psycopg2-binary==2.8.6 pyasn1-modules==0.2.8 pyasn1==0.4.8 pycparser==2.20; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -pyhamcrest==2.0.2; python_version >= '3.5' pyopenssl==20.0.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' python-dateutil==2.8.1 python-dotenv==0.15.0 @@ -85,8 +84,8 @@ sortedcontainers==2.3.0 sqlparse==0.4.1; python_version >= '3.5' threadpoolctl==2.1.0; python_version >= '3.5' tika==1.24 -tqdm==4.57.0 -twisted[tls]==20.3.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' +tqdm==4.58.0 +twisted[tls]==21.2.0; python_full_version >= '3.5.4' txaio==21.2.1; python_version >= '3.6' tzlocal==2.1 urllib3==1.26.3; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4' diff --git a/src-ui/angular.json b/src-ui/angular.json index 2877408d2..9f53a8fb1 100644 --- a/src-ui/angular.json +++ b/src-ui/angular.json @@ -20,7 +20,9 @@ "nl-NL": "src/locale/messages.nl_NL.xlf", "fr": "src/locale/messages.fr.xlf", "en-GB": "src/locale/messages.en_GB.xlf", - "pt-BR": "src/locale/messages.pt_BR.xlf" + "pt-BR": "src/locale/messages.pt_BR.xlf", + "it": "src/locale/messages.it.xlf", + "ro": "src/locale/messages.ro.xlf" } }, "architect": { diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index d04d5a6f8..329399584 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -419,7 +419,7 @@ Do you really want to delete the tag ""? src/app/components/manage/tag-list/tag-list.component.ts - 30 + 26 @@ -517,35 +517,35 @@ Saved view "" deleted. src/app/components/manage/settings/settings.component.ts - 67 + 68 Settings saved successfully. src/app/components/manage/settings/settings.component.ts - 87 + 89 Use system language src/app/components/manage/settings/settings.component.ts - 92 + 94 Use date format of display language src/app/components/manage/settings/settings.component.ts - 98 + 100 Error while storing settings on server: src/app/components/manage/settings/settings.component.ts - 115 + 117 @@ -566,14 +566,14 @@ Notifications src/app/components/manage/settings/settings.component.html - 115 + 116 Saved views src/app/components/manage/settings/settings.component.html - 133 + 134 @@ -681,102 +681,109 @@ 98 + + Invert thumbnails in dark mode + + src/app/components/manage/settings/settings.component.html + 99 + + Bulk editing src/app/components/manage/settings/settings.component.html - 102 + 103 Show confirmation dialogs src/app/components/manage/settings/settings.component.html - 106 + 107 Deleting documents will always ask for confirmation. src/app/components/manage/settings/settings.component.html - 106 + 107 Apply on close src/app/components/manage/settings/settings.component.html - 107 + 108 Document processing src/app/components/manage/settings/settings.component.html - 118 + 119 Show notifications when new documents are detected src/app/components/manage/settings/settings.component.html - 122 + 123 Show notifications when document processing completes successfully src/app/components/manage/settings/settings.component.html - 123 + 124 Show notifications when document processing fails src/app/components/manage/settings/settings.component.html - 124 + 125 Suppress notifications on dashboard src/app/components/manage/settings/settings.component.html - 125 + 126 This will suppress all messages about document processing status on the dashboard. src/app/components/manage/settings/settings.component.html - 125 + 126 Appears on src/app/components/manage/settings/settings.component.html - 145 + 146 Show on dashboard src/app/components/manage/settings/settings.component.html - 148 + 149 Show in sidebar src/app/components/manage/settings/settings.component.html - 152 + 153 No saved views defined. src/app/components/manage/settings/settings.component.html - 162 + 163 @@ -867,28 +874,28 @@ Create new tag src/app/components/manage/tag-list/tag-edit-dialog/tag-edit-dialog.component.ts - 21 + 22 Edit tag src/app/components/manage/tag-list/tag-edit-dialog/tag-edit-dialog.component.ts - 25 + 26 Inbox tag src/app/components/manage/tag-list/tag-edit-dialog/tag-edit-dialog.component.html - 21 + 13 Inbox tags are automatically assigned to all consumed documents. src/app/components/manage/tag-list/tag-edit-dialog/tag-edit-dialog.component.html - 21 + 13 @@ -973,42 +980,42 @@ Manage src/app/components/app-frame/app-frame.component.html - 107 + 112 Admin src/app/components/app-frame/app-frame.component.html - 149 + 154 Info src/app/components/app-frame/app-frame.component.html - 155 + 160 Documentation src/app/components/app-frame/app-frame.component.html - 162 + 167 GitHub src/app/components/app-frame/app-frame.component.html - 170 + 175 Suggest an idea src/app/components/app-frame/app-frame.component.html - 176 + 181 @@ -1029,84 +1036,98 @@ Close all src/app/components/app-frame/app-frame.component.html - 101 + 106 + + + + Title + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 73 + + + + Title & content + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 74 Correspondent: src/app/components/document-list/filter-editor/filter-editor.component.ts - 29 + 32 Without correspondent src/app/components/document-list/filter-editor/filter-editor.component.ts - 31 + 34 Type: src/app/components/document-list/filter-editor/filter-editor.component.ts - 36 + 39 Without document type src/app/components/document-list/filter-editor/filter-editor.component.ts - 38 + 41 Tag: src/app/components/document-list/filter-editor/filter-editor.component.ts - 42 + 45 Without any tag src/app/components/document-list/filter-editor/filter-editor.component.ts - 46 + 49 Title: src/app/components/document-list/filter-editor/filter-editor.component.ts - 50 + 53 Filter tags src/app/components/document-list/filter-editor/filter-editor.component.html - 12 + 20 Filter correspondents src/app/components/document-list/filter-editor/filter-editor.component.html - 20 + 28 Filter document types src/app/components/document-list/filter-editor/filter-editor.component.html - 27 + 35 Reset filters src/app/components/document-list/filter-editor/filter-editor.component.html - 50 + 58 @@ -1128,28 +1149,28 @@ Last 7 days src/app/components/common/date-dropdown/date-dropdown.component.ts - 24 + 34 Last month src/app/components/common/date-dropdown/date-dropdown.component.ts - 25 + 35 Last 3 months src/app/components/common/date-dropdown/date-dropdown.component.ts - 26 + 36 Last year src/app/components/common/date-dropdown/date-dropdown.component.ts - 27 + 37 @@ -1163,7 +1184,7 @@ Before src/app/components/common/date-dropdown/date-dropdown.component.html - 29 + 38 @@ -1602,7 +1623,7 @@ Invalid date. src/app/components/common/input/date/date.component.html - 13 + 14 @@ -1630,49 +1651,63 @@ English (US) src/app/services/settings.service.ts - 88 + 90 English (GB) src/app/services/settings.service.ts - 89 + 91 German src/app/services/settings.service.ts - 90 + 92 Dutch src/app/services/settings.service.ts - 91 + 93 French src/app/services/settings.service.ts - 92 + 94 Portuguese (Brazil) src/app/services/settings.service.ts - 93 + 95 + + + + Italian + + src/app/services/settings.service.ts + 96 + + + + Romanian + + src/app/services/settings.service.ts + 97 ISO 8601 src/app/services/settings.service.ts - 98 + 102 @@ -1798,13 +1833,6 @@ 18 - - Title - - src/app/services/rest/document.service.ts - 19 - - Document type @@ -1833,97 +1861,6 @@ 23 - - Light blue - - src/app/data/paperless-tag.ts - 6 - - - - Blue - - src/app/data/paperless-tag.ts - 7 - - - - Light green - - src/app/data/paperless-tag.ts - 8 - - - - Green - - src/app/data/paperless-tag.ts - 9 - - - - Light red - - src/app/data/paperless-tag.ts - 10 - - - - Red - - src/app/data/paperless-tag.ts - 11 - - - - Light orange - - src/app/data/paperless-tag.ts - 12 - - - - Orange - - src/app/data/paperless-tag.ts - 13 - - - - Light violet - - src/app/data/paperless-tag.ts - 14 - - - - Violet - - src/app/data/paperless-tag.ts - 15 - - - - Brown - - src/app/data/paperless-tag.ts - 16 - - - - Black - - src/app/data/paperless-tag.ts - 17 - - - - Light grey - - src/app/data/paperless-tag.ts - 18 - - Create new item diff --git a/src-ui/package-lock.json b/src-ui/package-lock.json index fd6d69538..54c99b1b3 100644 --- a/src-ui/package-lock.json +++ b/src-ui/package-lock.json @@ -2035,6 +2035,11 @@ "to-fast-properties": "^2.0.0" } }, + "@ctrl/tinycolor": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.4.0.tgz", + "integrity": "sha512-JZButFdZ1+/xAfpguQHoabIXkcqRRKpMrWKBkpEZZyxfY9C1DpADFB8PEqGSTeFr135SaTRfKqGKx5xSCLI7ZQ==" + }, "@istanbuljs/schema": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", @@ -7895,6 +7900,11 @@ "object-visit": "^1.0.0" } }, + "material-colors": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/material-colors/-/material-colors-1.2.6.tgz", + "integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==" + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -8333,6 +8343,16 @@ } } }, + "ngx-color": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ngx-color/-/ngx-color-6.2.0.tgz", + "integrity": "sha512-n04tcMnCpOgmI24egST94YwHmnSoAxK8O1T2t3nGrTwWbvw5XBRJvImNFnoNrriBXzc4Gx4hFehH5MU8CZxp1w==", + "requires": { + "@ctrl/tinycolor": "^3.1.6", + "material-colors": "^1.2.6", + "tslib": "^2.0.0" + } + }, "ngx-cookie-service": { "version": "10.1.1", "resolved": "https://registry.npmjs.org/ngx-cookie-service/-/ngx-cookie-service-10.1.1.tgz", diff --git a/src-ui/package.json b/src-ui/package.json index 896caab30..b005d843a 100644 --- a/src-ui/package.json +++ b/src-ui/package.json @@ -25,6 +25,7 @@ "bootstrap": "^4.5.0", "file-saver": "^2.0.5", "ng-bootstrap": "^1.6.3", + "ngx-color": "^6.2.0", "ngx-cookie-service": "^10.1.1", "ngx-file-drop": "^10.0.0", "ngx-infinite-scroll": "^9.1.0", diff --git a/src-ui/src/app/app.module.ts b/src-ui/src/app/app.module.ts index e9f52d62e..dc8b185ea 100644 --- a/src-ui/src/app/app.module.ts +++ b/src-ui/src/app/app.module.ts @@ -61,18 +61,26 @@ import { CustomDatePipe } from './pipes/custom-date.pipe'; import { DateComponent } from './components/common/input/date/date.component'; import { ISODateTimeAdapter } from './utils/ngb-iso-date-time-adapter'; import { LocalizedDateParserFormatter } from './utils/ngb-date-parser-formatter'; +import { ApiVersionInterceptor } from './interceptors/api-version.interceptor'; +import { ColorSliderModule } from 'ngx-color/slider'; +import { ColorComponent } from './components/common/input/color/color.component'; import localeFr from '@angular/common/locales/fr'; import localeNl from '@angular/common/locales/nl'; import localeDe from '@angular/common/locales/de'; -import localePt from '@angular/common/locales/pt-PT'; +import localePt from '@angular/common/locales/pt'; +import localeIt from '@angular/common/locales/it'; import localeEnGb from '@angular/common/locales/en-GB'; +import localeRo from '@angular/common/locales/ro'; + registerLocaleData(localeFr) registerLocaleData(localeNl) registerLocaleData(localeDe) registerLocaleData(localePt, "pt-BR") +registerLocaleData(localeIt) registerLocaleData(localeEnGb) +registerLocaleData(localeRo) @NgModule({ declarations: [ @@ -123,7 +131,8 @@ registerLocaleData(localeEnGb) NumberComponent, SafePipe, CustomDatePipe, - DateComponent + DateComponent, + ColorComponent ], imports: [ BrowserModule, @@ -134,7 +143,8 @@ registerLocaleData(localeEnGb) ReactiveFormsModule, NgxFileDropModule, InfiniteScrollModule, - NgSelectModule + NgSelectModule, + ColorSliderModule ], providers: [ DatePipe, @@ -142,6 +152,10 @@ registerLocaleData(localeEnGb) provide: HTTP_INTERCEPTORS, useClass: CsrfInterceptor, multi: true + },{ + provide: HTTP_INTERCEPTORS, + useClass: ApiVersionInterceptor, + multi: true }, FilterPipe, DocumentTitlePipe, diff --git a/src-ui/src/app/components/app-frame/app-frame.component.html b/src-ui/src/app/components/app-frame/app-frame.component.html index 34a978fe5..c59bc3e0a 100644 --- a/src-ui/src/app/components/app-frame/app-frame.component.html +++ b/src-ui/src/app/components/app-frame/app-frame.component.html @@ -92,6 +92,11 @@  {{d.title | documentTitle}} + + + + +