Compare commits

...

5900 Commits

Author SHA1 Message Date
Safihre
63c03b42a9 Update text files for 4.6.0Beta2 2025-12-22 22:00:02 +01:00
SABnzbd Automation
4539837fad Update translatable texts
[skip ci]
2025-12-22 20:53:43 +00:00
Safihre
a0cd48e3f5 Notify user if they run AMD64 version on ARM64 Windows machine
Closes #3235
2025-12-22 21:52:58 +01:00
Safihre
ceeb7cb162 Add Windows ARM64 binary 2025-12-22 21:25:17 +01:00
SABnzbd Automation
f9f4e1b028 Update translatable texts
[skip ci]
2025-12-22 15:40:48 +00:00
Safihre
6487944c6c Move Pipelining setting to Server-level 2025-12-22 16:38:46 +01:00
renovate[bot]
239fddf39c Update all dependencies (develop) (#3238)
* Update all dependencies

* Compare fakefs result after sorting

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2025-12-22 12:45:00 +00:00
SABnzbd Automation
8ada8b2fd9 Update translatable texts
[skip ci]
2025-12-19 11:41:18 +00:00
Safihre
b19bd65495 Show error in case of failed NZB upload
Closes #3233
2025-12-19 12:40:34 +01:00
Safihre
e3ea5fdd64 Update appdata file with Flathub suggestions
@jcfp
2025-12-19 11:54:53 +01:00
Safihre
4fdb89701a Add release URL's to appdata 2025-12-19 11:42:36 +01:00
SABnzbd Automation
9165c4f304 Update translatable texts
[skip ci]
2025-12-18 20:10:14 +00:00
mnightingale
4152f0ba6a Increase max pipelining (#3234) 2025-12-18 20:09:24 +00:00
SABnzbd Automation
3eaab17739 Update translatable texts
[skip ci]
2025-12-16 09:04:29 +00:00
Safihre
578bfd083d Update text files 4.6.0 Beta 1 2025-12-16 10:03:41 +01:00
renovate[bot]
dd464456e4 Update all dependencies (#3231)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-15 02:08:17 +00:00
mnightingale
e7a0255359 Make behaviour after reset more robust (#3229)
* Make behaviour after reset more robust

* Remove use of hasattr and rename to generation

* I had a feeling this would be a circular reference

* Reset and increment generation under lock
2025-12-14 22:39:48 +01:00
mnightingale
2e1281d9e8 Fix nzb types (#3230) 2025-12-14 15:46:14 +01:00
SABnzbd Automation
efecefdd3b Update translatable texts
[skip ci]
2025-12-09 20:22:55 +00:00
Safihre
a91e718ef5 Split nzbstuff into separate files for Article, NzbFile and NzbObject (#3221) 2025-12-09 21:21:51 +01:00
mnightingale
b420975267 Fix read/write actions after reset_nw (#3223) 2025-12-09 19:39:49 +01:00
SABnzbd Automation
c4211df8dc Update translatable texts
[skip ci]
2025-12-08 21:37:36 +00:00
Safihre
e182707d3a Update text files for 4.6.0Alpha2 2025-12-08 22:36:51 +01:00
Safihre
05cbd9d7c4 Correct process_nzb_only_download and add tests 2025-12-08 11:42:22 +01:00
Safihre
6e8683349f Keep NZB name prefix when processing multiple NZBs
Closes #3217
2025-12-08 10:27:16 +01:00
Safihre
adb4816552 Update to Python 3.14.2 2025-12-08 10:27:16 +01:00
renovate[bot]
3914290c11 Update all dependencies (#3219)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-08 01:00:54 +00:00
Safihre
f76bf55b4a Handle aborted Direct Unpack better
Closes #3212
2025-12-05 16:18:17 +01:00
SABnzbd Automation
1cde764336 Update translatable texts
[skip ci]
2025-12-05 12:34:16 +00:00
mnightingale
44d94226ec Pipelining and performance optimisations (#3199)
* Pipelining and performance optimisations

* Refactor to remove handle_remainder and add on_response callback to allow inspecting of nntp messages

* Logic fix if there are sockets but nothing to read/write

* Fix logic errors for failed article requests

* Fix logic for reconfiguring servers

* Add guard_restart callback to pipelining_requests

* Fix article download stats

* Fix current article request shown via api

* Removal of DecodingStatus

* Fix circular reference

* Cleanup imports

* Handle reset_nw and hard_reset for inflight requests

* Improve __request_article behaviour using discard helper

* Article should be None here (before auth) but just in case

* Remove command_queue_condition unnecessary with the pull rather than push queue system

* During reset discard any data received prior to sending quit request

* Circular references again

* Revert to using bytearray

* Revert "During reset discard any data received prior to sending quit request"

This reverts commit ed522e3e80.

* Simpler interaction with sabctools

* Temporarily use the sabctools streaming decoder branch

* Fix most uu tests

* Reduce maximum pipelining requests

* Fix the squiggly line

* Remove some LOG_ALL debug code

* Make get_articles return consistent (None) - it now populates the server deque

* Reduce NNTP_BUFFER_SIZE

* Rename PIPELINING_REQUESTS to DEF_PIPELINING_REQUESTS

* A little refactoring

* Reduce default pipelining until it is dynamic

* Use BoundedSemaphore and fix the unacquired release

* Use crc from sabctools for uu and make filename logic consistent wit yenc

* Use sabctools 9.0.0

* Fix Check Before Download

* Move lock to NzbFile

* Use sabctools 9.1.0

* Minor change

* Fix 430 on check before download

* Update sabnews to work reliably with pipelining

* Minor tidy up

* Why does only Linux complain about this

* Leave this as it was

* Remove unused import

* Compare enum by identity

* Remove command_queue and just prepare a single request
Check if it should be sent and discard when paused

* Kick-start idle connections

* Modify events sockets are monitored for
2025-12-05 13:33:35 +01:00
Safihre
e8e8fff5bf Prevent filepath creation before first article is processed (#3215) 2025-12-05 13:18:27 +01:00
SABnzbd Automation
1b04e07d40 Update translatable texts
[skip ci]
2025-12-04 14:14:01 +00:00
Safihre
54db889f05 Update sfv help text
Closes #3214 and #3213
2025-12-04 15:13:07 +01:00
Safihre
777d279267 Only clear work-flag for post processing when needed 2025-12-01 16:40:59 +01:00
Safihre
75be6b5850 Use Event's to handle Post Processing queue
See #3209
2025-12-01 15:28:05 +01:00
Safihre
a4657e2bd3 Correct rar-version logging line 2025-12-01 11:36:10 +01:00
renovate[bot]
095b48ca47 Update all dependencies (#3210)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-01 01:32:06 +00:00
renovate[bot]
d459f69113 Update all dependencies (#3204)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-24 01:49:05 +00:00
mnightingale
2ecdd0b940 Optimise bpsmeter to avoid repeat lookups and try/except (#3203) 2025-11-22 14:46:21 +01:00
Safihre
73a4ad50e5 Allow longer build timeout for Snap amr64 build 2025-11-21 12:02:41 +01:00
Safihre
9b59e24961 Lower macOS build version to support older clients 2025-11-21 11:50:45 +01:00
Safihre
27e164763e Remove unused imports and shorten build timeouts 2025-11-21 11:29:53 +01:00
Safihre
eb544d85c7 Update text files for 4.6.0Alpha1 2025-11-21 11:02:24 +01:00
Safihre
ad85a241df Enable verify_xff_header by default 2025-11-21 10:12:47 +01:00
Safihre
e4d8642b4f Correct mobile layout if Full Width is enabled 2025-11-21 10:12:19 +01:00
Safihre
77b35e7904 Re-enable all Python versions for CI tests 2025-11-21 10:05:01 +01:00
Safihre
f8a0b3db52 Remove hostname resolution in get_webhost
#3131
2025-11-21 10:00:12 +01:00
Safihre
9c8b26ab4e Use new removeprefix and removesuffix 2025-11-21 10:00:11 +01:00
Safihre
67a5a552fd Add missing typing hints to several files 2025-11-21 10:00:10 +01:00
Safihre
80f57a2b9a Drop support for Python 3.8 2025-11-21 10:00:09 +01:00
Safihre
baaf7edc89 Windows tray icon disappears after Explorer restart
Closes #3200
2025-11-20 16:05:52 +01:00
Safihre
2d9f480af1 Only measure real write time during disk speed test 2025-11-20 15:34:34 +01:00
L-Cie
2266ac33aa Address low throughput reporting in diskspeed.py (#3197)
* increased buffer, mesaurement time, changed file management and calcucation of result

* Write smaller chunks first, abort if time exceeds

* Move urandom dump to diskspeedmeasure, reduced buffer size to 16MB and recycled buffer for more efficient resource usage during writes

* fixed formatting issues

* fixed formatting issues

* fixed formatting issues

---------

Co-authored-by: L-Cie <lcie@sturmklinge.ch>
2025-11-20 06:49:18 +01:00
renovate[bot]
1ba479398c Update all dependencies (develop) (#3195)
* Update all dependencies

* Pin tavern due to failure in newer versions

* User SABnzbd User-agent in wiki test

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2025-11-18 13:30:07 +01:00
Safihre
f71a81f7a8 Stop endless loop in edge-case of no STAT or HEAD support
Closes #3191
2025-11-13 13:33:11 +01:00
Safihre
1916c01bd9 Use general failure flag for pre-check result check
Closes #3190
2025-11-11 16:48:05 +01:00
Safihre
699d97965c Make Assembler queue configurable and auto increase on high bw-limit 2025-11-10 15:54:26 +01:00
renovate[bot]
399935ad21 Update all dependencies (develop) (#3186)
* Update all dependencies

* Allow older markdown for Python 3.9 and below

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2025-11-10 14:19:10 +00:00
Sander
0824fdc7c7 STAT: tell on which server an article is present (#3185)
* STAT: tell on which server an article is present

* Update logging format for article presence: old format
2025-11-10 11:08:31 +01:00
SABnzbd Automation
a3f8e89af8 Update translatable texts
[skip ci]
2025-11-05 21:37:39 +00:00
Safihre
f9f17731c8 Certificate validation should also be Strict in Wizard
Closes ##3183
2025-11-05 22:36:49 +01:00
SABnzbd Automation
b052325ea7 Update translatable texts
[skip ci]
2025-11-03 13:29:35 +00:00
Safihre
daca14f97e Update Apprise texts 2025-11-03 14:28:47 +01:00
renovate[bot]
daa26bc1a6 Update dependency cheroot to v11.1.0 (#3180)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-03 06:43:18 +00:00
renovate[bot]
70d5134d28 Update all dependencies (#3174)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-27 01:46:12 +00:00
Safihre
a32458d9a9 Resolve another PyGithub deprecation 2025-10-24 13:22:07 +02:00
Safihre
4c77954526 Add 4.5.5 to appdata 2025-10-24 12:47:26 +02:00
SABnzbd Automation
a229a2a5ea Update translatable texts
[skip ci]
2025-10-24 10:35:59 +00:00
Safihre
0a2f3865ee Check if all macOS binary files support the minimal required version 2025-10-24 12:27:48 +02:00
Safihre
900e68bb9a Resolve PyGithub deprecation warnings 2025-10-22 23:25:42 +02:00
Safihre
1de674a532 Correct appdata between branches 2025-10-22 22:33:55 +02:00
Safihre
e1dad3e4c4 Start SABnzbd service after installation, if installed 2025-10-20 13:18:44 +02:00
SABnzbd Automation
44f2eb8620 Update translatable texts
[skip ci]
2025-10-20 07:57:56 +00:00
renovate[bot]
70945a9c5b Update all dependencies (#3167)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-20 09:57:12 +02:00
SABnzbd Automation
fdfca97dfa Update translatable texts
[skip ci]
2025-10-16 08:58:27 +00:00
Safihre
b84900dcb5 Add extra warning to Remove All Orphans
See https://forums.sabnzbd.org/viewtopic.php?p=133922
2025-10-16 10:57:31 +02:00
Safihre
d989ec928a Small styling issue for tooltip in Night mode 2025-10-14 11:12:06 +02:00
SABnzbd Automation
d7fa3e1f7b Update translatable texts
[skip ci]
2025-10-13 14:24:54 +00:00
Safihre
c1417c319d Add tooltip that users need to Test Server before saving/next 2025-10-13 16:24:04 +02:00
Safihre
6689939cc9 Large par2 files could require more parsing to get all crc32 slices
Closes #3164
2025-10-13 15:26:55 +02:00
Safihre
09347d0766 Switch everything to Python 3.14 2025-10-13 07:44:35 +02:00
SABnzbd Automation
41db09057c Update translatable texts
[skip ci]
2025-10-13 01:10:52 +00:00
renovate[bot]
6983058f49 Update all dependencies (#3165)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-13 01:09:52 +00:00
SABnzbd Automation
fb2d412c97 Update translatable texts
[skip ci]
2025-10-08 21:01:13 +00:00
Safihre
1c0b1205b2 Add quota notifications
Closes #2926
2025-10-08 22:58:08 +02:00
Safihre
f556cea488 Use release version of Python 3.14 in CI 2025-10-08 20:07:39 +02:00
Sander
a2447253a0 Local ipv4 with socks5 proxy (#3161)
* Update all dependencies

* use socks5 server as test server

* make black happy

* improved active_socks5_proxy(): default port = 1080

* improved local_ipv4()

* use int_conv

* black

* use socks.socksocket.default_proxy directly

* active_socks5_proxy cleaner with int_conv

* correct to windows-2022

* socks.socksocket.default_proxy as check

* uniform naming socks5host/port

Closes #3154
---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: sanderjo <sander.jonkers+github@github.com>
2025-10-08 19:10:47 +02:00
Safihre
3393d7c976 Changing server name shows button "failure" instead of "saving..."
Closes #1551
2025-10-06 15:54:11 +02:00
renovate[bot]
06572bdf7d Update all dependencies (#3159)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-06 02:33:57 +00:00
Safihre
d4411f1b8f Replace vendored rarfile with official one
Closes #2560
2025-10-05 22:40:30 +02:00
SABnzbd Automation
1bfd1b8f41 Update translatable texts
[skip ci]
2025-10-05 20:38:14 +00:00
Safihre
c47dbfdc26 Let unrar handle rename of chars invalid on Windows filesystem
Closes #1574

Add tests for long paths

Make sure long path is >260

Add rar test file with invalid Windows filenames

Add rar_unpack tests for unicode and passworded sets

Simplify Unrar command building

Add test for rar_invalid_windows

Remove check for 260 chars in rar_unpack

Should never happen anymore

Let Unrar rename invalid filenames

Check full path output if rar_unpack

Add helper for check

Correct test_rar_unpack_invalid_windows_filenames

Apply changes also to Direct Unpacker

Extend testing to make sure full paths are tested

Add tests for long paths inside rar

Unrar auto-rename message is different on Linux
2025-10-05 22:37:22 +02:00
Safihre
b5e55cd9b2 Unselect Multi-Operations Play/Resume on second click
Closes #2725
2025-10-03 15:06:37 +02:00
Hugo Lloreda
85c98d7203 Add option to bind outgoing connections (#3155)
* refactor outgoing interface

* refactor

* rollback old change

* We actually don't need another port


Closes #3153

* refactor

* refactor

* refactor to be compatible with old python versions

* forgot to remove match

* fix no route to host on mac

* fix no route to host on mac + rename interface to ip

* fix black + try to fix windows error

* fix black + try to fix windows error

* fix windows error

* fix windows failure

* rollback optional changes

* Remove optional type

* rollback changes + fix issue

* black change

* refactor

* missing refactor
2025-10-03 11:28:44 +02:00
Safihre
9e95717619 Enable Make Windows compatible if we cannot write special characters 2025-09-30 12:18:18 +02:00
SABnzbd Automation
90b4ff2720 Update translatable texts
[skip ci]
2025-09-30 09:28:01 +00:00
Safihre
0f97a9fdfc Workaround for macOS statvfs no longer needed
Part of Python 3.13 and above.
https://github.com/python/cpython/pull/99570
2025-09-30 11:21:14 +02:00
Safihre
90caf0c164 Lock changes to job properties during URL-grabbed NZO creation
Closes #1908
2025-09-29 15:51:26 +02:00
Safihre
9b3fe470a0 Run tests on Python 3.14
Force newer pytest

Force beta release of tavern

Unfix werkzeug

Allow latest tavern only on Python 3.11 and above

Fix test failure in Python 3.14
2025-09-29 13:29:50 +02:00
SABnzbd Automation
ab318729ab Update translatable texts
[skip ci]
2025-09-29 10:43:50 +00:00
Safihre
9576554426 Move to top/bottom for Multi edit
Closes #1088
2025-09-29 12:40:44 +02:00
Safihre
3cd819b78d Refactor history API call handling 2025-09-29 11:56:03 +02:00
renovate[bot]
bb24f3f04e Update all dependencies (#3156)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-29 07:28:52 +00:00
Safihre
6f4416236d Prevent renovate from updating macOS version
Due to #3131
2025-09-29 09:10:23 +02:00
SABnzbd Automation
47dcccd17f Update translatable texts
[skip ci]
2025-09-26 14:29:44 +00:00
Safihre
6b026d8274 Add way to mark job as Completed and remove Incomplete
Closes #1174
2025-09-26 16:28:57 +02:00
Safihre
ec18606557 Require correct server test in Wizard
Closes #3148
General refactor.
2025-09-25 13:40:25 +02:00
Safihre
895c8549ba Add 4.5.4 to appdata 2025-09-22 14:09:54 +02:00
Safihre
0d80efb898 Update Python to 3.13.7 2025-09-22 13:54:16 +02:00
Safihre
deace9f8ae Add SignPath to the release notes 2025-09-22 13:30:43 +02:00
Safihre
1c96dff133 Implement SignPath binary signing for Windows releases
Keep zip structure

Download all signed artifacts for release step

Correctly download all releases

Only sign when tagging release

Restore CI tests

Test production certificate

Closes #2870
2025-09-22 12:16:10 +02:00
renovate[bot]
1734b11338 Update all dependencies (#3144)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-22 08:34:30 +00:00
Safihre
5f3c4d17da Prevent Renovate from updating GitHub Actions Windows runner 2025-09-22 10:18:58 +02:00
jcfp
4ffe0e27fb Handle weird anime episode notation (#3146)
* handle weird anime episode notation

* make black even happier /s
2025-09-15 22:55:07 +02:00
renovate[bot]
951bc0c957 Update all dependencies (#3142)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-08 20:00:14 +00:00
SABnzbd Automation
60f985ba00 Update translatable texts
[skip ci]
2025-09-08 19:37:06 +00:00
Safihre
a42a2db196 Github Actions Windows 2025 runners do not included NSIS 2025-09-08 21:36:13 +02:00
SABnzbd Automation
64034c5636 Update translatable texts
[skip ci]
2025-08-26 13:30:14 +00:00
Safihre
e03a031342 Add Run SABnzbd to Windows Installer 2025-08-26 15:29:34 +02:00
Safihre
da3d72b484 No longer reduce threads counter on connection loss
Closes #3137
2025-08-25 13:48:00 +02:00
SABnzbd Automation
e3042a6106 Update translatable texts
[skip ci]
2025-08-25 00:59:25 +00:00
renovate[bot]
55f1253a56 Update all dependencies (#3138)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 00:58:50 +00:00
Safihre
5e432bea37 Cache par2 download 2025-08-19 16:22:50 +02:00
renovate[bot]
2d0cc08987 Update all dependencies (#3136)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-18 01:59:29 +00:00
Safihre
627797f8c7 No longer apply Bug and Feature Request directly
This way they can be auto-closed if stale.
2025-08-14 10:50:42 +02:00
Safihre
e37a777f29 Run CI Tests on macOS 13
See #3131
2025-08-12 11:44:31 +02:00
SABnzbd Automation
13a76e5824 Update translatable texts
[skip ci]
2025-08-11 12:07:26 +00:00
Safihre
e4c64cac12 Automated update of translations
Used AI to add missing translations.
Not 100% coverage, it keeps missing some texts.
Stopping here.
2025-08-11 14:06:40 +02:00
SABnzbd Automation
c6694483e4 Update translatable texts
[skip ci]
2025-08-11 10:32:26 +00:00
thezoggy
bc793e11c4 bump windows unrar to 7.13 for CVE-2025-8088 (#3129) 2025-08-11 11:59:12 +02:00
Safihre
4980fc70a0 Small tweaks to the workflows 2025-08-11 11:57:54 +02:00
Safihre
8afac4f6fb Push the snap to stable for any tag
This is the same we did before using the Python script.
2025-08-11 11:50:11 +02:00
Safihre
c78b633da8 Update snap publish credentials 2025-08-11 11:32:25 +02:00
SABnzbd Automation
a1ee1677dc Update translatable texts
[skip ci]
2025-08-11 09:27:39 +00:00
Safihre
511bb153d7 Add Publish snap step 2025-08-11 11:26:28 +02:00
Safihre
c1af36f6b0 Move user logged in notification 2025-08-11 11:22:13 +02:00
Safihre
6028824966 RSS Next scan time is not recalculated after manual Read All Feeds Now
Closes #2979
2025-08-08 22:06:02 +02:00
Safihre
49a7300ad6 Pre-queue script rejected NZBs are sometimes reported in history as "URL Fetching failed;"
Closes #3023
2025-08-08 21:57:50 +02:00
Safihre
8e8e560eac Add building of snap as a GitHub Action 2025-08-08 09:49:19 +02:00
Safihre
e51da569ca Add curl as snapcraft par2cmdline build-package 2025-08-08 08:52:21 +02:00
mnightingale
6ce43eed5f Fix snap with core24 (#3126)
* Fix snap with core24

* Remove probably unused

* Switch to 7zip-standalone package which only has the 7zz binary
2025-08-08 08:31:32 +02:00
Safihre
73ec6d8323 Add tests for new conditional_cache decorator 2025-08-07 22:09:25 +02:00
Safihre
27a7531f79 Make smarter decorator that only caches if there's a result 2025-08-07 21:55:18 +02:00
Safihre
423bdb4f81 Replace HappyEyeBalls with concurrent fastest connection check 2025-08-07 21:25:06 +02:00
Safihre
7f8081e2cc Correct add_fake_history_jobs after adding time_added 2025-08-07 20:21:43 +02:00
Safihre
50c2d5e2ab Add time_added to History output and interface
Closes #2914
2025-08-07 16:41:01 +02:00
Safihre
552bfd4b72 Add time_added to queue output 2025-08-07 14:41:40 +02:00
Safihre
3d522c8205 Update snapcraft.yaml format 2025-08-07 10:02:29 +02:00
Safihre
b6b0d10367 Try to get the snap to compile again 2025-08-05 14:04:56 +02:00
Safihre
8d4d69d56b Add 4.5.3 to Appdata file 2025-08-05 11:32:33 +02:00
Safihre
0e475e593a Update to par2cmdline-turbo 1.3.0 that supports older macOS
And it's universal2
2025-08-05 11:09:24 +02:00
renovate[bot]
78424318ce chore(deps): update all dependencies (#3123)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-04 01:01:09 +00:00
mnightingale
57c90b2554 Skip adding postproc items to the history if they are already completed (#3120)
* Skip adding postproc items to the history if they are already completed

* Add test that duplicate nzo_ids are not added to the history
2025-08-02 12:11:47 +02:00
Safihre
9b94d22621 Broken "Show Logging" function when console logging
Closes #3107
2025-08-01 14:57:33 +02:00
SABnzbd Automation
5c30b0ee29 Update translatable texts
[skip ci]
2025-08-01 12:50:43 +00:00
Safihre
3a1c60a3ed Persist the Permanently delete checkbox
On Archive page, never even ask the question.
Yeah, if you combine History+Archive it will be always Permanently deleted. So be it.
2025-08-01 14:49:39 +02:00
SABnzbd Automation
bd07a79c97 Update translatable texts
[skip ci]
2025-08-01 07:09:26 +00:00
Safihre
c562c9a468 Update sabctools to 8.2.6
Remove reference to Github issue for sabctools feedback. That's ages ago already.
2025-08-01 09:08:31 +02:00
renovate[bot]
fdd3f590cd chore(deps): update all dependencies (#3119)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-28 02:35:15 +00:00
thezoggy
77e9627e64 Skip cbr durning rarcheck to prevent badly renamed (#3115) 2025-07-24 10:53:09 +02:00
renovate[bot]
c40d1274d2 chore(deps): update all dependencies (#3116)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-21 02:43:33 +00:00
Safihre
d1948071fc No longer crash on Windows 8 for binary releases 2025-07-14 12:48:55 +02:00
renovate[bot]
4f79d924e6 chore(deps): update dependency certifi to v2025.7.14 (#3111)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-14 04:58:53 +00:00
SABnzbd Automation
872cf835df Update translatable texts
[skip ci]
2025-07-09 18:05:33 +00:00
thezoggy
69bb1a87a4 Bump 7zip to 25 (#3109) 2025-07-09 20:05:00 +02:00
renovate[bot]
e3339a1ab4 chore(deps): update all dependencies (#3108)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-09 20:04:28 +02:00
renovate[bot]
18d84fa522 chore(deps): update all dependencies (#3101)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-26 14:52:23 +02:00
Safihre
7a7e7b7b93 Remove Python 3.8 from CI (but keep support) 2025-06-26 13:32:32 +02:00
thezoggy
18ca9d6155 Update unrar 7.12 (#3103)
- CVE-2025-6218 only affects windows.
2025-06-26 10:44:26 +02:00
Safihre
f5aa0f52d6 Correct Windows version check for notifications 2025-06-24 11:19:31 +02:00
Safihre
5a93074f4b Update NSIS language map 2025-06-23 12:51:00 +02:00
SABnzbd Automation
3863d6bd2f Update translatable texts
[skip ci]
2025-06-23 10:43:39 +00:00
Safihre
753d1e3bd3 Add Download button to Windows and macOS update notification 2025-06-23 12:38:34 +02:00
Safihre
5393b6330e Add Turkish to installer 2025-06-23 12:36:54 +02:00
Safihre
2d8be8d89b Disable forced check for Windows verison
See https://github.com/pywinrt/pywinrt/issues/136
2025-06-23 12:36:39 +02:00
Safihre
08723f0432 Windows Toasts did not work anymore 2025-06-23 10:40:29 +02:00
Safihre
1e1220c509 Update appdata on develop brach 2025-06-19 08:57:48 +02:00
renovate[bot]
c6920e09bf chore(deps): update all dependencies (#3098)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-16 01:08:08 +00:00
SABnzbd Automation
74d2a9f7c4 Update translatable texts
[skip ci]
2025-06-14 21:10:55 +00:00
Safihre
31c9c64741 Remove double da language files 2025-06-14 22:38:40 +02:00
Safihre
96e7999b4f Update Python for macOS release to 3.13.5 2025-06-14 22:15:54 +02:00
Safihre
5303b9d291 Make internetspeed robust against failure
Closes #3097
2025-06-14 21:59:44 +02:00
renovate[bot]
91af147b8b chore(deps): update all dependencies (develop) (#3096)
* chore(deps): update all dependencies

* List Python 3.8 version of portend

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2025-06-10 12:27:03 +00:00
renovate[bot]
33463a3fd1 chore(deps): update all dependencies (#3095)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-26 03:53:49 +00:00
SABnzbd Automation
ac88446757 Update translatable texts
[skip ci]
2025-05-22 18:45:13 +00:00
Michael Nightingale
d129eec4a7 Filter rss enclosures by application/x-nzb mimetype (#3093)
* Filter rss enclosures by application/x-nzb mimetype

* Add tests and fix the failing one

* Change empty RSS entry logging to info
2025-05-22 20:44:30 +02:00
SABnzbd Automation
9b1b908115 Update translatable texts
[skip ci]
2025-05-21 08:44:14 +00:00
Arun Rawat
5866c029c4 feat: add tab and shift+tab navigation between rename fields in queue (#3091) 2025-05-21 10:43:28 +02:00
renovate[bot]
de6a6a084e Update all dependencies (#3090)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 03:07:37 +00:00
renovate[bot]
139489e5b3 Update all dependencies to v3 (#3085)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-12 07:20:38 +00:00
Safihre
a91f72a7f4 Allow renovate to update winrt again 2025-05-12 09:07:41 +02:00
renovate[bot]
f5fd4c1c18 Update all dependencies (#3084)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-12 02:26:49 +00:00
Safihre
3da67dc4af Correct permissions of included macos binaries 2025-05-07 14:58:37 +02:00
jcfp
0220d886c5 prevent cherrypy from stumbling over invalid cookies (#3082)
* prevent cherrypy from stumbling over invalid cookies

* group workarounds for flaws in external mods
2025-05-06 09:07:43 +02:00
SABnzbd Automation
19ea25f072 Update translatable texts
[skip ci]
2025-05-05 20:15:43 +00:00
Safihre
d934c588ad Rename osx to macos in the code 2025-05-05 22:15:02 +02:00
Safihre
ccb036ba37 Update par2cmdline-turbo to 1.3.0 2025-05-05 22:01:59 +02:00
renovate[bot]
3d1c5c82d1 Update all dependencies (#3081)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 03:22:11 +00:00
thezoggy
d37532a4eb Update build_release.yml for Python 3.13.3 (#3080)
python 3.13.3 bump
2025-04-28 20:32:45 +02:00
renovate[bot]
143851d1cb Update all dependencies (#3079)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-28 04:06:17 +00:00
SABnzbd Automation
235dd32ad0 Update translatable texts
[skip ci]
2025-04-26 09:39:58 +00:00
Matt Miller
0b295d7b57 Update to_units and quota api output format (#3076)
* Include byte unit in quota strings

Fixes #2590

I expect to continue to iterate on some of the ideas in the comments
thereon, but this fixes the proximate issue mentioned in the issue.

This includes changes to the interface to properly interpret the new
strings:

- Remove the UI-based `B` designations as they are now tagged with
  units from the api
- Let parseInt do its magic with string-y numbers plus units
- Expand parseInt for use in the checking whether quota is set

The display will be better in this `Glitter` case. This may well be
considered a breaking change for the API and not applied.

* Reduce computation slightly

No need to iterate over the evenly spaced unit sizes.
We can determine its magnitude quickly and convert it
into an index for our tags.

Avoiding the repeated divisons might also reduce error, but it is
unlikely to be noticeable.

* Drop trailing space when no units

The issue didn't expressly complain, but there is a trailing space when
all of the other unit information is empty.  Might as well not include
it when it clearly will happen.

The use of `f-strings` might also simplify future maintenance.

* Better document to_units methodology

This addresses some code review concerns with respect to readability.
Frankly, having this much exposition in the comments might imply that
it's a lot less obvious than I thought at initial writing.

This also maps everything under `1024` directly to `0`.  This avoids
concerns about potentially generating negative indices into the tags
tuple which would be surprising and wildly incorrect.
2025-04-26 11:39:10 +02:00
renovate[bot]
a4020ed085 Update all dependencies (#3075)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-21 02:34:15 +00:00
SABnzbd Automation
af1e5e0c1d Update translatable texts
[skip ci]
2025-04-18 07:46:33 +00:00
thezoggy
a3fffea9f9 fixup prowl/pushover pri setting due to value returned as int not string now (#3072) 2025-04-18 10:45:44 +03:00
jcfp
180bc30ea5 improve happyeyeballs logging (#3067) 2025-04-15 19:46:47 +02:00
renovate[bot]
f6b21680f8 Update all dependencies (develop) (#3064)
* Update all dependencies

* markdown Python 3.8 fix

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2025-04-15 09:26:06 +02:00
SABnzbd Automation
f6b65a4d1a Update translatable texts
[skip ci]
2025-04-15 06:52:38 +00:00
Safihre
4662bb8129 Update version file to 4.6.0-dev 2025-04-15 08:51:45 +02:00
jcfp
e2f613da6c stop catching BaseException (#3062) 2025-04-09 15:27:22 +02:00
jcfp
d4874970cd fix root dir check in make_mo (#3061) 2025-04-05 14:17:11 +02:00
Safihre
80268c4068 The From SxxEyy RSS filters did not work due to rename in sorter
Closes https://forums.sabnzbd.org/viewtopic.php?t=26966
2025-04-04 14:05:02 +02:00
renovate[bot]
e2811f93b1 Update all dependencies (develop) (#3058)
* Update all dependencies

* orjson dropped support for Python 3.8

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2025-04-04 13:16:39 +02:00
SABnzbd Automation
f8190e28c9 Update translatable texts
[skip ci]
2025-04-04 10:32:10 +00:00
Safihre
7eb460ba1f Update UnRar to 7.11 2025-04-04 12:31:14 +02:00
Michael Reid
fe647284e7 Fix Platform Detection on Linux (#3059)
* Fix Platform Detection on Linux

* Simplify solution to suppress stderr
2025-04-01 11:36:57 +02:00
SABnzbd Automation
54fe887636 Update translatable texts
[skip ci]
2025-03-28 13:54:16 +00:00
jcfp
2604775e5c avoid pop from empty list (#3056) 2025-03-28 14:53:30 +01:00
Safihre
a15bad6fb4 Use base SABnzbd version in translation files 2025-03-24 12:37:44 +01:00
Safihre
58c060c39d Downgrade winrt so Windows notifications keep working 2025-03-24 12:24:45 +01:00
SABnzbd Automation
6ecd0a8561 Update translatable texts
[skip ci]
2025-03-24 03:49:45 +00:00
renovate[bot]
4a52289f05 Update all dependencies (#3054)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-24 03:48:57 +00:00
SABnzbd Automation
104c0b20fe Update translatable texts
[skip ci]
2025-03-21 20:58:38 +00:00
Safihre
b8a3a264e3 Update text files for 4.5.0RC1 2025-03-21 21:38:45 +01:00
Safihre
b0e42940e5 Update pywin32 dependency 2025-03-21 21:28:14 +01:00
jcfp
4bc6fefa1f also disable argparse's auto-added help in the (io)nice parameters check (#3052) 2025-03-14 15:44:31 +01:00
jcfp
3ec8227745 add unrar_parameters option in config special (#3047)
* add unrar_parameters option in config special

* add tests for case-insensitive matching and argparse's auto-help
2025-03-14 11:49:26 +01:00
renovate[bot]
9f6dc3df01 Update all dependencies (#3048)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-11 13:18:42 +01:00
SABnzbd Automation
cadeae061f Update translatable texts
[skip ci]
2025-03-06 18:44:44 +00:00
jcfp
80c3226147 fix UnboundLocalError in testhelper (#3046) 2025-03-06 19:43:55 +01:00
SABnzbd Automation
f2137e2fa3 Update translatable texts
[skip ci]
2025-03-03 02:28:34 +00:00
renovate[bot]
9bf80a3745 Update all dependencies (#3044)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-03 02:27:51 +00:00
renovate[bot]
750ee422a7 Update dependency PyGithub to v2.6.1 (#3042)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 03:36:17 +00:00
luzpaz
035559f1c3 Fix typos (#3041)
Found via `codespell -q 3 -S "*.po,*.pot,*.min.js" -L allo,collet,fo,parm,ciph,datas,parms,reenabled,re-use,re-used,re-using,sav,tage`
2025-02-23 08:38:00 +01:00
SABnzbd Automation
4751f609bb Update translatable texts
[skip ci]
2025-02-20 21:10:43 +00:00
Safihre
40fde7a411 Update text files for 4.5.0Beta2 2025-02-20 22:07:58 +01:00
thezoggy
b27a7f6cf4 Update unrar to 7.10 (#3039) 2025-02-20 22:01:58 +01:00
thezoggy
9006875d6c par2cmdline turbo update (#3036)
* bump par2cmdline-turbo to 1.2.0 for osx, and 1.2.0-utf8-20250212 for win

* Try UNC paths for par2cmdline-turbo update

---------

Co-authored-by: Safihre <safihre@sabnzbd.org>
2025-02-18 16:40:49 +01:00
thezoggy
dd0122865a bump copyright year (#3034) 2025-02-17 14:06:12 +01:00
renovate[bot]
9a5f39ce99 Update all dependencies (#3038)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-17 03:41:19 +00:00
thezoggy
545f75b456 Update 7zip to 24.09 (#3035) 2025-02-16 09:31:37 +01:00
thezoggy
e1553e86b6 bump macos to build with 3.13.2 (#3037) 2025-02-16 09:31:01 +01:00
jcfp
c85ddd0595 add tests for remote_ip_from_xff (#3032) 2025-02-13 20:24:58 +01:00
RooHTaylor
5d763f52af Add check XFF headers for remote ip in cookie (#3029)
* Add check XFF headers for remote ip in cookie

If verify_xff_header() then also check for the client IP in the XFF headers to ensure the IP used for the session cookie is actually the client IP and not a proxy IP.

* Fix code formatting

* Remove duplicate check for empty xff_ips. for -> for else
2025-02-12 15:36:38 +01:00
renovate[bot]
2b842b2bc5 Update dependency pyinstaller to v6.12.0 (#3031)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-10 00:59:08 +00:00
renovate[bot]
2a3e144ed6 Update all dependencies (#3027)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 10:09:24 +00:00
SABnzbd Automation
52f09dbf55 Update translatable texts
[skip ci]
2025-02-04 09:35:28 +00:00
Safihre
6bce289c8f Update for new black rules 2025-02-04 10:34:35 +01:00
SABnzbd Automation
20bc8f0d06 Update translatable texts
[skip ci]
2025-01-22 12:42:57 +00:00
cardpuncher
966fe246f6 French & Turkish translations for the desktop file (#3024)
As I couldn't find this file on Transifex, I added translations for the GenericName, Comment and Keywords fields here.
2025-01-22 13:42:08 +01:00
SABnzbd Automation
c4a84b3a31 Update translatable texts
[skip ci]
2025-01-20 12:42:17 +00:00
renovate[bot]
e06f91c243 Update all dependencies (develop) (#3022)
* Update all dependencies

* Fix more-itertools

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2025-01-20 12:41:37 +00:00
Dan Christensen
42c00dda84 Directly decompress gzip responses in urlgrabber (#3014)
The URLGrabber sets Accept-encoding: gzip on requests, so a server may
respond with gzipped compressed data.  That data is tested without
having been decompressed which then can result in unnecessary errors.
2025-01-16 13:54:59 +01:00
SABnzbd Automation
e40d2980e7 Update translatable texts
[skip ci]
2025-01-15 11:08:07 +00:00
thezoggy
b6a905be21 Sanitize email related fields from json logging lines (#3021) 2025-01-15 12:07:22 +01:00
Safihre
22800ae411 Add 4.5.0 to Appdata 2025-01-14 11:59:36 +01:00
SABnzbd Automation
e8a4d95177 Update translatable texts
[skip ci]
2025-01-14 10:16:44 +00:00
Safihre
026a606e7f Update text files for 4.5.0Beta1 2025-01-14 11:15:54 +01:00
renovate[bot]
9551f9a3b9 Update all dependencies (develop) (#3015)
* Update all dependencies

* Unpin tempora for Python 3.8

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2025-01-14 09:58:57 +01:00
SABnzbd Automation
f62e7ab560 Update translatable texts
[skip ci]
2025-01-14 08:08:21 +00:00
jcfp
92fbd75cc3 replace leftover wikidot url about email templates (#3018)
closes #3017
2025-01-14 09:07:31 +01:00
SABnzbd Automation
7de0869376 Update translatable texts
[skip ci]
2025-01-05 22:12:33 +00:00
Safihre
57606ef1bb Add more detailed detection of platform we are running on
Closes #3010
2025-01-05 23:11:48 +01:00
SABnzbd Automation
318d3ff649 Update translatable texts
[skip ci]
2025-01-05 21:03:18 +00:00
Safihre
8953f4df4a Refactor start-up checks 2025-01-05 22:01:46 +01:00
Safihre
7c607a6bf6 Simplify file and folder name sanitization 2024-12-30 22:15:14 +01:00
Safihre
93c6d67ef8 Improve handling of too long utf8 file and folder names
Closes #2991
Closes #2988
2024-12-30 14:59:26 +01:00
Safihre
a314d6ab71 Did not count number of skipped files 2024-12-30 14:59:26 +01:00
SABnzbd Automation
62bb9b3816 Update translatable texts
[skip ci]
2024-12-30 13:09:48 +00:00
Safihre
2ef5cec5c5 Remove MultiPar support 2024-12-30 14:09:05 +01:00
Safihre
c8e2329bee Refactor of code related to adding nzf's 2024-12-30 11:28:39 +01:00
renovate[bot]
f0358d9f0a Update all dependencies (develop) (#3004)
* Update all dependencies

* Allow older urllib3 on Python 3.8

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2024-12-30 09:48:35 +01:00
SABnzbd Automation
3f89114c73 Update translatable texts
[skip ci]
2024-12-22 20:47:59 +00:00
Safihre
721f5dfe86 Add additional par2 files to download first in case of missing articles 2024-12-22 21:46:44 +01:00
SABnzbd Automation
ef38c1d7c8 Update translatable texts
[skip ci]
2024-12-21 21:53:02 +00:00
jcfp
fe88760600 switch test_cert_gen check to utc (#3003) 2024-12-21 22:52:20 +01:00
SABnzbd Automation
e498ef6302 Update translatable texts
[skip ci]
2024-12-18 12:20:53 +00:00
Safihre
b1c486fa2a Update text files for 4.4.1RC1 2024-12-18 13:19:27 +01:00
Safihre
d9aa42dc31 Add new Certificate verification setting Medium
Closes #2993
2024-12-18 13:18:50 +01:00
Safihre
3ee0db8cff Don't block virusscanner certificates on Windows
See #2993
2024-12-18 13:18:40 +01:00
Safihre
23cae4d073 Add missing hidden import for Windows notifications 2024-12-18 13:18:35 +01:00
SABnzbd Automation
2b45ba044e Update translatable texts
[skip ci]
2024-12-16 01:16:55 +00:00
renovate[bot]
cd831d2775 Update dependency certifi to v2024.12.14 (#2996)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-16 01:16:13 +00:00
Safihre
8c761ba67e Update release date of 4.4.0 in appdata 2024-12-09 21:50:23 +01:00
SABnzbd Automation
07243290ec Update translatable texts
[skip ci]
2024-12-09 02:14:44 +00:00
renovate[bot]
317a9c00de Update all dependencies (#2989)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-09 02:13:59 +00:00
SABnzbd Automation
cc40214818 Update translatable texts
[skip ci]
2024-12-02 11:35:23 +00:00
Safihre
3b52379e56 Remove Windows 32bit support 2024-12-02 12:13:47 +01:00
SABnzbd Automation
8a2f8d969d Update translatable texts
[skip ci]
2024-12-02 08:56:07 +00:00
Safihre
6f9bf68528 Update text files for 4.4.0RC1 2024-12-02 09:55:22 +01:00
Safihre
5a48301d25 Prevent division by zero in bad server check
Closes #2963
2024-12-02 09:51:41 +01:00
SABnzbd Automation
d1d3e27dea Update translatable texts
[skip ci]
2024-12-02 08:45:53 +00:00
Safihre
2f1805123a Add 4.4.0 to appdata 2024-12-02 09:42:38 +01:00
renovate[bot]
f05c82b3a7 Update all dependencies (#2985)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-02 01:13:49 +00:00
Michael Nightingale
1fe01f2724 Fix displayTabbed observable default value (#2984) 2024-12-01 18:47:00 +01:00
renovate[bot]
a5239808eb Update all dependencies (#2977)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-25 00:55:58 +00:00
SABnzbd Automation
00a7b4fffc Update translatable texts
[skip ci]
2024-11-21 21:00:04 +00:00
Safihre
0c5010f5c1 Warn users that the legacy Windows release will be dropped 2024-11-21 21:51:41 +01:00
renovate[bot]
a8b33e7686 Update all dependencies (develop) (#2974)
* Update all dependencies

* Add fix for Python 3.8 for PyJWT

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2024-11-19 09:09:13 +00:00
Safihre
0294e01fae Always notarize the macOS release 2024-11-19 08:52:33 +01:00
SABnzbd Automation
c2621f56eb Update translatable texts
[skip ci]
2024-11-18 21:03:49 +00:00
Safihre
ebac7707ff Always run release preparation 2024-11-18 22:03:04 +01:00
SABnzbd Automation
26adade8be Update translatable texts
[skip ci]
2024-11-18 14:30:25 +00:00
Safihre
dd9c7488c6 Update text files for 4.4.0Beta2 2024-11-18 15:29:25 +01:00
Safihre
754b862a29 Build release using Python 3.13 2024-11-17 21:10:48 +01:00
Safihre
0ddf343bb7 Generalize wildcard addition in par2cmdline call 2024-11-17 21:06:30 +01:00
SABnzbd Automation
7a8a45b811 Update translatable texts
[skip ci]
2024-11-17 19:56:02 +00:00
Safihre
66c525ef95 Remove any custom Multipar parameters when updating 2024-11-17 20:54:59 +01:00
SABnzbd Automation
7cd3e50ded Update translatable texts
[skip ci]
2024-11-17 19:45:37 +00:00
Safihre
d5094e1aa6 Switch to modified par2cmdline-turbo-utf8 2024-11-17 20:35:33 +01:00
renovate[bot]
bca9559783 Update all dependencies (#2961)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-12 14:34:43 +00:00
Safihre
0cbb8af7a0 More compatibility fixes for Python 3.8 2024-11-12 15:14:53 +01:00
Safihre
afab90ca68 Ignore package updates that are unsupported on Python 3.8 2024-11-12 08:58:42 +01:00
SABnzbd Automation
92ecfc4930 Update translatable texts
[skip ci]
2024-11-11 11:17:53 +00:00
Safihre
b064f112cd Fix version of blinker for Python 3.8 2024-11-11 12:16:56 +01:00
renovate[bot]
629da51be7 Update all dependencies 2024-11-04 08:08:53 +00:00
Safihre
0fa0f7286c Let renovate also update uvicorn branch 2024-11-03 20:47:24 +01:00
Safihre
6cd8f3e333 Add server note to the main servers display
Closes #2957
2024-11-03 16:45:52 +01:00
Safihre
ff18fe03e9 Update the release builder configuration 2024-10-31 21:33:34 +01:00
SABnzbd Automation
a1e30d19e3 Update translatable texts
[skip ci]
2024-10-31 20:23:25 +00:00
Safihre
3d74c19f41 Update text files for 4.4.0Beta1 2024-10-31 21:22:40 +01:00
SABnzbd Automation
33a831e87c Update translatable texts
[skip ci]
2024-10-29 21:03:01 +00:00
Safihre
7b04917f0e Kill unrar if it reports disk full, since it can hang
See #2948
2024-10-29 22:02:17 +01:00
SABnzbd Automation
2f62b76279 Update translatable texts
[skip ci]
2024-10-29 20:17:28 +00:00
Safihre
bd43bca1cf Include dateutil timezone file that would show warning in executables 2024-10-29 21:16:41 +01:00
Safihre
d200f0a618 Small refactor of improved warnings for weird ports
Not needed, but I liked it
2024-10-29 21:08:49 +01:00
SABnzbd Automation
c5314569db Update translatable texts
[skip ci]
2024-10-29 11:11:35 +00:00
Sander
001e215b7d Better analysis & better user info if newsserver connection fails (#2951)
* Better analysis & better user info if newsserver connection fails

* make Black happy

* make Black happy

* make Black happy

* make Black happy ... corrected

* make Black happy ... corrected

* make Black happy ... corrected

* make Black happy ... corrected

* Safihre's feedback handled

* more Safihre's feedback handled

---------

Co-authored-by: sanderjo <sander.jonkers+github@github.com>
2024-10-29 12:10:45 +01:00
SABnzbd Automation
3a628a0025 Update translatable texts
[skip ci]
2024-10-28 01:04:25 +00:00
renovate[bot]
7e48207fbc Update all dependencies 2024-10-28 01:03:38 +00:00
renovate[bot]
48a6d6b289 Update all dependencies (#2949)
Co-authored-by: Safihre <safihre@sabnzbd.org>
2024-10-22 12:19:15 +02:00
SABnzbd Automation
21f05ad3d9 Update translatable texts
[skip ci]
2024-10-21 06:56:44 +00:00
Safihre
d93c861eb3 Add disk full error to Direct Unpacker
Closes #2948
2024-10-21 08:55:56 +02:00
Safihre
fb0ef21768 The tests folder was ignored by default by Renovate 2024-10-15 11:55:26 +02:00
Safihre
277679ef53 Add Python 3.13 to CI tests 2024-10-15 10:10:24 +02:00
Safihre
e7e47bbcb0 Do not compare articles just based on article-ID
Turns out that there are NZBs that contain duplicate article-ID's within 1 file. This causes all "article in nzf.article" comparisons to return the wrong comparison.
2024-10-15 09:44:04 +02:00
Safihre
65ffb5ca81 All resets of try lists should be locked fully 2024-10-15 09:43:55 +02:00
SABnzbd Automation
6cf308e441 Update translatable texts
[skip ci]
2024-10-14 01:47:23 +00:00
renovate[bot]
870fa40c91 Update all dependencies 2024-10-14 01:46:42 +00:00
Safihre
39d9eaec2a Create new history database in case of no such table error 2024-10-08 21:06:59 +02:00
SABnzbd Automation
6fd4d0882c Update translatable texts
[skip ci]
2024-10-08 07:39:00 +00:00
Safihre
32591f7c46 Update text files for 4.4.0Alpha2 2024-10-08 09:38:01 +02:00
SABnzbd Automation
6b47d1126d Update translatable texts
[skip ci]
2024-10-07 00:23:20 +00:00
renovate[bot]
53df39dd12 Update dependency pywin32 to v307 2024-10-07 00:22:35 +00:00
Safihre
b5d33fc17c Mount interface again on both / and url_base
Closes #2936
2024-10-05 20:58:45 +02:00
SABnzbd Automation
8a517b668e Update translatable texts
[skip ci]
2024-10-01 06:27:56 +00:00
thezoggy
67135ba4c8 Update 7zip and multipar (#2942)
* Update 7zip to 24.08

* Update multipar to 1.3.3.3
2024-10-01 08:27:12 +02:00
renovate[bot]
c9efda1889 Update all dependencies 2024-09-30 00:44:59 +00:00
Safihre
250869c242 Force Selenium browser_version to 127
Closes #2932
2024-09-26 22:41:20 +02:00
SABnzbd Automation
844650e6be Update translatable texts
[skip ci]
2024-09-26 20:27:25 +00:00
Safihre
6685c72894 Saving Specials page would result in restart even for no changes
Relates to #2932
2024-09-26 22:26:39 +02:00
renovate[bot]
154a5e4989 Update all dependencies (#2937)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-23 07:34:11 +02:00
SABnzbd Automation
93d302c9d7 Update translatable texts
[skip ci]
2024-09-20 08:11:43 +00:00
Safihre
f664df7f05 Update text files for 4.4.1Alpha1 2024-09-20 10:10:55 +02:00
thezoggy
8fbf50292b Add additional server priority colors (#2934) 2024-09-17 20:27:22 +02:00
Safihre
f3fed43022 Remove logging line for scheduled history purge 2024-09-17 15:06:56 +02:00
Safihre
2d323ba18c Update to Python 3.12.6 and drop macOS <10.13 support
Closes #2784
2024-09-16 13:59:38 +02:00
Safihre
1ec30a56e1 Improve logging of server address retrieval 2024-09-16 13:58:57 +02:00
renovate[bot]
b98f3a07dd Update all dependencies (#2933)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-16 13:58:12 +02:00
Safihre
46170ffb3d Reset article queue only when really stopping the server
Closes #2866
2024-09-10 20:25:56 +03:00
renovate[bot]
5e8b41be5a Update all dependencies (#2930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-10 20:13:14 +03:00
SABnzbd Automation
47a2d5387d Update translatable texts
[skip ci]
2024-09-10 07:57:26 +00:00
Safihre
1e61239933 Add Bootstrap tooltips to any elements with title 2024-09-10 10:55:06 +03:00
Safihre
aedbf35be8 Show file being moved during Moving phase 2024-09-07 11:10:58 +03:00
Safihre
cf9540842b Config restart would always try to build URL instead of using current
#2835
2024-09-07 10:51:11 +03:00
Safihre
9205b9161b Update Linux test runners 2024-09-05 12:43:31 +03:00
Safihre
07b64b4abb Update tests for change in webpage mounting 2024-09-04 12:09:07 +03:00
Safihre
c56145e424 Only mount webpages on /, no longer on /sabnzbd
Closes #2929
2024-09-04 11:39:38 +03:00
Safihre
ef11aba166 Add basic system to do trigger one-time config conversions 2024-09-04 11:39:37 +03:00
SABnzbd Automation
fcf03e9a59 Update translatable texts
[skip ci]
2024-09-03 09:06:42 +00:00
renovate[bot]
6662065bb1 Update all dependencies (#2928)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-03 12:05:52 +03:00
SABnzbd Automation
4973672892 Update translatable texts
[skip ci]
2024-08-30 12:47:50 +00:00
bt90
efa73a52e1 Add doctype to login page (#2927) 2024-08-30 14:47:02 +02:00
SABnzbd Automation
82098a6228 Update translatable texts
[skip ci]
2024-08-26 02:47:15 +00:00
renovate[bot]
07250aa355 Update all dependencies 2024-08-26 02:46:28 +00:00
Safihre
46caa8b33f Add Docker to CPU label 2024-08-19 20:21:19 +02:00
Safihre
b0564c1bab Small style fixes for the Config 2024-08-19 11:42:12 +02:00
SABnzbd Automation
3c8a85ff35 Update translatable texts
[skip ci]
2024-08-19 09:28:34 +00:00
Safihre
656c329912 Update version to 4.4.0-develop 2024-08-19 11:27:46 +02:00
SABnzbd Automation
983253908c Update translatable texts
[skip ci]
2024-08-19 01:20:50 +00:00
renovate[bot]
cef0eeb25b Update all dependencies 2024-08-19 01:20:10 +00:00
Safihre
a9eace759f increase_bad_articles_counter should be called before register_article 2024-08-16 22:23:14 +02:00
Safihre
ad0e7bf5df Prevent excessive newswrapper data buffer size
Closes #2895
2024-08-16 17:25:57 +02:00
Safihre
bea348232a Do not use article_queue when resetting newswrapper
Relates to #2866
2024-08-16 16:50:28 +02:00
jcfp
1519dbc554 Remove pyfakefs workarounds and put its new apply_umask option to good use (#2922) 2024-08-16 15:44:52 +02:00
SABnzbd Automation
297455cd35 Update translatable texts
[skip ci]
2024-08-12 02:04:47 +00:00
renovate[bot]
56b68024db Update all dependencies 2024-08-12 02:04:06 +00:00
SABnzbd Automation
09aa09a55b Update translatable texts
[skip ci]
2024-08-09 17:46:39 +00:00
Sander
f1d134fe2e Deobfuscate subtitles (#2903)
* deobfuscate_subtitles

* deobfuscate_subtitles: unit test aka pytest

* deobfuscate_subtitles: unit test aka pytest

* deobfuscate_subtitles: no reanem is first part of filename is the samen

* deobfuscate_subtitles: no reanem is first part of filename is the samen

* deobfuscate_subtitles: no reanem is first part of filename is the samen

* deobfuscate_subtitles: more structured unit test method

* deobfuscate_subtitles: back to basic testing method

* deobfuscate_subtitles: cleanup

* deobfuscate_subtitles: cleanup

* deobfuscate_filenames.test_first_file_is_much_bigger() improved

* deobfuscate_subtitles(): checks on biggest file and srt files. input can be directory or filelist.

* rename to clearly_one_biggest_file()

* WIP on develop

* accept work by safihre

* do nothing when not one_file_is_biggest

* a lot of cleanup, also with help of the walrus

* a lot of cleanup, also with help of the walrus

* fix typo's in test_deobfuscate_filenames.py

* Update sabnzbd/postproc.py

Co-authored-by: Safihre <safihre@sabnzbd.org>

* handle review comments

* handle review comments

* remove import glob

* remove special underscore support. Add srt deob info into GUI-history

---------

Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2024-08-09 19:45:57 +02:00
Safihre
621d586c2f Reduce timeouts during happyeyeballs and others 2024-08-09 10:01:21 +02:00
Safihre
4966f9c753 Update sabctools to 8.2.5 2024-08-09 09:42:57 +02:00
SABnzbd Automation
059d82f6f0 Update translatable texts
[skip ci]
2024-08-05 00:18:07 +00:00
renovate[bot]
bca41db6b7 Update all dependencies 2024-08-05 00:17:22 +00:00
renovate[bot]
613ba0b05f Update dependency setuptools to v72 2024-07-29 03:45:46 +00:00
renovate[bot]
5f3b03ed87 Update all dependencies 2024-07-29 02:12:43 +00:00
SABnzbd Automation
f6fe801000 Update translatable texts
[skip ci]
2024-07-28 16:31:44 +00:00
bt90
8ff34660d8 Add autocomplete attributes (#2916) 2024-07-28 10:31:03 -06:00
renovate[bot]
0c1b8dd60a Update all dependencies 2024-07-24 23:08:07 +00:00
SABnzbd Automation
8e8ee7a3ab Update translatable texts
[skip ci]
2024-07-24 22:11:38 +00:00
Safihre
9145a90e33 Update test_cert_gen for new cryptography default 2024-07-24 16:10:58 -06:00
Safihre
02b4a116dd Update AppData for 4.3.3 2024-07-16 00:06:21 +02:00
SABnzbd Automation
e504b288a2 Update translatable texts
[skip ci]
2024-07-15 22:05:36 +00:00
Safihre
5128f788f0 Update text files for 4.3.3Beta2 2024-07-16 00:02:42 +02:00
Sander
044fe7a26a fix when no connection (for example IPv6-test on IPv4-only connection) (#2908)
* fix when no connection (for example IPv6-test on IPv4-only connection)

* fix when no connection (for example IPv6-test on IPv4-only connection)

* make black happy ... hopefully

* make black happy ... hopefully ... linelength 120
2024-07-15 07:27:43 +02:00
renovate[bot]
4ed2565101 Update all dependencies 2024-07-15 03:56:19 +00:00
SABnzbd Automation
abbd77bac4 Update translatable texts
[skip ci]
2024-07-14 21:24:11 +00:00
Safihre
38c9a52e1d Add changes to web_host and web_port to ignored revs 2024-07-14 23:23:26 +02:00
Safihre
f89114ca7e Rename cherryhost and cherryport to web_host and web_port 2024-07-14 23:23:01 +02:00
Safihre
773d567eed Skip propagation delay calculation if delay is set to 0
Since OptionNumber doesn't allow empty values
2024-07-14 23:19:05 +02:00
Safihre
ee717b679e Set limits to number-input types that were missing them 2024-07-13 19:39:53 +02:00
Safihre
f50810fb58 Remove article from TryList when resetting article Queue
When we reset the Server's Article-queue, we should retry that article again on that server.
2024-07-10 20:48:06 +02:00
jcfp
08b1b20b34 fix filesystem permission test for pyfakefs 5.4.0+ (#2905) 2024-07-10 16:16:18 +02:00
SABnzbd Automation
edca79af83 Update translatable texts
[skip ci]
2024-07-08 13:11:04 +00:00
Safihre
dd5dcd0ec9 Update text files for 4.3.3Beta1 2024-07-08 15:10:22 +02:00
Safihre
820824e443 Disable failing test until #2883 is fixed 2024-07-08 13:47:01 +02:00
Safihre
4c2dfdee43 Correctly handle the difference between no category and Default
Closes #2902
2024-07-08 13:47:00 +02:00
Safihre
ece4437c3a General changes to sanitization functions 2024-07-08 13:46:59 +02:00
renovate[bot]
74daa15ce4 Update dependency certifi to v2024.7.4 (#2904)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-08 08:04:01 +02:00
renovate[bot]
4f81bc8a26 Update all dependencies (#2901)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-02 22:10:07 +02:00
jcfp
e77d15f75e don't bother looking up a public address if the local ipv6 is link-local (#2899) 2024-06-29 10:16:12 +02:00
Sander
8668852574 make WIN64 also true if on ARM64 (#2893)
Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
2024-06-25 07:03:18 +02:00
renovate[bot]
7e944f393e Update winrt dependencies to v2.1.0 (#2891)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-24 15:29:58 +02:00
renovate[bot]
1646fbfd17 Update all dependencies (#2890)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-24 06:52:59 +02:00
Safihre
72b0521325 Correct crash in Notifications page
Closes #2887
2024-06-19 21:11:03 +02:00
renovate[bot]
8aa53fd43f Update all dependencies (#2882)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-17 14:22:03 +02:00
Safihre
aa67edb2d9 Fix macOS CI run by pinning older Python 3.12.3 version 2024-06-17 09:25:51 +02:00
SABnzbd Automation
0054b17f41 Update translatable texts
[skip ci]
2024-06-17 07:03:09 +00:00
Safihre
2af2cc7370 Add file version information to Windows installer
#2870
2024-06-17 09:02:29 +02:00
renovate[bot]
5aa7aafebb Update all dependencies 2024-06-10 01:14:35 +00:00
Safihre
3bd0f7c1e0 Experiment to improve idle job detection
No longer rely on just length of arrays, but use fast set-comparisons.
2024-06-09 22:23:55 +02:00
Safihre
9c8d21f6db Remove warning about AppRise
Closes #2875
2024-06-09 21:22:52 +02:00
SABnzbd Automation
4947effeb7 Update translatable texts
[skip ci]
2024-06-09 19:02:22 +00:00
Safihre
b8fd9e6e31 Introduce bool_conv and fix ambiguous JSON retry value in history queue 2024-06-09 21:01:32 +02:00
jcfp
2a02c93e4b Fix checkdir argument handling (#2873)
* fix checkdir argument handling

* housekeeping

* shut up black
2024-06-03 22:03:20 +02:00
SABnzbd Automation
a0ef520e06 Update translatable texts
[skip ci]
2024-06-03 02:05:42 +00:00
renovate[bot]
a9eb32eba6 Update all dependencies 2024-06-03 02:05:01 +00:00
SABnzbd Automation
592ef0e645 Update translatable texts
[skip ci]
2024-05-31 14:13:53 +00:00
Safihre
cce53ee058 Set version to 4.3.2 2024-05-31 16:13:02 +02:00
Safihre
93755aa6d8 Update sabctools to 8.3.3 2024-05-29 16:55:12 +02:00
SABnzbd Automation
b1d42c7c22 Update translatable texts
[skip ci]
2024-05-27 20:00:41 +00:00
Safihre
8286b7b830 Add pkg_resources.extern to hidden imports 2024-05-27 19:59:56 +00:00
renovate[bot]
fbaa3c0420 Update all dependencies 2024-05-27 19:59:56 +00:00
SABnzbd Automation
ba6c30cf24 Update translatable texts
[skip ci]
2024-05-23 08:24:29 +00:00
Safihre
3ce5679298 Update text files for 4.3.2RC2 2024-05-23 10:23:41 +02:00
jcfp
47e1d40943 set basic systemd hardening options (#2865) 2024-05-22 13:52:23 +02:00
Safihre
1687130107 Ignore shutdown exception in cheroot
Closes #2857
2024-05-22 10:20:09 +02:00
SABnzbd Automation
8e59146d60 Update translatable texts
[skip ci]
2024-05-20 00:41:49 +00:00
renovate[bot]
4b37d2772f Update all dependencies 2024-05-20 00:41:01 +00:00
thezoggy
ea9d690a90 Switch discord link to vanity link. Add binhex as docker maintainer entry (#2861) 2024-05-17 07:16:25 +02:00
Safihre
3a2e967a03 Add 4.3.2 to appdata 2024-05-16 21:45:00 +02:00
SABnzbd Automation
a2eb0cc2c3 Update translatable texts
[skip ci]
2024-05-16 19:44:14 +00:00
Safihre
8b9341023a Update text files for 4.3.2RC1 2024-05-16 21:39:42 +02:00
Safihre
54314c0198 Only remove Windows shortcuts on uninstall
Closes #2850
2024-05-16 21:32:53 +02:00
Safihre
b0e4c4c5bf Pin paho-mqtt to 1.6.1
Closes #2855
2024-05-16 15:28:05 +02:00
Safihre
989e215acc Update sabctools to 8.2.0 2024-05-16 15:00:26 +02:00
thezoggy
ba88bb15a9 Update unrar 7.01 and 7zip to 24.05 (#2860)
* Update unrar to 7.01

* Upgrade 7zip to 24.05
2024-05-16 09:10:14 +02:00
SABnzbd Automation
0cac0d942c Update translatable texts
[skip ci]
2024-05-15 11:04:15 +00:00
Chris Caron
b24a9ee781 Added tests cases to wrap calls to the Apprise integration (#2856)
* Added tests cases to wrap calls to the Apprise integration

* workaround to default config getting lost from test_misc.py

* 100% test coverage in send_apprise()
2024-05-15 13:03:26 +02:00
SABnzbd Automation
25ae29235f Update translatable texts
[skip ci]
2024-05-13 01:51:57 +00:00
renovate[bot]
a8d4de2d3d Update all dependencies 2024-05-13 01:51:12 +00:00
SABnzbd Automation
ccb3e0522c Update translatable texts
[skip ci]
2024-05-09 20:56:42 +00:00
Safihre
a9f1838b52 Update History Retention wording 2024-05-09 22:55:27 +02:00
SABnzbd Automation
d744c293fb Update translatable texts
[skip ci]
2024-05-09 20:49:42 +00:00
Safihre
94848979ad Add disable_archive for users that want to always skip it
Relates to #2848
2024-05-09 22:47:31 +02:00
SABnzbd Automation
2732326b3d Update translatable texts
[skip ci]
2024-05-06 00:22:01 +00:00
renovate[bot]
ea8328c199 Update all dependencies 2024-05-06 00:21:22 +00:00
Safihre
f1e42707a0 Update appdata for 4.3.1 2024-05-03 17:00:20 +02:00
SABnzbd Automation
c1bdc3abff Update translatable texts
[skip ci]
2024-05-03 13:29:51 +00:00
Safihre
5cbb569b38 Update text files for 4.3.1 2024-05-03 15:28:03 +02:00
Safihre
d4a3f0ea79 Correct missing winrt and apprise imports on macOS/Windows builds 2024-05-03 14:04:00 +02:00
SABnzbd Automation
b31fe2cf49 Update translatable texts
[skip ci]
2024-05-01 19:43:17 +00:00
Safihre
65d748fc9f Update text files for 4.3.0 2024-05-01 21:42:27 +02:00
Safihre
ab2da15bc9 Add SAB_API_KEY and SAB_API_URL to script environment variables 2024-04-29 21:45:00 +02:00
renovate[bot]
bf8bef3cd0 Update all dependencies to v2.0.1 2024-04-29 07:23:08 +00:00
renovate[bot]
adbe2f3c96 Update all dependencies 2024-04-29 02:18:10 +00:00
Safihre
dadb8ee71b Add version 4.3.0 to appdata 2024-04-24 12:11:24 +02:00
SABnzbd Automation
7d30f12532 Update translatable texts
[skip ci]
2024-04-24 10:11:10 +00:00
Safihre
9c41cbd2f3 Update text files for 4.3.0RC2 2024-04-24 12:10:27 +02:00
Safihre
5ce9a0c17d Update cheroot to 10.0.1 2024-04-24 08:53:36 +02:00
Safihre
7b2d2df299 Prevent crash on invalid server expiration date 2024-04-24 08:53:36 +02:00
renovate[bot]
285ff00c12 Update all dependencies 2024-04-22 01:25:16 +00:00
SABnzbd Automation
04ca95cc83 Update translatable texts
[skip ci]
2024-04-21 18:20:26 +00:00
Chris Caron
3b25a07522 drop check for apprise_prio as it's not applicable (#2838) 2024-04-21 20:19:44 +02:00
SABnzbd Automation
14aa449c35 Update translatable texts
[skip ci]
2024-04-19 12:14:24 +00:00
Safihre
d88c035c23 Correct reading of startup shortcut setting on Windows 2024-04-19 14:13:23 +02:00
SABnzbd Automation
6d2d90b1e5 Update translatable texts
[skip ci]
2024-04-16 08:47:17 +00:00
Safihre
e2ca39fb36 Update text files for 4.3.0RC1 2024-04-16 10:46:26 +02:00
Safihre
6a37780b8e Create loop right away, so socks5 proxy doesn't break it 2024-04-16 10:42:50 +02:00
SABnzbd Automation
146f33f38e Update translatable texts
[skip ci]
2024-04-16 08:30:17 +00:00
Safihre
c6c26c5de4 Update Python to 3.12.3 2024-04-16 10:27:31 +02:00
Safihre
262cc8dbbd Limit pyfakefs 2024-04-14 19:20:13 +00:00
renovate[bot]
5bec8e99a5 Update all dependencies 2024-04-14 19:20:13 +00:00
Safihre
2e0e6749ca Ignore jaraco.collections updates in renovate 2024-04-14 20:48:14 +02:00
SABnzbd Automation
c0ef18e8b3 Update translatable texts
[skip ci]
2024-04-14 18:19:47 +00:00
Safihre
52173804f1 Ignore jaraco.context updates in renovate 2024-04-14 20:18:58 +02:00
Safihre
2d8cf69140 Prevent Queue flicker if just single item deleted 2024-04-03 15:36:37 +02:00
Safihre
e2603d74ca Show Apprise version in Config 2024-04-03 14:03:48 +02:00
SABnzbd Automation
9df9238d56 Update translatable texts
[skip ci]
2024-04-01 01:09:30 +00:00
renovate[bot]
b697165392 Update all dependencies 2024-04-01 01:08:51 +00:00
SABnzbd Automation
16bfcc27d8 Update translatable texts
[skip ci]
2024-03-29 13:25:52 +00:00
Safihre
be3f47539d Update text files for 4.3.0Beta1 2024-03-29 14:25:01 +01:00
Safihre
f3fd63cd70 Update Multipar to v1.3.3.2 2024-03-29 14:25:00 +01:00
SABnzbd Automation
aafdf7620e Update translatable texts
[skip ci]
2024-03-29 13:17:06 +00:00
thezoggy
4f3b0541eb Unrar/7zip updates for Windows/MacOS (#2814)
* unrar 7.00

* 7zip 24.03b
2024-03-29 14:16:24 +01:00
Safihre
04fb73fd4a Add extra newline to Reddit release notes 2024-03-25 08:38:35 +01:00
SABnzbd Automation
b1a7924c75 Update translatable texts
[skip ci]
2024-03-25 00:53:29 +00:00
renovate[bot]
4e618206a8 Update all dependencies 2024-03-25 00:52:46 +00:00
jcfp
8a510331df update appstream xml (#2828) 2024-03-20 14:30:13 +01:00
SABnzbd Automation
81035964ca Update translatable texts
[skip ci]
2024-03-18 15:39:49 +00:00
Safihre
304cf5eda0 Update text files for 4.3.0Alpha1 2024-03-18 16:38:46 +01:00
Safihre
b987749291 Fix crash in file selector 2024-03-18 14:23:30 +01:00
SABnzbd Automation
cc3ad230f8 Update translatable texts
[skip ci]
2024-03-18 01:14:52 +00:00
renovate[bot]
e7266db3b3 Update all dependencies 2024-03-18 01:14:10 +00:00
Safihre
a85f39a6e4 Check for end-of-line during NNTP status handling and safeguard status
Closes #2821 
Closes #2822
2024-03-12 13:51:16 +01:00
Safihre
14fdb93c07 Support NNTP code 220 after ARTICLE request
Closes #2817
2024-03-12 12:05:25 +01:00
SABnzbd Automation
349957b8d4 Update translatable texts
[skip ci]
2024-03-11 02:31:19 +00:00
renovate[bot]
16134c6421 Update all dependencies 2024-03-11 02:30:35 +00:00
Safihre
608d05fabc Show file icon instead of folder icon for files in browser 2024-03-06 15:33:38 +01:00
SABnzbd Automation
c410e1209d Update translatable texts
[skip ci]
2024-03-06 14:28:05 +00:00
Safihre
74aefd868a Browse-button to select files on disk and pathbrowser refactor
Closes #2682
2024-03-06 15:27:11 +01:00
Safihre
55476b6594 Correct input placeholder styling in Night themes 2024-03-04 09:58:27 +01:00
renovate[bot]
ad650aa6eb Update all dependencies 2024-03-04 00:12:56 +00:00
SABnzbd Automation
154d2d73ef Update translatable texts
[skip ci]
2024-03-02 20:23:59 +00:00
Safihre
b171f7764f Do not log NNTP data in unknown status code warning
See #2817
2024-03-02 21:23:14 +01:00
SABnzbd Automation
30a20b549e Update translatable texts
[skip ci]
2024-03-01 08:59:50 +00:00
Safihre
a3cc5e244d No need to translate Apprise 2024-03-01 08:46:48 +01:00
SABnzbd Automation
37441f598f Update translatable texts
[skip ci]
2024-02-28 20:24:28 +00:00
Safihre
8bced7cdc9 Update History Retention options to allow archiving 2024-02-28 21:09:27 +01:00
SABnzbd Automation
35d0589f46 Update translatable texts
[skip ci]
2024-02-28 13:18:26 +00:00
Safihre
5c45db3d45 Update error message in case of news server instead of usenet server 2024-02-28 14:17:27 +01:00
SABnzbd Automation
700d08c69d Update translatable texts
[skip ci]
2024-02-27 22:04:40 +00:00
Safihre
1b71c60256 Help users that enter an indexer as server by checking port 80
Closes #2802
2024-02-27 23:01:30 +01:00
Safihre
8cf7d812ab Italian was missed as NSIS language 2024-02-27 13:53:52 +01:00
Safihre
627264affd Cryptography no longer requires special handling for macOS binary 2024-02-27 13:39:21 +01:00
Safihre
674502323b Force universal2 compilation for Cheetah 2024-02-27 13:10:04 +01:00
Safihre
34a9d751b8 Update requirement cheetah3 to CT3
https://cheetahtemplate.org/news.html#id4
2024-02-27 12:34:29 +01:00
SABnzbd Automation
5b252efcf0 Update translatable texts
[skip ci]
2024-02-26 15:33:19 +00:00
Safihre
6756f2ba2e Move servertests to api 2024-02-26 16:32:18 +01:00
Safihre
3c0e89802e Archive option was ignored if categories were supplied
Thanks @thezoggy
2024-02-26 13:30:35 +01:00
renovate[bot]
e55a95db39 Update all dependencies 2024-02-26 01:18:54 +00:00
SABnzbd Automation
80cd64b4ba Update translatable texts
[skip ci]
2024-02-25 19:12:11 +00:00
Safihre
962642b0d0 Archive by default when deleting items without specific archive= set 2024-02-25 20:11:23 +01:00
SABnzbd Automation
641f353c84 Update translatable texts
[skip ci]
2024-02-23 20:30:05 +00:00
Safihre
d598bc0a79 Add typing to api.py 2024-02-23 20:52:04 +01:00
Safihre
153041c431 Disable backup_for_duplicates for new installations
Since we will have the archive
2024-02-23 16:19:06 +01:00
Safihre
582a40599a Improve wording of the delete confirmation 2024-02-23 16:19:06 +01:00
Safihre
6e21f14ae9 Add option to skip archive to purge actions 2024-02-23 16:19:06 +01:00
Safihre
a4540b8deb Allow moving to archive 2024-02-23 16:19:06 +01:00
Safihre
fe10c7daad Enable Archive mode 2024-02-23 16:19:06 +01:00
Safihre
cd4ee1eee9 Add toggle for Archive to History 2024-02-23 16:19:06 +01:00
SABnzbd Automation
54ec05d63e Update translatable texts
[skip ci]
2024-02-23 14:04:48 +00:00
Safihre
da7a74ee58 Correct translatable texts about connection threads 2024-02-23 15:03:45 +01:00
SABnzbd Automation
72d08f60b2 Update translatable texts
[skip ci]
2024-02-23 13:44:49 +00:00
Safihre
4e6878972e Reduce Server test timeout to 10s
Unless otherwise specified
Related to #2802
2024-02-23 14:44:04 +01:00
Safihre
f5efa5e93d Refactor handling of multiple comma separated values in the API 2024-02-20 16:23:33 +01:00
Safihre
179f765ca0 Refactor part of database.py
Use autocommit and skip unnecessary checks on every connect
2024-02-20 12:42:48 +01:00
SABnzbd Automation
6a8f78ec23 Update translatable texts
[skip ci]
2024-02-19 21:06:30 +00:00
Shane Mc Cormack
f46e669eeb Handle NNTP error code 451 (#2808)
* Handle error code 451.

This is used by some servers to show that an article was intentionally removed.
Fix #2807

* Add a warning when an unknown status code is given for an article.

* Make warning message translatable.
2024-02-19 22:05:44 +01:00
SABnzbd Automation
1c3188a3bb Update translatable texts
[skip ci]
2024-02-19 14:35:52 +00:00
Safihre
a7fe030557 Update all dependencies 2024-02-19 15:35:10 +01:00
Safihre
dacadfc59e Notify users of sabnzbd-notify.py that they don't need it anymore 2024-02-16 16:30:31 +01:00
SABnzbd Automation
aa01855ac3 Update translatable texts
[skip ci]
2024-02-16 15:19:09 +00:00
Safihre
2d9b91eff5 Add link to Apprise documentation section 2024-02-16 16:18:26 +01:00
Safihre
d2c6c6e564 Remove parsing of Group command code
Since we never request it.
2024-02-16 12:33:00 +01:00
SABnzbd Automation
a11a4d1aee Update translatable texts
[skip ci]
2024-02-16 11:29:17 +00:00
Chris Caron
ad43a18f59 Apprise Integration (#2796)
* Basic Apprise Integration

* added try/catch

* comments/code review adapted

* refactored get_target() to better work with walrus operator

* Added explicit requests and markdown dependancies

* requests-oauthlib dep's added

* Updates

---------

Co-authored-by: Safihre <safihre@sabnzbd.org>
2024-02-16 12:28:30 +01:00
SABnzbd Automation
b1a9ff708c Update translatable texts
[skip ci]
2024-02-14 13:44:45 +00:00
Safihre
97a01b302f Replace History delete-confirmation by modal
Preparing for Archive function
2024-02-14 14:13:55 +01:00
Safihre
c22a73a98d Replace Queue delete-confirmation by modal 2024-02-14 13:16:18 +01:00
renovate[bot]
bc9a7a0eb7 Update dependency setuptools to v69.1.0 2024-02-12 03:48:44 +00:00
renovate[bot]
b35a737d97 Update all dependencies 2024-02-12 01:23:25 +00:00
thezoggy
760364d4c7 Add missing tooltips (#2800)
Co-authored-by: Safihre <safihre@sabnzbd.org>
2024-02-09 09:50:59 +01:00
Safihre
e4ff047c6e Update log message about version check 2024-02-06 10:16:03 +01:00
Safihre
833219d5e5 Update standby command on macOS 2024-02-05 13:24:35 +01:00
Safihre
eed1ab3ce3 Use --no-dependencies during CI 2024-02-05 08:40:40 +01:00
renovate[bot]
c9a427bf8b Update all dependencies 2024-02-05 01:20:36 +00:00
SABnzbd Automation
6b4d7bde71 Update translatable texts
[skip ci]
2024-02-04 16:45:24 +00:00
jcfp
96442a3578 improve happyeyeballs tests (#2797) 2024-02-04 17:44:40 +01:00
jcfp
60e1dfb380 don't assume the test host has an ipv4 address (#2795) 2024-02-03 12:42:55 +01:00
SABnzbd Automation
deaa150ab4 Update translatable texts
[skip ci]
2024-02-02 12:26:32 +00:00
Safihre
ca649a31a4 Remove Send Group option
Closes #2715
2024-02-02 13:25:49 +01:00
SABnzbd Automation
a2e514c10d Update translatable texts
[skip ci]
2024-02-01 10:53:37 +00:00
Safihre
0577a64ae3 Wrong archive password is used for Retry
Closes #2790
2024-02-01 11:52:46 +01:00
SABnzbd Automation
1a69842871 Update translatable texts
[skip ci]
2024-01-29 15:34:46 +00:00
Safihre
992c6c71b0 Only attempt Windows Toasts on Windows 10 and above 2024-01-29 16:08:35 +01:00
SABnzbd Automation
bad0914e3c Update translatable texts
[skip ci]
2024-01-29 04:58:42 +00:00
renovate[bot]
8495a234e8 Update all dependencies 2024-01-29 04:57:58 +00:00
Safihre
3faa6577df Use setup-python way of caching pip packages
Our previous action is no longer supported
2024-01-26 16:43:42 +01:00
Safihre
f398d2a0d8 Use Renovate to update GitHub Actions 2024-01-26 16:40:50 +01:00
Safihre
335ae82a3d Remove text output formatting from API
Closes #2785
2024-01-26 16:20:44 +01:00
SABnzbd Automation
4ac15880db Update translatable texts
[skip ci]
2024-01-22 14:16:27 +00:00
Safihre
fd5c2795b1 Set version to 4.3.0-develop 2024-01-22 15:15:35 +01:00
Safihre
47c71422bc Add logging which notification will be sent 2024-01-22 14:46:54 +01:00
Sander
bfb7fd92b0 Add IPv6 staging option (#2781)
* ipv6_staging: for ipv6 related stuff that is (allegedly) not yet mainstream

* ipv6_staging: separate internetspeed() ipv4 resp ipv6

* ipv6_staging: separate internetspeed() ipv4 resp ipv6

* ipv6_staging: separate internetspeed() ipv4 resp ipv6

* Move logic to internetspeed

* Add back alternative IPv6-address mapping

This reverts commit ec71d20d37.

* Usenetfarm added IPv6

---------

Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2024-01-22 13:15:59 +01:00
renovate[bot]
bf52430da8 Update all dependencies 2024-01-22 01:31:55 +00:00
Safihre
7005b3ee86 Do not trigger Duplicate Check twice on URL's 2024-01-21 22:00:12 +01:00
Safihre
8f2ea239c5 Do not send Windows notifications if ran as Service 2024-01-21 20:35:27 +01:00
Safihre
9ee2a8a98c Add hover to Night style buttons 2024-01-19 13:56:43 +01:00
jcfp
6f0daf9d1b Use local ipv6 if public fails and is rout able (#2783)
* use local ipv6 if routable

* always try a remote lookup anyway, for statistics purposes
2024-01-19 13:01:18 +01:00
Safihre
28ed424fa8 Cache CPU name for 1 hour 2024-01-18 21:40:08 +01:00
SABnzbd Automation
fe3e20b108 Update translatable texts
[skip ci]
2024-01-17 15:11:46 +00:00
Safihre
23f3b901e3 Update text files for 4.2.2RC1 2024-01-17 16:11:00 +01:00
Safihre
567608b3c4 Using password=PW resulted in PW.nzb as password
Closes #2779
2024-01-17 14:51:35 +01:00
Safihre
4ff0f94d41 Add IRC and Discord label 2024-01-17 11:59:57 +01:00
Safihre
a56290489c Only request addrinfo once per internetspeed 2024-01-17 11:53:56 +01:00
Safihre
aac4392f69 Handle brackets in potentical filenames in subjects
Closes #2772
2024-01-15 09:55:22 +01:00
SABnzbd Automation
c130feefc5 Update translatable texts
[skip ci]
2024-01-15 02:00:46 +00:00
renovate[bot]
474bcf5f05 Update dependency more-itertools to v10.2.0 2024-01-15 02:00:04 +00:00
Safihre
cf24ada3f1 Move helpful_warnings declaration so it's read as the very first 2024-01-10 16:23:07 +01:00
Safihre
7b26bb7171 Add 4.2.2 already to appdata 2024-01-10 13:32:35 +01:00
SABnzbd Automation
83d89ff05c Update translatable texts
[skip ci]
2024-01-10 09:53:14 +00:00
Safihre
7034bdcbf6 Update text files for 4.2.2 Beta 1
Closes #2776
2024-01-10 10:52:24 +01:00
Safihre
4c12da5418 Update log anonymization for new IPv4/6 logging
Closes #2775
2024-01-10 09:07:23 +01:00
SABnzbd Automation
8bf1d2bc1f Update translatable texts
[skip ci]
2024-01-10 05:54:35 +00:00
Steve Albrecht
900a99653f Move UI theme selection out of advanced settings (#2774)
* Make UI theme selection a non-advanced setting

* Call stylesheet a "theme" instead of a "skin"

---------

Co-authored-by: sbalbrecht <stpehen.b.albrecht@gmail.com>
2024-01-10 06:53:54 +01:00
Safihre
f33fcfa7b1 Require only 5 characters to define a filename 2024-01-09 16:22:15 +01:00
SABnzbd Automation
130148d475 Update translatable texts
[skip ci]
2024-01-09 09:34:35 +00:00
Safihre
021f87eef3 Correct focus style of Config Night navbar 2024-01-09 10:33:45 +01:00
Safihre
8ef8788152 Correct logic error in guess_what
@jcfp This check seems very specific, are these conditions ever all True at the same time?
2024-01-08 15:34:31 +01:00
renovate[bot]
041756829a Update dependency pyinstaller-hooks-contrib to v2023.12 2024-01-08 00:42:10 +00:00
Safihre
89c7f52d84 Do not ask for feedback about categories based on Groups anymore
It's staying.
2024-01-07 21:18:00 +01:00
SABnzbd Automation
c40b560d15 Update translatable texts
[skip ci]
2024-01-07 19:58:50 +00:00
Safihre
74f9391076 Explain that Retry disabled aborting due to missing articles
Closes #2765
2024-01-07 20:58:12 +01:00
SABnzbd Automation
76dab68759 Update translatable texts
[skip ci]
2024-01-07 19:48:48 +00:00
Safihre
d405548825 Shutdown SABnzbd automatically during update on Windows
Closes #2766
2024-01-07 20:48:05 +01:00
Safihre
b4c76f034f If duplicate is discarded during URL-fetches, no nzo_id is known yet
Closes #2771
2024-01-06 22:53:17 +01:00
Safihre
cda2402d01 Fix typo in asset name of Windows release 2024-01-06 11:37:33 +01:00
Safihre
2cf9ab2620 Build using old PyInstaller so virusscanners don't get upset 2024-01-06 09:26:02 +01:00
Safihre
465f182493 Add 4.2.1 to appdata 2024-01-05 10:11:37 +01:00
SABnzbd Automation
23321a1075 Update translatable texts
[skip ci]
2024-01-05 08:54:08 +00:00
Safihre
ff2b9243e9 Update text files for 4.2.1 2024-01-05 09:53:09 +01:00
Safihre
471fb7a83c Log waiting for download folder at Info level
Closes #2768
2024-01-05 09:34:28 +01:00
Safihre
0db5ae8390 Updates to table structure require commit
Closes #2769
2024-01-05 09:33:46 +01:00
SABnzbd Automation
e36f60085f Update translatable texts
[skip ci]
2024-01-04 13:42:32 +00:00
Safihre
3718fc36f0 Don't block network drives, only warn against them 2024-01-04 14:41:25 +01:00
Safihre
71a41f6369 Catch None-return value from user_version database command
Relates to #2764
2024-01-04 14:06:41 +01:00
SABnzbd Automation
47a2f9a4a7 Update translatable texts
[skip ci]
2024-01-03 21:11:59 +00:00
Safihre
a6f0bc0490 New release check is performed daily 2024-01-03 22:10:08 +01:00
Safihre
cb7c37a836 Remove outdated certificate validation check
It was relevant in Python 2.7-days.
This was we also don't make any external HTTP calls on start-up anymore, so hopefully we upset less virus scanners.
2024-01-03 22:04:42 +01:00
Safihre
e89eba08c4 Add helper function is_none 2024-01-03 15:56:09 +01:00
Sander
d5d857983d Improved IPv6 address detection (#2753)
* happyeyeballs(): you can specify the family

* happyeyeballs(): you can specify the family

* happyeyeballs(): pytest

* happyeyeballs(): measure internetspeed_ipv4 and internetspeed_ipv6

* happyeyeballs(): measure internetspeed_ipv4 and internetspeed_ipv6

* happyeyeballs(): corrected pytest in case no ipv6 in environment

* internetspeed ipv4 and ipv6

* take care when ipv6 is not working

* take care when ipv6 is not working

* take care when ipv6 is not working

* take care when ipv6 is not working

* take care when ipv6 is not working

* black formatting

* faster test-HE on ipv4-only network

* comment in unittest

* requests in requirements.txt

* use urllib, not requests

* use urllib, not requests

* logging: tell family, if specified

* logging: tell family, if specified

* Merge remote-tracking branch 'origin/ipv6_HE_speedtest_address' into ipv6_HE_speedtest_address

* Merge remote-tracking branch 'origin/ipv6_HE_speedtest_address' into ipv6_HE_speedtest_address

* cleanup of getipaddress

* cleanup of getipaddress

* cleanup of getipaddress

* cleanup of getipaddress

* Merge remote-tracking branch 'origin/ipv6_HE_speedtest_address' into ipv6_HE_speedtest_address

* Changes to PR

* Make sure the returned IP is valid

---------

Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2024-01-03 14:25:34 +01:00
SABnzbd Automation
9ab30dffd8 Update translatable texts
[skip ci]
2024-01-03 12:28:20 +00:00
Safihre
1e630c3c68 Update text files for 4.2.0 2024-01-03 13:24:44 +01:00
Safihre
b2cd596401 Add copyright update to ignore-revs 2024-01-02 10:05:32 +01:00
SABnzbd Automation
ef6be9d436 Update translatable texts
[skip ci]
2024-01-02 08:43:02 +00:00
thezoggy
9f6a9f9912 normalize and update copyright year 2024-01-02 09:42:17 +01:00
renovate[bot]
e4c37af7b7 Update all dependencies 2024-01-01 02:12:40 +00:00
SABnzbd Automation
353e90cf6d Update translatable texts
[skip ci]
2023-12-31 20:29:06 +00:00
Safihre
ecf7fb4bc4 Only check for a new release 10 min after starting and then daily
Less outgoing connections at start-up to scare virus scanners.
2023-12-31 21:26:06 +01:00
SABnzbd Automation
e200a5ed78 Update translatable texts
[skip ci]
2023-12-28 19:52:08 +00:00
Safihre
5e02263ad1 Update text files for 4.2.0RC4 2023-12-28 20:51:08 +01:00
Safihre
a6af810274 Remove startup logging of basic performance measurements
Has not been useful so far
2023-12-27 22:38:22 +01:00
thezoggy
d9d34735da par2cmdline-turbo v1.1.1 (#2760) 2023-12-27 19:30:33 +01:00
Safihre
087bc95f80 Set default order for default and new categories 2023-12-25 22:19:03 +01:00
Safihre
ff27f9832a Ask why users have set a newsgroup in their Category settings 2023-12-25 21:59:35 +01:00
SABnzbd Automation
2124e66219 Update translatable texts
[skip ci]
2023-12-25 16:13:38 +00:00
Safihre
9ae80b60b4 Move NNTP closed assignment up 2023-12-25 17:12:55 +01:00
Safihre
d701c4c3f9 If connecting is slow, downloads queue would hang up to 1 min 2023-12-25 13:36:28 +01:00
SABnzbd Automation
b4cc5eea66 Update translatable texts
[skip ci]
2023-12-25 01:53:23 +00:00
renovate[bot]
7cdf14c43b Update all dependencies 2023-12-25 01:52:46 +00:00
Safihre
06d086725c Add git blame ignore list 2023-12-22 13:59:18 +01:00
SABnzbd Automation
a8e79d64c0 Update translatable texts
[skip ci]
2023-12-20 15:33:22 +00:00
Safihre
742c6fa5dd Update text files 4.2.0RC3 2023-12-20 16:32:34 +01:00
Safihre
f4cfdc6647 All Notifications should have same default selection
And a number of type hints.
2023-12-20 15:42:02 +01:00
Safihre
43ae566053 Download stalls if nw.data limit is reached
Closes #2752
2023-12-20 10:20:06 +01:00
Safihre
063a6428f3 Add timeout to join's in shutdown code
In case of crash!
2023-12-18 08:53:14 +01:00
renovate[bot]
3e302d7c04 Update all dependencies 2023-12-18 01:52:21 +00:00
Safihre
436ceabb9e Pass integer to bytearray_malloc instead of float
Prevent silent crashes in `process_nw` that would have made us discover this sooner.
2023-12-17 23:26:34 +01:00
SABnzbd Automation
186dc6db31 Update translatable texts
[skip ci]
2023-12-16 22:18:51 +00:00
Safihre
af4feba7d7 Standardize parsing of cat/pp/script input when adding NZB or URL
Closes #2750
2023-12-16 23:11:37 +01:00
SABnzbd Automation
549aac15b7 Update translatable texts
[skip ci]
2023-12-15 12:27:34 +00:00
Safihre
06d8d92dbe Remove IRC specific texts 2023-12-15 12:12:53 +01:00
SABnzbd Automation
6a8763d7ba Update translatable texts
[skip ci]
2023-12-14 20:49:37 +00:00
Safihre
521b97b7b7 Update text files for 4.2.0RC2 2023-12-14 21:48:18 +01:00
SABnzbd Automation
58c8601067 Update translatable texts
[skip ci]
2023-12-14 20:38:57 +00:00
Safihre
36609376e8 Add button to macOS notification
Closes #2749
2023-12-14 21:36:55 +01:00
Safihre
32a1c8264e Add buttons to Windows Notifications
Closes #2641
2023-12-14 21:36:13 +01:00
Safihre
06754f4ef1 Mark second test_download_sorting_single as xfail on macOS and Windows 2023-12-13 14:40:02 +01:00
Safihre
99d9b3bf94 "Disk Full" notification type was not actually used 2023-12-13 14:18:53 +01:00
Safihre
ec71d20d37 Remove alternative IPv6-address mapping
Due to provider concerns
2023-12-13 11:16:51 +01:00
Safihre
2d1e88bb39 Ignore warning about old SSL/TLS settings in test_newswrapper 2023-12-12 14:28:05 +01:00
Safihre
c9d30bb422 Update sabnews for current asyncio behaviour 2023-12-12 14:28:05 +01:00
SABnzbd Automation
cd448082e3 Update translatable texts
[skip ci]
2023-12-12 11:00:30 +00:00
Safihre
46239dddac Update code for deprection warnings 2023-12-12 11:59:43 +01:00
SABnzbd Automation
81177fda35 Update translatable texts
[skip ci]
2023-12-11 20:35:26 +00:00
Michael Nightingale
983d623d7f Fix dirscanner async tests (#2748)
* Fix dirscanner async tests

* Use root of fake filesystem to test dirscanner

* Revert minor change
2023-12-11 21:34:42 +01:00
Safihre
bdda8f4abf Correct Direct Unpack unrar output logging 2023-12-11 13:25:46 +01:00
SABnzbd Automation
94fc804394 Update translatable texts
[skip ci]
2023-12-11 01:01:21 +00:00
renovate[bot]
e00d8c09e7 Update all dependencies 2023-12-11 01:00:42 +00:00
Safihre
70a40b4bdd Add duplicate_key to script environment variables 2023-12-08 21:10:47 +01:00
Safihre
f806a62f01 Add change of Pre-queue parameters to changelog 2023-12-08 21:10:47 +01:00
SABnzbd Automation
71a9281b8f Update translatable texts
[skip ci]
2023-12-08 13:25:25 +00:00
Safihre
a34747fbd5 Update text files for 4.2.0RC1
Yes, I used AI to generate the new release notes
2023-12-08 14:24:40 +01:00
Safihre
6b0380199b Mark test_download_sorting_single as xfail on macOS and Windows 2023-12-07 21:43:43 +01:00
Safihre
39d2f90a84 Trigger duplicate analysis if pre-queue script sets a new name 2023-12-07 21:42:43 +01:00
Safihre
7bff7651f3 Only auto-enable Direct Unpack for >100MB/s drives 2023-12-07 21:34:09 +01:00
Safihre
44bd15d519 Small change to internetspeed measurement 2023-12-07 15:49:07 +01:00
SABnzbd Automation
1ca93b03a0 Update translatable texts
[skip ci]
2023-12-06 15:56:06 +00:00
Safihre
3295142d81 Use sabctools for Internet Bandwidth measurement
Closes #2737
2023-12-06 13:44:12 +01:00
Safihre
f12fdc46dc Improve stability of test_adding_nzbs_nzoids 2023-12-06 13:22:59 +01:00
Safihre
fc01254fe6 Mark test_download_sorting_single as xfail on macOS and Windows 32bit 2023-12-06 12:58:47 +01:00
Safihre
8fb3368601 Add guestimate of performance test duration to hint 2023-12-06 12:46:44 +01:00
SABnzbd Automation
58facc2512 Update translatable texts
[skip ci]
2023-12-05 09:56:24 +00:00
Safihre
b43c2b308b Use correct keys for Season and Episode in Smart Duplicate detection 2023-12-05 10:55:34 +01:00
renovate[bot]
1e89a0af56 Update all dependencies 2023-12-04 02:19:58 +00:00
Safihre
acd3cbbf49 Correct test_validate_safedir 2023-12-03 20:02:41 +01:00
SABnzbd Automation
a806521745 Update translatable texts
[skip ci]
2023-12-02 20:20:33 +00:00
Safihre
0dddaf26e0 Stricter validation on Windows to prevent network drives as Incomplete 2023-12-02 21:19:48 +01:00
Safihre
cdf63a005b Python 3.8 doesn't have functools.cache so use lru_cache 2023-12-02 21:09:44 +01:00
SABnzbd Automation
ca422a0af3 Update translatable texts
[skip ci]
2023-12-02 19:40:31 +00:00
Safihre
a682371a91 Cache result of HappyEyeBalls 10 seconds 2023-12-02 20:39:38 +01:00
Safihre
26ef146526 Use decorator to maintain diskspace cache and HappyEyeBalls cache 2023-12-02 20:36:14 +01:00
Safihre
936ee58abb Reduce waiting time if there are no sockets to read 2023-12-01 15:11:05 +01:00
Safihre
71d8c208bc Micro-optimization of NzbQueue.is_empty 2023-12-01 14:50:07 +01:00
Safihre
2200ffa88e Use Server-specific timeout in final attempt 2023-12-01 14:34:07 +01:00
Safihre
4453316516 Server warnings were not always shown 2023-11-30 22:15:32 +01:00
Safihre
b947207571 Use Server-specific timeout during HappyEyeBalls 2023-11-30 19:50:31 +01:00
SABnzbd Automation
25d29deae6 Update translatable texts
[skip ci]
2023-11-30 12:26:53 +00:00
Safihre
9abe6d6d71 Skip empty HTTP-headers in URLGrabber and skip invalid categories 2023-11-30 13:25:43 +01:00
Safihre
77dbc0a37f Check nzb backup folder only if the job is not still in the queue 2023-11-30 13:19:57 +01:00
Safihre
659117512b Give RSS feed it's own history-stage 2023-11-30 13:04:12 +01:00
SABnzbd Automation
b1dbbc6a69 Update translatable texts
[skip ci]
2023-11-29 20:47:52 +00:00
Safihre
424a1c626e Add name of RSS feed to history Source
Closes #2206
2023-11-29 21:46:19 +01:00
Safihre
522666191b Indexer category was not used anymore 2023-11-29 21:46:19 +01:00
Safihre
78055ef794 Do not show propagation label in case job is Forced 2023-11-29 21:46:19 +01:00
SABnzbd Automation
0fe534c202 Update translatable texts
[skip ci]
2023-11-29 13:58:08 +00:00
Safihre
257179de31 Add ability to search Queue/History for status
Closes #2376
2023-11-29 14:57:15 +01:00
Safihre
65b57112b9 Optimize handling of propagation_delay 2023-11-29 14:57:15 +01:00
renovate[bot]
27f0b1d1f2 Update dependency cryptography to v41.0.6 [SECURITY] 2023-11-29 01:54:31 +00:00
SABnzbd Automation
6e31476c45 Update translatable texts
[skip ci]
2023-11-28 21:07:35 +00:00
Safihre
bc7f0f3fb3 Update text files for 4.2.0Beta1 2023-11-28 22:06:43 +01:00
SABnzbd Automation
13eeb5164f Update translatable texts
[skip ci]
2023-11-28 14:31:50 +00:00
Safihre
fc756ed23d Add smarter duplicate detection (#2736)
Restore pre-queue
2023-11-28 15:30:46 +01:00
SABnzbd Automation
c150365462 Update translatable texts
[skip ci]
2023-11-27 12:18:43 +00:00
renovate[bot]
58d209059e Update dependency setuptools to v69 2023-11-27 13:12:00 +01:00
Safihre
506179b517 Remove unused sort_type from guess_what 2023-11-24 21:17:29 +01:00
SABnzbd Automation
f0f4eb75df Update translatable texts
[skip ci]
2023-11-22 15:55:34 +00:00
Safihre
6c1c025668 Update text files 4.2.0Alpha3 2023-11-22 16:54:50 +01:00
SABnzbd Automation
987032b384 Update translatable texts
[skip ci]
2023-11-22 15:14:06 +00:00
Safihre
d516cbf363 Correct tests and improvements for new Duplicate handling 2023-11-22 16:13:22 +01:00
Safihre
824274ac5e Trigger duplicate handling when job is removed from the queue 2023-11-22 16:13:22 +01:00
Safihre
82b1c784f4 No longer warn for duplicates by default 2023-11-22 16:13:22 +01:00
Safihre
232512b860 Let main duplicate handling handle RSS duplicates 2023-11-22 16:13:22 +01:00
Safihre
223fa421c7 Implement more sophisticated duplicate handling
[skip ci]
2023-11-22 16:13:22 +01:00
Safihre
2e5e72bfcf Label in progress bar for URL fetches
Visually more distinctive
2023-11-22 15:37:35 +01:00
Safihre
9bdb986382 Only redirect cherrypy logging to their access log
Closes #2731
2023-11-20 08:49:27 +01:00
SABnzbd Automation
901ff30e11 Update translatable texts
[skip ci]
2023-11-18 20:24:07 +00:00
Safihre
5e04599212 Revert "Simplify handling of nzo.pp"
Closes #2733
2023-11-18 21:22:45 +01:00
Safihre
d3c9b7ead3 Simplify handling of nzo.pp 2023-11-13 12:33:05 +01:00
renovate[bot]
361770c34b Update all dependencies 2023-11-13 01:44:28 +00:00
SABnzbd Automation
5168f3fa97 Update translatable texts
[skip ci]
2023-11-11 22:01:41 +00:00
Safihre
94d307e198 Add simplified Sorter override, to analyse series information 2023-11-11 22:59:58 +01:00
Safihre
eba6236ad2 Make sure we only return successful Happy Eyeballs results 2023-11-10 16:16:46 +01:00
Safihre
d0128bd989 Use sabnzbd.filesystem functions directly 2023-11-10 13:45:56 +01:00
Safihre
fbd7c0ec36 Correct Night display of Sorting page 2023-11-08 16:33:40 +01:00
SABnzbd Automation
55abac97ea Update translatable texts
[skip ci]
2023-11-08 11:38:17 +00:00
Safihre
740b94170e Prevent looping over files for unwanted extension detection 2023-11-08 12:36:57 +01:00
SABnzbd Automation
c6a1a09213 Update translatable texts
[skip ci]
2023-11-07 15:33:21 +00:00
Safihre
cd84d52398 End of queue script to be moved to it's own configuration menu item
Closes #2385
Setting is not copied since it's such an exotic function.
Made pre-queue script an Advanced Setting.
2023-11-07 16:32:39 +01:00
Safihre
cdbad1b397 Add password as option to NzbObject creation
And another refactor of filename/work_name/final_name
2023-11-07 16:24:31 +01:00
Safihre
67e227008a Revert "Remove undocumented detection of password=XX from job name"
This reverts commit 62a057dbfb.

It is listed here: https://sabnzbd.org/wiki/advanced/password-protected-rars
Oops
2023-11-07 15:47:41 +01:00
Safihre
23cf43cac5 Replace uses of os.path.splitext with helper functions 2023-11-06 15:05:50 +01:00
Safihre
62a057dbfb Remove undocumented detection of password=XX from job name 2023-11-06 14:35:17 +01:00
renovate[bot]
f2ff9ae557 Update dependency jaraco.functools to v4 2023-11-06 00:42:28 +00:00
Safihre
9ed4e46919 Update macOS workflow for new GitHub runner 2023-11-03 20:17:52 +01:00
Safihre
faa71bae40 Log traceback in case of exception in __finish_connect_nw 2023-11-03 20:06:41 +01:00
Safihre
bbd5d2cd6d Prevent duplicate IP's in Happy Eyeballs 2023-11-03 12:03:14 +01:00
Safihre
221e135c07 Optimize Happy Eyeballs for our use
Reduced time between connection attempts to prevent slow hosts that happened to be the first in the list to win from faster second-in-list.
Add test for our IPv6 mapping
2023-11-02 21:12:32 +01:00
Safihre
956904c0b3 Correctly implement RFC 6555/8305 (Happy Eyeballs) 2023-11-01 15:16:10 +01:00
Safihre
8590481022 Add IPv6 alternative hostname for common providers
Closes #2721
2023-11-01 09:07:42 +01:00
SABnzbd Automation
2171d0139e Update translatable texts
[skip ci]
2023-10-30 13:45:23 +00:00
Safihre
71d6aca9f8 Remove unused exceptions in servertest 2023-10-30 14:44:31 +01:00
Safihre
0125e279c0 Prevent PyWin32 warning by returning True instead of nothing 2023-10-30 12:33:57 +01:00
SABnzbd Automation
b8e46ccf10 Update translatable texts
[skip ci]
2023-10-30 01:02:52 +00:00
renovate[bot]
787fef1c03 Update dependency orjson to v3.9.10 2023-10-30 01:02:09 +00:00
SABnzbd Automation
98b7a6171f Update translatable texts
[skip ci]
2023-10-27 12:41:14 +00:00
Safihre
210f254f63 Update text files for 4.2.0Alpha2 2023-10-27 14:40:22 +02:00
Safihre
ecdccda1ce Remove support to upgrade from 2.3.9 and older 2023-10-27 14:40:22 +02:00
Safihre
ed66ac91e0 Remove old nzo.md5packs attribute 2023-10-27 14:40:22 +02:00
SABnzbd Automation
e571165c15 Update translatable texts
[skip ci]
2023-10-27 10:20:00 +00:00
Safihre
1513664b5f Lock all config dict operations
Closes #2685
2023-10-27 12:19:12 +02:00
SABnzbd Automation
0132d81c43 Update translatable texts
[skip ci]
2023-10-25 14:19:40 +00:00
Safihre
8d32da8b27 Refactor of some parts of Config saving 2023-10-25 16:06:28 +02:00
Safihre
b5fbc8af86 Refactor handling of Complete vs Incomplete check
Closes #2717
2023-10-25 16:06:28 +02:00
SABnzbd Automation
d0166b5a5c Update translatable texts
[skip ci]
2023-10-25 10:01:25 +00:00
renovate[bot]
ada77d6970 Update all dependencies (#2716)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-25 12:00:42 +02:00
Safihre
9f8758b242 Mark newshosting Happy EyeBalls tests as xfail 2023-10-25 11:18:41 +02:00
SABnzbd Automation
5ca629ebea Update translatable texts
[skip ci]
2023-10-24 18:30:36 +00:00
Safihre
f9f3820652 Refactor the way we getaddrinfo and use Happy Eyeballs (#2713)
* Refactor the way we getaddrinfo and use  Happy Eyeballs

* Move tests to right directory

* Do not run Happy Eyeballs for only 1 address

* Process feedback

* Make sure we always have a canonname

* Show IP and resolved name in Status Window

* Simplify Status server updates

* Remove unused imports
2023-10-24 20:29:50 +02:00
Safihre
08e61ecf19 Build all binaries without unspecified dependencies 2023-10-23 15:44:26 +02:00
SABnzbd Automation
d15f0cafce Update translatable texts
[skip ci]
2023-10-23 11:53:27 +00:00
Safihre
1b85253940 Limit recursive unpack to 2 additional levels
Closes #2714
2023-10-23 13:50:40 +02:00
Safihre
b329ff007e Wrap DEF_FILE_MAX check in try/except
See #2714
2023-10-23 13:42:56 +02:00
Safihre
f6918d598a Add thread name to start-up logging of Downloader 2023-10-23 12:16:36 +02:00
Safihre
0cdfdd82d4 Renovate ignored tests requirements 2023-10-23 09:04:53 +02:00
SABnzbd Automation
de3649dba4 Update translatable texts
[skip ci]
2023-10-22 18:15:07 +00:00
Safihre
9ba975ac44 Remove &nbsp from translation string 2023-10-22 20:12:37 +02:00
Safihre
2b0ea92da8 Ask users why they still have Send Group enabled 2023-10-20 17:06:58 +02:00
Safihre
b79a1e973d Revert removal of SABnzbd-console.exe
Sad-face.. See pyinstaller/pyinstaller/issues/8022
2023-10-20 16:26:15 +02:00
renovate[bot]
1be4cf986d Update all dependencies 2023-10-16 09:37:20 +02:00
SABnzbd Automation
18c4226b90 Update translatable texts
[skip ci]
2023-10-15 19:25:19 +00:00
Safihre
07a5ba6857 Update text files for 4.2.0Alpha1 2023-10-15 21:24:30 +02:00
Safihre
6252d02498 Changes to binary building after PyInstaller update
Correct restart on macOS binary.
Allow to be less strict about file removal.
Remove not needed zip parameter.
Remove old modifications of sys.argv.
Make sure that after restart we still log to console.
2023-10-15 21:12:15 +02:00
Safihre
11cf8c5397 Test build with PyInstaller 6.1.0 and Python 3.12 2023-10-14 23:41:19 +02:00
Safihre
1f3f4a4c85 Crashes during server connect could result in bad socket state
For example if the queue was disconnected while some threads were still connecting
For example: https://www.reddit.com/r/SABnzbd/comments/1759lha/anyone_know_what_this_could_be
2023-10-13 22:52:33 +02:00
Safihre
5bfe5967db Do not delay getting server.info
It was delayed as part of the busy_threads check
2023-10-13 22:50:10 +02:00
Safihre
476fa25a12 Restore broken fetching of scriptlog 2023-10-11 21:15:50 +02:00
Safihre
792bd20fa2 Reduce number of assembler level checks 2023-10-11 17:31:03 +02:00
Safihre
26f3cd064e Use readline instead of read in par2cmdline and Multipar handling
No longer log empty lines in external processing output.
2023-10-11 16:36:38 +02:00
Safihre
0556a84cbc Reduce locking and unlocking in DirectUnpack 2023-10-11 15:10:32 +02:00
Safihre
090871625a Remove often failing test_validate_host rules 2023-10-11 12:32:45 +02:00
Safihre
12dedb7cff Separate Queue and History multi-edit code again
#2702
2023-10-11 10:44:12 +02:00
Safihre
d4187e93b2 Raise error in binary build if files we expected to remove do not exist 2023-10-09 22:28:46 +02:00
Safihre
1beb1aafd8 Update paths of files to remove from Windows binaries 2023-10-09 16:18:19 +02:00
Safihre
67c4703bab Small refactor of database.py 2023-10-09 09:29:55 +02:00
SABnzbd Automation
d850c9c6e3 Update translatable texts
[skip ci]
2023-10-08 20:44:22 +00:00
Safihre
38e07b0859 Use a faster Queue that allows adding multiple items at once
See #2704
2023-10-08 22:43:30 +02:00
SABnzbd Automation
ea10785160 Update translatable texts
[skip ci]
2023-10-06 08:21:15 +00:00
Safihre
16803b9f17 Remove build_history to unpack_history hack and make output consistent
`id` is only internal id, external apps cannot use it for anything and should use `nzo_id`
`script_log` is always empty
2023-10-06 10:20:18 +02:00
SABnzbd Automation
b9a0cf3f76 Update translatable texts
[skip ci]
2023-10-05 09:56:39 +00:00
Safihre
71ff6b14da Remove unnecessary files and modules from Windows binaries 2023-10-05 11:55:47 +02:00
SABnzbd Automation
a98b3c7e85 Update translatable texts
[skip ci]
2023-10-03 19:42:23 +00:00
Safihre
7259c25ece Force pytest to latest version and include in Renovate updates 2023-10-03 20:22:01 +02:00
Safihre
5e7154530b Add Python 3.12 to CI
Not yet for releases, as we need PyInstaller 6.0.0
2023-10-03 19:52:43 +02:00
Safihre
d501cc0a23 Use simpler threading system for process_nw 2023-10-03 19:51:21 +02:00
Safihre
45606285ec Apply various fixes found by PyCharm 2023-10-02 11:29:32 +02:00
Safihre
a5e860a60f Apply correct JS comparisons 2023-10-02 09:51:37 +02:00
Safihre
d93333f9ef Disable Add NZB buttons while processing
Closes #2690
2023-10-02 09:02:53 +02:00
Safihre
3bd68b630a Do not update PyInstaller just yet 2023-10-02 06:37:46 +00:00
renovate[bot]
97c93a0858 Update all dependencies 2023-10-02 06:37:46 +00:00
SABnzbd Automation
8b15fe0d6a Update translatable texts
[skip ci]
2023-10-01 19:05:25 +00:00
Safihre
2d22a5f5b9 Move part of Downloader to check_assembler_levels 2023-10-01 21:04:27 +02:00
Safihre
be63fbaada Only install required parts of PyObjC 2023-09-30 20:53:19 +02:00
Safihre
dc6b338266 Use sabctools.bytearray_malloc in NewsWrapper
It's only a tiny bit faster
2023-09-30 20:36:00 +02:00
Safihre
9e36971151 Remove locking from part of process_nw
The remove_socket part is already locked.
2023-09-29 22:10:22 +02:00
Safihre
9dc08d16b6 Restore uudecode functionality using memview 2023-09-29 22:10:22 +02:00
Safihre
182a5412a5 Use new decoder based on memoryview
[skip ci]
2023-09-29 14:46:42 +02:00
Safihre
cb15c79e4b Only remove incomplete folder if it was a failed job and del_files=1
So we don't remove jobs that have the same name that are still in the queue.
Closes #2693
2023-09-29 13:55:53 +02:00
Safihre
06e6e81779 Updates to issue template 2023-09-29 13:10:52 +02:00
Safihre
938b833954 Catch all OSErrors when trying to measure diskspeed 2023-09-29 10:22:09 +02:00
Safihre
596f069e46 Add issue templates 2023-09-29 09:11:12 +02:00
SABnzbd Automation
e16a7f06d6 Update translatable texts
[skip ci]
2023-09-27 11:54:17 +00:00
Safihre
2947f2c2ff Set version to 4.2.0-develop 2023-09-27 13:53:27 +02:00
Safihre
0d33039b72 Posting to r/usenet requires a flair to be provided 2023-09-26 16:49:53 +02:00
Safihre
682f8227fd Update appdata.xml for 4.1.0 2023-09-26 15:07:29 +02:00
renovate[bot]
dc1675073d Update dependency cryptography to v41.0.4 [SECURITY] 2023-09-23 10:42:06 +00:00
Safihre
d71f4eb802 Switch to set for server.busy/idle_threads 2023-09-21 22:07:11 +02:00
Safihre
e55756469d Switch to set for nzo.saved_articles 2023-09-21 22:07:05 +02:00
Safihre
3764b705a8 Switch to set for TryList bookkeeping 2023-09-21 22:06:59 +02:00
Safihre
1e4ef9c381 Simplify and speed up calc_age 2023-09-19 21:05:56 +02:00
Safihre
8188d8256a Lock old issues to prevent issue hijacking 2023-09-19 12:35:26 +02:00
Safihre
5fb2fcb059 Mark Downloader.decode method as static
It's even slightly faster.
2023-09-19 11:47:28 +02:00
Safihre
0bb2f677b2 Simplify if-statement in get_articles 2023-09-18 13:23:11 +02:00
Michael Nightingale
4d324de343 Only download force priority items when paused (#2679)
* Fix when downloader paused only download force priority items

* Remove resolved issue
2023-09-18 11:17:52 +02:00
Safihre
8e2972edae Mark test_api_watched_now as xfail
See #2685

This also reverts commit 8643c6b260.
2023-09-18 09:13:05 +02:00
renovate[bot]
550ff83781 Update dependency setuptools to v68.2.2 2023-09-18 04:40:14 +00:00
SABnzbd Automation
db793810eb Update translatable texts
[skip ci]
2023-09-17 19:03:58 +00:00
Safihre
1fb24c5705 Use correct identifier for promo element
Closes #2683
2023-09-17 21:03:13 +02:00
SABnzbd Automation
cbbdfce5cd Update translatable texts
[skip ci]
2023-09-14 15:29:57 +00:00
Safihre
8576e377fa Use correct par2cmdline parameter 2023-09-14 17:28:12 +02:00
SABnzbd Automation
0d500f443f Update translatable texts
[skip ci]
2023-09-13 19:39:47 +00:00
Safihre
bed6dacff2 Detect par2cmdline-turbo instead of mt
Closes #2613
2023-09-13 21:38:11 +02:00
Safihre
8643c6b260 Add debug information to failing test_api_watched_now 2023-09-12 23:08:37 +02:00
Safihre
71e529ebe9 Remove outdated known issue about VPN use 2023-09-12 22:59:15 +02:00
SABnzbd Automation
fc951b964f Update translatable texts
[skip ci]
2023-09-12 20:33:47 +00:00
Safihre
900d3d6b71 Update text files for 4.1.0RC2 2023-09-12 22:32:40 +02:00
Safihre
2b3b5e02f5 Update sabctools to 7.1.2 2023-09-12 21:19:23 +02:00
Safihre
b1b75dcad2 Fail binary build if warning/error is present during test run 2023-09-12 21:18:10 +02:00
SABnzbd Automation
b558b1c6b4 Update translatable texts
[skip ci]
2023-09-11 20:35:47 +00:00
Safihre
9e58b97362 Update text files for 4.1.0RC1 2023-09-11 22:34:54 +02:00
thezoggy
1f4f4f1a5f Add par2cmdline-turbo as option for windows, still default to Multipar (#2674)
* Add par2cmdline as option for windows, still default to multipar.

* Fix tests and do not give par2cmdline long-paths on Windows

* Set enable_multipar to true

---------

Co-authored-by: Safihre <safihre@sabnzbd.org>
2023-09-11 22:14:28 +02:00
Anthony Vanelverdinghe
bc705b5563 Use "All Users" locations for shortcuts on Windows (#2677)
* Use "all users" locations for shortcuts on Windows

* Use command inside section/function

* Copy edit

* Take both locations into account
2023-09-11 10:46:34 +02:00
SABnzbd Automation
677850e18a Update translatable texts
[skip ci]
2023-09-11 01:22:19 +00:00
renovate[bot]
1f2c3af660 Update all dependencies 2023-09-11 01:21:37 +00:00
Hans Kristian Rosbach
667ffec667 Add support for finding updated 7-Zip versions on Linux (#2673) 2023-09-04 15:40:26 +02:00
renovate[bot]
9837c23daf Update all dependencies 2023-09-04 01:22:32 +00:00
Safihre
ab3bef3d2f Use par2cmdline-turbo v1.1.0 for macOS release
#2613
2023-09-02 09:32:57 +02:00
Safihre
58cb710d38 Improve Night-mode display of folder selection 2023-09-01 15:34:44 +02:00
Safihre
afbb340f8d Replace $ by jQuery in templates to help IDE's parse the Javascript 2023-09-01 15:26:22 +02:00
Safihre
f378741152 Make server-ad release dependant 2023-09-01 12:29:32 +02:00
Safihre
9f88bda8e5 Remove old upgrade notice from release notes 2023-08-30 15:00:45 +02:00
Safihre
33ebb1593f Small walrus operator refactor 2023-08-30 15:00:27 +02:00
jcfp
b0b91bd002 set per-server connection limit to 500 (#2668) 2023-08-30 11:02:58 +02:00
Safihre
77518cf1f5 Correct title in release notes 2023-08-27 22:32:55 +02:00
SABnzbd Automation
8b329ed602 Update translatable texts
[skip ci]
2023-08-27 20:04:42 +00:00
Safihre
0b27b21e75 Update text files for 4.1.0Beta1 2023-08-27 22:01:56 +02:00
Safihre
d7da55c823 Update macOS Python to 3.11.5 2023-08-27 10:13:28 +02:00
SABnzbd Automation
e6c15e2f73 Update translatable texts
[skip ci]
2023-08-26 19:38:23 +00:00
thezoggy
c3dbd77c17 fixup dark theme handling for config/login with using auto or loading explicit night theme when set, minor dark skin fixes (#2665) 2023-08-26 21:37:43 +02:00
Safihre
f7901711a9 Just skip 7zip unpack if 7zip isn't present 2023-08-25 13:39:55 +02:00
Safihre
ec8fee0a75 Apply correct sanitizer in renamer
Closes #2664
2023-08-25 11:40:55 +02:00
Safihre
ca6ce3af09 Small formatting change 2023-08-25 10:57:20 +02:00
Safihre
65eaf0fc76 Temporarily remove sparse file support
This reverts commit a179f2a895.

Closes #2628
2023-08-25 09:51:40 +02:00
SABnzbd Automation
bfba8d10cf Update translatable texts
[skip ci]
2023-08-25 06:57:48 +00:00
Safihre
6cd89a5614 Restore Enable 7zip text 2023-08-25 08:56:55 +02:00
Safihre
16163c7c5f Do not trigger script-dir in program-dir warning incorrectly
https://forums.sabnzbd.org/viewtopic.php?p=130200
2023-08-23 14:58:03 +02:00
Safihre
0482fbed05 Experiment with Servers text-ad 2023-08-23 14:14:28 +02:00
Safihre
d0f1574893 Further improvements to dark mode 2023-08-22 12:29:54 +02:00
thezoggy
e64167bb99 Cancel purge log should stay on current page (#2660) 2023-08-21 06:30:03 +02:00
SABnzbd Automation
22098c5424 Update translatable texts
[skip ci]
2023-08-21 02:25:26 +00:00
renovate[bot]
273c56aa0b Update all dependencies 2023-08-21 02:24:37 +00:00
Safihre
a951361fa6 Update sabctools to 7.1.1 2023-08-16 09:54:15 +02:00
SABnzbd Automation
2795c3718b Update translatable texts
[skip ci]
2023-08-14 14:59:44 +00:00
Safihre
1a365bdefd Remove unzip support
Closes #2646
2023-08-14 16:58:41 +02:00
SABnzbd Automation
d3db70baab Update translatable texts
[skip ci]
2023-08-14 13:19:40 +00:00
Safihre
20324ad88b Update text files for 4.1.0Alpha1 2023-08-14 15:18:08 +02:00
Safihre
80f34bdf3e Further improve Config Dark Mode 2023-08-14 12:17:46 +02:00
renovate[bot]
f2dbdb95dc Update dependency orjson to v3.9.4 2023-08-14 04:38:56 +00:00
jcfp
0e3893122d ditch call to get_unique_filename in Sorter.rename (#2653) 2023-08-12 11:33:13 +02:00
SABnzbd Automation
831ff6e3ae Update translatable texts
[skip ci]
2023-08-10 20:06:51 +00:00
Safihre
b62d17cbee Convert several statements to walrus operator 2023-08-10 22:06:05 +02:00
Safihre
b95d6cfca0 Filename in NZB subject should be at least 6 characters
Closes #2650 #2649
2023-08-09 15:48:06 +02:00
SABnzbd Automation
d0d1876783 Update translatable texts
[skip ci]
2023-08-09 12:54:11 +00:00
Safihre
df23bf21ea Add option to purge all logs from Config > Folders 2023-08-09 14:53:15 +02:00
Safihre
934561e551 Show text-ad in New Server section 2023-08-09 10:15:07 +02:00
SABnzbd Automation
de6c560027 Update translatable texts
[skip ci]
2023-08-08 12:33:31 +00:00
Safihre
9c582fccc8 Small refactor of name_extractor 2023-08-08 14:32:41 +02:00
Andrew Lavryshyn
cab5c26e3e Add dark mode for wizard, config, and login (#2621)
* feat: add dark mode for wizard, config, and login

* combine the dark skins

* make the buttons the same as in Glitter

* load the night theme based on config setting

* Changes to darkmode

---------

Co-authored-by: Safihre <safihre@sabnzbd.org>
2023-08-07 11:34:25 +02:00
Michael Nightingale
cca6dda9e6 Fix quick check of sets with duplicate files (#2645)
* Fix quick check of sets with duplicate files

* Add explanation and example of why sorting par fileset is necessary
2023-08-07 09:48:21 +02:00
renovate[bot]
77aea23007 Update all dependencies 2023-08-07 00:26:40 +00:00
SABnzbd Automation
42c5403bbe Update translatable texts
[skip ci]
2023-08-06 05:38:59 +00:00
thezoggy
b14dacd44d unrar 6.23 (#2647) 2023-08-06 07:38:14 +02:00
thezoggy
abd47ddcf7 add additional common ebook/audiobook (readarr) (#2643) 2023-08-04 22:37:49 +02:00
Safihre
8611e65fc6 Update reference to SABnzbd-Team 2023-08-04 17:12:01 +02:00
SABnzbd Automation
8663fe39e3 Update translatable texts
[skip ci]
2023-08-04 12:28:34 +00:00
Ricardo Christmann
4891213a88 Fix check-all checkbox state (#2639)
* Fix check-all checkbox state

* Refactor check-all fix
2023-08-04 14:27:48 +02:00
Safihre
828ea8e61a flat_unpack was not applied for 7Zip
Closes #2631
2023-08-02 14:32:02 +02:00
Safihre
f6fae7c0b8 Add comment why not all data could be written (#2634) 2023-08-02 14:05:45 +02:00
Michael Nightingale
b4b446e770 Ensure all data is written to file (#2634) 2023-08-02 14:04:43 +02:00
Safihre
9ff4fdaab8 Remove small SyntaxWarninh
Thrown by Python 3.12 in `-X dev` mode.
2023-08-02 13:54:00 +02:00
renovate[bot]
d3bfbb0642 Update dependency cryptography to v41.0.3 [SECURITY] 2023-08-02 08:29:36 +00:00
SABnzbd Automation
57ab0a05f7 Update translatable texts
[skip ci]
2023-07-31 01:32:12 +00:00
renovate[bot]
296aee9757 Update dependency more-itertools to v10 2023-07-31 01:31:29 +00:00
Safihre
3d8c408627 Usernames and passwords were not always sanitized from the log
Closes #2630
2023-07-26 09:51:03 +02:00
renovate[bot]
11cdb24558 Update dependency pyinstaller-hooks-contrib to v2023.6 2023-07-24 00:58:33 +00:00
Safihre
589cc69498 Convert forward slashes to backward slashes in par2 filenames
Closes #2626
2023-07-21 14:19:40 +02:00
SABnzbd Automation
6f17ab1f02 Update translatable texts
[skip ci]
2023-07-21 09:35:04 +00:00
Safihre
7cbbff727f Remove (almost) all references to unused team@sabnzbd.org 2023-07-21 11:33:51 +02:00
Ricardo Christmann
daa07ed2d2 Add multi-select to history (#2607)
* Add multi-select to history

* Fix checkbox state when multi-selecting on queue and history

* Refactor multi-select feat and fix for tabbed layout

* Fix failing ci tests

* Fixes and improvements
2023-07-20 21:41:47 +02:00
Safihre
b3ced3bb40 Restore Series Duplicate detection
Closes #2620
2023-07-19 15:49:01 +02:00
L2501
20127e5bcd add m4b file extension to known extensions (#2625) 2023-07-19 11:31:43 +02:00
Safihre
f7a5e462b7 Update 7zip to 23.01 2023-07-17 08:57:32 +02:00
renovate[bot]
728bc723c2 Update dependency praw to v7.7.1 2023-07-17 00:37:20 +00:00
renovate[bot]
b1f75ec35b Update dependency cryptography to v41.0.2 [SECURITY] 2023-07-15 01:51:06 +00:00
Safihre
1709c778a6 Remove redundant README.txt
Stupid mistake.
2023-07-10 15:27:24 +02:00
Safihre
769e110ffb Remove duplicate Reddit posting 2023-07-10 15:19:54 +02:00
Safihre
a0808d2d4c Release notes were not present in releases 2023-07-10 14:43:45 +02:00
Safihre
59bd38ddc7 Correct finding of release in appdata 2023-07-10 14:23:45 +02:00
renovate[bot]
000ecb5669 Update all dependencies 2023-07-10 02:06:30 +00:00
jcfp
8525f60488 add optional xff header verification to check_access (#2611)
* add optional xff header verification to check_access

* make xff ip checking code more readable
2023-07-05 20:12:59 +02:00
Sander
24329faf5c better docker detections: works for older and newer docker versions (#2606)
* better docker detections: works for Ubuntu 18.04 and 22.04

* DOCKER = False, needed for non-POSIX

---------

Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
2023-07-03 15:10:34 +02:00
renovate[bot]
4a72c6fdf9 Update all dependencies 2023-07-03 00:54:33 +00:00
jcfp
8235c3048e add a grace period for expected filenames to show up (#2609) 2023-06-29 21:30:56 +02:00
jcfp
209e9f0573 add debug output to help with failures in functional sorting test (#2608) 2023-06-28 16:22:33 +02:00
SABnzbd Automation
9455121647 Update translatable texts
[skip ci]
2023-06-28 09:00:26 +00:00
Safihre
fa7a11617e Move "On failure, try alternative NZB" to Specials
Might be removed later.
2023-06-28 10:57:45 +02:00
Safihre
a6c62bc118 Build binary using Python 3.11.4 2023-06-28 10:00:33 +02:00
Michael Nightingale
dbf4073da4 Fix uu decoding when collapsing of lines starting with a doubled period is required (#2605) 2023-06-27 15:14:11 +02:00
renovate[bot]
552ca12bc1 Update dependency jaraco.functools to v3.8.0 2023-06-26 05:09:31 +00:00
renovate[bot]
e13968eec1 Update all dependencies 2023-06-26 00:40:59 +00:00
Safihre
2ce56c8581 Add newline after link to Downloads page in Reddit post 2023-06-23 21:45:53 +02:00
jcfp
8d6cc8c86a Fix sorting for #2551 (#2598)
* fix #2551

* add test data dirs

* move sorting test data into subdir

* undo change to sabnews.create_nzb
2023-06-23 09:06:57 +02:00
Safihre
488719de1e Convert various re statements to walrus operator 2023-06-21 21:38:32 +02:00
Safihre
8cb4011a44 Check if version is present appdata before releasing 2023-06-19 15:28:07 +02:00
Safihre
9ff0bab873 Additional logging to debug Direct Unpack 2023-06-18 22:17:36 +02:00
François M
3331738f2b Add versions to appdata (#2595) 2023-06-16 19:25:09 +02:00
Safihre
e768ceea96 Lock add/remove_socket in Downloader
See if we can resolve #2591
2023-06-16 15:48:54 +02:00
Safihre
cb4215910c Link to Downloads page was not included in Reddit post 2023-06-16 11:49:02 +02:00
Safihre
b9e014b8bd No longer * import AppKit and Foundation 2023-06-14 12:56:02 +02:00
Safihre
96f0743ce5 Update release script to post directly to r/usenet and include link 2023-06-13 14:00:25 +02:00
renovate[bot]
560766dfa0 Update all dependencies 2023-06-12 00:48:42 +00:00
thezoggy
a2bbccd3ea Unable to modify Sorters (#2587) 2023-06-09 13:51:24 +03:00
Safihre
5570b804ba Correct parameter in release script to merge PR of update 2023-06-07 17:22:28 +02:00
Safihre
3ff1d4b68c Move DirScanner Lock creation 2023-06-06 17:10:01 +02:00
Safihre
d19d3c382c Move ipv6_servers to be a Special bool 2023-06-06 16:53:41 +02:00
SABnzbd Automation
05a68a7506 Update translatable texts
[skip ci]
2023-06-06 14:50:57 +00:00
Safihre
9aacf4c780 Remove load_balancing option 2023-06-06 16:50:06 +02:00
Safihre
0390dc14c5 Remove test_ipv6 2023-06-06 16:32:49 +02:00
Safihre
1ee1ef836a Simplify get_server_addrinfo to just allow enabling or disabling IPv6
Closes #2553
2023-06-06 16:10:30 +02:00
SABnzbd Automation
bf1080ac5a Update translatable texts
[skip ci]
2023-06-06 13:52:44 +00:00
Safihre
ee4fdb9563 Remove useless AMBI_LOCALHOST 2023-06-06 15:51:45 +02:00
Michael Nightingale
a179f2a895 Write articles to correct offsets and use sparse files (#2574)
* Basic direct write implementation

* Correctly track file_position and only write continuous

* Direct write with sparse files

---------

Co-authored-by: Safihre <safihre@sabnzbd.org>
2023-06-06 15:49:12 +02:00
Safihre
b4c3a4b19f Only initialize DirScanner Lock after starting event loop 2023-06-05 15:52:34 +02:00
renovate[bot]
71e203f19c Update all dependencies 2023-06-05 02:03:53 +00:00
jcfp
07283ba9ab Fix sorting lowercasing (#2584)
* run lowercasing on season pack setname

* also subject %fn to lowercasing

* add tests

* woops
2023-06-03 16:45:41 +02:00
renovate[bot]
decfb2c168 Update dependency cryptography to v41 [SECURITY] (#2583)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-02 22:49:13 +02:00
Safihre
71778656da Correct reference to removed_from_queue in Direct Unpacker 2023-06-02 22:05:30 +02:00
Safihre
517d6e3e1a Update tests for ppslots 2023-06-02 21:48:44 +02:00
Safihre
e11e9e7201 Force full refresh after changing items-per-page
Closes #2416
2023-06-02 21:34:40 +02:00
Safihre
135b9336a4 Show active jobs post processing in tabbed layout
Closes #2580
2023-06-02 21:29:10 +02:00
Safihre
e0d4d4abbd Use more reliable marker if job is still active 2023-06-02 15:36:38 +02:00
Safihre
422b4fce7b Notification Script did not get environment variables 2023-05-31 21:16:15 +02:00
Safihre
e3a7226648 Move Notification Script Parameters to environment variable
Fixes #2549
2023-05-31 11:35:23 +02:00
Michael Nightingale
5b9fc86319 Fix uu decode workaround (#2573)
* Fix uu decode workaround

* Remove trailing junk test because workaround handles it
2023-05-29 14:20:01 +02:00
renovate[bot]
5afea2d3c7 Update dependency orjson to v3.8.14 2023-05-29 02:10:08 +00:00
SABnzbd Automation
5f942a6943 Update translatable texts
[skip ci]
2023-05-24 15:45:03 +00:00
Safihre
18075c5c51 Print last line in case of error
Closes #2566
2023-05-24 17:44:10 +02:00
Safihre
a728225782 Automatically merge website update during release 2023-05-24 09:38:15 +02:00
Safihre
3e6ae26710 Tray icon could not be disabled on macOS 2023-05-23 21:18:49 +02:00
Safihre
a8a4e442a8 Add PYTHONUNBUFFERED env variable for Python post-processing scripts 2023-05-23 20:34:38 +02:00
Safihre
c16e91734d Catch all errors during rarfile header parsing
Closes #2569
2023-05-22 10:23:28 +02:00
Safihre
bb9ad4b546 Disable buffering in POpen calls
Closes #2567
2023-05-22 10:10:46 +02:00
renovate[bot]
43045e5d4e Update all dependencies 2023-05-22 03:18:21 +00:00
Safihre
63c7dbdb4d Rely on POpen's text mode to handle encoding 2023-05-17 17:08:16 +02:00
Safihre
ef217bba90 Only open pipe for stdin when we actually need it 2023-05-17 16:52:59 +02:00
Safihre
ca9924c38f Only warn about sabctools linking if OpenSSL >= 1.1.1
Relates to #2421
2023-05-17 16:39:06 +02:00
SABnzbd Automation
c3c47507e7 Update translatable texts
[skip ci]
2023-05-16 11:18:41 +00:00
Safihre
dc237c752a Do not push local translations to allow modifications 2023-05-16 13:17:58 +02:00
SABnzbd Automation
08892c71b2 Update translatable texts
[skip ci]
2023-05-16 11:06:46 +00:00
Safihre
026717b7c2 Build binaries without dependencies 2023-05-16 13:05:23 +02:00
Michael Nightingale
be06290f6c Addnzbfile enums and keep empty (#2554)
* Add enum result to add_nzbfile

* Do not delete invalid single file NZBs if file could not be decoded

* Move enum to constants and make it a class
2023-05-15 14:28:49 +02:00
SABnzbd Automation
9ec55478c9 Update translatable texts
[skip ci]
2023-05-15 00:42:16 +00:00
renovate[bot]
4172b4a2a6 Update all dependencies 2023-05-15 00:41:05 +00:00
Safihre
59620c2217 Remove debugging code for Downloader sleep time
Seems your solution worked @puzzledsab!
2023-05-10 21:31:15 +02:00
SABnzbd Automation
c410c646b2 Update translatable texts
[skip ci]
2023-05-10 19:26:14 +00:00
Safihre
0b515996d7 Wrap Downloader in try/except
We need diagnostic info. No clue why we didn't do this before.
Relates to #2559
2023-05-10 21:24:28 +02:00
Safihre
8b9b8319a1 Warn users against using application directory as their Scripts Folder
Closes #2557
2023-05-10 21:16:49 +02:00
Safihre
161cf14519 Disabling a server during download doesn't stop it from downloading
Closes #2555
2023-05-10 10:28:18 +02:00
thezoggy
c6ac09e938 Disable sorting on pattern key so you can select text on it / prevent it from moving. (#2556) 2023-05-10 06:40:53 +02:00
Safihre
fde8f9d133 Allow longer binary startup during release quick-test 2023-05-08 17:04:45 +02:00
SABnzbd Automation
2bd222ca1c Update translatable texts
[skip ci]
2023-05-08 14:57:52 +00:00
Safihre
12228fe1fb Update Watched Folder text to include supported extensions
Relates to #2550
2023-05-08 16:56:32 +02:00
SABnzbd Automation
c63b2592f1 Update translatable texts
[skip ci]
2023-05-08 09:52:03 +00:00
Sander
e65980258c test writing long and unicode filenames (#2542)
* test writing long and unicode filenames

* Update sabnzbd/filesystem.py

Co-authored-by: Safihre <safihre@sabnzbd.org>

* Update sabnzbd/filesystem.py

Co-authored-by: Safihre <safihre@sabnzbd.org>

* Update sabnzbd/filesystem.py

Co-authored-by: Safihre <safihre@sabnzbd.org>

* Update sabnzbd/filesystem.py

Co-authored-by: Safihre <safihre@sabnzbd.org>

* test writing long and unicode filenames

* seperate function test_filesystem_capabilities

* rename test_filesystem_capabilities to filesystem_capabilities

* rename filesystem_capabilities to check_filesystem_capabilities

---------

Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2023-05-08 11:50:49 +02:00
SABnzbd Automation
bd0a90d2dd Update translatable texts
[skip ci]
2023-05-08 06:15:40 +00:00
renovate[bot]
33a7e92f4c Update dependency orjson to v3.8.12 2023-05-08 08:14:31 +02:00
Safihre
51d1a1994d Allow for more time to start and shutdown during testing
macOS sometimes needs more time
2023-05-03 14:53:46 +02:00
Safihre
835745e485 Remove PKG-INFO
Closes #2548
2023-05-03 14:25:03 +02:00
Safihre
bcb553d9f9 Move release actions to separate build step 2023-05-03 14:22:50 +02:00
Safihre
b73b8aae6a Post release notes to Reddit after release
Add praw to builder requirements
2023-05-03 14:22:50 +02:00
Safihre
51792e31a8 Add release to PR of new release 2023-05-02 10:45:48 +02:00
Safihre
636a391db3 Update appdata for 4.0.1 release 2023-05-01 21:36:13 +02:00
Safihre
57d5ed2f21 Add Windows Python 3.8 32bit to CI test
Since we also use it for the release.
2023-05-01 21:33:49 +02:00
Safihre
bbb1d1d908 Update sabctools to 7.0.2 2023-05-01 21:29:19 +02:00
François M
c5d8f52f03 Add releases tag (#2539)
* Add 3.7.2 release tag

* Add 4.0.0 placeholder
2023-05-01 21:23:30 +02:00
renovate[bot]
1b49e4a355 Update all dependencies 2023-05-01 02:16:27 +00:00
Safihre
878cb589c3 Show a better crash on Python <3.8 2023-04-30 21:37:16 +02:00
Safihre
53ce88d3d2 Make Config link to wiki dynamic 2023-04-26 22:24:53 +02:00
Safihre
85e9bea9e7 Make sure all paths are unique in deobfuscate
Closes #2535
2023-04-26 17:22:56 +02:00
Safihre
7c7f88ebb5 Correctly set version to 4.1.0-develop 2023-04-26 17:20:11 +02:00
SABnzbd Automation
cbd007b81a Update translatable texts
[skip ci]
2023-04-26 13:28:51 +00:00
Safihre
ac0438de42 Set version to 4.1.0-develop 2023-04-26 15:27:31 +02:00
Safihre
b73699be8d Allow 20 min for CI tests 2023-04-25 17:12:31 +02:00
SABnzbd Automation
bc87b6e955 Update translatable texts
[skip ci]
2023-04-25 14:48:40 +00:00
Safihre
f15155ddc9 Add Keyboard shortcut hint in the Status window
Closes sabnzbd/sabnzbd.github.io/issues/235
2023-04-25 16:47:24 +02:00
renovate[bot]
37b556012e Update all dependencies 2023-04-24 05:38:50 +00:00
SABnzbd Automation
79ba3dd874 Update translatable texts
[skip ci]
2023-04-23 19:40:19 +00:00
Safihre
28795c3158 Re-ordering Sorters was not possible after refactor
Closes #2536
2023-04-23 21:38:57 +02:00
SABnzbd Automation
935d248b53 Update translatable texts
[skip ci]
2023-04-19 14:52:21 +00:00
Safihre
b2103afe30 Update text files for 4.0.0RC1 2023-04-19 16:51:05 +02:00
Safihre
fcbc4e420e Add locking to __reset_nw
Relates to #2533
2023-04-19 13:21:15 +02:00
Safihre
19fcda877f Show Sorting edit details when clicking on display data 2023-04-19 12:35:34 +02:00
SABnzbd Automation
48cd93ef93 Update translatable texts
[skip ci]
2023-04-19 10:19:27 +00:00
Safihre
80fd39826b Add Quick Start suggestions when user has no Sorters defined 2023-04-19 12:17:50 +02:00
Safihre
50c7d1531b Store yEnc-detected begin and size
We will use this later, see #2526
2023-04-17 22:02:09 +02:00
SABnzbd Automation
657c6f2b7d Update translatable texts
[skip ci]
2023-04-17 05:12:52 +00:00
renovate[bot]
e7484fac09 Update all dependencies 2023-04-17 05:11:37 +00:00
Safihre
613ec9c48c Try to fix armhf Snap build 2023-04-14 12:43:41 +02:00
SABnzbd Automation
322050efd8 Update translatable texts
[skip ci]
2023-04-14 09:34:13 +00:00
Safihre
5242368343 Add possibility to mark Option's as non-public
Closes #2489
2023-04-14 11:18:15 +02:00
Safihre
564151e520 Resolve HTML code issues 2023-04-13 13:39:36 +02:00
Safihre
b40220cb73 Only convert old-style sorters if they were enabled 2023-04-13 13:14:18 +02:00
Safihre
2ebac74049 Correct HTML for Sorting page 2023-04-13 12:57:27 +02:00
SABnzbd Automation
8ede63a960 Update translatable texts
[skip ci]
2023-04-12 21:06:53 +00:00
Safihre
38a0cc39e6 Improve preset display for Sorters 2023-04-12 22:28:37 +02:00
SABnzbd Automation
b482b61770 Update translatable texts
[skip ci]
2023-04-12 15:19:07 +00:00
Safihre
36a6f6e151 First refactor of new Sorting page
@jcfp FYI :)
2023-04-12 17:17:51 +02:00
Safihre
0c45883649 Remove Windows firewall rules on uninstall and prevent duplicating them
Closes #2528
2023-04-12 16:12:22 +02:00
renovate[bot]
c243144009 Update all dependencies 2023-04-10 07:24:25 +00:00
Safihre
4e2df006e7 Use correct pip call to update pip itself on Windows 2023-04-08 22:15:55 +02:00
SABnzbd Automation
02964d3bef Update translatable texts
[skip ci]
2023-04-08 20:09:29 +00:00
Safihre
c0e50aac48 Update text files for 4.0.0Beta2 2023-04-08 22:08:18 +02:00
Safihre
6c0804ba4f Correctly handle broken par2 files
Closes #2517
2023-04-07 22:39:32 +02:00
Safihre
708b13dd71 Prevent orphaned Article objects resulting in ghost files
Relates to #2521, #2517
2023-04-06 21:41:40 +02:00
Safihre
eb64e054b5 Refactor par2file 2023-04-06 21:11:34 +02:00
SABnzbd Automation
c42f7f930c Update translatable texts
[skip ci]
2023-04-04 17:36:21 +00:00
Sander
44c1d7306d Bigger files (50 and 100MB) for internet speed testing (#2524)
Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
2023-04-04 19:35:06 +02:00
SABnzbd Automation
2413c22a51 Update translatable texts
[skip ci]
2023-04-03 07:37:32 +00:00
Safihre
31fefb4f86 Actually remove the RAR inspection traceback logging 2023-04-03 09:36:25 +02:00
renovate[bot]
745fd81aa1 Update all dependencies 2023-04-03 05:39:09 +00:00
Safihre
f7bf1567c1 Add sleep between Transifex push and pull 2023-04-02 21:30:49 +02:00
Safihre
02021a09b1 Don't show traceback on RAR-inspection failure
Closes #2482
2023-04-02 21:30:49 +02:00
SABnzbd Automation
6411d32228 Update translatable texts
[skip ci]
2023-04-02 19:22:43 +00:00
Safihre
56287e8094 Small refactor of Server-methods 2023-04-02 14:16:02 +02:00
thezoggy
62f70fd628 Set min-width to make macos chrome behave like others (#2518) 2023-03-29 09:16:00 +02:00
Thomas
dcca2c5821 Check for errors when creating the download path (#2516)
Fixes https://github.com/sabnzbd/sabnzbd/issues/2515.
2023-03-28 17:54:39 +02:00
dependabot[bot]
d22f2296c2 Bump actions/stale from 7 to 8 (#2514)
Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 13:56:25 +02:00
SABnzbd Automation
2e0ea5d085 Update translatable texts
[skip ci]
2023-03-27 05:49:28 +00:00
renovate[bot]
cb4526e8e2 Update all dependencies 2023-03-27 05:48:30 +00:00
puzzledsab
fc3132cd77 Set maximum soft sleep time to 0.15 seconds (#2510) 2023-03-22 21:34:51 +01:00
Michael Nightingale
e474db33ec Check speedlimit after each recv (#2509) 2023-03-20 21:55:10 +01:00
jcfp
6274d2b250 avoid traceback after postproc script (#2508) 2023-03-20 19:28:51 +01:00
puzzledsab
d4bfdaa29e Tweak assembler queue variables for smoother download (#2505) 2023-03-20 08:47:51 +01:00
renovate[bot]
3b7f5f5ce0 Update all dependencies 2023-03-20 05:05:53 +00:00
Safihre
496e2f1840 Bring BPSMeter and Assembler check back in main loop 2023-03-19 22:23:50 +01:00
Safihre
98f3c055d7 Ignore resource fork files created by macOS
Closes #2380
2023-03-19 21:41:31 +01:00
Safihre
7df36ce8b4 switchinterval should be a positive number
Closes #2504
2023-03-17 21:32:23 +01:00
SABnzbd Automation
5deaca45c2 Update translatable texts
[skip ci]
2023-03-16 21:41:31 +00:00
Safihre
e790757855 Update text files for 4.0.0Beta1 2023-03-16 22:40:22 +01:00
jcfp
46b2c6494f only save series_info in the history db for job type "tv" (#2496)
* only save series_info for job type "tv"

* make analyse_show return a dictionary
2023-03-16 22:23:45 +01:00
Sander
c4216a4075 Deobfuscate filenames ON by default (#2493)
* Deobfuscate ON by default

* Correct data test set: filename that is not obfuscated. Except test_par2file

* Correct data test set: filename that is not obfuscated. Except test_par2file

* Commented out test in test_par2file.py

* Commented out test in test_par2file.py

* assert for unicode_rar 我喜欢编程 now working too

---------

Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
2023-03-15 22:31:09 +01:00
SABnzbd Automation
375412aa42 Update translatable texts
[skip ci]
2023-03-15 17:04:36 +00:00
thezoggy
895ac56eb3 change regex for hash from md5 to more generic to catch more hashes (ex: apikey in rss feed), and hide email_from as well (#2499) 2023-03-15 18:03:22 +01:00
SABnzbd Automation
c593388ec6 Update translatable texts
[skip ci]
2023-03-14 07:05:56 +00:00
jakepez
1c6960fe44 Corrected msgids - msgid "Pause * prioirty jobs" spelling error (#2501)
* Corrected msgid spelling error

* Reverted change to en.po as requested
2023-03-14 08:04:53 +01:00
Safihre
e7ac2ffd6c Broaden renovate trigger window 2023-03-13 12:49:27 +01:00
SABnzbd Automation
df35e54fba Update translatable texts
[skip ci]
2023-03-10 20:37:03 +00:00
puzzledsab
15f757ae04 Make cleanup_list use scandir and keep main nzb directory even if it's empty (#2497)
* Make cleanup_list use scandir and keep main nzb directory even if it's empty

* Use entry.path
2023-03-10 21:35:45 +01:00
Safihre
b7dc15099c Change quote style of Stale action condition 2023-03-10 08:38:37 +01:00
jcfp
dc33c67f48 fix extra info fields for pre-q scripts (#2494) 2023-03-09 17:34:38 +01:00
SABnzbd Automation
89fb517fd1 Update translatable texts
[skip ci]
2023-03-09 13:06:13 +00:00
jcfp
51eb94dbe9 Sorter fixes (#2492)
* fix typos (closes #2488)

* fix logic errors in prepare_extraction_path (closes #2490, closes #2491)
2023-03-09 14:05:01 +01:00
Safihre
03747f618f Do not run Stale action on forks 2023-03-08 09:55:12 +01:00
SABnzbd Automation
8154322448 Update translatable texts
[skip ci]
2023-03-08 08:54:04 +00:00
Safihre
7531ae2749 Replace Stale-bot by Stale-action 2023-03-08 09:52:23 +01:00
SABnzbd Automation
32515172d3 Update translatable texts
[skip ci]
2023-03-06 21:24:14 +00:00
Safihre
3b500ecf69 Update text files for 4.0.0 Alpha 3 2023-03-06 22:23:11 +01:00
SABnzbd Automation
b93dd4751d Update translatable texts
[skip ci]
2023-03-06 21:14:18 +00:00
jcfp
d651f8db34 Replace series/date/movie sorters with a generic one + season pack handling (#2461)
* replace series/date/movie sorters with a generic sorter

* fix test_eval_sort on windoze

* unbreak and de-uglify the fix

* add special setting for season pack sorting

* remove unused import

* replace series/date/movie sorters with a generic sorter

* fix test_eval_sort on windoze

* unbreak and de-uglify the fix

* add special setting for season pack sorting

* remove unused import

* correct type for sort_type entries

* standardize ui

* add visual hints for drag-n-drop

* move presets directly below sort string field

* replace hex with ascii letters to avoid random occurences of (cd|e)[0-9]+

* Some styling things

---------

Co-authored-by: Safihre <safihre@sabnzbd.org>
2023-03-06 22:13:12 +01:00
Safihre
3f8f7d21d0 Revert "Make renovate config less strict on when it runs on Monday"
This reverts commit a1d51502c4.
2023-03-06 21:38:05 +01:00
renovate[bot]
824341e396 Update all dependencies 2023-03-06 15:32:27 +00:00
SABnzbd Automation
a972708d69 Update translatable texts
[skip ci]
2023-03-06 01:29:48 +00:00
renovate[bot]
47b305c83b Update all dependencies 2023-03-06 01:28:44 +00:00
SABnzbd Automation
2ec3da18f2 Update translatable texts
[skip ci]
2023-03-02 21:32:12 +00:00
Michael Nightingale
70aea9ac0c Decode articles as they are downloaded (#2476)
* Decode articles as they are downloaded

* Combine the recv and process methods

* Less cryptic futures

* Lock get_article because it can be called by multiple threads within the pool

* Add handle_process_nw_result

* Use add_socket helper

* Lock finish_connect_nw

* Add locks and remove callback

* Use same lock for updating nzo statistics

* Remove None typing

* Add downloader lock

* read_fds by index because it will never fail

* Use downloader lock
2023-03-02 22:31:11 +01:00
Safihre
38270bf4e2 Do not auto-update sabctools
We will do it manually when needed, as it also requires the constants.py value to be updated.
2023-02-28 22:00:04 +01:00
thezoggy
05d58ca0da update unrar to 6.21 (#2479) 2023-02-28 11:42:42 +01:00
Safihre
91aab54b43 Update sabctools 2023-02-28 10:40:20 +00:00
renovate[bot]
25d552c09e Update all dependencies 2023-02-28 10:40:20 +00:00
Safihre
a1d51502c4 Make renovate config less strict on when it runs on Monday 2023-02-24 08:07:35 +01:00
SABnzbd Automation
883d1dfa19 Update translatable texts
[skip ci]
2023-02-22 22:05:59 +00:00
Safihre
f94c48b27c Update text files for 4.0.0 Alpha 2 2023-02-22 23:04:54 +01:00
puzzledsab
0734547aec Make switchinterval configurable (#2473) 2023-02-22 13:22:57 +01:00
puzzledsab
8ab87d9844 Re-add last_max_chunk_size (#2472)
* Update last_max_chunk_size for each call to recv

* Reduce _DEFAULT_CHUNK_SIZE
2023-02-21 08:19:15 +01:00
jcfp
21b3b85e6e convert tests to tavern 2.0.0+ (#2468) 2023-02-20 17:08:22 +00:00
Michael Nightingale
45ccac3bc4 Decode UU with bytearray (#2466)
* Decode UU with bytearray

* Revert changed test
2023-02-19 17:32:02 +01:00
SABnzbd Automation
0b95b0b94b Update translatable texts
[skip ci]
2023-02-19 13:51:37 +00:00
Safihre
501b370dc0 Remove unused sched_converted 2023-02-19 14:44:08 +01:00
Safihre
2058a4b639 Update text files for 4.0.0Alpha1 2023-02-19 14:27:40 +01:00
Safihre
266823a81e Update macOS Python to 3.11.2 2023-02-19 14:07:13 +01:00
puzzledsab
6cd5713baa Translate ascii control chars below value 32 to _ (#2463)
* Translate ascii control chars below value 32

* Try to make code and tests consistent

* More test fixing

* Delete too much

* Different approach

* Finally got it?

* Start from 0

* Convert \0 to _ for all systems

* Check if CH_ILLEGAL_WIN is translated to CH_LEGAL_WIN

* Test specific chars
2023-02-18 22:48:00 +01:00
Safihre
e9038de819 Update sabctools to 6.1.0 2023-02-18 14:48:46 +01:00
Safihre
9129b681dc Only test wiki-entries consistency on develop 2023-02-17 21:50:24 +01:00
SABnzbd Automation
1f2b602638 Update translatable texts
[skip ci]
2023-02-17 07:18:41 +00:00
Michael Nightingale
87d9de1009 Only allocate disk speed random data when required (#2460) 2023-02-17 08:17:33 +01:00
Safihre
81a6db2190 Update test for defaulting to SSL 2023-02-15 23:06:18 +01:00
Michael Nightingale
dbd335fd3b Improve dirscanner performance and reduce system calls (#2434)
* Improve dirscanner performance and reduce system calls

* Break up one liners

* Rename functions and add typings

* yield from instead of looping

* Fix optional typing

* Replace threads with asyncio

* Use full module path

* Replace list comprehension with for loop

* Give other coroutines a chance to run if we ignore a path

* Remove uncesserary unnecessary asyncio.sleep on skipped path

* Catch and report all exceptions within the scanner task to the user to ensure the overall scanner task cannot crash

* Log traceback
2023-02-15 22:57:09 +01:00
Safihre
84fc6e7a7a Enable Newsserver SSL by default 2023-02-15 22:52:32 +01:00
SABnzbd Automation
f851f10ee1 Update translatable texts
[skip ci]
2023-02-14 22:02:17 +00:00
Safihre
0d92d9f9bd Update references to 4.0.x 2023-02-14 22:57:23 +01:00
puzzledsab
73fce52df1 Threaded polling of connections (#2438)
* Threaded polling of connections

* Do speed limit check after handling

* Use ThreadPoolExecutor, remove code for updating recv_threads while running

* Get newswrapper inside try

* Change default settings to 2 threads

---------

Co-authored-by: Safihre <safihre@sabnzbd.org>
2023-02-14 22:17:24 +01:00
SABnzbd Automation
14223d239a Update translatable texts
[skip ci]
2023-02-14 20:55:48 +00:00
Safihre
a3daa7b257 Increase threshold for logging excessive sleep time
Closes #2458
2023-02-14 21:54:41 +01:00
SABnzbd Automation
a70f943462 Update translatable texts
[skip ci]
2023-02-13 02:39:27 +00:00
renovate[bot]
a717260574 Update all dependencies 2023-02-13 02:38:27 +00:00
Safihre
90a4898dbd Use walrus operator in several places 2023-02-11 22:34:53 +01:00
Safihre
4543d9e975 Log decode cache limit and assembler trigger 2023-02-11 17:33:24 +01:00
jcfp
2aedd20007 Include https config files in backup (#2450)
* include https config files in backup

* add constants for default https config filenames

* refresh test_config, add coverage for https backup

* remove some unicode from the tests

* On Windows we use long-paths

---------

Co-authored-by: Safihre <safihre@sabnzbd.org>
2023-02-11 09:21:22 +01:00
renovate[bot]
822e1cbfb5 Update dependency cryptography to v39.0.1 [SECURITY] 2023-02-08 05:40:16 +00:00
puzzledsab
0ec082669d Gradual slowdown on filling queues (#2439)
* Gradual slowdown on filling queues

* Move delayed counters to new slowdown check, otherwise they will rarely trigger

* Simplify the full decoder part a bit

* Reduce sleep aggressiveness a bit

* Make a constant for the queue level slowdown limit

* Rename the slowdown limit variable and put it in constants with the other queue limit variables

* Also constants...

* Make black happy
2023-02-07 23:24:57 +01:00
puzzledsab
5315eeb26b Write first article directly (#2443)
* Write first article directly

* Add first article to assembler in usual place instead of ArticleCache

* Remove redundant deref

* Update comment to reflect new code

* Partly restore old code

* First article should not always be added to the queue if SAB has started downloading the other parts

* Yet another redundant deref :(
2023-02-05 22:29:38 +01:00
puzzledsab
32bd5a4cca Let the assembler write trigger scale with the size of the cache (#2436) 2023-02-05 20:47:27 +01:00
jcfp
e4ec774d16 restore startup history purge (#2449) 2023-02-04 19:13:46 +01:00
puzzledsab
b1ce21ad77 Reduce useless logging (#2448) 2023-02-03 14:14:57 +01:00
puzzledsab
9ab5e86c81 Make downloader use received buffer size to determine if it's ok to sleep (#2424)
* Make downloader use used buffer size to determine if it's ok to sleep

* Log number of times slept and average time slept last 10 seconds

* Log if downloader slept much too long

* Improvements to sleep debugging

* Remove get_stable_speed
2023-02-02 10:25:02 +01:00
renovate[bot]
ea3442ad27 Update dependency setuptools to v67 2023-02-01 19:54:56 +00:00
puzzledsab
e1af02a642 Don't crash on invalid yenc footer (#2440)
* Don't crash on invalid yenc footer

* What he said

* Forgot to remove debug print
2023-02-01 20:44:12 +01:00
Safihre
fe0c4e4f92 Update formatting with black 23 rules 2023-02-01 20:42:06 +01:00
puzzledsab
5e58fdf821 Don't immediately add new article if downloading should be stopped (#2429)
* Don't immediately add new article if downloading should be stopped

* VS Code black and Github black don't agree
2023-01-28 18:42:55 +01:00
SABnzbd Automation
01537c03b1 Update translatable texts
[skip ci]
2023-01-26 22:19:13 +00:00
Safihre
b78f4d13c1 Update Unrar to 6.20
Closes #2325
2023-01-26 23:15:09 +01:00
Safihre
ba68243dc7 Drop official support for Python 3.7 for the next major release 2023-01-25 23:02:33 +01:00
SABnzbd Automation
b742971d9b Update translatable texts
[skip ci]
2023-01-25 21:41:02 +00:00
Safihre
6492cfb430 Update copyright year to 2023 2023-01-25 22:39:49 +01:00
puzzledsab
c229adcbb9 Immediately request new article after the previous was done (#2423)
* Immediately request new article after the previous was done

* Add server.get_article method
2023-01-25 22:36:49 +01:00
puzzledsab
abb08a4589 Various minor changes and fixes (#2422) 2023-01-24 22:40:18 +01:00
Safihre
5ccc124ad4 Print status of OpenSSL link during start-up and request feedback 2023-01-24 17:28:43 +01:00
SABnzbd Automation
db22fea0d1 Update translatable texts
[skip ci]
2023-01-24 16:22:05 +00:00
Safihre
7ebd12ec3d Rename sabyenc3 to sabctools 2023-01-24 17:06:53 +01:00
Safihre
ac0e57726f Replace crc32calc with C-version 2023-01-24 17:06:36 +01:00
Safihre
e3200b1481 Apply changes need for updates to buffer_decode 2023-01-24 17:06:36 +01:00
Safihre
5492935c32 Use buffer-based sabyenc3 2023-01-24 17:06:32 +01:00
puzzledsab
2a67d80057 Stop using 0 as failed and use new crc32 value in SFV check (#2411)
* Stop using 0 as failed and use new crc32 value in SFV check

* Make nzf.crc32sum differentiate between uninitialized, valid and invalid CRC32 value

* Replace crc32sum with assembled and use crc32 value instead
2023-01-24 17:06:32 +01:00
puzzledsab
7956a75344 Call getsize in try and use CRC32 from sabyenc (#2409)
* Call getsize in try and use CRC32 from sabyenc

* Always fail if crc32sum is 0
2023-01-24 17:06:32 +01:00
puzzledsab
cfa82e5086 CRC32 check (#2407)
* Only set on_disk and don't set decoded until article is saved to cache (#2403)

* Mark unavailable articles as saved

* Save broken article if a valid one doesn't exist

* Change bad article message a bit

* Reduce to only set on_disk and don't set decoded until article is saved to cache

* Use CRC32 from PAR2 instead of MD5

* Move crc32calc.py to utils

* Update credits in crc32.py, use crc32 in test_par2file.py

* Various smaller changes to CRC32 patch

* Handle unfinished par2 files better

* Optimized crc32 calculations

* Rename md5sum to crc32sum and include filesize check
2023-01-24 17:06:32 +01:00
Safihre
60291a93c2 Use buffer per connection 2023-01-24 17:06:18 +01:00
Safihre
51fec1c5a0 Use new sabyenc3.unlocked_ssl_recv_into 2023-01-24 17:06:18 +01:00
Safihre
5b8c5e2fd7 Allocate only once a buffer for each connection 2023-01-24 17:06:18 +01:00
renovate[bot]
5a0fd6ee08 chore(deps): update all dependencies 2023-01-23 06:09:10 +00:00
renovate[bot]
d7d3810874 chore(deps): update all dependencies 2023-01-16 00:18:57 +00:00
SABnzbd Automation
f0819c339c Update translatable texts
[skip ci]
2023-01-15 12:36:21 +00:00
Safihre
adcdca6f2e Pin tavern due to incompatibility of tavalidate with tavern>=2.0.0
@jcfp if you ever feel like a refactor of these tests ;)
2023-01-15 13:35:03 +01:00
SABnzbd Automation
efd7d1a4a0 Update translatable texts
[skip ci]
2023-01-11 02:27:37 +00:00
One CD
fc3fa137ac relabel UI button to show "Hidden" instead of "System" (#2410)
- as per: https://forums.sabnzbd.org/viewtopic.php?t=26089
2023-01-11 03:26:25 +01:00
SABnzbd Automation
61e901e07b Update translatable texts
[skip ci]
2023-01-10 08:57:09 +00:00
Safihre
d5dee106d1 Use newer cryptography package 2023-01-10 08:56:11 +00:00
renovate[bot]
00518e1a60 chore(deps): update all dependencies 2023-01-10 08:56:11 +00:00
Michael Reid
129d622015 Ignore file permissions when running unrar (#2401)
* fix: use permission bits from root when doing file recursion

* fix: restrict setting root permissions to files

* Revert "fix: restrict setting root permissions to files"

This reverts commit 0ef72f6038.

* Revert "fix: use permission bits from root when doing file recursion"

This reverts commit 0a1ceff8c0.

* fix: always ignore file attributes on unrar
2023-01-05 23:03:25 +01:00
puzzledsab
4423cbfcf3 Only set on_disk and don't set decoded until article is saved to cache (#2403)
* Mark unavailable articles as saved

* Save broken article if a valid one doesn't exist

* Change bad article message a bit

* Reduce to only set on_disk and don't set decoded until article is saved to cache
2023-01-05 14:39:11 +01:00
SABnzbd Automation
7f0d845dd0 Update translatable texts
[skip ci]
2022-12-31 16:17:05 +00:00
jcfp
bba1c894c5 Refresh and expand the appstream metadata (#2393)
Add supported control methods [1] as well as recommended screen sizes [2] and internet availability. Most of these properties are already in active use by appdata clients such a Gnome's "Software" program. The display size basically says "all but extra-small", where the extra extra-small category is used for tiny devices such a wearables and watches, and is kept as a recommend to not block installs on headless systems.

Also set a vcs-browser URL, and update the contact URL to point to the more generic live-chat page rather than directly to the forums.

[1] https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-relations-control
[2] https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-relations-display_length
2022-12-31 17:14:01 +01:00
SABnzbd Automation
6c197a4a8c Update translatable texts
[skip ci]
2022-12-28 21:33:20 +00:00
Safihre
4ceae8ec31 Update macOS build to Python 3.11.1 2022-12-28 22:28:48 +01:00
SABnzbd Automation
d257f903cc Update translatable texts
[skip ci]
2022-12-28 21:21:26 +00:00
Safihre
69742dd785 Refactor server error message reporting 2022-12-28 22:16:21 +01:00
SABnzbd Automation
92161eae07 Update translatable texts
[skip ci]
2022-12-28 20:59:39 +00:00
Sander
70d5099902 better logging with login from multiple IP (#2370)
* better logging with login from multiple IP

* warning in one line

* warning in one line

* warning in one line

* cleanup

* errormsg in better place

* Patch error

Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-12-28 21:56:35 +01:00
thezoggy
de80f4e262 fix typo in default to url input when add nzb modal is shown (#2384) 2022-12-23 07:31:24 +01:00
thezoggy
0f0b8d4528 default to url input when add nzb modal is shown (#2383) 2022-12-22 19:54:50 +00:00
renovate[bot]
e34301fb2f chore(deps): update all dependencies 2022-12-19 13:25:39 +01:00
Safihre
a140c1ddc1 Remove special universal2 build step for orjson on macOS
orjson now provides universal2 wheel
2022-12-16 22:56:17 +01:00
Safihre
b472c615fb Multi-edit applying category + something else can be unpredictable
Closes #2375
2022-12-15 16:39:46 +01:00
Safihre
d41f33775e On mobile disable accept parameter on file inputs
Doesn't work on mobile Safari
See https://forums.sabnzbd.org/viewtopic.php?p=128651
2022-12-15 16:07:29 +01:00
Safihre
c27d60e2b0 Run Windows CI tests on Python 3.11 now lxml is available 2022-12-15 09:57:10 +01:00
Safihre
77fcaf4fca Remove redundant combine_chunk from recv_chunk 2022-12-12 13:58:03 +01:00
renovate[bot]
206dc66f7c Update dependency mac-alias to v2.2.2 2022-12-12 09:08:14 +00:00
puzzledsab
2d267fc50a Put */Default category first in lists (#2372)
* Put * category first in lists

* Seems there is some disagreement on how to format **

* Somewhat shorter version

* Use get_ordered_categories
2022-12-10 21:30:54 +01:00
puzzledsab
5cd5f00df7 Fix division by zero (#2369) 2022-12-10 08:40:30 +01:00
puzzledsab
6a80869861 Put some of the nntp connection handling code in a separate method (#2368) 2022-12-08 19:40:44 +01:00
puzzledsab
fb113514ae More recv_chunk refactoring (#2367) 2022-12-08 15:43:43 +01:00
puzzledsab
91740048c2 Limited refactoring of recv_chunk (#2366)
* Limited refactoring

* Remove explicit setblocking from servertests.py

* Make combine_chunk exactly 5 bytes so we can use ==

* Move timeout down a bit
2022-12-07 20:14:05 +01:00
Safihre
ff2e206229 sys.stdout and sys.stderr not defined by new PyInstaller version
Closes #2360
2022-12-06 17:06:56 +01:00
Jagandeep Brar
5f1f82257b fix: set stage_log to empty array on missing database content (#2364)
Closes #2363
2022-12-06 05:15:37 +01:00
Safihre
3df0fab793 Correctly set non-blocking mode
Relates to #2357
2022-12-05 14:03:41 +01:00
dependabot[bot]
7e7fa62c24 Bump stefanzweifel/git-auto-commit-action from 4.15.4 to 4.16.0 (#2359)
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4.15.4 to 4.16.0.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.4...v4.16.0)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 11:54:38 +01:00
renovate[bot]
6220c00dcb Update all dependencies 2022-12-05 00:40:47 +00:00
Safihre
59a3d58c0f Process feedback on Downloader optimizations 2022-12-01 09:43:35 +01:00
Safihre
d8fb19c26e Use actual data_size in decoder
To be added to sabyenc3 later
2022-11-29 17:05:01 +01:00
Safihre
b0530325c5 Optimize downloader loop
Increase number of pre-fetched articles.
Only update the job download statistics after completing an article instead of after every chunk
2022-11-29 14:38:54 +01:00
Safihre
734a86a248 Optimize synchronized decorator 2022-11-29 13:50:16 +01:00
Safihre
a12d447d95 Optimize the has_forced_items check 2022-11-29 12:27:15 +01:00
puzzledsab
e9578d9aa0 Optimize highest_server (#2350) 2022-11-28 18:07:06 +01:00
renovate[bot]
5fef185a30 Update all dependencies 2022-11-28 01:04:10 +00:00
puzzledsab
ee2b2b2c3a Improve handling of unresolvable news servers (#2347)
* Trying to find cause of git bug #2345

* Try to find IP using happyeyeballs first, fall back to default if it fails

* Fix mistake

* Add host name to connection error message

* Always debug log IP address
2022-11-25 22:47:58 +01:00
Safihre
45d232e401 Scripts set as end-of-queue actions are no longer persistent
https://forums.sabnzbd.org/viewtopic.php?p=128490
2022-11-25 22:33:56 +01:00
Safihre
9a4d56e4e1 Status information was not updated on shortcut-key S
Closes #2346
2022-11-23 10:26:35 +01:00
puzzledsab
63018439c8 Refactor article.get_article (#2344)
* Refactor article.get_article

* Add some tests

* Another test

* Test tries updating

* Fix assignment mistake

* Remove debug logging from get_article
2022-11-21 07:34:20 +01:00
renovate[bot]
b5fef2ecb9 Update all dependencies 2022-11-21 01:22:29 +00:00
puzzledsab
fd3ece31c7 Do a more thorough check when a bad try_list is detected (#2330)
* Do a more thorough check when a bad try_list is detected

* Improve idle job check and fix DNS lookup problem

* Loop through copy of article list and move nzf.reset_try_list below the article check

Closes #2320
2022-11-16 19:51:13 +01:00
SABnzbd Automation
7aa8e3d60d Update translatable texts
[skip ci]
2022-11-16 15:42:50 +00:00
Safihre
9d71b39b31 Remove Queue/History search term exclusion as we do not support it
Closes #2342
2022-11-16 16:42:18 +01:00
Safihre
7cb09a0e0b Priority list in Add NZB window was not correct
Closes #2332
2022-11-14 16:07:41 +01:00
Safihre
fa47448ddc Remove redundant has_bad_articles
Leftover of new-but-failed-quikcheck
2022-11-14 16:00:02 +01:00
thezoggy
be7ae3d151 Tweak so hotkeys update both queue+history for non-tabbed layout. (#2337) 2022-11-14 15:20:07 +01:00
Kian-Meng Ang
fcb3c11203 Fix typos (#2339)
Found via `codespell -S po,interfaces -L
ciph,fo,ro,nd,parm,parms,readd,reenabled,msdos,sav,tage,datas`
2022-11-14 07:21:42 +01:00
renovate[bot]
c63002e145 Update dependency pyinstaller-hooks-contrib to v2022.13 2022-11-14 02:59:03 +00:00
Safihre
7758079efa Disable separateMajorMinor in Renovate config 2022-11-07 21:42:57 +01:00
Safihre
9e43cc30a7 Only run codesign import step if available 2022-11-07 21:37:00 +01:00
dependabot[bot]
40eaf15538 Bump stefanzweifel/git-auto-commit-action from 4.15.3 to 4.15.4 (#2335)
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4.15.3 to 4.15.4.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.3...v4.15.4)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-07 11:40:47 +01:00
renovate[bot]
a6228b43f3 Update all dependencies 2022-11-07 05:26:12 +00:00
SABnzbd Automation
b5fcc90da2 Update translatable texts
[skip ci]
2022-11-07 02:31:55 +00:00
renovate[bot]
c66e80fdaf Update all dependencies 2022-11-07 02:31:21 +00:00
Safihre
7853e1990f Replace apple-actions/import-codesign-certs 2022-11-04 10:11:09 +01:00
SABnzbd Automation
9d52a335c3 Update translatable texts
[skip ci]
2022-11-04 07:58:15 +00:00
Safihre
8597784bc6 Correct tests after server timeout correction 2022-11-03 11:24:36 +01:00
Safihre
557b9ef71d Server timeouts were applied wrongly during testing
Closes #2326
2022-11-03 09:23:17 +01:00
SABnzbd Automation
c7791a478a Update translatable texts
[skip ci]
2022-11-02 21:38:52 +00:00
renovate[bot]
d29a20727b Update dependency cryptography to v38.0.3 [SECURITY] 2022-11-02 21:38:14 +00:00
SABnzbd Automation
a14a2f6c96 Update translatable texts
[skip ci]
2022-11-01 16:26:40 +00:00
thezoggy
cc402e35a1 codespell (#2321)
* ran through codespell to cleanup a bit of typos, excluded a bit to try and avoid any issues

* fix typos - may need review
2022-10-31 22:51:38 +01:00
renovate[bot]
2813c30536 Update all dependencies 2022-10-31 19:10:35 +00:00
dependabot[bot]
8bd0bdf5b2 Bump stefanzweifel/git-auto-commit-action from 4.15.2 to 4.15.3 (#2323)
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4.15.2 to 4.15.3.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.2...v4.15.3)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-31 12:28:24 +01:00
SABnzbd Automation
26a99443d7 Update translatable texts
[skip ci]
2022-10-29 18:02:15 +00:00
Safihre
6d5aa77dee Set version to 3.8.0-develop
Closes #2319
2022-10-29 20:01:22 +02:00
Safihre
5fa7bea885 Update (almost) all Python versions to 3.11 2022-10-27 08:58:28 +02:00
Safihre
62fb85a94b Update Transifex client to supported version 2022-10-25 20:16:55 +02:00
dependabot[bot]
c840e3485e Bump stefanzweifel/git-auto-commit-action from 4.15.1 to 4.15.2 (#2317)
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4.15.1 to 4.15.2.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.1...v4.15.2)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-24 13:01:11 +02:00
renovate[bot]
04c72d51fd Update all dependencies 2022-10-24 01:02:55 +00:00
renovate[bot]
eae1250cac Update all dependencies 2022-10-24 00:48:19 +00:00
dependabot[bot]
634801431d Bump stefanzweifel/git-auto-commit-action from 4.15.0 to 4.15.1 (#2313)
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4.15.0 to 4.15.1.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.0...v4.15.1)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-17 13:12:04 +02:00
dependabot[bot]
e9a884ab39 Bump syphar/restore-virtualenv from 1.2 to 1.3 (#2312)
Bumps [syphar/restore-virtualenv](https://github.com/syphar/restore-virtualenv) from 1.2 to 1.3.
- [Release notes](https://github.com/syphar/restore-virtualenv/releases)
- [Commits](https://github.com/syphar/restore-virtualenv/compare/v1.2...v1.3)

---
updated-dependencies:
- dependency-name: syphar/restore-virtualenv
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-17 13:11:23 +02:00
renovate[bot]
40fc1511d0 Update all dependencies 2022-10-17 02:00:09 +00:00
SABnzbd Automation
8642723c77 Update translatable texts
[skip ci]
2022-10-11 18:16:02 +00:00
Safihre
15ac97e41a Update text files for 3.7.0Beta1 2022-10-11 20:15:14 +02:00
Safihre
8202ae7cf6 PyInstaller now supports Python 3.11 2022-10-10 09:27:26 +02:00
renovate[bot]
1b459460dc Update dependency pyinstaller to v5.5 2022-10-10 01:01:04 +00:00
Safihre
bdf7df9ecd Fix importlib_metadata testing-requirement 2022-10-07 21:10:31 +00:00
renovate[bot]
7e55c6a79d Update all dependencies 2022-10-07 21:10:31 +00:00
thezoggy
183570aaa5 WIN: multipar 1.3.2.5 (#2308) 2022-10-05 13:21:43 +02:00
Safihre
de1d66d4dd Console logging directed to stdout
Closes #2302
2022-09-26 22:21:21 +02:00
dependabot[bot]
0b27e57ad7 Bump stefanzweifel/git-auto-commit-action from 4.14.1 to 4.15.0 (#2303)
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4.14.1 to 4.15.0.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.14.1...v4.15.0)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-26 12:59:18 +02:00
renovate[bot]
182bbd43c5 Update all dependencies 2022-09-26 01:33:43 +00:00
Safihre
cdf4d6c5fd Update README badges, include Discord 2022-09-24 22:46:13 +02:00
SABnzbd Automation
86db74c394 Update translatable texts
[skip ci]
2022-09-24 19:44:02 +00:00
Safihre
856e63794b Small refactor of database.py 2022-09-24 21:40:49 +02:00
Safihre
c29a57445a Sanitize RSS-feed name when renaming
Closes #2300
2022-09-23 09:45:20 +02:00
SABnzbd Automation
4aba90ad3f Update translatable texts
[skip ci]
2022-09-22 12:53:52 +00:00
Safihre
4f2b6d4cd7 Update text files for 3.7.0Alpha1 2022-09-22 14:52:44 +02:00
Safihre
92067fa3f3 Build release using Python 3.11 RC 2
Set PYTHONNODEBUGRANGES
Use main pyinstaller branch
rustup target add aarch64-apple-darwin
2022-09-22 14:19:32 +02:00
SABnzbd Automation
c26ea4ceeb Update translatable texts
[skip ci]
2022-09-22 12:13:12 +00:00
Safihre
35ccbff5b9 Update label for System load 2022-09-22 14:12:29 +02:00
SABnzbd Automation
1a265a5176 Update translatable texts 2022-09-22 10:49:38 +00:00
Safihre
ef2d243fa8 Move sysload indicator to status window 2022-09-22 12:48:58 +02:00
Safihre
c2b8fa59a6 Update sabyenc3 to 5.4.4
Only adds Python 3.11 wheels
2022-09-22 12:35:10 +02:00
Safihre
a85f9e39bd Force-downloads can result in extra data downloaded of other jobs 2022-09-22 12:12:42 +02:00
Safihre
a13f8828fb Move Server - Port setting to Advanced settings 2022-09-22 12:02:32 +02:00
Safihre
7d391b8465 Small improvement of BPSMeter.get_sums
Leftover of Python 2 days
2022-09-21 23:06:50 +02:00
Safihre
dbfa7cc4eb Refactor Downloader.bandwidth_perc and bandwidth_limit usage 2022-09-21 22:49:41 +02:00
Safihre
66e99df303 Free Space Detection too strict when using Direct Unpack
Closes #2299
2022-09-21 21:41:24 +02:00
Safihre
77ecf64443 Prevent crash on disappearing Article
Closes #2295
2022-09-21 21:31:02 +02:00
Safihre
f7060804b2 Set logging to info when no file given to deobfuscate
Closes #2297
2022-09-20 10:22:00 +02:00
renovate[bot]
a44a1269c0 Update all dependencies 2022-09-19 01:53:27 +00:00
Safihre
ac6fc37c7d Small improvements of to_units and opts_to_pp 2022-09-16 06:50:48 +02:00
Safihre
9472d65af9 Update output tests to match removed API fields 2022-09-15 22:49:36 +02:00
Safihre
1b4c07f229 Remove categories and scripts from queue-API-call
So we don't check the disk for available scripts every second
2022-09-15 14:49:20 +02:00
Safihre
a645058ae1 Update Snapcraft release process 2022-09-13 16:48:28 +02:00
Safihre
edec6defbb Show the custom job name in case of fetch-failure
Closes #2294
2022-09-12 22:52:44 +02:00
SABnzbd Automation
27b3a3ddef Update translatable texts 2022-09-12 13:58:44 +00:00
Safihre
da0903b8a6 Link to Not-complete info on low article availability 2022-09-12 15:57:57 +02:00
renovate[bot]
a49a3b45e5 Update dependency cryptography to v38 2022-09-12 05:08:14 +00:00
SABnzbd Automation
b9225fb153 Update translatable texts 2022-09-12 03:09:18 +00:00
renovate[bot]
656b7f0948 Update dependency pyinstaller to v5.4.1 2022-09-12 03:08:39 +00:00
SABnzbd Automation
08b249ee09 Update translatable texts 2022-09-08 15:15:35 +00:00
Safihre
5d76ebfe6e Force push requires automation token 2022-09-08 17:14:40 +02:00
Safihre
0d53b12ade Force-push updates to translation files 2022-09-08 17:01:54 +02:00
Safihre
f403e12a2a Add option to specify Backup Folder and clarify scheduler usage
Closes #2288
2022-09-08 16:54:13 +02:00
Safihre
5abce26309 Update build_release.yml
Update the actual macOS build code
2022-09-06 12:35:44 +00:00
Safihre
e73cb0958f Update macOS build script 2022-09-06 12:35:44 +00:00
renovate[bot]
70070e2f1c Update dependency pyinstaller-hooks-contrib to v2022.10 2022-09-06 12:35:44 +00:00
Sander
2685f9adab more some extensions that are non-mainstream (#2285)
Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
2022-09-03 16:20:59 +02:00
renovate[bot]
c43e74eabd Update all dependencies 2022-08-29 01:51:48 +00:00
m0vie
b0d3306209 Determine password from <meta> before running preprocessing script (#2282)
This way the environment variable SAB_PASSWORD (whose documentation
says is supplied by user OR the nzb) is filled properly and the
password is available in a preprocessing script.
2022-08-27 20:08:08 +02:00
Safihre
4aaabae109 Pin jaraco.text to lower version due to irrelevant extra dependencies 2022-08-26 11:32:02 +02:00
Safihre
b8188f999e Prevent failure in TestPar2Repair if it takes more than 0 seconds
Closes #2273
2022-08-25 20:28:39 +02:00
Safihre
4dc5ceb9b1 Delete .pyup.yml 2022-08-25 13:20:50 +02:00
Safihre
4f8e5053f7 Update renovate.json (#2280) 2022-08-25 07:23:48 +00:00
renovate[bot]
3d97ce99e1 Update all dependencies 2022-08-24 16:34:41 +00:00
renovate[bot]
8620412b3a Configure Renovate (#2277)
* Add renovate.json

* Create renovate.json

* Delete renovate.json

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-08-24 14:25:35 +00:00
SABnzbd Automation
a6d07d89d0 Update translatable texts 2022-08-22 17:55:36 +00:00
Safihre
a63efcefd6 Make sure also short-dates are detected as YY-MM-DD in Sorting 2022-08-22 19:54:49 +02:00
Safihre
bce9207161 Update backup tests 2022-08-22 10:40:45 +02:00
SABnzbd Automation
12670dedbe Update translatable texts 2022-08-21 20:14:14 +00:00
Safihre
40393f9548 Add Create Backup to Scheduler 2022-08-21 22:13:31 +02:00
Safihre
94cae5f015 Only allow Config-backup to the Complete Folder
Closes #2261
2022-08-21 22:05:42 +02:00
Safihre
8353227f9d No longer install builder requirements during CI 2022-08-20 23:13:38 +02:00
Safihre
5c1d69b934 Run Linux CI tests on Python 3.11 2022-08-20 23:03:40 +02:00
thezoggy
fb04b58b57 selenium syntax update (#2271)
* handle sab path with spaces

* fix py3.10 win "Unable to remove cache dir"

* remove unused imports

* update selenium find_element(s) syntax

* Fix selenium_wrapper usage

Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-08-19 22:25:48 +02:00
Safihre
2bb14bba2a Correct: Compressed NZB filename could exceed OS limitation 2022-08-19 13:31:33 +02:00
Safihre
91195eb21b Compressed NZB filename could exceed OS limitation
See https://www.reddit.com/r/SABnzbd/comments/wrserd/importing_nzb_files/
2022-08-19 13:15:38 +02:00
Sander
3b8d6dd3c8 detect and log fully encrypted (obfuscated) rars (#2266)
* detect fully encrypted rars

* debug.warning working, nzo.fail_msg alas is overwritten

* a bit of clean-up

* a bit of clean-up

* the real clean-up

* no intermediate variable

Co-authored-by: Safihre <safihre@sabnzbd.org>

* Shorter message

Co-authored-by: Safihre <safihre@sabnzbd.org>

* more clean-up

* unittest

Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-08-17 02:00:26 +02:00
Safihre
ff2ab2da8d Pyup/scheduled update 2022 08 15 (#2270)
* Update setuptools from 63.4.2 to 65.0.0

* Update orjson from 3.7.11 to 3.7.12

* Update jaraco.text from 3.8.1 to 3.9.0

* Update more-itertools from 8.13.0 to 8.14.0

* Update pytz from 2022.1 to 2022.2.1

Co-authored-by: pyup-bot <github-bot@pyup.io>
2022-08-16 20:20:07 +02:00
Sander
85aed457b2 Handle Unicoded filenames add via SAB GUI (cherrypy) (#2268)
* Linux: handle Unicoded filenames add via SAB GUI

* Unittest

* Unittest

* Unittest

* Unittest

* Unittest

* Unittest more

* naming, less code

* even less code

* better unittests

* and less, less code

Closes #2267

Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
2022-08-15 19:57:58 +02:00
Safihre
d624d1d5b6 Do not repeatedly add password to meta-password list 2022-08-14 11:36:55 +02:00
Safihre
6c6a1049ea Validation error would not be shown on Config General page
Due to #2253
2022-08-12 16:48:30 +02:00
SABnzbd Automation
f380889d98 Update translatable texts 2022-08-12 14:44:22 +00:00
Sander
f61df0e126 Check if host is valid: an IP address, or a name/FQDN that resolves (#2253)
* Check if host is valid: an IP address, or a name/FQDN that resolves

* Check if host is valid: an IP address, or a name/FQDN that resolves

* default to "127.0.0.1"

* default to "127.0.0.1"

* manual black

* manual black

* manual black

* based on feedback, plus back-to-basics

* based on feedback, plus back-to-basics, plus debug logging

* based on feedback, plus back-to-basics, plus debug logging

* based on feedback, plus back-to-basics, plus debug logging

* clean formatting

* clean formatting

Co-authored-by: sander <san.d.erjonkers+github@gmail.com>
2022-08-12 16:43:40 +02:00
Safihre
ffca12123f Update Unrar to 6.11/6.12
Closes #2265
2022-08-12 10:49:10 +02:00
SABnzbd Automation
1077ca3753 Update translatable texts 2022-08-12 08:45:59 +00:00
Safihre
c7189dbceb Graceful log sabyenc decoding (CRC/formatting) errors
Closes sabnzbd/sabyenc#62
2022-08-12 10:43:59 +02:00
SABnzbd Automation
f2361c49b4 Update translatable texts 2022-08-10 06:54:38 +00:00
thezoggy
f84cbb66c3 Add option to replace underscores in folder name. (#2263) 2022-08-10 08:53:54 +02:00
Safihre
e45f254d19 strftime does not require explicit call to localtime 2022-08-09 21:54:04 +02:00
Safihre
b6cd3c0bae Config backup filename in same format as *arr apps
See #2261
2022-08-09 21:51:58 +02:00
pyup.io bot
4a98724a35 Update setuptools from 63.3.0 to 63.4.2 (#2262) 2022-08-09 07:39:49 +02:00
SABnzbd Automation
4680fa5ae9 Update translatable texts 2022-08-05 19:19:00 +00:00
Safihre
458f4e2bdc Remove deprecation notices 2022-08-05 21:18:12 +02:00
Safihre
3357fd81c7 Add Filter and Age columns to Downloaded RSS-feed tab
Closes #2257
2022-08-03 21:58:40 +02:00
Safihre
3ebe277303 Update macOS Python version to 3.10.6 2022-08-02 22:30:26 +02:00
Safihre
29c57dce0f Remove new QuickCheck implementation
See https://github.com/sabnzbd/sabnzbd/discussions/2160
And https://github.com/sabnzbd/sabnzbd/issues/2251
2022-08-02 22:16:21 +02:00
Safihre
27a9330638 Pyup/scheduled update 2022 08 01 (#2260)
* Update pyinstaller from 5.2 to 5.3

* Update setuptools from 63.2.0 to 63.3.0

* Update orjson from 3.7.8 to 3.7.11

Co-authored-by: pyup-bot <github-bot@pyup.io>
2022-08-02 20:25:31 +02:00
Safihre
4b42b1f55d Upgrade pip/wheel before installing requirements
Closes #2244
2022-07-26 09:52:58 +02:00
pyup.io bot
db761395e5 Update orjson from 3.7.7 to 3.7.8 (#2250) 2022-07-26 09:51:09 +02:00
Sander
249d73e270 Deobfuscation: comments and logging (#2246)
* Comment block that explains what deobfuscation does

* get better logging (with reason of no deobfuscation), leading to other code structure

* get better logging (with reason of no deobfuscation), leading to other code structure

* get better logging (with reason of no deobfuscation), leading to other code structure

* based on feedback: comment with typical cases to the beginning of function, error logging if file is not given/found, other logical notation in if-statement
2022-07-25 22:19:11 +02:00
Safihre
5d359afedb Downloads in Checking-status were not displayed correctly
Closes #2249
2022-07-25 11:02:26 +02:00
Safihre
5e8e37e6a2 Correctly remove disable_api_key 2022-07-21 21:39:07 +02:00
SABnzbd Automation
a74df6f04f Update translatable texts 2022-07-21 19:30:52 +00:00
Safihre
10991d5472 Remove replace_illegal option 2022-07-21 21:26:30 +02:00
Safihre
b3206fe1db Remove enable_meta option 2022-07-21 21:24:29 +02:00
Safihre
70391ea055 Remove disable_key option 2022-07-21 21:22:19 +02:00
thezoggy
5b69155d49 Tweak hotkeys, add pagination navigation, use jquery.hotkeys (#2235) 2022-07-20 13:38:11 +02:00
pyup.io bot
941bb8adca Scheduled weekly dependency update for week 29 (#2242)
* Update setuptools from 63.1.0 to 63.2.0

* Update cherrypy from 18.7.0 to 18.8.0

* Update jaraco.functools from 3.5.0 to 3.5.1

* Update jaraco.collections from 3.5.1 to 3.5.2

* Update jaraco.text from 3.8.0 to 3.8.1

* Update jaraco.classes from 3.2.1 to 3.2.2

* Update jaraco.context from 4.1.1 to 4.1.2

* Update tempora from 5.0.1 to 5.0.2
2022-07-20 13:36:55 +02:00
Sander
b5eb014084 Only pick biggest file for deobfuscation (#2241)
* Only pick biggest file for deobfuscation

* unit tests working again

* unit tests working again

* get counter nr_files_renamed right

* also deobfuscate sample and other files with same basename

* also deobfuscate sample and other files with same basename

* naming, comments

* unit test with just one small file (should get deobfuscated). Plus improved text/names.

* Moved most typical unit test (test_deobfuscate_big_file_small_accompanying_files() ) more to the top

* Moved most typical unit test (test_deobfuscate_big_file_small_accompanying_files() ) more to the top
2022-07-20 13:36:40 +02:00
jcfp
ee4b9339a7 use OSType in pyfakefs instead of setting separate properties (#2243) 2022-07-19 22:36:44 +02:00
pyup.io bot
3acfe19499 Scheduled weekly dependency update for week 28 (#2239)
* Update cryptography from 37.0.3 to 37.0.4

* Update cryptography from 37.0.3 to 37.0.4

* Update pyinstaller from 5.1 to 5.2

* Update pyinstaller-hooks-contrib from 2022.7 to 2022.8

* Update orjson from 3.7.6 to 3.7.7

* Update cherrypy from 18.6.1 to 18.7.0
2022-07-12 08:09:54 +02:00
pyup.io bot
9bac23b38f Scheduled weekly dependency update for week 27 (#2237)
* Update setuptools from 62.6.0 to 63.1.0

* Update orjson from 3.7.3 to 3.7.6

* Update cffi from 1.15 to 1.15.1

* Update ujson from 5.3.0 to 5.4.0
2022-07-04 23:20:33 +02:00
Safihre
b028258cbd Pyup/scheduled update 2022 06 27 (#2226)
* Update cryptography from 37.0.2 to 37.0.3

* Update cryptography from 37.0.2 to 37.0.3

* Update orjson from 3.7.2 to 3.7.3

* Update chardet from 4.0.0 to 5.0.0

* Force selenium<4.3.0

Co-authored-by: pyup-bot <github-bot@pyup.io>
2022-06-28 08:48:45 +02:00
Safihre
4d442159cb Remove unused code 2022-06-22 20:17:29 +02:00
Safihre
181a91ccf6 Prevent crash if DNS lookup fails for external IPv4
Closes #2217
2022-06-21 22:31:01 +02:00
SABnzbd Automation
1c6f2e9d10 Update translatable texts 2022-06-21 07:54:26 +00:00
Safihre
244fe3b116 Remove unused translations from Glitter 2022-06-21 09:52:41 +02:00
Safihre
9ee7391918 Pyup/scheduled update 2022 06 20 (#2215)
* Update setuptools from 62.4.0 to 62.6.0

* Update charset-normalizer from 2.0.12 to 2.1.0

Co-authored-by: pyup-bot <github-bot@pyup.io>
2022-06-21 08:32:28 +02:00
Safihre
2eadc3ace6 Merge osx_menu, osx_speed and win_menu into tray_icon
See also #2214
2022-06-21 08:28:09 +02:00
SABnzbd Automation
786b29c18d Update translatable texts 2022-06-19 18:38:48 +00:00
Safihre
315f787d20 Prevent scheduler crash if event is canceled that was no longer queued
https://www.reddit.com/r/SABnzbd/comments/vfa1fr/what_is_causing_this_error_its_not_harming/
2022-06-19 20:38:04 +02:00
Safihre
0347907044 Prevent crash in new Quick-check if file was already moved 2022-06-16 13:53:54 +02:00
Joulinar
f2ae281195 Update sabyenc3 to 5.4.3 (#2209)
* Update requirements.txt

Update requirements sabyenc3 to new version

* Update sabyenc3 to 5.4.3

Update sabyenc3 to 5.4.2
2022-06-15 13:24:12 +02:00
Safihre
a4f76d59b0 Prevent showing crash on Status window during Shutdown 2022-06-14 11:36:00 +02:00
Safihre
52a3e04eae Fix macOS cffi version and test orjson by installing build requirements 2022-06-14 11:26:25 +02:00
pyup.io bot
390abb00df Scheduled weekly dependency update for week 24 (#2208)
* Update pyinstaller-hooks-contrib from 2022.6 to 2022.7

* Update setuptools from 62.3.2 to 62.4.0

* Update pkginfo from 1.8.2 to 1.8.3

* Update orjson from 3.7.1 to 3.7.2
2022-06-14 10:58:38 +02:00
dependabot[bot]
02c50e4b17 Bump actions/setup-python from 3 to 4 (#2207)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-13 13:35:42 +02:00
Sander
8c8a78c0ab Less narrow exception handling with publicipv4 (#2202)
* wider exception handling

* Easier coding for easier reading

* Easier coding for easier reading

* except Exception:
2022-06-09 20:05:25 +02:00
Safihre
fb75cde710 Print hashes for Synology release 2022-06-09 08:47:17 +02:00
Safihre
fc855dccff Remove enable_https_verification from possible deprecation list 2022-06-07 09:31:22 +02:00
pyup.io bot
3d57def676 Scheduled weekly dependency update for week 23 (#2198)
* Update orjson from 3.6.8 to 3.7.1

* Update jaraco.text from 3.7.0 to 3.8.0
2022-06-06 22:51:42 +02:00
pyup.io bot
74d2da8857 Update pyinstaller-hooks-contrib from 2022.5 to 2022.6 (#2195) 2022-05-31 00:12:43 +02:00
Safihre
8cfd721ef6 Prevent unnecessary update API-calls when searching 2022-05-30 14:48:30 +02:00
Safihre
d4e10f32e7 Added filtering for Queue (category, priority) and History (category)
Closes #1158
2022-05-30 10:55:19 +02:00
Safihre
5a7cff491d Update sabyenc3 to 5.4.2 2022-05-29 14:29:09 +02:00
puzzledsab
392ae695d0 Change variable names from completed to remaining for consistency and fix sort order (#2194) 2022-05-29 13:01:15 +02:00
SABnzbd Automation
b39effc067 Update translatable texts 2022-05-28 18:23:22 +00:00
Safihre
908f4f01cf Update develop branch to 3.7.0-develop 2022-05-28 20:22:43 +02:00
Safihre
8baab13192 Additional refactor of queue sorting 2022-05-27 22:17:05 +02:00
SABnzbd Automation
abb38d3e49 Update translatable texts 2022-05-27 17:50:11 +00:00
puzzledsab
d0016e390a Optimize sort_queue_function (#2192) 2022-05-27 19:49:33 +02:00
puzzledsab
c80012e367 Remove redundant if in _nzo_completed_cmp (#2191) 2022-05-26 22:19:31 +02:00
SABnzbd Automation
19fc60a1d8 Update translatable texts 2022-05-26 09:58:29 +00:00
puzzledsab
487c9e96ce Add sort by completedness (#2186)
* Add sort by completedness

* Change sortCompleted text and move resort code

* Update explain-auto_sort

* Split explain-auto_sort for easier translation update
2022-05-26 11:57:46 +02:00
Safihre
cd337cb164 NZB files not removed when rejected by pre-queue script
Closes #2188
2022-05-24 17:25:47 +02:00
Safihre
5c15747d62 Also check for writing of special characters even if sanitize_safe is on
Relates to #2165
2022-05-24 10:39:35 +02:00
Safihre
7f11e6946b Scheduled weekly dependency update for week 21 (#2189)
* Update pyinstaller from 5.0.1 to 5.1

* Update pyinstaller-hooks-contrib from 2022.4 to 2022.5

* Update setuptools from 62.2.0 to 62.3.2

* Update sabyenc3 from 5.3.0 to 5.4.0

* Update feedparser from 6.0.8 to 6.0.10

* Update ujson from 5.2.0 to 5.3.0

* Update sabyenc3 to 5.4.1

Co-authored-by: pyup-bot <github-bot@pyup.io>
2022-05-24 10:16:31 +02:00
SABnzbd Automation
8fa77691d0 Update translatable texts 2022-05-23 14:41:12 +00:00
Safihre
894e5910c3 Also allow "cat" to filter categories on history call 2022-05-23 16:40:16 +02:00
SABnzbd Automation
54f33a72c4 Update translatable texts 2022-05-23 09:26:34 +00:00
Safihre
566f90ff30 Switched noslots and noslots_total
Closes #2187
2022-05-23 11:25:57 +02:00
SABnzbd Automation
debc59744f Update translatable texts 2022-05-19 10:31:16 +00:00
Safihre
33c6ac813c Update text files for 3.6.0RC2 2022-05-19 12:30:35 +02:00
Safihre
04875d07c5 Update sabyenc3 to 5.3.0 2022-05-19 12:20:01 +02:00
SABnzbd Automation
39eb594e12 Update translatable texts 2022-05-18 11:56:30 +00:00
Safihre
2561182126 Remove unused and undocumented API-calls 2022-05-18 13:46:58 +02:00
SABnzbd Automation
a68ab27bac Update translatable texts 2022-05-17 08:33:00 +00:00
Safihre
c27acb0e90 Warn users that we want to remove some settings 2022-05-17 10:32:02 +02:00
SABnzbd Automation
875d1ab952 Update translatable texts 2022-05-17 08:30:21 +00:00
Safihre
3496480254 Remove unused option movie_extra_folder 2022-05-17 10:29:27 +02:00
pyup.io bot
2ca79ab3b9 Scheduled weekly dependency update for week 20 (#2181)
* Update setuptools from 62.1.0 to 62.2.0

* Update puremagic from 1.12 to 1.14
2022-05-17 07:42:11 +02:00
Safihre
51ce7b657c Use directory of Default Category if the NZB-Category doesn't have one
Closes #2179
2022-05-16 13:45:31 +02:00
Safihre
67a34dcc78 Test for consistency of sabyenc3 version between code and requirements 2022-05-16 13:42:20 +02:00
Safihre
81d27ece54 Update BPS when we delay the Downloader due to full queues
Prevents "constant" speed that users see
2022-05-13 16:08:29 +02:00
Koen van Wijngaarden
f3a2e54e61 Disable password manager autofill on socks5 field (#2177)
* disable password manager autofill on socks5 field

* autocomplete="off" in socks5 field
2022-05-12 23:04:59 +02:00
Safihre
1894ed72e3 Move the building of source distribution to macOS job 2022-05-12 16:51:29 +02:00
SABnzbd Automation
64bf7d541e Update translatable texts 2022-05-12 09:33:36 +00:00
Safihre
8beba13430 Update text files for 3.6.0RC1 2022-05-12 11:32:40 +02:00
Safihre
6379869d41 Also create complete directory, if it does not exists 2022-05-12 10:52:28 +02:00
Safihre
5a666a28ef Remove tr language files (empty) 2022-05-12 09:56:54 +02:00
SABnzbd Automation
3c80053010 Update translatable texts 2022-05-12 06:37:57 +00:00
jcfp
7fd4941923 Add bash completion (#2175)
* add bash completion

* restore missing return for --server
2022-05-12 08:37:15 +02:00
SABnzbd Automation
b42e600285 Update translatable texts 2022-05-11 17:41:00 +00:00
Sander
df8859d49e Check filesystem capability for writing and writing filenames with special characters (#2167)
* functions to test directory for writing capabilities

* functions to test directory for writing capabilities

* use checking in postproc, and give warning if needed

* use checking in postproc, and give warning if needed

* put into function, with translatable folder names

* remove test file if still there

* better message formatting

* remove friendly directory name. Less comments

* move stuff into filesystem.py

* clean it up

* unit test for check_directory_writing_capability on tempdir

* unit test for check_directory_writing_capability on tempdir

* unit test for check_directory_writing_capability on tempdir

* unit test for check_directory_writing_capability on tempdir

* unit test for check_directory_writing_capability on tempdir

* Update sabnzbd/filesystem.py

Co-authored-by: Safihre <safihre@sabnzbd.org>

* feedback processed

* feedback processed

* feedback processed

* Merge remote-tracking branch 'origin/check_filesystem_capabilty' into check_filesystem_capabilty

# Conflicts:
#	sabnzbd/filesystem.py

* typo: uniformed on "writable"

Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-05-11 19:40:19 +02:00
Safihre
d62d006398 Do not show extrapar files twice in get_files API-call
Regression from the removal of QNFO tuples.
2022-05-11 14:17:03 +02:00
Safihre
dadf1bdcc1 Use orjson with fallback to ujson/json 2022-05-10 15:04:30 +02:00
pyup.io bot
da961b7722 Scheduled weekly dependency update for week 19 (#2174)
* Update cryptography from 37.0.1 to 37.0.2

* Update cryptography from 37.0.1 to 37.0.2

* Update more-itertools from 8.12.0 to 8.13.0
2022-05-10 03:14:53 +02:00
SABnzbd Automation
087326ed32 Update translatable texts 2022-05-06 18:59:46 +00:00
Safihre
fc9f66e3e2 Update test_par2file 2022-05-06 20:59:02 +02:00
Safihre
cb25e0dcb3 Add test to see if every option has a Wiki-entry
Maybe annoying, but needed.
2022-05-05 12:54:09 +02:00
Safihre
88da458c2b Allow multiple parameters to be passed to par2cmdline/Multipar
Closes #2172
2022-05-05 08:39:09 +02:00
SABnzbd Automation
705b3aa74e Update translatable texts 2022-05-04 14:30:21 +00:00
Safihre
f35bfa45db Update text files for 3.6.0Beta6 2022-05-04 16:29:09 +02:00
SABnzbd Automation
cc59037fbc Update translatable texts 2022-05-04 11:44:09 +00:00
Safihre
1c442128dd Small changes to osxmenu 2022-05-04 13:40:25 +02:00
Safihre
d70d8d34dc Delay in test_adding_nzbs_nzoids to allow transition to History 2022-05-03 09:30:14 +02:00
Safihre
2c972995d3 UnRar on Windows escapes quotes by double quoting them 2022-05-03 09:30:14 +02:00
Safihre
794f6239bb Pyup/scheduled update 2022 05 02 (#2168)
* Update cryptography from 36.0.2 to 37.0.1

* Update cryptography from 36.0.2 to 37.0.1

* Update wrapt from 1.14.0 to 1.14.1

* Update pywin32 from 303 to 304

Co-authored-by: pyup-bot <github-bot@pyup.io>
2022-05-03 08:46:31 +02:00
SABnzbd Automation
5f498c3bb1 Update translatable texts 2022-05-02 10:52:58 +00:00
Safihre
8efce7430f Refactor queue-API data collection and XML output changes 2022-05-02 12:51:56 +02:00
SABnzbd Automation
fa3bf93464 Update translatable texts 2022-04-28 20:12:24 +00:00
Safihre
ff1f0986cf Remove "eta" API-fields from main queue and slots
Please let me know if this is a problem.
2022-04-28 22:11:33 +02:00
SABnzbd Automation
a1601a0c1f Update translatable texts 2022-04-28 20:03:12 +00:00
Safihre
2f457c2721 Remove unused texts from skintext and add test for it 2022-04-28 22:02:31 +02:00
Safihre
02c9d0d387 Keep nzo.md5packs for backwards compatibility 2022-04-28 20:18:31 +02:00
Safihre
9b002fe568 Set minval for num_simd_decoders 2022-04-28 20:15:53 +02:00
Safihre
73ec5df88d Move test_adding_nzbs_nzoids to separate module to have a clean instance 2022-04-28 11:08:50 +02:00
Safihre
82e0635995 Previous tests could break nzo_ids test 2022-04-27 14:30:53 +02:00
SABnzbd Automation
da0ff7be27 Update translatable texts 2022-04-27 06:54:31 +00:00
Safihre
569260b396 Update text files for 3.6.0Beta4 2022-04-27 08:53:32 +02:00
Safihre
bbce0afbf4 Add tests for correct nzo_ids on failed NZBs 2022-04-26 16:00:08 +02:00
Safihre
33022d82c4 Remove undocumented "xcat" API-option 2022-04-26 12:44:43 +02:00
Safihre
a7c29fa317 Refactor NZB rejection, no nzo_ids were returned for Fail to history
See: https://forums.sabnzbd.org/viewtopic.php?p=127386
2022-04-26 12:36:46 +02:00
Safihre
8974944044 Make sure duplicate md5of16k hashes are not used in Quick-check 2022-04-26 08:34:19 +02:00
pyup.io bot
60c86a45da Scheduled weekly dependency update for week 17 (#2163)
* Update pyinstaller from 5.0 to 5.0.1

* Update pyobjc from 8.4.1 to 8.5
2022-04-26 07:09:56 +02:00
Safihre
92883f313a Improve new Quick-check implementation
We only care about missing/broken articles in files that we have par2 for. So we check for each NZF if it has bad articles, and only fail if it is part of a par2 set. Additionally we check if the file size matches the one from par2.

Since this also enables CRC check for sabyenc3, it will be slower and the default of num_simd_decoders is increased to 2.
2022-04-25 13:45:49 +02:00
Safihre
ce4524e2bb Do not show traceback when getipaddress functions timeout 2022-04-21 11:26:17 +02:00
SABnzbd Automation
fdf4242a6c Update translatable texts 2022-04-20 23:44:32 +00:00
Safihre
e44c603ba7 Interface did not default correctly to Glitter - Auto 2022-04-21 01:43:44 +02:00
Safihre
1f30714e17 Move Black to CI Test workflow 2022-04-19 09:43:05 +02:00
SABnzbd Automation
36f32f518f Update translatable texts 2022-04-19 07:39:29 +00:00
Safihre
bdbd02fa0b Warn in case there are no valid servers
https://forums.sabnzbd.org/viewtopic.php?p=127310
2022-04-19 09:38:42 +02:00
pyup.io bot
0a1e018144 Scheduled weekly dependency update for week 16 (#2159)
* Update pyinstaller from 4.10 to 5.0

* Update pyinstaller-hooks-contrib from 2022.3 to 2022.4
2022-04-19 06:38:02 +02:00
dependabot[bot]
601649e028 Bump stefanzweifel/git-auto-commit-action from 4.14.0 to 4.14.1 (#2157)
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4.14.0 to 4.14.1.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.14.0...v4.14.1)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-18 15:29:28 +02:00
Sander
7c17dc64c9 Solve traceback and failing GUI when unknown language setting sabnzbd.ini (#2156)
* solve traceback and failing GUI when unknown langauge setting in sabnzbd.ini

* make black happy

* make black happy
2022-04-16 22:17:37 +02:00
SABnzbd Automation
647f04b6f0 Update translatable texts 2022-04-14 11:08:25 +00:00
Safihre
c2102c38f3 Update text files for 3.6.0Beta4 2022-04-14 13:07:45 +02:00
Safihre
6c82e47d32 Add black to test requirements
Not really, but still needed.
2022-04-14 09:53:27 +02:00
Safihre
b53529614e Note that SABnzbd also works with pre-Rust cryptography
Closes #2155
2022-04-14 08:59:03 +02:00
thezoggy
2a25c201a7 Fix category script typeahead alignment (#2153) 2022-04-12 20:41:29 +02:00
Safihre
8f3d5047fc Update test_par2file.py
Update test_par2file.py
2022-04-12 17:02:59 +02:00
Safihre
6a08b5b71b Implement new style Quick-check 2022-04-12 17:02:59 +02:00
Safihre
c08715614a Revert "Use multiple Assemblers in case SIMD is available" 2022-04-12 17:02:59 +02:00
Safihre
ea2b130b57 Mark functional download tests as flaky 2022-04-12 14:33:25 +02:00
Safihre
daa3b25822 Update setuptools from 62.0.0 to 62.1.0 (#2149)
Co-authored-by: pyup-bot <github-bot@pyup.io>
2022-04-12 08:58:42 +02:00
dependabot[bot]
0184e8de2f Bump actions/upload-artifact from 2 to 3 (#2147)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 12:39:36 +02:00
SABnzbd Automation
eec59252f6 Update translatable texts 2022-04-10 09:51:37 +00:00
Safihre
2b7f8fb1c9 Move assembler steps in separate function 2022-04-10 10:46:00 +02:00
SABnzbd Automation
345a37d024 Update translatable texts 2022-04-08 18:56:07 +00:00
Safihre
5f04211c58 Update text files for 3.6.0Beta3 2022-04-08 20:51:10 +02:00
Safihre
80b679e9dc Use multiple Assemblers in case SIMD is available 2022-04-08 18:15:18 +02:00
SABnzbd Automation
e9ecf39d54 Update translatable texts 2022-04-07 20:14:46 +00:00
Safihre
c5a022958c Remove additional unused translations and functions 2022-04-07 22:05:26 +02:00
SABnzbd Automation
97abbafbe9 Update translatable texts 2022-04-07 19:54:51 +00:00
Safihre
776b0367a5 Remove Indexer Integration
Closes #2118
Closes #1317
2022-04-07 21:54:12 +02:00
Safihre
c6822fc4f5 Remove included Deobfuscate.py as it is outdated 2022-04-05 09:48:15 +02:00
SABnzbd Automation
a2f10b5416 Update translatable texts 2022-04-05 07:18:41 +00:00
pyup.io bot
4ea7ce7138 Scheduled weekly dependency update for week 14 (#2141)
* Update pyinstaller-hooks-contrib from 2022.2 to 2022.3

* Update setuptools from 60.10.0 to 62.0.0

* Update cheetah3 from 3.2.6.post1 to 3.2.6.post2

* Stop Cheetah3 updates

Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-04-05 09:18:01 +02:00
SABnzbd Automation
ab9842b599 Update translatable texts 2022-04-04 19:44:52 +00:00
Safihre
7bba292f46 Only allow .zip files in Backup-file-picker 2022-04-04 21:44:08 +02:00
SABnzbd Automation
867bbd5326 Update translatable texts 2022-04-01 07:56:54 +00:00
Safihre
2690f26300 Update text files for 3.6.0Beta2 2022-04-01 09:55:42 +02:00
Safihre
b514c81015 Update sabyenc3 to 5.1.6 2022-03-30 23:19:43 +02:00
Safihre
cd75d5acd3 Only handle par2 files that could be parsed
Closes #2132
2022-03-30 23:04:54 +02:00
Safihre
b9a60f598c Also use lower_case_ext validator for quick_check_ext_ignore 2022-03-30 22:59:42 +02:00
Safihre
7b39578461 Use new extension validator and rename ext_rename_ignore
Closes #2139
2022-03-30 22:51:17 +02:00
Sander
8934c29617 User defined extensions (#2135)
* checkdir: is_writable(check_dir: str) -> bool

* user can define well known extensions

* user can define well known extensions

* user can define well known extensions

* user can define well known extensions

* user can define well known extensions

* user can define well known extensions

* user can define well known extensions

* unit-test

* unit-test

* unit-test

* based on feedback

* introduce validation=lower_case_extensions_without_dot to get clean extensions

* introduce validation=lower_case_extensions_without_dot to get clean extensions

* introduce validation=lower_case_extensions_without_dot to get clean extensions
2022-03-30 15:38:07 +02:00
Safihre
dbaed5c8ed Fix werkzeug version due to problem with httpbin 2022-03-28 22:46:54 +02:00
Safihre
5a091d55a6 Make sure all unpack_info messages are strings
Closes #2134
2022-03-26 20:01:38 +01:00
Safihre
a28d7ecfab Update macOS release Python to 3.10.4 2022-03-25 10:53:22 +01:00
Safihre
7dea433f52 Revert cheetah3 to 3.2.6.post1
Closes #2133
2022-03-25 10:07:18 +01:00
Safihre
80a2ffdead Do not put partial NZF in Assembler queue if it's already there 2022-03-23 11:03:02 +01:00
pyup.io bot
e4b5d937d7 Scheduled weekly dependency update for week 12 (#2131)
* Update cryptography from 36.0.1 to 36.0.2

* Update cheetah3 from 3.2.6 to 3.2.6.post2
2022-03-22 11:27:30 +01:00
dependabot[bot]
5806f816b8 Bump setuptools from 60.9.3 to 60.10.0 (#2126)
Bumps [setuptools](https://github.com/pypa/setuptools) from 60.9.3 to 60.10.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v60.9.3...v60.10.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 15:48:03 +01:00
dependabot[bot]
385928c6e5 Bump pyobjc from 8.4 to 8.4.1 (#2125)
Bumps [pyobjc](https://github.com/ronaldoussoren/pyobjc) from 8.4 to 8.4.1.
- [Release notes](https://github.com/ronaldoussoren/pyobjc/releases)
- [Changelog](https://github.com/ronaldoussoren/pyobjc/blob/master/docs/changelog.rst)
- [Commits](https://github.com/ronaldoussoren/pyobjc/compare/v8.4...v8.4.1)

---
updated-dependencies:
- dependency-name: pyobjc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 15:47:55 +01:00
dependabot[bot]
3e1654356d Bump pytz from 2021.3 to 2022.1 (#2124)
Bumps [pytz](https://github.com/stub42/pytz) from 2021.3 to 2022.1.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](https://github.com/stub42/pytz/compare/release_2021.3...release_2022.1)

---
updated-dependencies:
- dependency-name: pytz
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 15:47:48 +01:00
dependabot[bot]
def4d596dc Bump macholib from 1.15.2 to 1.16 (#2123)
Bumps [macholib](https://github.com/ronaldoussoren/macholib) from 1.15.2 to 1.16.
- [Release notes](https://github.com/ronaldoussoren/macholib/releases)
- [Changelog](https://github.com/ronaldoussoren/macholib/blob/master/doc/changelog.rst)
- [Commits](https://github.com/ronaldoussoren/macholib/commits/v1.16)

---
updated-dependencies:
- dependency-name: macholib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 15:47:38 +01:00
dependabot[bot]
a239039a89 Bump cryptography from 36.0.1 to 36.0.2 (#2122)
Bumps [cryptography](https://github.com/pyca/cryptography) from 36.0.1 to 36.0.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/36.0.1...36.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 15:47:00 +01:00
Safihre
1a71265354 Further update pyup.yml 2022-03-21 12:53:41 +01:00
pyup.io bot
9a3a3b0868 Config file for pyup.io (#2130)
* create pyup.io config file

* Update pyup

* Remove dependabot

Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-03-21 12:49:05 +01:00
dependabot[bot]
b0a109bd0d Bump actions/cache from 2 to 3 (#2127)
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 12:05:32 +01:00
dependabot[bot]
525d10c0ae Bump stefanzweifel/git-auto-commit-action from 4.13.1 to 4.14.0 (#2128)
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4.13.1 to 4.14.0.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.13.1...v4.14.0)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 12:02:57 +01:00
SABnzbd Automation
8de65d48f3 Update translatable texts 2022-03-18 18:01:01 +00:00
Safihre
a5f21c764c Update text files for 3.6.0Beta1 2022-03-18 18:59:46 +01:00
Safihre
1e4e18e51d Correct refactor mistakes 2022-03-18 18:52:46 +01:00
SABnzbd Automation
281921ec59 Update translatable texts 2022-03-17 11:10:49 +00:00
Safihre
c10efcbf4c Update handling of errors in servertest
Many errors were just thrown on 1 big pile and even connection-errors were accepted as success because all 4xx codes were accepted.
2022-03-17 12:10:04 +01:00
Safihre
661ab24d6f NNTPLib wil be removed in future version of Python 2022-03-17 11:20:02 +01:00
Safihre
4bf33f5a0a Bump sabyenc3 to 5.1.2
See https://github.com/sabnzbd/sabyenc/issues/33
2022-03-16 15:55:30 +01:00
SABnzbd Automation
b256e086c7 Update translatable texts 2022-03-16 10:05:52 +00:00
jcfp
a9470ae959 Ensure sufficient available blocks remain if add_parfile fails (#2119)
* ensure sufficient available blocks remain if add_parfile fails

* replace while loop, drop use of pop()
2022-03-16 11:05:14 +01:00
SABnzbd Automation
100018d6bf Update translatable texts 2022-03-16 08:53:31 +00:00
SABnzbd Automation
7719513c72 Update translatable texts 2022-03-15 20:58:27 +00:00
Safihre
970703671d Revert "Update translatable texts"
This reverts commit 1ffdd53629.
2022-03-15 21:57:45 +01:00
Safihre
6d3a4a391c Catch all sabyenc3 import exceptions 2022-03-15 21:52:30 +01:00
SABnzbd Automation
9838c6a05c Update translatable texts 2022-03-15 20:49:49 +00:00
Safihre
5744b1ae98 Revert "Remove Prowl/Pushover/Pushbullet support"
This reverts commit 97f91e734a.
See #2093
2022-03-15 20:52:51 +01:00
Safihre
879af8744d Reduce default number of decoders now that we have SIMD 2022-03-14 20:34:06 +01:00
Safihre
640f941180 Remove unused truncatedText 2022-03-14 20:15:53 +01:00
Safihre
a48d8b8f6a Catch all errors during startup in test_sab_binary
We can wait 10 seconds in case something is wrong.
2022-03-14 16:43:42 +01:00
Safihre
20d92bf36b Ask for feedback about Indexer Integration
See #2118
2022-03-14 16:40:44 +01:00
Safihre
7f2ab5d629 Remove cache_max, refresh_rate, rating_enable from queue API-call
They are not queue related information
2022-03-14 16:26:35 +01:00
Safihre
bb46b474c3 Small API cleanup 2022-03-14 16:08:05 +01:00
Safihre
5a3e8836e0 Report SIMD set as part of the CPU information 2022-03-14 15:37:30 +01:00
Safihre
e100c4ce7f Correct highlight of pop-up tabs 2022-03-14 13:19:02 +01:00
dependabot[bot]
32b3db80d8 Bump pyobjc from 8.3 to 8.4
Bumps [pyobjc](https://github.com/ronaldoussoren/pyobjc) from 8.3 to 8.4.
- [Release notes](https://github.com/ronaldoussoren/pyobjc/releases)
- [Changelog](https://github.com/ronaldoussoren/pyobjc/blob/master/docs/changelog.rst)
- [Commits](https://github.com/ronaldoussoren/pyobjc/compare/v8.3...v8.4)

---
updated-dependencies:
- dependency-name: pyobjc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-14 11:48:53 +01:00
dependabot[bot]
7ac24e69c4 Bump wrapt from 1.13.3 to 1.14.0
Bumps [wrapt](https://github.com/GrahamDumpleton/wrapt) from 1.13.3 to 1.14.0.
- [Release notes](https://github.com/GrahamDumpleton/wrapt/releases)
- [Changelog](https://github.com/GrahamDumpleton/wrapt/blob/develop/docs/changes.rst)
- [Commits](https://github.com/GrahamDumpleton/wrapt/compare/1.13.3...1.14.0)

---
updated-dependencies:
- dependency-name: wrapt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-14 11:41:59 +01:00
dependabot[bot]
80f2a5476e Bump sabyenc3 from 5.1.0 to 5.1.1
Bumps [sabyenc3](https://github.com/sabnzbd/sabyenc) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/sabnzbd/sabyenc/releases)
- [Commits](https://github.com/sabnzbd/sabyenc/compare/v5.1.0...v5.1.1)

---
updated-dependencies:
- dependency-name: sabyenc3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-14 11:41:51 +01:00
Safihre
d27237832e Prevent stall when decoder/assembler queues are full 2022-03-14 08:21:41 +01:00
SABnzbd Automation
73a3ce9889 Update translatable texts 2022-03-13 14:18:02 +00:00
Safihre
ff66b8ec01 Show in the status window why download speed was limited
Set to show if >5 times. Arbitrary number, might change in future.
2022-03-13 15:17:25 +01:00
Safihre
d632084c58 Update URL's to wiki pages 2022-03-13 13:14:57 +01:00
Safihre
4257ff3e67 Forgot to update SABYENC_VERSION_REQUIRED 2022-03-10 17:17:42 +01:00
Safihre
72ca0a6ef7 Update sabyenc3 to 5.1.0 2022-03-10 15:48:52 +01:00
Safihre
5b361a6a2e Jobs waiting to fetch get stuck indefinitely upon restart
Closes #2114
2022-03-10 13:40:02 +01:00
Safihre
40d3a69b1c Prevent Direct Unpack proceeding faster than it should, locking files
Relates to #2113
2022-03-10 13:40:02 +01:00
Safihre
0cc618e1b2 Revert "Revert "Disable buffering when writing files in assembler""
This reverts commit de4ca8e55c.

Turns out not to be the case, see #2113
2022-03-10 13:40:02 +01:00
Safihre
0ee04ada31 Log also the OSError.winerror just to be sure 2022-03-10 08:25:16 +01:00
Safihre
807b1c64dd Update MultiPar to v1.3.2.3
Closes #2097
2022-03-08 10:25:49 +01:00
Safihre
690aad123c No longer build sabyenc3 from sources for the release 2022-03-08 08:40:17 +01:00
Safihre
73b6a3159f Allow longer build timeouts
Especially on macOS this can be really slow on busy days.
2022-03-08 08:37:45 +01:00
Safihre
73e8a18d5a Force codesign_identity to None if not set 2022-03-07 21:48:45 +01:00
dependabot[bot]
e613dda536 Bump pyinstaller from 4.9 to 4.10
Bumps [pyinstaller](https://github.com/pyinstaller/pyinstaller) from 4.9 to 4.10.
- [Release notes](https://github.com/pyinstaller/pyinstaller/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller/blob/v4.10/doc/CHANGES.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller/compare/v4.9...v4.10)

---
updated-dependencies:
- dependency-name: pyinstaller
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 21:48:45 +01:00
dependabot[bot]
2621b90d3b Bump actions/checkout from 2 to 3 (#2110)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-07 21:19:37 +01:00
Sander
9e95736b48 In case of sabyenc version mismatch, log the sabyenc file used, to help debugging (#2108) 2022-03-04 17:50:06 +01:00
Safihre
de4ca8e55c Revert "Disable buffering when writing files in assembler"
This reverts commit 3c3aeac93c.

It turns out this causes problems!
2022-03-03 15:44:06 +01:00
Safihre
f4247e0361 Use 1 shared ThreadPoolExecutor instead of ThreadPool (#2103)
See #2103
2022-03-02 10:04:29 +01:00
Safihre
d9df7b66f5 Sign files before handing them over to PyInstaller 2022-03-01 17:38:50 +01:00
Safihre
c5feb5bdc9 Revert "Let PyInstaller sign the macOS executable and the app" 2022-03-01 15:54:29 +01:00
Safihre
ee170d2f51 Update SABYenc to 5.0.1 2022-03-01 14:58:04 +01:00
dependabot[bot]
eea6d07613 Bump actions/setup-python from 2 to 3 (#2101)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 3.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-01 14:37:26 +01:00
dependabot[bot]
4a9a26d470 Bump stefanzweifel/git-auto-commit-action from 4.5.1 to 4.13.1 (#2100)
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4.5.1 to 4.13.1.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.5.1...v4.13.1)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-01 14:37:17 +01:00
Safihre
f949487a75 Add dependabot for GitHub Actions 2022-03-01 14:21:15 +01:00
Safihre
d7572c5772 RSS filters At most/least were broken 2022-03-01 08:42:14 +01:00
dependabot[bot]
74e3bbb83b Bump pyobjc from 8.1 to 8.3 (#2099)
Bumps [pyobjc](https://github.com/ronaldoussoren/pyobjc) from 8.1 to 8.3.
- [Release notes](https://github.com/ronaldoussoren/pyobjc/releases)
- [Changelog](https://github.com/ronaldoussoren/pyobjc/blob/master/docs/changelog.rst)
- [Commits](https://github.com/ronaldoussoren/pyobjc/commits/v8.3)

---
updated-dependencies:
- dependency-name: pyobjc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-28 13:01:07 +01:00
Sander
adaa4cade5 SAB wizard: get_access_info() more robust with try-except (#2090) 2022-02-28 13:00:29 +01:00
Safihre
09e670bce4 Try to fix the functional tests 2022-02-28 12:17:49 +01:00
SABnzbd Automation
d6b601968d Update translatable texts 2022-02-25 22:14:32 +00:00
Safihre
f07db641d4 Set version to 3.6.0-develop and make sure we keep it correct
Relates to Sonarr/Sonarr/4912
Closes sabnzbd/sabnzbd/2095
2022-02-25 23:13:39 +01:00
SABnzbd Automation
1ffdd53629 Update translatable texts 2022-02-24 15:37:29 +00:00
Safihre
97f91e734a Remove Prowl/Pushover/Pushbullet support
Closes #2093
2022-02-24 16:35:37 +01:00
Christopher Kreft
4eee13ac02 #2089 - try to fix build/stage packages for arm64/armhf (#2094)
* #2089 - use snapcraft-preload to rewrite the /dev/shm path dynamically

* #2089 - try to fix build/stage packages for arm64/armhf
2022-02-22 14:50:43 +01:00
Christopher Kreft
5869022a28 #2089 - use snapcraft-preload to rewrite the /dev/shm path dynamically (#2092) 2022-02-22 12:47:24 +01:00
Safihre
19e77590f3 Make sure all extrapars and md5packs are unique
Closes #2084
2022-02-21 11:56:23 +01:00
dependabot[bot]
bc790275aa Bump setuptools from 60.9.0 to 60.9.3 (#2087)
Bumps [setuptools](https://github.com/pypa/setuptools) from 60.9.0 to 60.9.3.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v60.9.0...v60.9.3)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 11:46:38 +01:00
dependabot[bot]
1c35cd9d65 Bump pyinstaller-hooks-contrib from 2022.1 to 2022.2 (#2086)
Bumps [pyinstaller-hooks-contrib](https://github.com/pyinstaller/pyinstaller-hooks-contrib) from 2022.1 to 2022.2.
- [Release notes](https://github.com/pyinstaller/pyinstaller-hooks-contrib/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller-hooks-contrib/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller-hooks-contrib/compare/2022.1...2022.2)

---
updated-dependencies:
- dependency-name: pyinstaller-hooks-contrib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 11:29:02 +01:00
Safihre
d6dd8da81e Prevent crash due to get_formatted_stats returning int 2022-02-20 19:26:39 +01:00
Safihre
d55b23c482 Multiset-unpack with partial failure should correctly be reported
Relates to #2084
2022-02-20 11:05:10 +01:00
Safihre
f95f83c85b Allow longer timeouts for status update
Closes #2066
2022-02-16 16:46:54 +01:00
Safihre
f0fa67d16d Add Debug logging when applying permissions failed 2022-02-16 13:08:50 +01:00
Safihre
89756b7c9e Allow chmod failures if no custom permissions are set
This is the same as before 3.5.0!
2022-02-16 10:38:07 +01:00
Safihre
5f9693cb34 Perform the internetspeed measure in separate thread 2022-02-15 15:37:05 +01:00
Safihre
2856f3af8c Use 1 ThreadPool for all timeout_decorators 2022-02-15 15:05:34 +01:00
Safihre
e7b1db8b09 Prevent logging performance/network measures twice 2022-02-15 10:39:53 +01:00
Sander
48c3a84b85 Logging of performance measurements (#2071)
* logging.debug of all performance measurements

* logging.debug of all performance measurements

* logging.debug of all performance measurements

* logging.debug of all performance measurements

* black black black

* internetspeed ... logging.debug start & done

* internetspeed ... back to total 8 seconds, plus a Note in comments

* no more logging "starting ..."

* change the Note a bit

* internetspeed: correct seconds, and Note

* SAB-standard wording. Plus meausurement of duration, where possibly relevant

* SAB-standard wording. Plus meausurement of duration, where possibly relevant

* shorter variable name for disk writing MB per sec

* shorter variable name for disk writing MB per sec
2022-02-14 21:30:30 +01:00
Safihre
eca3705794 Let PyInstaller sign the macOS executable and the app
It signs the binaries anyway, so let it do it properly.
Verify signature applied by PyInstaller
2022-02-14 15:38:26 +01:00
dependabot[bot]
74fd17d7ac Bump charset-normalizer from 2.0.11 to 2.0.12 (#2077)
Bumps [charset-normalizer](https://github.com/ousret/charset_normalizer) from 2.0.11 to 2.0.12.
- [Release notes](https://github.com/ousret/charset_normalizer/releases)
- [Changelog](https://github.com/Ousret/charset_normalizer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ousret/charset_normalizer/compare/2.0.11...2.0.12)

---
updated-dependencies:
- dependency-name: charset-normalizer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 12:55:33 +01:00
dependabot[bot]
35cbf0ebb4 Bump setuptools from 60.8.1 to 60.9.0 (#2078)
Bumps [setuptools](https://github.com/pypa/setuptools) from 60.8.1 to 60.9.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v60.8.1...v60.9.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 12:55:21 +01:00
dependabot[bot]
2eb8b8e2b2 Bump puremagic from 1.11 to 1.12 (#2076)
Bumps [puremagic](https://github.com/cdgriffith/puremagic) from 1.11 to 1.12.
- [Release notes](https://github.com/cdgriffith/puremagic/releases)
- [Changelog](https://github.com/cdgriffith/puremagic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cdgriffith/puremagic/compare/1.11...1.12)

---
updated-dependencies:
- dependency-name: puremagic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 12:54:52 +01:00
dependabot[bot]
883596d1d7 Bump pyinstaller-hooks-contrib from 2022.0 to 2022.1 (#2079)
Bumps [pyinstaller-hooks-contrib](https://github.com/pyinstaller/pyinstaller-hooks-contrib) from 2022.0 to 2022.1.
- [Release notes](https://github.com/pyinstaller/pyinstaller-hooks-contrib/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller-hooks-contrib/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller-hooks-contrib/compare/2022.0...2022.1)

---
updated-dependencies:
- dependency-name: pyinstaller-hooks-contrib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 12:54:29 +01:00
Wolfgang Scherer
698487377b Do not fail if attribute subject is missing in NZB file-section (#2075)
* Use attribute poster of file element, if attribute subject ist missing

* Don't fail, if subject is missing.

* Textual change

Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-02-14 09:15:53 +01:00
jcfp
c3d826df8c set log level of "completed not on fat" to debug 2022-02-10 12:47:19 +01:00
Safihre
d5536ed246 Wait before removing the temporary directory in binary test 2022-02-09 13:05:20 +01:00
Safihre
df077f8ef6 Add small delay to test_download check of result file
To prevent zip-test-failures on Windows.
2022-02-09 12:55:04 +01:00
Safihre
4293a098e3 Fix version of more dependencies 2022-02-09 08:52:12 +01:00
SABnzbd Automation
cf07260186 Update translatable texts 2022-02-07 14:28:21 +00:00
Safihre
9ad5bd477b Correctly handle the transition from download to active post-processing 2022-02-07 15:27:43 +01:00
Safihre
1d2c1dbc6f Restore correct display of Direct Unpack progress 2022-02-07 15:12:13 +01:00
Safihre
8c44c5b79a Correct mistake in 171f04 2022-02-07 11:57:34 +01:00
dependabot[bot]
0c84eb3dd0 Bump pyinstaller from 4.8 to 4.9 in /builder
Bumps [pyinstaller](https://github.com/pyinstaller/pyinstaller) from 4.8 to 4.9.
- [Release notes](https://github.com/pyinstaller/pyinstaller/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller/blob/v4.9/doc/CHANGES.rst)
- [Commits](https://github.com/pyinstaller/pyinstaller/compare/v4.8...v4.9)

---
updated-dependencies:
- dependency-name: pyinstaller
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 11:51:01 +01:00
dependabot[bot]
869792c09e Bump setuptools from 60.6.0 to 60.8.1 in /builder
Bumps [setuptools](https://github.com/pypa/setuptools) from 60.6.0 to 60.8.1.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v60.6.0...v60.8.1)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 11:50:51 +01:00
Safihre
09ab158d66 Prevent Direct Unpack crash on obfuscated posts
Closes #2060
2022-02-07 11:49:57 +01:00
Safihre
f539a8ccda Dependabot update config
It will pick up sub-directories automatically
2022-02-07 11:33:16 +01:00
Safihre
171f049607 Use nzo.deleted instead of nzo.is_gone to prevent assembly during pp
Relates to #2059, #2054 and #1509.
2022-02-07 10:37:28 +01:00
Safihre
43e47e6249 Correct undefined function remove_data 2022-02-05 09:51:45 +01:00
Safihre
afbfe72489 Use notarytool on macOS to do notarization 2022-02-04 22:28:04 +01:00
Safihre
59d042c9a7 Test starting of binary during release building 2022-02-04 21:46:09 +01:00
Safihre
38a613de45 Pin even more requirements
Closes #2056
2022-02-04 10:09:32 +01:00
Safihre
1c27ebc1e4 Add unittests for case where api_warnings is disabled 2022-01-31 10:22:49 +01:00
Safihre
6f1d8a99e7 Do not return access denied message when api_warnings is disabled
Closes #2029
2022-01-31 10:13:07 +01:00
Safihre
8c9e5b4963 Add small delay between volumes in Direct Unpack to prevent UnRar error 2022-01-31 09:23:39 +01:00
Safihre
3c3aeac93c Disable buffering when writing files in assembler 2022-01-30 10:51:48 +01:00
Safihre
846c2761f6 Fix dependencies in requirements.txt and configure dependabot 2022-01-30 09:59:50 +01:00
Safihre
d03eabe4d5 Black formatting update 2022-01-30 09:25:54 +01:00
Safihre
cad9be6e74 RSS feeds with HTML-chars in the feed name would result in crash 2022-01-28 12:36:14 +01:00
SABnzbd Automation
dbb166e94f Update translatable texts 2022-01-28 11:06:30 +00:00
Safihre
6b92922ee5 Test using separate par2 libomp.dylib 2022-01-28 12:05:57 +01:00
Safihre
479431b283 Add M1 (arm64) versions of unrar 6.10 and par2cmdline 0.8.1 2022-01-28 12:05:57 +01:00
Safihre
2ab1a27f8b Update 7zip to 21.07, including universal2 version for macOS 2022-01-28 12:05:57 +01:00
Safihre
8470e61e3f Reduce par2cmdline output log in Debug mode 2022-01-26 16:36:23 +01:00
Safihre
6c6c8c86d8 Rename DARWIN constant to MACOS 2022-01-25 13:44:51 +01:00
SABnzbd Automation
efab6ee229 Update translatable texts 2022-01-25 07:15:06 +00:00
jcfp
72a1173615 add appstream metadata, sample desktop and mimeinfo files (#2040)
* add appstream metadata, sample desktop and mimeinfo files

* remove overlooked plus
2022-01-25 08:14:32 +01:00
Safihre
1dfa3a64a7 Cache whole vitualenv for CI and release building 2022-01-24 14:31:42 +01:00
Safihre
7b36396570 Do not trigger keyboard shortcuts if the user pressed keycombos 2022-01-23 15:00:54 +01:00
Safihre
c1a8470dcf Handle early NNTP 500 Access Denied
Closes #2033
Closes #2034
Removed old code for some attack that could still happen on the regular connect.
2022-01-23 13:54:21 +01:00
Safihre
ba0d9ac834 Do not trigger keyboard shortcuts if the user is typing in text field 2022-01-23 13:27:06 +01:00
SABnzbd Automation
56d0feab12 Update translatable texts 2022-01-22 16:27:12 +00:00
Sven
0674737796 Add keyboard shortcuts (#2031)
* Add keybinds

* Change quote style to match codebase

* Store keyboard binding setting in config

Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-01-22 17:26:45 +01:00
SABnzbd Automation
58b632b6c6 Update translatable texts 2022-01-22 16:26:31 +00:00
Safihre
43f3e13491 Prevent extra error when no 7zip is available
Closes #2036, #2035
2022-01-22 17:25:48 +01:00
SABnzbd Automation
7b69060776 Update translatable texts 2022-01-22 08:51:38 +00:00
puzzledsab
75f6cc7f0f Backup and restore admin data (#2023)
* Backup and restore admin data

* Don't import archives containing subpaths

* Show result after uploading

* Use existing upload system and fixed list of admin files

* Fix confusing order of code lines

* Add translations and link from wizard

* Refactoring, change some names and move some code to sabnzbd.config

* Remove unused imports

* Remove queue and scan databases from backup

* Style changes

* Code changes

* Add tests and don't crash if any admin files are missing

* Cleanup

* Small changes and rebase on develop

Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-01-22 09:51:01 +01:00
Safihre
8ef8200363 Set Python for macOS release to 3.10.2 2022-01-21 16:53:15 +01:00
Safihre
8b31c38229 Cache pip packages in Github Actions 2022-01-21 16:45:14 +01:00
Safihre
651591a063 Correctly implement skipping duplicate check if the job is forced
Closes #2032
2022-01-21 16:39:08 +01:00
SABnzbd Automation
c86b3c972b Update translatable texts 2022-01-20 09:52:21 +00:00
Safihre
7529297151 Pass nzo to deobfuscate.deobfuscate
Closes #2030
2022-01-20 10:51:34 +01:00
Safihre
2c411e343d Only build 32bit release when we are creating a full release 2022-01-19 17:22:39 +01:00
Safihre
e9d8f6aebd Skip duplicate check for downloads with Force-priority
Closes #2002
2022-01-19 13:06:49 +01:00
SABnzbd Automation
d144582f1c Update translatable texts 2022-01-19 10:14:36 +00:00
Safihre
2d3e703979 List Deobfuscate result in history 2022-01-19 11:12:24 +01:00
SABnzbd Automation
af440ffffa Update translatable texts 2022-01-19 08:32:10 +00:00
Safihre
e129b2df57 Always sanitize config-section name 2022-01-19 09:18:44 +01:00
Safihre
09f2b36920 Style refactor of config.py 2022-01-18 16:39:08 +01:00
Safihre
37af295873 HTML-sanitizer would sanitize the source data
Closes #2026
2022-01-17 14:08:17 +01:00
Safihre
52d21e94d3 Sort sevenset so x.7z.001 is always the first file 2022-01-15 17:09:35 +01:00
Safihre
acd80cc05e Failed 7zip unpack was not reported in the history 2022-01-15 17:04:52 +01:00
Safihre
de48464661 Set version to 3.6.0-develop
Create new wiki-pages later.
2022-01-13 14:56:18 +01:00
Safihre
623cac6220 Use new env-variable to force PyInstaller bootloader from sources 2022-01-13 11:40:26 +01:00
SABnzbd Automation
ad558b4984 Update translatable texts 2022-01-11 10:20:49 +00:00
Safihre
ae0ba59f67 Only update interface settings in the config after fetching them
Closes #2012
2022-01-11 11:19:33 +01:00
Safihre
fd28a8b427 Escape all HTML on template-based pages 2022-01-10 12:14:05 +01:00
Sander
b390e5de98 Do not deobfuscate/rename anything if there is a typical DVD or Bluray directory (#2022)
* Do not deobfuscate/rename anything if there is a typical DVD or Bluray directory

* Do not deobfuscate/rename anything if there is a typical DVD or Bluray directory

* Do not deobfuscate/rename anything if there is a typical DVD or Bluray directory

* Do not deobfuscate/rename anything if there is a typical DVD or Bluray directory

* Do not deobfuscate/rename anything if there is a typical DVD or Bluray directory
2022-01-10 09:26:59 +01:00
Sander
82402abe43 Dont run deobfuscate if dvd or bluray typical directory name (#2020)
* detect DVD/Bluray structure, and do not run deobfuscate on that

* detect DVD/Bluray structure, and do not run deobfuscate on that

* detect DVD/Bluray structure, and do not run deobfuscate on that

* detect DVD/Bluray structure, and do not run deobfuscate on that

* detect IGNORED_MOVIE_FOLDERS in filelist

* detect IGNORED_MOVIE_FOLDERS in filelist

* better code

* better code

* better code

* better code

* better code

* use one-liner

* wording in comment

* unittest for VIDEO_TS

* unittest for VIDEO_TS
2022-01-09 16:25:13 +01:00
SABnzbd Automation
78da7ddb55 Update translatable texts 2022-01-08 13:22:06 +00:00
Safihre
1dd48743c2 Refactor location of functions from __init__ 2022-01-08 14:21:23 +01:00
Safihre
015417d640 Only run macOS universal2-check when running on GitHub or releasing 2022-01-08 13:16:41 +01:00
Safihre
94de00b14c Automatically release latest snap when building a tag 2022-01-08 10:41:45 +01:00
Safihre
4d237c4328 Add unit tests for format_time_left 2022-01-08 09:49:44 +01:00
SABnzbd Automation
b7f721e869 Update translatable texts 2022-01-08 08:46:01 +00:00
Safihre
49ba555fc0 Revert "Change timeleft format from 0:00:00 to 0:00"
Reverts 1d3a922a7b
2022-01-08 09:45:20 +01:00
SABnzbd Automation
cd1b25ec2b Update translatable texts 2022-01-07 08:30:46 +00:00
Safihre
109725fafe Update text files for 3.5.0RC1 2022-01-07 09:29:57 +01:00
Safihre
9c7b61070b Update copyright year to 2022 2022-01-07 09:29:32 +01:00
SABnzbd Automation
8b5a1fef51 Update translatable texts 2022-01-06 21:11:39 +00:00
Safihre
72f8dd5b3a Show an estimated time-left indicator for par2-repair and unrar 2022-01-06 22:10:55 +01:00
Safihre
1d3a922a7b Change timeleft format from 0:00:00 to 0:00 2022-01-06 22:10:55 +01:00
Safihre
ab2b145556 Literal is not supported on Python 3.7 2022-01-06 13:42:52 +01:00
SABnzbd Automation
8960ff5a4d Update translatable texts 2022-01-06 12:10:55 +00:00
Safihre
06b41b1b5a Create directories before moving to new path 2022-01-06 12:53:39 +01:00
Safihre
4277ac65a4 Add ".ssa" as common extension 2022-01-06 12:53:39 +01:00
Safihre
6ed815f1ac Refactor 7zip handling similar to unrar and skip extra join step 2022-01-06 12:53:39 +01:00
Sander
4ebfa6a3d0 more known extensions (#2016)
* more known extensions, based on mime-type extensions

* put NZB detection first
2022-01-06 12:08:08 +01:00
Safihre
529f75467b Multipar does repair broken parts of joinables 2022-01-05 13:43:03 +01:00
Safihre
062895c7ca Catch ValueError for publicipv4 lookup
Closes #2008
2022-01-04 15:13:34 +01:00
SABnzbd Automation
7b174ac498 Update translatable texts 2022-01-04 13:52:51 +00:00
Safihre
beb8f627ee Add unit tests for par2 filejoin 2022-01-04 14:40:44 +01:00
Safihre
1badbaa182 Refactor of postproc and newsunpack functions 2022-01-04 10:47:07 +01:00
Safihre
75f2930f53 Refactor of newsunpacking functions 2022-01-04 10:16:21 +01:00
Safihre
60b746e4dd Refactor par2cmdline processing 2022-01-04 10:16:21 +01:00
Safihre
dbef9af0df Add unit tests for Multipar and par2cmdline processing 2022-01-04 10:16:21 +01:00
SABnzbd Automation
2a5cdf49ad Update translatable texts 2022-01-03 09:44:33 +00:00
Safihre
0bb5432223 Do not apply permissions if not requested by the user, but remove xbits (#2004)
* Do not apply permissions if not requested by the user, but remove xbits

* Verify umask and user-permissions and warn for potential access problems

* Correctly name umask/permissions options

* Apply permissions only on download_dir creation

* Refactor some permissions related actions

* Block setting permissions=0 and only stat when no custom_permissions
2022-01-03 10:43:57 +01:00
SABnzbd Automation
f565a50e90 Update translatable texts 2022-01-01 15:04:17 +00:00
Safihre
0a840228b2 No longer throw warnings/errors during unpacking, only set job status 2022-01-01 16:03:11 +01:00
SABnzbd Automation
37c1964991 Update translatable texts 2022-01-01 14:48:07 +00:00
Sander
f3cd5b06fa 7z password detection relocation (#2009)
* coding style for 7z unpacking

* coding style: better order

* make black happy

* make black happy

* make black happy

* make black happy

* make black happy

* make black happy

* use two standard message so no translations needed

* use two standard message so no translations needed

* setname_from_path(sevenset)

* setname_from_path(sevenset)

* anything ret > 0 is one case
2022-01-01 15:47:33 +01:00
Sander
c735ad5110 to avoid exception when no 7z/7za was found/defined (#2013)
Co-authored-by: SanderJo <sand.e.rjonkers+github@gmail.com>
2022-01-01 10:16:18 +01:00
Graham Morrison
51b27cb002 snap: 7z env and path fix for outdated deb (#2011) 2021-12-31 14:44:12 +01:00
Safihre
0406f1df01 In multi-set fail_msg should only be set for full fail 2021-12-30 14:54:12 +01:00
Safihre
a72401a529 On Retry the number of downloaded bytes could exceed the total bytes 2021-12-30 09:40:40 +01:00
Safihre
406c4d20cf When Retrying a job, finished par2's were still counted as available 2021-12-27 21:54:43 +01:00
SABnzbd Automation
49ef9ae85d Update translatable texts 2021-12-27 14:00:41 +00:00
Safihre
d65eacea41 Correctly parse helpful_warning in extract_pot 2021-12-27 14:59:50 +01:00
SABnzbd Automation
347904297e Update translatable texts 2021-12-27 10:26:41 +00:00
Safihre
404aeb026d Correctly name the helpful_warning function and option
Yes, this will break current users of the old name. Too bad.
2021-12-27 11:25:52 +01:00
Safihre
29df51a4b0 Standardize 7zip version detection 2021-12-27 11:17:55 +01:00
Sander
397cde2be2 bugfix with 7z if ionice is set: command must be a list (#2007) 2021-12-26 22:13:20 +01:00
Sander
a848283d59 Detect another obfuscation pattern (#2005)
* this is obfuscated now: "[BlaBla] something [More] something 5937bc5e32146e.bef89a622e4a23f07b0d3757ad5e8a.a02b264e [Brrr]"

* this is obfuscated now: "[BlaBla] something [More] something 5937bc5e32146e.bef89a622e4a23f07b0d3757ad5e8a.a02b264e [Brrr]"
2021-12-26 17:38:24 +01:00
SABnzbd Automation
80b4582e81 Update translatable texts 2021-12-25 20:08:19 +00:00
Sander
9d5c7d3317 if too little disk space reported by 7z unzipping, report so in GUI (#2000)
* if too little disk space reported by 7z unzipping, report so in GUI

* comment about 7z version needed

* find and print 7z version at startup

* feedback from safihre

* change to existing wording, so no translations needed

* change to existing wording, so no translations needed

* even better wording: re-use existing error message
2021-12-25 21:07:47 +01:00
SABnzbd Automation
b860741ab8 Update translatable texts 2021-12-23 12:50:31 +00:00
Safihre
792825bdaa Update text files for 3.5.0 Beta 3 2021-12-23 13:48:19 +01:00
Graham Morrison
ad2371dc9a snap build fix for snap/snapcraft.yaml (#1998)
* updated snapcraft.yaml.

* snap: updated target builds
2021-12-17 07:45:44 +01:00
Safihre
dfb771a51e Add basic tests of nzbparser 2021-12-16 12:49:16 +01:00
SABnzbd Automation
14a0dbbd5c Update translatable texts 2021-12-16 09:59:55 +00:00
Safihre
bb1c63cc92 Unrar logging of Direct Unpack was not log if it was aborted 2021-12-16 10:58:55 +01:00
Safihre
38ca26e6f3 Basic tests for SevenZip-code 2021-12-12 17:55:42 +01:00
SABnzbd Automation
285d5688f5 Update translatable texts 2021-12-12 14:29:24 +00:00
Safihre
26cdfc2279 Rework adding of NZB's to use filehandlers (#1994)
* Rework adding of NZB's to use filehandlers

* Use zf.open() instead of zf.read()

* Make SevenZip-class compatible with file handler approach

* Do not attempt to overwrite existing admin-NZB

* Reset pointer when checking for incomplete NZB

* No longer check for incomplete NZB

* Refactor of archived NZB handling
2021-12-12 15:28:46 +01:00
Safihre
d915dfc941 NZO URL property was incorrectly filled with filename 2021-12-09 14:55:43 +01:00
puzzledsab
d29bd65f97 Read NZB from file using iterparse (#1992)
* Read XML from file using iterparse

* Ignore XML namespace

* Minor cleanup

* More tweaking

* Small improvements to the NZB-backup process

* Add type-hint and logging of backup

* Don't remove nzo data after failed import

Co-authored-by: Safihre <safihre@sabnzbd.org>
2021-12-08 08:58:30 +01:00
Safihre
81d378498e Automatically retry newswrapper tests 2021-12-06 15:39:30 +01:00
Safihre
d32630c759 Improve stability of the test_newswrapper test 2021-12-03 09:03:43 +01:00
puzzledsab
b8d7ec0723 Add option to preserve paused state after restart (#1990)
* Add option to preserve Downloader run state

* Add updating to set_paused_state

* Restore set_paused_state call

* Messed up again

* Requested changes

* Missed one
2021-12-02 22:09:52 +01:00
Safihre
207c5430c1 Make sure the test-server in test_newswrapper is shut down 2021-12-01 16:35:25 +01:00
Safihre
b922274b61 Update text files for 3.5.0 Beta 2 2021-11-30 16:49:50 +01:00
Safihre
863c0e5eb7 Add unittests for the NNTP SSL/cipher settings 2021-11-30 16:19:16 +01:00
Safihre
46f9956791 Force TLSv1.2 when setting custom ciphers 2021-11-30 16:19:16 +01:00
Safihre
879a6f2552 Always set SSL ciphers to allow TLSv1.2 connections 2021-11-30 16:19:16 +01:00
Safihre
5e3d237c99 HappyEyeBalls used SSL even though it wasn't needed 2021-11-30 16:19:16 +01:00
puzzledsab
1eb83e4eb0 Print low level Windows status error on IOError (#1986)
* Print low level Windows status error on assembler IOError

* Include error code in renamer OSError message
2021-11-30 08:06:11 +01:00
puzzledsab
194c0e6708 Add all passwords to list every time (#1985) 2021-11-28 08:28:10 +01:00
Safihre
a87d38c61f Full Apple M1 compatibility
Closes #1711 (see for more details!)
2021-11-27 16:28:08 +01:00
Safihre
ed0e5bbf9b Add placeholder for SOCKS5 Proxy input 2021-11-22 16:54:19 +01:00
Safihre
2249b623e6 Restore CI functional tests
Use build-in Chrome and ChromeDriver, we shouldn't try to be smarter than GitHub Actions 😉
2021-11-21 13:58:00 +01:00
SABnzbd Automation
854ca5f5d4 Update translatable texts 2021-11-21 08:06:35 +00:00
Safihre
a0a8029c36 Set the minimum supported TLS version the new way 2021-11-21 09:06:00 +01:00
Safihre
e7eec8e4f1 Check for PySocks at start-up to give a nice error 2021-11-21 08:54:21 +01:00
Safihre
a354c1984b Update text files for 3.5.0 Beta 1 2021-11-20 09:49:11 +01:00
Safihre
34799c397c Force compile all Python modules on macOS 2021-11-20 09:31:56 +01:00
Safihre
2c88dddc1e Set selenium-requirement to fix tests 2021-11-20 09:31:41 +01:00
SABnzbd Automation
64b0216ba9 Update translatable texts 2021-11-20 06:06:10 +00:00
puzzledsab
f950520475 Compare variable with int, not string (#1981) 2021-11-20 07:05:34 +01:00
SABnzbd Automation
60f3de2a91 Update translatable texts 2021-11-19 13:39:58 +00:00
puzzledsab
06e13483bd SOCKS 5 support (#1894)
* Add testable socks support

* Messed up merge

* Use proxy for urllib.request.urlopen

* Reset socket before trying to get public IP

* Add socks requirement

* PySocks, not socks?

* Use only PySocks

* Clean up and reduce number of new translations

* Move configuration to special variable socks5_proxy_url

* Remove useless dereferencing

* Catch OSError on proxy preconnect

* Try only setting socks proxy once

* Missed some spots

* Catch all errors for IPv6 checks

* Move proxy initialization up before threads are started

* No special `sock.connect` required for Socks5

* Revert "No special `sock.connect` required for Socks5"

This reverts commit 5e901f8b58.

* Remove callback and ORIGINAL_SOCKET variable

* Move all `sock.connect` code

* Create SSLContext only once for each server

It is re-created if server-settings are updated.

* Add SOCKS5 proxy configuration to General page

* Show if proxy is active in Status-window

Co-authored-by: Safihre <safihre@sabnzbd.org>
2021-11-19 14:39:23 +01:00
Safihre
f00cbe89bc Refactor HappyEyeBalls 2021-11-18 20:27:49 +01:00
SABnzbd Automation
e450f5744b Update translatable texts 2021-11-18 14:27:05 +00:00
jcfp
255242eca5 disable randomisation of directory listings in pyfakefs (#1978) 2021-11-18 15:26:26 +01:00
Safihre
cbeab4dd55 Force rebuild for binary pip-packages 2021-11-16 21:56:10 +01:00
Safihre
6b8506c986 Set target-arch to universal2 for macOS 2021-11-16 21:40:42 +01:00
Safihre
d5d5647b7c Add hidden import of guessit.data 2021-11-16 21:24:35 +01:00
Safihre
1a76de1ca3 Build PyInstaller bootloader from sources to support macOS 10.9 2021-11-16 20:40:24 +01:00
Safihre
1913109623 Add freeze support for multiprocessing
See https://github.com/pyinstaller/pyinstaller/issues/6368
2021-11-16 13:58:12 +01:00
Safihre
e76b4395a7 Remove specific macOS version check
Old macOS versions just have to deal with it
2021-11-15 21:41:31 +01:00
Safihre
6670156397 Correct Scheduler Wiki-URL 2021-11-08 13:15:13 +01:00
Safihre
37b7a77b70 Update snapcraft build 2021-11-07 09:08:43 +01:00
Safihre
ddb5a007a5 Update snapcraft base to Ubuntu 20.04 2021-11-07 08:50:06 +01:00
SABnzbd Automation
8568df4552 Update translatable texts 2021-11-05 06:57:19 +00:00
jcfp
493a5f715c Reintroduce uu support (#1969)
* reintroduce uu support

* housekeeping, bug fixes

* add tests for decode_uu()

* simplify, fix typo

* remove leftover debugging; housekeeping

* oops

* add non-ascii input for test_broken_uu
2021-11-05 07:56:39 +01:00
Safihre
a61b27992e Update code-format to 3.7
No changes really
2021-11-05 07:50:55 +01:00
Safihre
798eec7aa8 Drop (official) Python 3.6 support and run fully on 3.10
Probably still runs, we just don't test it.
2021-11-05 07:45:24 +01:00
Safihre
0d29603e2b portable.cmd was no longer included in Windows release
Closes sabnzbd/sabnzbd.github.io/176
2021-11-03 21:06:28 +01:00
SABnzbd Automation
48882220d6 Update translatable texts 2021-11-02 10:32:30 +00:00
Safihre
b4ad292ec5 Build release using 3.10
Closes #1958
2021-11-02 11:31:43 +01:00
Safihre
b59a14f6b7 Correct "Remove even more unused imports"
My fault.
2021-10-22 10:04:35 +02:00
SABnzbd Automation
80ed385a41 Update translatable texts 2021-10-22 07:52:02 +00:00
Safihre
04cd67b98b Remove even more unused imports 2021-10-22 09:51:24 +02:00
jcfp
68eded2c0c remove unused imports (#1966) 2021-10-19 19:29:54 +02:00
Safihre
389a0d3afa Revert to using regex based sample detection
Closes #1964
2021-10-13 18:24:55 +02:00
Safihre
5a3e4a28fe Solve deprecation warnings 2021-10-12 11:20:33 +02:00
SABnzbd Automation
66b5629a31 Update translatable texts 2021-10-12 07:30:17 +00:00
Safihre
eae77eb236 Prevent double guessit parsing 2021-10-12 09:29:38 +02:00
Safihre
5f44ec8a0d Correct behavior of Sorter when no filename and/or extension is supplied
Closes #1962, #1957
2021-10-08 10:35:06 +02:00
Safihre
9d8c62de6b Only fail jobs if the sorter should have renamed 2021-10-08 10:35:06 +02:00
Safihre
3229fd8d28 Use general detection of RAR-files in file-extension correction
Correct file_extension test
2021-10-08 10:35:06 +02:00
SABnzbd Automation
fdee789637 Update translatable texts 2021-10-08 08:34:20 +00:00
Safihre
c762dda1b1 Fix tavern for Python 3.6 and run tests on Python 3.10 (Linux-only) 2021-10-08 10:33:37 +02:00
SABnzbd Automation
c5c8b902c4 Update translatable texts 2021-10-06 12:36:55 +00:00
Safihre
ee255a5042 Require at least 1 category to be set for Sorting and warn if not set
Before 3.4.0, only for TV sorting we allowed to set 0 categories. But for Movies and Date Sorting we did require at least 1 category to be set. This was harmonized in 3.4.0, breaking existing setups. Added warning for those users.
The Sorting behavior is different from Notifications: in Notifications selecting Default only(!) means to apply it to all categories.
However, that has never been the case for Sorting. So for now added a bit more help texts to the Affected categories box on both pages.
2021-10-06 14:34:15 +02:00
Sander
3952965632 make .cbz a well-known extension, so that no extension is added (#1960) 2021-10-05 22:00:30 +02:00
Safihre
85db706bbe Always require TLS1.2 or higher for NNTP connections 2021-10-05 17:32:39 +02:00
Safihre
ea570442c6 Update Wiki-URL to 3.5 2021-10-05 17:21:29 +02:00
Safihre
9c109b803d Do not fail all jobs if one job fails in order to locate the failing job 2021-10-05 12:29:37 +02:00
Safihre
86f77f8064 Only run Transifex if the TX_TOKEN is set 2021-10-05 12:26:34 +02:00
Sander
81c33d65e4 make .cbr a well-known extension, so that no extension (".rar") is added (#1959) 2021-10-05 10:11:52 +02:00
SABnzbd Automation
a1cf822141 Update translatable texts 2021-10-03 08:06:24 +00:00
Safihre
ce48a9697a Check for puremagic and guessit first and add comments about cherrypy 2021-10-03 10:05:39 +02:00
Safihre
9b22c4b23c Always show number of MB missing
https://forums.sabnzbd.org/viewtopic.php?f=2&t=25573
2021-10-03 09:59:26 +02:00
Safihre
6283b0460a Job failure due to Sorting-problems was not shown in the interface 2021-10-01 15:43:13 +02:00
Safihre
4fe977fa47 rXX files are popular extensions and don't need renames
Closes #1955
2021-09-29 09:17:19 +02:00
SABnzbd Automation
f188e55692 Update translatable texts 2021-09-29 06:37:30 +00:00
Safihre
f5487ed932 Do not search whole file when checking if txt or nzb file 2021-09-29 08:36:48 +02:00
Safihre
c69b25ff0d Only run process_unpacked_par2 when cleanup happened
Relates to https://forums.sabnzbd.org/viewtopic.php?f=1&t=25552
2021-09-29 08:24:27 +02:00
SABnzbd Automation
b608af640f Update translatable texts 2021-09-27 18:22:43 +00:00
puzzledsab
315f1ff3bc Add required server option (#1948)
* Add required server option

* Use plan_resume() instead of the resume_task system

* Retry articles on required servers after connection failure

* Update comment to match new code

* Remove unnecessary try
2021-09-27 20:22:02 +02:00
Safihre
b6c2ac194b Set version information to 3.5.0-develop 2021-09-24 13:41:12 +02:00
Safihre
00570d2089 Make add_parfile return if it could actually add the file
Maybe it was long finished, which could result in crashes.
Closes #1953
2021-09-24 08:57:53 +02:00
Safihre
56375b16fe Do not rename in decode_par2 if the filename didn't change
Closes #1952
2021-09-23 10:00:19 +02:00
Safihre
447a7b684c Update text files for 3.4.1 2021-09-23 08:50:04 +02:00
Safihre
82379481dd Revert "Un-pin version of PyInstaller"
This reverts commit a95714710b.
2021-09-23 08:44:44 +02:00
puzzledsab
06f9e28170 Don't show undefined if metric is bytes in speedometer slider (#1951) 2021-09-22 13:52:57 +02:00
Safihre
d89b6f814b Update text files for 3.4.0 2021-09-17 20:41:13 +02:00
SABnzbd Automation
fad69356c1 Update translatable texts 2021-09-17 18:38:28 +00:00
Safihre
2285c6e430 Small refactor of the new content-disposition parsing 2021-09-17 20:36:34 +02:00
p0ps
c1b9b727e6 Correctly parse the filename in content-disposition header. (#1946)
* Implement regex to match the filename in the content-disposition header.

The following srings will match:
filename=Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb; filename*=UTF-8''Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb
filename=Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb;
filename*=UTF-8''Zombie.Land.Saga.Revenge.S02E12.480p.x264-mSD.nzb

* Missed quote

* Implement the mailbox/Message solution
* Add basic tests

* Add `attachment;`

* Add example with attachment.

* Fix some linting.
* Added edge case tests.

* Added comment.

* Added test to include path elements.

* Only try the content-disposition header when it has `filename` in it

* Project uses double quotes.

* Update test.
* Add `attachment;`

* black formatter

* remove release names.

* trailing commas

* quote enclosures
2021-09-11 22:56:17 +02:00
Safihre
a95714710b Un-pin version of PyInstaller 2021-09-08 09:12:18 +02:00
Safihre
82268b58e2 Update Python build version to 3.9.7 2021-09-01 23:45:30 +02:00
Safihre
0dd7e71fd1 Update text files for 3.4.0 RC 1 2021-09-01 23:35:26 +02:00
Safihre
63f1d2905f Correct reference to Sorter vs BaseSorter
Closes #1941
2021-08-14 09:35:50 +02:00
SABnzbd Automation
ea9b409a04 Update translatable texts 2021-08-13 10:11:22 +00:00
Safihre
8957a8421d Update text files for 3.4.0 Beta 2 2021-08-13 12:10:42 +02:00
SABnzbd Automation
7c171081c6 Update translatable texts 2021-08-13 07:50:29 +00:00
Safihre
e4520e9e16 Prevent crashing Assembler from missing saved_articles
Closes #1933
2021-08-13 09:49:41 +02:00
SABnzbd Automation
336c373dd0 Update translatable texts 2021-08-02 13:05:22 +00:00
Safihre
fc721f31c5 Only run recover_par2_names if all_ok 2021-08-02 15:04:31 +02:00
Safihre
062ed9f7b8 decode_par2 should return a list
Yeah Typing
2021-08-01 17:10:18 +02:00
SABnzbd Automation
59a915cdac Update translatable texts 2021-08-01 14:43:07 +00:00
Safihre
191f7d2152 Warning instead of Info when we restart due to crashed threads
Closes #1936
2021-08-01 16:42:09 +02:00
puzzledsab
a76e9c2c1f Always deobfuscate names from par2 (#1935)
* Always deobfuscate names from par2

* Different par2 test

* Different par2 test take 2

* Make par2 filename decoding optional and add some typing

* Rename variable
2021-07-30 16:01:30 +02:00
SABnzbd Automation
9d616459b7 Update translatable texts 2021-07-28 12:32:51 +00:00
Safihre
82fa42d182 Correct sorting test 2021-07-28 14:26:08 +02:00
Safihre
0c36aaa5ff nzo.correct_password was not always defined
Closes #1932
2021-07-25 17:35:44 +02:00
Safihre
a9761464a0 Only run Direct Unpack if enable_unrar=1 2021-07-25 10:28:55 +02:00
Safihre
355d02faa3 Sorting would always update final path even if disabled 2021-07-25 09:58:13 +02:00
jcfp
1052f37d02 create a record for the successful password (#1919)
* create a record for the successful password

* make get_all_passwords not return all, expand nzo.correct_password to directunpacker
2021-07-23 14:35:00 +02:00
Safihre
92b023599b Correct the build process to include guessit 2021-07-12 11:56:00 +02:00
jcfp
0c0dc946d8 avoid logging empty bytes object in directunpacker (#1924) 2021-07-11 20:32:07 +02:00
Safihre
9301edaee8 Make "Multi-operations" persistent after a page reload 2021-07-08 21:14:00 +03:00
Safihre
cf3136781d Make "Show All / Show Failed" persistent after a page reload 2021-07-08 09:30:15 +03:00
Safihre
d17368a9d2 Update text files for 3.4.0 Beta 1 2021-07-05 17:48:10 +03:00
Safihre
acfdef0c19 Update references to 3.4.0 2021-07-05 17:48:10 +03:00
Sander
1f4c7239d7 Continue after par2 renaming (#1921)
* record new files generated based on par2

* record new files generated based on par2

* test first par2 based renaming, then deobfuscate obfuscated names

* remove commented-out line

* corrected contents zip-file

* try again, github

* try again, github
2021-07-05 16:54:50 +03:00
Safihre
2aa0dbd93d Transfer /status/ functions to API-functions
TODO: Update documentation and maybe some tests
2021-07-04 18:03:58 +03:00
Safihre
a9135280ba Duplicate detection would always trigger based on backup dir 2021-07-03 10:41:28 +03:00
Safihre
0352ed79fa Update UnRar to 6.0.2 and MultiPar to 1.3.1.8
Closes #1915
2021-07-03 10:07:23 +03:00
jcfp
87454c9b10 enforce local ranges for broadcasts (#1920) 2021-07-02 12:00:15 +03:00
SABnzbd Automation
1afec3aa95 Update translatable texts 2021-07-01 07:59:55 +00:00
Safihre
a7a3334c9a Duplicate check based on md5 was performed before md5 was calculated
The side effect of this change is also that if you have an nzb-backup dir with the file already present that this second will be found duplicate, even before the first job has finished in the queue. Relates to #727
2021-07-01 10:46:51 +03:00
SABnzbd Automation
dc1f9bb252 Update translatable texts 2021-06-30 14:09:30 +00:00
jcfp
b2cbb8c8d0 Use guessit for sorting and sample detection (#1916)
* Use guessit for sorting and sample detection

* Fix bad logic in is_sample

* address comments, pt. 1

* address comments pt. 2

* address comments, pt. 3

* don't reference title before assignment

* whoops... overlooked the lowercasing

* add another title safeguard

* prevent uninitialized use of variable

* fix for jobs that should not be sorted

* don't list excluded guessit props in the interface

* insert linebreak between guessit props under pattern key

* use constant for excluded props

* dump COUNTRY_REP

* block rebulk log spam

* remove redundant season default; don't set for episodes

* make substitution regex a raw str
2021-06-30 17:08:54 +03:00
SABnzbd Automation
399de15792 Update translatable texts 2021-06-29 05:39:21 +00:00
Safihre
9ef30625a6 Add additional explanation to Deobfuscate final filenames 2021-06-29 08:38:13 +03:00
Sander
9b870e64d2 Use puremagic to deobfuscate file extensions (#1914)
* correct_extension: basics, including unittest

* correct_extension: basics, including unittest

* correct_extension: puremagic into requirements.txt

* correct_extension: introduce a main for testing from CLI

* correct_extension: parse all parameters on CLI as files

* correct_extension: parse all parameters on CLI as files

* correct_extension: CLI parameter "-p" for privacy output

* correct_extension: has_common_extension() and most_likely_extension()

* correct_extension: has_common_extension() and most_likely_extension()

* correct_extension: add extension if file has no commonly used extension

* correct_extension: Black happy ... hopefully

* correct_extension: Black happy ... hopefully

* correct_extension: process feedback, mainly the extenions lists ^H^H^H^ tuples

* correct_extension: process feedback, mainly the extenions lists ^H^H^H^ tuples

* correct_extension: process feedback, mainly the extenions lists ^H^H^H^ tuples

* correct_extension: process feedback, mainly the extenions lists ^H^H^H^ tuples

* correct_extension: cleaned up

* correct_extension: cleaned up ... github-black now happy?

* correct_extension: cleaned up ... github-black now happy?

* correct_extension: cleaned up ... github-black now happy?

* correct_extension: cleaned up ... github-black now happy?

* correct_extension: cleaned up ... github-black now happy?

* correct_extension: easier if-then-logic, check if new_extension_to_add is filled.

* correct_extension: if puremagic does recoging txt or nzb, check ourselves

* correct_extension: if puremagic does recoging txt or nzb, check ourselves

* correct_extension: only files!

* correct_extension: only files!

* correct_extension: rNN files not common extension, plus easier testing

* correct_extension: clean-up ... no more boolean extension_too

* correct_extension: requirements.txt, solved a TODO, and use get_ext()

* correct_extension: a comment added

* correct_extension: correct typing, correct txt and nzb extension

* correct_extension: extensions always with dots, bug fix in what_is_most_likely_extension()

* correct_extension: back on track?

* correct_extension: back on track?

* correct_extension: better comments
2021-06-29 08:27:08 +03:00
puzzledsab
c90a93661b Changes to determining can_be_slowed (#1891)
* Changes to determining can_be_slowed

* Add return type for get_stable_speed and make can_be_slowed local
2021-06-20 22:58:54 +02:00
SABnzbd Automation
d8349764ed Update translatable texts 2021-06-15 09:32:33 +00:00
Safihre
232740fc2e Set version to develop 2021-06-15 11:31:53 +02:00
Safihre
88b5810d8e Open Status Info - Connections when clicking on the speed graph 2021-06-14 11:00:54 +02:00
Safihre
3fa528224f Automatically publish release when all files are present 2021-06-11 17:48:44 +02:00
SABnzbd Automation
edc1f734b7 Update translatable texts 2021-06-10 14:46:41 +00:00
Safihre
49f4ced8e0 Remove redundant file_has_articles check
Unknown encodings are caught in the decoder already
2021-06-10 16:45:52 +02:00
Safihre
7bc0a6d140 Some Config functions were broken due to interface refactor 2021-06-08 11:45:31 +02:00
Safihre
968a347664 Remove unused Glitter code 2021-06-07 16:49:19 +02:00
Safihre
1740b16a0f Add direct opening of tabs by URL to Glitter tab-layout 2021-06-07 16:31:06 +02:00
Safihre
be5a71ce47 Add more typing to nzbstuff functions 2021-06-06 10:22:09 +02:00
Safihre
2d195e9584 Update NzbQueue functions after all the refactors 2021-06-05 22:45:45 +02:00
Safihre
b975489ddd Queue repair pop-over would not be cleared 2021-06-05 15:55:27 +02:00
Safihre
5cefa5f2c4 Include wiki URL in Internal internet access denied message 2021-06-05 15:50:11 +02:00
Safihre
4da9e64737 Clean timeline_total of BPSMeter
Received multiple reports that somehow it could get corrupt values in there
2021-06-05 15:38:08 +02:00
Safihre
37f2b1abe2 Import constants by name 2021-06-04 13:00:13 +02:00
Safihre
6d729d27cd Filtering active post-proc queue by category was broken 2021-06-03 11:50:48 +02:00
Safihre
ec40cbc2ed Correct example in test_name_extractor 2021-06-01 12:02:52 +02:00
Safihre
0575f1710d Build release when creating the tag 2021-06-01 11:20:07 +02:00
Safihre
15823e6fe8 Filenames should end after the extension 2021-06-01 11:18:08 +02:00
jcfp
7dbde008af Regex for unwanted extensions (#1907)
* allow regexp for unwanted extensions

* housekeeping

* use rss.convert_filter

* improve function name

* move convert_filter to misc
2021-06-01 07:28:19 +02:00
Safihre
d8ebd647a2 Refactor passing of API-output type 2021-05-30 13:54:44 +02:00
Safihre
ece0d7fabe Clear test-queue before running move_nzf_bulk test 2021-05-29 21:21:51 +02:00
SABnzbd Automation
679a712e16 Update translatable texts 2021-05-29 07:24:07 +00:00
Safihre
18ad9e22f5 Could not dismiss warnings
Closes #1905
2021-05-29 09:21:54 +02:00
Safihre
152029c85b Remove Plush-related code 2021-05-29 09:21:54 +02:00
Sander
e91de667e0 deobfuscate: bugfix for collections if extension in CAPITALS (#1904) 2021-05-26 22:25:40 +02:00
SABnzbd Automation
7f21b8263b Update translatable texts 2021-05-25 08:06:34 +00:00
Safihre
f65acc9f95 Remove Plush
Closes #1902
2021-05-25 10:05:21 +02:00
Safihre
6a61bacd60 Additional cleanup of interface.py functions (2) 2021-05-24 09:31:13 +02:00
SABnzbd Automation
fb9489f470 Update translatable texts 2021-05-23 07:54:03 +00:00
Safihre
87da19caa3 Additional cleanup of interface.py functions 2021-05-23 09:53:12 +02:00
Safihre
378f6fe485 Cleanup of interface.py functions
Glitter uses a lot of legacy functions. They should be moved to actual API-calls so we can drop even more functions from interface.py.
2021-05-22 19:20:55 +02:00
puzzledsab
65a8886e61 Keep password order 2021-05-22 10:51:50 +02:00
Safihre
8fdb259270 Update text files for 3.3.0RC2
draft release
2021-05-20 08:04:06 +02:00
Safihre
98b0b46dda Only use active servers in stop_idle_jobs 2021-05-17 23:04:22 +02:00
Safihre
861fb9e3d5 Always update the number of servers
init_server(None, newid) would not trigger a recount
2021-05-17 23:04:22 +02:00
Safihre
644bcee14e Remove max_art_opt
Moved to Specials in 2.2.x and never heard anyone complain about it. So time to get rid of it.
2021-05-17 23:04:22 +02:00
Safihre
933d9e92d1 Re-work the Server's reset article queue 2021-05-17 23:04:22 +02:00
jcfp
9fb03a25f6 allow missing extension for unwanted check (#1896) 2021-05-16 21:02:06 +02:00
Safihre
0b1f7827fc Add additional unrar output when checking passworded files 2021-05-14 22:09:11 +02:00
Safihre
49f21e2c9d macOS Python set to 3.9.5 2021-05-14 22:02:13 +02:00
Safihre
990c0e07cf platform.platform() is not available on all platforms
Closes #1893
2021-05-14 09:08:53 +02:00
Safihre
745459e69f Update text files for 3.3.0RC1
draft release
2021-05-13 15:14:35 +02:00
Safihre
115a6cf5d7 Windows: Update Multipar to 1.3.1.7 2021-05-10 10:44:59 +02:00
Safihre
39aafbbc61 Windows/macOS: Update UnRar to 6.0.1 2021-05-10 10:44:47 +02:00
puzzledsab
93ddc9ce99 Add article queue and change article tries system (#1870)
* Add article queue and change article tries system

* Don't reuse queued articles with get_articles

* Add article_queue to server slots

* Generalize get_articles

* Set fetch_limit to be at least 1

* A little tweaking

* More micro optimization

* Small tweaks

* Remove misplaced reset_article_queue()

* Call reset_article_queue() from plan_server

Co-authored-by: Safihre <safihre@sabnzbd.org>
2021-05-07 22:18:50 +02:00
Safihre
3d877eed13 Call BPSmeter.init_server_stats for all servers at end of day 2021-05-07 16:51:47 +02:00
Safihre
308d612c05 Re-init server statistics when clearing 2021-05-07 15:45:17 +02:00
Safihre
9b75f0428d Only call single BPSMeter.update at midnight 2021-05-07 15:41:40 +02:00
Safihre
e6858659fb Prevent ZeroDivisionError's in BPSMeter 2021-05-07 14:06:27 +02:00
Safihre
815058ffcd Fix and extend on BPSMeter optimalizations 2021-05-07 13:40:08 +02:00
puzzledsab
915b540576 BPSMeter optimalizations (#1889)
* Remove stats initalization

* Use update(), remove sum_cached_amount

* Refactor can_be_slowed ifs

* Revert "Refactor can_be_slowed ifs"

This reverts commit 4c9e3e6645.
2021-05-07 13:02:01 +02:00
Safihre
5b06d6925c Sort Downloader.servers by priorty 2021-05-07 09:07:14 +02:00
Safihre
ef875fa720 Remove unused Downloader.server_dict 2021-05-07 08:46:13 +02:00
Safihre
994a7d044f Config restart-check faster because shutdown is now much faster 2021-05-07 08:32:45 +02:00
Safihre
80cd7f39b4 Show server in download-rapport even if it was disabled later on 2021-05-07 07:15:37 +02:00
Safihre
93bf45cde6 Simplify build_status by removing server connection details for Plush 2021-05-06 22:44:19 +02:00
Safihre
b4adc064a0 Remove subject nzf.subject property as it is unused
Since 3.0.0 we always fill the nzf.filename
2021-05-06 22:33:20 +02:00
Safihre
7e81d0bcbb Update text files for 3.3.0Beta4
draft release
2021-05-06 10:36:47 +02:00
SABnzbd Automation
33b59f091e Update translatable texts 2021-05-06 08:26:04 +00:00
Safihre
ea3dc1f2f4 Add validation of translations 2021-05-06 10:00:10 +02:00
SABnzbd Automation
5d3e68a6a5 Update translatable texts 2021-05-06 07:31:48 +00:00
Safihre
64f2ec3ffe Setting RSS rate would result in crash
Closes #1890
2021-05-06 09:30:55 +02:00
Safihre
c80014ec7d Use __slots__ on Downloader thread object 2021-05-03 22:57:00 +02:00
Safihre
6515720d55 Use __slots__ on Server object (#1887) 2021-05-03 16:34:12 +02:00
puzzledsab
605c5cbfd8 Check busy threads less often if nothing is wrong (#1884)
* Check busy threads less often if nothing is wrong

* Simplify variable usage

* Use local constant for server check delaying
2021-05-03 15:51:16 +02:00
puzzledsab
77e97d1a89 Check header before entering parse_par2_packet (#1885)
* Check header before entering parse_par2_packet

* Stop using offset variable
2021-05-03 13:35:11 +02:00
Safihre
f17d959770 Remove unused code to support Windows Vista 2021-05-02 13:06:45 +02:00
Safihre
22f1d2f642 Stop scanning the par2 file once we have the information of all files 2021-05-02 10:16:17 +02:00
jcfp
7d3907fa0e also test with (partially) exploded ipv4-mapped addresses (#1880) 2021-05-01 19:45:53 +02:00
Safihre
9588fe8d94 Simplify startup logging 2021-05-01 18:38:24 +02:00
Sander
3b3ffdb8d1 Show cpu architecture (#1879)
* show CPU architecture in logging.info

* show CPU architecture in logging.info ... make black happy

* show CPU architecture in logging.info ... comment

* show CPU architecture in logging.info ... comment

* show CPU architecture in logging.info ... comment

* show CPU architecture in logging.info ... oneliner
2021-05-01 17:16:09 +02:00
Safihre
cdd7e6931a Post-processing would crash if there is no files to unpack 2021-05-01 16:50:15 +02:00
puzzledsab
4c3df012a6 Don't slice data and stop reading par2 files when duplicate filename is found (#1878)
* Don't slice data

* Stop reading par2 files when duplicate filename is found
2021-05-01 16:10:40 +02:00
Safihre
b0eaf93331 Extend unit test for par2file to check logging of par2 creator 2021-05-01 12:24:11 +02:00
Safihre
55c03279ca Optimize par2 file parsing 2021-05-01 12:06:00 +02:00
Safihre
c4f0753f5a Add basic unit tests for par2file 2021-05-01 12:03:31 +02:00
puzzledsab
a9bd25873e Store status_code as attribute (#1877)
* Store status_code as attribute

* Do reading of code in try
2021-05-01 07:26:44 +02:00
jcfp
5ab6de8123 cut closer to the middle to avoid random test failures (#1874) 2021-04-30 10:45:51 +02:00
jcfp
75deb9d678 add --disable-file-log to systemd service (#1873) 2021-04-30 09:26:55 +02:00
Safihre
b5ce0e0766 Allow setting inet_exposure from command line
Closes #1872
2021-04-30 09:23:30 +02:00
Safihre
43817aef20 Update text files for 3.3.0Beta3
draft release
2021-04-29 11:01:12 +02:00
jcfp
81a7a58299 support prefix and netmask for local_ranges (#1871)
* support prefix and netmask for local_ranges

* housekeeping
2021-04-29 08:35:46 +02:00
puzzledsab
4ae1c21b6f Minor optimizations (#1869) 2021-04-28 12:15:10 +02:00
Safihre
8ffa3e5d4c Add unit tests for sanitize_files 2021-04-27 22:51:43 +02:00
Safihre
ac6ebe1f99 Only reset the NZF try_list when adding par2 files
We can rely on the article try list, or at least we should be able to..
2021-04-27 17:56:13 +02:00
Safihre
a5c07e7873 Reset fetcher and fetcher_priority when resetting article try_list
Closes #1863
2021-04-27 16:48:34 +02:00
SABnzbd Automation
94c4f6008d Update translatable texts 2021-04-27 10:16:05 +00:00
Safihre
615c296023 sanitize_files_in_folder would ignore the newfiles
Would result in deobfuscate not working.
This needs unittests!
Closes #1868
2021-04-27 12:09:46 +02:00
SABnzbd Automation
d227611ee8 Update translatable texts 2021-04-26 21:34:41 +00:00
Safihre
acf00c723f Remove all xmlns from NZB-file data
https://forums.sabnzbd.org/viewtopic.php?f=2&t=25342
2021-04-26 23:33:47 +02:00
Safihre
adb3913daa Only remove the failed server in NzbQueue.reset_try_lists
Closes #1866
2021-04-26 11:48:48 +02:00
Safihre
faf1a44944 Black formatting update 2021-04-26 10:52:11 +02:00
Safihre
9f5cb9ffff Read All Feeds was broken
Closes #1865
2021-04-26 10:14:20 +02:00
SABnzbd Automation
068c653a2a Update translatable texts 2021-04-25 09:03:10 +00:00
Safihre
b1c922bb75 Post-proc queue was not filtered by nzo_ids 2021-04-25 11:02:04 +02:00
Safihre
4879fbc6d4 CRC/yenc errors would be counted twice as bad articles 2021-04-24 21:53:23 +02:00
Safihre
e7dc81eb38 Update text files for 3.3.0Beta2
draft release
2021-04-23 17:24:50 +02:00
Safihre
c2fa08598e Update text files for 3.3.0Beta1
draft release
2021-04-23 12:09:17 +02:00
Safihre
d23ca4a38e Add tests for dual-stack notation in check_access 2021-04-23 11:44:54 +02:00
Safihre
078b608582 Set Python for macOS release to 3.9.4 2021-04-23 11:17:29 +02:00
Safihre
a64457973f Apply NzbQueueLocker to end_job to prevent multiple post-processing
Closes #1862, #1862
2021-04-22 22:46:15 +02:00
SABnzbd Automation
00ef13fe9f Update translatable texts 2021-04-22 19:36:51 +00:00
Safihre
b4a7f2fdf6 Get rind of dual-stack notation when checking local_ranges 2021-04-22 21:36:13 +02:00
Safihre
a482bb7acc Add unittests for secured_expose 2021-04-22 21:36:13 +02:00
Safihre
ce46eeac49 Change permissions-level for Config-related API-calls 2021-04-22 21:36:13 +02:00
Safihre
110dbf6cca Correct invalid checking of API sub-call permissions
Some calls that should have been "full API" only were available with "basic API".
2021-04-22 21:36:13 +02:00
Safihre
c93de2dd6f Correct set_config fixture in unittests 2021-04-22 21:36:13 +02:00
Safihre
be88f5152f Default to block non-LAN traffic for empty Local network ranges 2021-04-22 21:36:13 +02:00
puzzledsab
efda5bab4d Make num_decoders configurable through special variables (#1860) 2021-04-19 14:02:28 +02:00
jcfp
d491eb1af0 fix use of dir (#1855) 2021-04-16 16:25:20 +02:00
jcfp
e249dbfc67 try sys.executable, but keep "python" as fallback (#1856) 2021-04-16 16:25:00 +02:00
Safihre
c994ae5798 Log all requests, not just API calls
Closes #1857
2021-04-16 13:30:56 +02:00
Safihre
cba61bd8fb Highlight even more the warning about exposed hosts 2021-04-15 10:04:33 +02:00
Sander
a72440ee6b make results from Status -> Performace copy-pasteable (#1849) 2021-04-11 14:58:05 +02:00
Safihre
cd3ed40ff3 Just always show the history statistic 2021-04-05 13:58:09 +02:00
Safihre
cf3ce5e31d Show history statistics even if history is empty
Closes #1843
2021-04-05 10:47:02 +02:00
Sander
bdcbc5e011 Internetspeed improve code style (#1848)
* interspeed: better styling

* interspeed: better styling

* interspeed: better styling

* interspeed: better styling ... logging style

* interspeed: tackle Windows' time granularity

* internetspeed: more feedback on naming
2021-04-04 21:01:02 +02:00
SABnzbd Automation
c2d3ce348f Update translatable texts 2021-04-04 13:49:24 +00:00
Safihre
970d580e4b Ignore duplicate files inside messy NZB's 2021-04-04 15:48:21 +02:00
Safihre
d2f9721576 Changed leftover str.encode to general utob function 2021-04-01 07:38:03 +02:00
Safihre
8a39e5827b Foldernames should always be stripped from dots and spaces at the end 2021-04-01 07:28:08 +02:00
Safihre
89c8b6a0a5 Do not notify warning/errors from same source twice
Closes #1842
2021-03-30 17:29:39 +02:00
Safihre
238f0a6108 Do not discard data for CrcError's
https://forums.sabnzbd.org/viewtopic.php?f=11&t=25278
2021-03-30 16:05:34 +02:00
puzzledsab
19950569cb Show server expiration date in server summary (#1841) 2021-03-29 20:26:20 +02:00
Safihre
a19553dddd Revert some improvements to the encrypted RAR-detection
Closes #1840
2021-03-29 14:05:39 +02:00
SABnzbd Automation
c383a5b120 Update translatable texts 2021-03-29 05:24:15 +00:00
Safihre
dab7243ccd Show Article availability number of articles in a nicer format 2021-03-29 07:23:37 +02:00
Sander
ccf15ab4a3 Diskspace macOS large drives (#1838)
* disk_free_macos_clib_statfs64() to report correct available disk space on MacOS

* disk_free_macos_clib_statfs64() ... correct call

* feedback processed into better code, and improved comments

* MACOSLIBC into __init__. And some comments about gnu libc

* import ctypes.util

* log ctypes.get_errno() in case of problems

* more cleanup and clarifications based on feedback

* mention python bug report in comment

* ... to trigger the CI again

* ... typo
2021-03-27 20:48:23 +01:00
Safihre
25a3ef2b3e Another try to fix the Snapcraft builds 2021-03-27 18:53:10 +01:00
Safihre
9bdaae8d9f Try to fix the Snapcraft builds 2021-03-27 11:03:56 +01:00
SABnzbd Automation
4115651998 Update translatable texts 2021-03-27 09:15:52 +00:00
Safihre
58349082df Prompt before renaming item that is being directly unpacked
Closes #1825
2021-03-27 10:14:10 +01:00
Safihre
aa75828296 Add title for long Config Server names 2021-03-21 16:56:21 +01:00
Safihre
10eaf6e278 Improvements to the encrypted RAR-detection 2021-03-20 18:28:06 +01:00
Safihre
04e22571e9 Make get_all_passwords return only unique passwords
If the filename and the NZB specified the same one it could occur 2 or 3 times.
2021-03-20 17:53:01 +01:00
Safihre
bc8b9e7c8b Update URL for Python 3 information 2021-03-18 09:09:43 +01:00
Sander
b6213654ef deobfuscate: no globber, but use given filelist (#1830) 2021-03-16 19:47:21 +01:00
Safihre
9ba17d5338 Remove old compatibility code from BPSMeter that causes crash on startup
Closes #1827
2021-03-15 12:58:02 +01:00
Sander
dde453744d deobfuscate: rename accompanying (smaller) files with same basename, and no renaming of collections with same extension (#1826)
* deobfuscate: rename accompanying (smaller) files with same basename

* deobfuscate: do not rename collections of same extension

* deobfuscate: collection ... much easier with one loop, thanks safihre.

* deobfuscate: globber_full, and cleanup

* deobfuscate: unittest test_deobfuscate_big_file_small_accompanying_files

* deobfuscate: unittest test_deobfuscate_collection_with_same_extension

* deobfuscate: unittest test_deobfuscate_collection_with_same_extension
2021-03-14 21:31:30 +01:00
Safihre
a86273f213 More space for the RSS table
Closes #1824
2021-03-14 12:05:17 +01:00
Safihre
2b312dfa6f Update documentation links to 3.3.x 2021-03-14 11:10:20 +01:00
Safihre
800c7182c1 Add simple unit test for test_validate_single_tag 2021-03-10 22:10:32 +01:00
Safihre
cbbd5faf24 Single indexer categories would be saved with "," between each letter 2021-03-10 20:01:57 +01:00
puzzledsab
bb9c8f04e2 Use binary mode to make write test more accurate on Windows (#1815) 2021-03-10 19:52:48 +01:00
puzzledsab
50469903dc Reduce the number of full BPSMeter.update calls by caching the amounts (#1801)
* Don't do a full calculation for every call to BPSMeter.update()

* Log current bps in MB/s

* Use to_units

* Add an bps update after disconnect or shutdown

* Switch to force_full_update being default

* Force update if bandwidth limit is set

* Fixed the real problem

Co-authored-by: Safihre <safihre@sabnzbd.org>
2021-03-10 19:51:57 +01:00
jcfp
b8f6cf11d6 fix config auto_sort setting, broken by #1666 (#1813)
* fix config auto_sort setting, broken by #1666

* oops I did it again
2021-03-07 18:37:02 +01:00
jcfp
f0d4f76e0f remove unused import of same_file (#1812) 2021-03-07 15:17:16 +01:00
SABnzbd Automation
05f0a12d16 Update translatable texts 2021-03-07 08:19:47 +00:00
Safihre
a1cad730ad Show name of item to be deleted from queue/history in confirm dialog 2021-03-07 09:18:57 +01:00
SABnzbd Automation
3e8c738496 Update translatable texts 2021-03-01 19:17:48 +00:00
Safihre
940dd3e3c0 Add traceback when failing to read the password file
Closes #1810
2021-03-01 20:16:54 +01:00
SABnzbd Automation
6de4e1a401 Update translatable texts 2021-02-28 10:43:23 +00:00
Sander
0a8747f600 pre-create subdir if needed (POSIX, par2) (#1802)
* pre-create subdir it needed

* pre-create subdir it needed: check if already exists

* use os.makedirs() to handle subdir1/subdir2/blabla

* protect against malicous "..", and better naming

* check for Windows \ and POSIX /

* check again within path, typo and formatting

* regex: square brackets

* cleanup: only "/" can occur in par2

* cleanup: better logging

* unit test: testing of filesystem.renamer()

* if subdir specified in par2: let filesystem.renamer() do all the work

* if create_local_directories=True, then renamer() must stay within specified directory. Plus unittest for that.

* if create_local_directories=True, then renamer() must stay within specified directory. Plus unittest for that.

* more comments in code

* use filesystem.create_all_dirs(), less logging, clearer "..", and other feedback from Safihre

* make remote black happy too

* Small changes in wording of comments and error

Co-authored-by: Safihre <safihre@sabnzbd.org>
2021-02-28 11:42:49 +01:00
thezoggy
68a5e7c8f7 3.2.x cleanup (#1808)
* Update uni_config bootstrap css to same version of js (3.3.7).
* small accessibility change, removed thin dot border on focus

* Ignore VS Code settings folder

* cherry picked 'Fix disabled select for Glitter Night'

* glitter night - fix search border color
2021-02-27 14:48:00 +01:00
Safihre
c3d4bf5428 Fix disabled select for Glitter Night
Closes #1807
2021-02-27 09:45:56 +01:00
Safihre
0cac0bc761 Run black with --diff to show what is wrong
Closes #1803
2021-02-26 16:46:39 +01:00
Safihre
05427b7b3b Always run rar_renamer if no rar-files are present 2021-02-26 16:42:13 +01:00
Safihre
9e73f9b5e0 Update macOS build Python to 3.9.2 2021-02-26 09:44:24 +01:00
SABnzbd Automation
5ec41bafbe Update translatable texts 2021-02-23 09:09:41 +00:00
jxyzn
cb67cc8c3d Sanitize names possibly derived from X-DNZB-EpisodeName (#1806) 2021-02-23 10:08:53 +01:00
Safihre
d35619805f Log all nzo_info when adding NZB's
Relates to #1806
2021-02-23 10:08:23 +01:00
SABnzbd Automation
cb26758d53 Update translatable texts 2021-02-18 19:58:44 +00:00
Sander
9783674890 handle gracefully if no malloc_trim() available (#1800) 2021-02-18 20:58:06 +01:00
SABnzbd Automation
270eeda3e2 Update translatable texts 2021-02-14 16:06:00 +00:00
jcfp
24d3d064bb add unwanted extensions whitelist mode (#1798)
* add unwanted extensions whitelist mode

* only call get_ext once

* remove unneeded .lower()
2021-02-14 17:05:26 +01:00
Sander
e8eec80696 Long hex name obfuscated (#1796)
* "0675e29e9abfd2.f7d069dab0b853283cc1b069a25f82.6547" is obfuscated

* "0675e29e9abfd2.f7d069dab0b853283cc1b069a25f82.6547" is obfuscated
2021-02-11 15:01:24 +01:00
jcfp
c366504868 add resolution pattern key to sorting (#1794) 2021-02-10 14:12:06 +01:00
SABnzbd Automation
c7b54856c5 Update translatable texts 2021-02-09 05:37:40 +00:00
puzzledsab
10c56e08d4 Remove some redundant ifs (#1791) 2021-02-09 06:36:59 +01:00
SABnzbd Automation
4af51b4a76 Update translatable texts 2021-02-08 12:24:13 +00:00
Safihre
65cc03da14 Small refactor of pre-queue code 2021-02-06 17:28:23 +01:00
SABnzbd Automation
e908cb0df5 Update translatable texts 2021-02-06 14:32:26 +00:00
puzzledsab
ae2cee3fda Right-to-Left support for Glitter and Config (#1776)
* Add rtl on main page

* Adjustments to rtl

* Forgot to add black check for this checkout

* Remove unnecessary style

* Remove more redundant attributes

* Some more reordering and alignment

* Align sorting and nzb drop downs

* Update NZB details and shutdown page

* Fix format

* Fix SABnzbd Config title tag

* Change file list header direction

* Set rtl variables in build_header instead and test dir="rtl" in config pages

* Revert some changes and handle styling using CSS

* Move more items to CSS

* Config RTL

* Move even more to CSS

* Small tweak

Co-authored-by: Safihre <safihre@sabnzbd.org>
2021-02-06 15:31:51 +01:00
SABnzbd Automation
0467ed7ffc Update translatable texts 2021-02-06 14:11:17 +00:00
puzzledsab
d5453b4aa4 Do full server check when there are busy_threads (#1786)
* Do full server check when there are busy_threads

* Reduce next_article_search delay to 0.5s
2021-02-06 15:10:44 +01:00
jcfp
7096a785db fix bonjour with localhost, retire LOCALHOSTS constant (#1782)
* fix bonjour with localhost, retire LOCALHOSTS constant

* rename probablyipv[46] functions to is_ipv[46]_addr

* refuse to send ssdp description_xml to outsiders
2021-02-05 18:48:14 +01:00
Safihre
c80db13c28 Rename Glitter Default to Light and make Auto the new Default 2021-02-05 14:20:14 +01:00
SABnzbd Automation
b971045cd2 Update translatable texts 2021-02-05 05:33:44 +00:00
Sam Edwards
61d4ccbf1b Support for auto night mode switching in Glitter (#1783) 2021-02-05 06:32:59 +01:00
SABnzbd Automation
c3b237466c Update translatable texts 2021-02-02 21:59:00 +00:00
jcfp
29c727319d Test adding nzbs (#1760)
* add tests for adding nzbs

* restore clean_cache_dir fixture, unbreak utils tests

* include tests for partial and malformed nzbs

* test handling of prio from nzb metadata category

* update params of test_adding_nzbs_malformed

* add metadata to sabnews nzb creator

* also test with size_limit

* test prio with dupe detection

* remove leftover todo entry

* move pause and cleanup to fixture; rename functions
2021-02-02 22:58:20 +01:00
Safihre
52c5dc589d Do not re-release from GA when the release tag is pushed 2021-02-01 17:04:39 +01:00
SABnzbd Automation
35cad9bf22 Update translatable texts 2021-02-01 15:19:54 +00:00
Safihre
b108876017 Set macOS Python installer target to "/" 2021-02-01 16:13:37 +01:00
Safihre
52bfff953a Set text files to 3.3.0-develop 2021-02-01 16:12:42 +01:00
Safihre
65278c4489 Update text files for 3.2.0RC1
draft release
2021-02-01 15:57:24 +01:00
Safihre
3a4a925ab0 Restore "--console" command line switch
Closes #1775
2021-02-01 13:57:41 +01:00
Safihre
6ef5d41c25 Python cache failed because build script reset work directory
So we store the download outside the work directory
2021-02-01 09:54:45 +01:00
Safihre
b9b9f46fbe Disable macOS Python download cache
I am not sure why this doesn't work..
2021-01-31 22:40:12 +01:00
Safihre
8d014e579d The installer-command removes the pkg file, breaking macOS GA cache 2021-01-31 22:31:59 +01:00
SABnzbd Automation
f2fc9f10f9 Update translatable texts 2021-01-31 20:01:25 +00:00
Safihre
f131155fd8 Update badges to GitHub Actions 2021-01-31 21:00:16 +01:00
Safihre
691e24a1d8 Build macOS 10.9+ compatible binary 2021-01-30 22:32:59 +01:00
jcfp
794a6f4454 fix another script validation issue (#1774)
* fix another script validation issue

* add test for changing script to str None

* cleanup change_script tests
2021-01-30 14:25:53 +01:00
Safihre
41bf8525cf Server disconnect was never triggered 2021-01-29 19:29:10 +01:00
SABnzbd Automation
6ebf486c09 Update translatable texts 2021-01-29 10:10:07 +00:00
Safihre
899ae94fcf Trigger malloc_trim when the queue is empty
See #1736
2021-01-29 11:09:14 +01:00
Safihre
d3cd5019d9 Small code change 2021-01-27 21:26:28 +01:00
SABnzbd Automation
1e4719558f Update translatable texts 2021-01-27 20:13:04 +00:00
Safihre
29ab83b9c0 Prospective par2 to add blocks from all sets in a job
Obfuscation is just too much nowadays.
2021-01-27 17:21:54 +01:00
puzzledsab
4b4d170ce1 Stop importing nzbs after shutdown request 2021-01-27 13:45:25 +01:00
SABnzbd Automation
8b0a12e0ba Update translatable texts 2021-01-27 11:29:35 +00:00
Safihre
430318ead7 Force installer to only run on Windows 8 and above
Closes #1770
2021-01-27 12:28:35 +01:00
Safihre
32f6ec63f2 Add NSIS-file to automated pot-file updates 2021-01-27 12:26:55 +01:00
Safihre
a3181c8f76 Check for Windows 8 or above in the installer 2021-01-27 12:23:24 +01:00
Safihre
412d169f58 Rename of the 32bit legacy release
"/" not supported by GA
2021-01-27 11:36:38 +01:00
Safihre
d1c2e6e0dd Build the 32bit Windows release on Python 3.8 to support Windows 7 2021-01-27 11:30:08 +01:00
Safihre
4f9ac56de0 Rename GITHUB_TOKEN to AUTOMATION_GITHUB_TOKEN 2021-01-27 11:26:14 +01:00
jcfp
9641dc82f9 fix cfg script validation on startup 2021-01-27 10:03:24 +01:00
Safihre
e68413b73c Filename parser should always output a filename with at least 1 char
Closes #1768
2021-01-26 22:52:07 +01:00
Safihre
a7386a25bd Update text files for 3.2.0Beta2
draft release
2021-01-26 20:45:50 +01:00
SABnzbd Automation
53f512e864 Update translatable texts 2021-01-26 19:17:46 +00:00
Safihre
283e643606 Always log the exact IP-address we are connecting to
Closes #1764
2021-01-26 20:16:51 +01:00
Safihre
fc1aa2db83 Mark test_download_unicode_made_on_windows as xfail on all platforms 2021-01-25 09:27:30 +01:00
SABnzbd Automation
0fc1e02519 Update translatable texts 2021-01-25 06:37:21 +00:00
jcfp
67581bf3f6 Validate input value for scripts (#1765)
* verify input values for scripts

* update and parametrise test_api_queue_change_job_script

* fortify cfg with script validation, fix test

* add typing to is_valid_script function :)

* move list_scripts function to filesystem

* also move windows-specific pathext stuff
2021-01-25 07:36:41 +01:00
Safihre
b7e4ca4d87 Correct server-tests after Downloader changes 2021-01-24 11:23:52 +01:00
Safihre
0594fc60c0 Rework shutdown and NewsWrapper handling in Downloader 2021-01-24 11:13:12 +01:00
Safihre
5a6c51219c Only parse interface settings when they are set 2021-01-24 10:39:32 +01:00
SABnzbd Automation
815542bf25 Update translatable texts 2021-01-24 08:57:26 +00:00
Safihre
0c5bd817a9 Small refactor of NNTP connection 2021-01-24 09:56:48 +01:00
Safihre
9b8a317351 Upgrade notice about totals10.sab
Closes #1744
2021-01-23 21:34:23 +01:00
SABnzbd Automation
7a9d8e021a Update translatable texts 2021-01-23 20:27:52 +00:00
puzzledsab
297ec1b8a1 Warn when a server has downloaded a certain amount of bytes or a given date is reached (#1762)
* First working version

* Remove pprint

* Black

* Use date type and move to 5 minute polling

* Give hints about intended usage in explain text

* Use scheduled tasks and some smaller changes

* Black

* Remove hidden fields from form

* Cleanup

* This is not the easiest part to get right

* Black hook take 3

* Rework the server check tasks

* Show quota left for server

* Move Server description

Co-authored-by: Safihre <safihre@sabnzbd.org>

Closes #1455
2021-01-23 21:27:17 +01:00
Safihre
f04f6684e0 Correct refactor of database.py
Sending invalid nzo_id's resulted in crashes.
https://forums.sabnzbd.org/viewtopic.php?f=11&t=25163
2021-01-23 16:18:26 +01:00
SABnzbd Automation
91870c6712 Update translatable texts 2021-01-22 13:57:11 +00:00
jcfp
9c48fcf5f8 correct msg for rar renamer (#1763) 2021-01-22 14:54:31 +01:00
Safihre
ee41cfc618 Correct Windows Service restart
Broke it in the previous commit.
2021-01-21 20:58:00 +01:00
Safihre
ae30f89a2d Use basic restart for Windows binaries
Python 3.9 changed the output of Py_GetArgcArgv on Windows, causing the restart of the binaries to fail.
2021-01-21 20:55:31 +01:00
Safihre
dfcce3a974 Sometimes Multipar says failed, but we can try again with extra blocks
https://forums.sabnzbd.org/viewtopic.php?f=2&t=25155
2021-01-21 20:35:31 +01:00
Safihre
59423df0cb Program shutdown could be too fast to complete the last response 2021-01-21 20:26:40 +01:00
Safihre
ee08c486bc Allow newer cheroot-versions 2021-01-21 20:15:01 +01:00
puzzledsab
a56c522068 Save all interface values if useGlobalOptions is true (#1761)
* Save all interface values if useGlobalOptions is true

* Try to fix the tests

* New test test

* Another test test

* Remove default value for interface_settings
2021-01-21 19:31:33 +01:00
Sander
6d40eba496 Filename limit in sanitize_filename() to avoid traceback (#1721)
* urlgrabber limit filename to avoid tracebacks

* urlgrabber limit filename to avoid tracebacks: black

* urlgrabber limit filename to avoid tracebacks: black

* filename_limit ... 2020-01-15

* filename_limit: into sanitize_filename()

* filename_limit: black and typo and logging

* filename_limit: debug show full filename

* filename_limit: unittests

* sanitize_filename(): take care of feedback: one ASCII method, handly silly extension lengths

* sanitize_filename(): tests/test_filesystem.py ... make black happy

* sanitize_filename(): typo in comment

* sanitize_filename(): test_filesystem.py ... black

* sanitize_filename(): more unittests, and DEF_FILE_MAX (yet without GUI option)

* sanitize_filename(): always use DEF_FILE_MAX

* sanitize_filename(): black

* sanitize_filename(): handle UTF8 correct (>1 byte). DEF_FILE_MAX = 255

* sanitize_filename: measure bytes (not chars), DEF_FILE_MAX = 255 - 6, no test-writing in unittests

* sanitize_filename: constants.py ... black

* sanitize_filename: comment about extension

* DEF_FILE_MAX = 255 - 10 again, to solve adding ".nzb.gz" elsewhere
2021-01-19 22:03:13 +01:00
Safihre
c772df9d65 Add sleep to gc_stats test to stabilize the overal tests 2021-01-19 09:03:03 +01:00
Sander Jonkers
2a73f26f2a is_probably_obfuscated(): count underscores as spacedots 2021-01-18 20:47:02 +01:00
Safihre
a750ade5a4 Server statistics reset on restart if start_paused is enabled
Closes #1753
Oops.
2021-01-18 13:44:55 +01:00
Safihre
06b37c02f1 Use with-statement for the DOWNLOADER_CV 2021-01-18 13:11:53 +01:00
Safihre
d129607d5c Fix exit_sab for macOS binary 2021-01-17 20:51:33 +01:00
Safihre
e6d812bbd8 Set default Bandwith percentage to 100
Oops, should have done a long time ago. Otherwise by default it will exceed 100%.
2021-01-17 20:49:19 +01:00
Safihre
9cc921098e Allow longer time for test after queue-repair 2021-01-17 13:11:50 +01:00
Safihre
38213c1a91 Use Condition based system for the DirScanner 2021-01-17 12:56:52 +01:00
Safihre
44d74924e6 Rework program shutdown and restart to always use the same path 2021-01-17 12:42:34 +01:00
Safihre
5eaf0c12d3 Use Condition based system for program shutdown
Prevent delays when shutting down because the main loop isn't ready.
2021-01-17 12:21:07 +01:00
Sander Jonkers
7c2b433f7b happyeyeballs.py: by default, do NOT prefer IPv6 anymore 2021-01-17 11:56:46 +01:00
Safihre
30e692cefe Handle shutdown of SSDP using Condition's so it doesn't block
Closes #1750
2021-01-17 07:26:57 +01:00
Safihre
396fb42b11 Additional refactoring of socket-handling in Downloader 2021-01-16 19:42:54 +01:00
Safihre
c8d882712e Remove write_fds
Sockets are connected in blocking mode, so there's no need to wait for them to be writeable. Only after the connect we switch to non-blocking mode.
2021-01-16 19:42:54 +01:00
Safihre
9667aad1cb Rework the handling of socket fileno's 2021-01-16 19:42:54 +01:00
Safihre
4471303aae Simplify delay if no articles were found for a server 2021-01-16 19:42:54 +01:00
Safihre
fe2ec8cc94 Downloader shutdown same as the other threads 2021-01-15 22:07:02 +01:00
SABnzbd Automation
25440c6fec Update translatable texts 2021-01-15 06:17:01 +00:00
puzzledsab
8c2d7243cc can_be_slowed with some modifications (#1748) 2021-01-15 07:16:13 +01:00
Safihre
49e67a0bef Change calls to parent class to super() 2021-01-12 09:11:46 +01:00
SABnzbd Automation
1dfa937bff Update translatable texts 2021-01-09 20:46:43 +00:00
Safihre
a3c6bbc1b5 Resolve typing problems 2021-01-09 21:46:01 +01:00
Safihre
241e8b6842 Refactor and typing of download functions 2021-01-09 10:05:55 +01:00
SABnzbd Automation
8660faaeb7 Update translatable texts 2021-01-06 13:05:04 +00:00
Safihre
687deab6bc Trigger garbage collection every 5 minutes
Relates to #1736
2021-01-06 14:04:22 +01:00
Safihre
17ec3cbf4b Always lowercase category name
Closes #1738
2021-01-04 09:12:23 +01:00
Safihre
f75609c98c Trigger garbage collection at the end of the queue
Relates to #1736
2021-01-04 09:12:23 +01:00
Safihre
5bd65cc06a Remove close-button on update message
Closes #1740
2021-01-04 07:37:17 +01:00
Safihre
e2177577be Additional release notes 2021-01-04 07:36:11 +01:00
SABnzbd Automation
a695744c7c Update translatable texts 2021-01-03 19:44:48 +00:00
Safihre
c2a89731c9 Update text files for 3.2.0Beta1
draft release
2021-01-03 20:44:04 +01:00
Safihre
f0bfb08c2e Update copyright year to 2021 2021-01-03 20:43:19 +01:00
Safihre
764f7df6a7 Limit the number of TryList resets
This might cause problems, but it's worth a try. It seems we resetted the trylists so often, this would cause a lot of extra CPU cycles to try all articles again.
2021-01-03 13:14:43 +01:00
Safihre
c310822945 Add some typing to downloader.py 2021-01-03 12:06:59 +01:00
Safihre
4cedd051b6 Correct "Form element for Add NZB window was not closed breaking ..." 2021-01-02 18:30:43 +01:00
Safihre
d36fe1ab12 Update wiki links for 3.2.x 2021-01-02 18:27:49 +01:00
SABnzbd Automation
9a14125c6b Update translatable texts 2021-01-02 15:53:05 +00:00
Sander
1a4ba51dec SSDP logging and interval_timer (#1734)
* SSDP: also log the User-Agent

* SSDP: also log the User-Agent

* SSDP: also log the User-Agent

* SSDP: ssdp_broadcast_interval in seconds, configurable via GUI -> Specials

* SSDP: ssdp_broadcast_interval as optional parater to the SSDP class

* SSDP: less is more: start_ssdp(*args, **kwargs):

* SSDP: less is more: start_ssdp(*args, **kwargs):

* SSDP: handle if no User-Agent specified

* SSDP: small change

Co-authored-by: Safihre <safihre@sabnzbd.org>
2021-01-02 16:49:55 +01:00
Safihre
826fb3f110 Release directly from GitHub Actions 2021-01-01 20:59:44 +01:00
Safihre
9f42eb3ad7 Update building workflow to support 32bit Windows and Notarization 2021-01-01 20:59:44 +01:00
Safihre
fbbc333221 Increase Maximum number of connections per server to 1000
Closes #1732
Cause, why not.
2021-01-01 14:57:03 +01:00
SABnzbd Automation
e62792b0da Update translatable texts 2021-01-01 11:51:24 +00:00
Safihre
dbc435c4e1 Update UnRar to 6.0.0 and MultiPar to 1.3.1.3 2021-01-01 12:29:38 +01:00
puzzledsab
ada2f2498e Don't crash if nzf is gone (#1731)
* Don't crash if nzf is gone

* Catch AttributeError and add comment
2020-12-31 17:24:25 +01:00
SABnzbd Automation
c736446872 Update translatable texts 2020-12-31 15:38:07 +00:00
puzzledsab
a1e7d5b36f Pause on full Complete Download Folder and regularly check if there is enough space to resume (#1724)
* Add pause on full Complete Download Folder and optional time limit for full disk pause

* Use nzo.bytes_tried in completed dir disk full check

* It's so black or white

* Don't pause on full download disk until it's necessary and don't apply timed pause to temporary disk

* Simpler ifs

* Compare with downloaded bytes, not remaining

* Fix comparison

* Increase pause check to 90% finished

* Subtract par2 files and increase limit to 95%

* Use checkbox for automatic resume and task scheduler for checking free space

* Make canceling resume task a separate method

* Black

* Replace some logging.debug with logging.info

* Remove sabnzbd.directunpacker.abort_all

* Rewrite explain-fulldisk_autoresume explanation

* Ignore complete_free if 0

* Style changes

* Remove scheduled task if the downloading is continued

* 'Every few minutes'

* Fix unchecking of fulldisk_autoresume in config page and don't do autoresume task if it has been disabled

* Black is rather picky

Co-authored-by: Safihre <safihre@sabnzbd.org>
2020-12-31 16:37:01 +01:00
SABnzbd Automation
24fd5a5e0b Update translatable texts 2020-12-31 14:24:54 +00:00
Sander
bc4557432a Test download 10GB (#1730)
* Test download 10GB

* "1000MB" renamed to "1 GB" in the GUI
2020-12-31 15:24:13 +01:00
Tim Gates
5df4a76367 docs: fix simple typo, sturct -> struct
There is a small typo in sabnzbd/utils/rarfile.py.

Should read `struct` rather than `sturct`.
2020-12-28 23:22:01 +01:00
Safihre
48d566fd98 Form element for Add NZB window was not closed breaking other windows
https://forums.sabnzbd.org/viewtopic.php?f=13&t=25121
2020-12-28 21:42:51 +01:00
Safihre
f9cd328b3a Update encryption check to handle partially assembled files
https://forums.sabnzbd.org/viewtopic.php?f=3&p=123147
In SABnzbd 3.x we write incomplete files to the disk instead of waiting for a file to be 100% complete.
So the password check fails because it will check part001 and automatically continue to part002. Instead of crashing with a "can't find part002" (this we expect) it finds a incomplete part002 and crashes with a different error that we don't catch.
Alternatively it can crash due to starting to check on part002 while part001 isn't there yet. This used to work, but broke now.
2020-12-28 17:35:40 +01:00
SABnzbd Automation
a24c13d8ce Update translatable texts 2020-12-26 12:43:26 +00:00
jcfp
8b5494d0a6 add selecting by nzo_id(s) for api queue and history output (#1718)
* add select by nzo_id to history api

* add select by nzo_id to queue api

* add tests for selecting by nzo_ids

* Do not run codesign step on pull requests

Co-authored-by: Safihre <safihre@sabnzbd.org>
2020-12-26 13:42:42 +01:00
Safihre
7f0e8f5591 Correctly keep track of article statistics 2020-12-26 13:20:40 +01:00
SABnzbd Automation
14f4e09676 Update translatable texts 2020-12-25 22:31:25 +00:00
puzzledsab
c5aa61e191 Use x- instead of X- with lowered line in decoder 2020-12-25 23:30:43 +01:00
SABnzbd Automation
c50efd7efd Update translatable texts 2020-12-25 00:32:40 +00:00
Safihre
c23c239ce9 Show article statistics in Config Servers
Closes #1226
2020-12-25 01:31:51 +01:00
SABnzbd Automation
5a1b92f060 Update translatable texts 2020-12-24 14:09:23 +00:00
Safihre
b7375b5a8e Keep track of article statistics for each server
Basis for #1226, still need to work on displaying the information.
2020-12-24 15:08:38 +01:00
Safihre
c42b5b2bb6 Prevent flash of unstled content of the Add NZB button
Before Knockout is active, the number of columns is 6 because of the foreach-loop.
2020-12-24 10:26:33 +01:00
Safihre
809783cd53 Build binary release for each commit and pull request (#1708)
* Build binary release for each commit and pull request

* Codesign macOS release
2020-12-24 09:57:21 +01:00
SABnzbd Automation
b5c5a18216 Update translatable texts 2020-12-23 22:14:02 +00:00
Safihre
49b4dca12c Improvements to the "Add NZB" modal window
Closes #1560
2020-12-23 23:13:18 +01:00
Safihre
37b03e6e37 RSS error messages with HTML characters would not be displayed 2020-12-23 20:35:59 +01:00
Safihre
70b92b5961 Make sure RSS titles with HTML characters can be modified 2020-12-23 20:23:04 +01:00
Safihre
f31da2a8e6 Make it possible to edit RSS Titles
Closes #1706
2020-12-23 20:22:36 +01:00
SABnzbd Automation
c68ff15f38 Update translatable texts 2020-12-23 16:50:40 +00:00
Safihre
bd1fe2b1cd Notify through Notifications if new version is available 2020-12-23 17:49:42 +01:00
Safihre
a1f3914054 Correct notification category for failed URL fetches 2020-12-23 17:39:15 +01:00
SABnzbd Automation
2d9dc48076 Update translatable texts 2020-12-23 10:43:18 +00:00
puzzledsab
c80c120153 Add multiple extra queue/history columns and option for unlimited width (#1714)
* Add option for unlimited width

* Add skintext

* Select multiple extra columns

* Fix some markup

* Suggested changes

* Retrigger tests

* Make it possible to select multiple history columns as well

* Do not show extra columns on <1200px

* Fix Add NZB-row

Co-authored-by: Safihre <safihre@sabnzbd.org>
2020-12-23 11:42:41 +01:00
Safihre
b75c23772e Remove unused function is_obfuscated_filename 2020-12-23 11:38:50 +01:00
SABnzbd Automation
d9a94bc59c Update translatable texts 2020-12-23 10:37:58 +00:00
Safihre
e446ab4762 Log which filename we are checking for obfuscation 2020-12-23 11:36:57 +01:00
SABnzbd Automation
2a656d437e Update translatable texts 2020-12-22 21:57:44 +00:00
Sander
7473cd2264 Warning for enabling HTTPS (#1715)
* GUI show warning for enabling HTTPS

* GUI show warning for enabling HTTPS. Make black happy

* GUI show warning for enabling HTTPS: warning in separate string

* GUI show warning for enabling HTTPS: Warning embedded

* GUI show warning for enabling HTTPS: proper class stuff
2020-12-22 22:57:05 +01:00
Safihre
9fb1c0fbbb Remove Glitter fade-on-delete
Closes #1710
2020-12-22 17:53:13 +01:00
SABnzbd Automation
4ae0e75dc9 Update translatable texts 2020-12-19 23:26:34 +00:00
Safihre
2632ce537a Refactor of the osxmenu functions
Closes #1683
2020-12-20 00:25:29 +01:00
SABnzbd Automation
4d79261851 Update translatable texts 2020-12-19 12:00:57 +00:00
puzzledsab
fadae5e33e Show per-server speed (issue #1150) (#1704)
* Show current server speed on server config page

* Show server bps on Status and interface page

* Make black happy

* Remove server bps from config page

* Small optimization tweak

Co-authored-by: Safihre <safihre@sabnzbd.org>
2020-12-19 12:59:52 +01:00
puzzledsab
7f702b7025 Make sleep more fine grained and add short sleep when no processing is done (#1697)
* Make sleep more fine grained and add short sleep when no processing is required

* Fix black complaint

* Only calculate sleep time when needed

* Remove empty line

* Add sleep_time variable to Downloader

* Make sure it sleeps in decoder and BPSMeter, even when sleep_time is 0

* Longer sleep for decoder and bandwidth limit delays

* Remove BPSMeter get_stable_speed as it is no longer used

* retrigger checks

* Updates based on feedback

* No more minimum value

* 0.01 it is

Co-authored-by: Safihre <safihre@sabnzbd.org>
2020-12-18 20:01:51 +01:00
SABnzbd Automation
db255a8b7e Update translatable texts 2020-12-15 12:57:36 +00:00
Safihre
47b8d1de39 Don't activate Windows notifications when running as service
Closes #1705
2020-12-15 13:56:33 +01:00
Safihre
01ea1d2910 Keep original priority of duplicate jobs
Closes #1702
2020-12-13 11:46:27 +01:00
Safihre
f5f8aa985e Sort script drop-down list alphabetically
Closes #1699
2020-12-12 19:13:27 +01:00
Safihre
1a848cf5fe Smarter extraction of filenames from NZB-subject 2020-12-12 17:18:58 +01:00
puzzledsab
b748b05fbd Only check idle servers for new articles twice per second (#1696)
* Only check idle servers for new articles twice per second

* Fix black complaint

* Store time.time() in variable in DL loop

* No need to check server for last_busy if it was just set
2020-12-12 17:05:29 +01:00
Safihre
9f2a9c32c0 Switch to GitHub Actions for CI
Removed the par2 files for the unicode job, they caused too much problems. It's a bad "fix" for #1509.
2020-12-12 16:52:43 +01:00
jcfp
92d0b0163a prevent repetition of unwanted extension warnings (#1695) 2020-12-11 21:09:16 +01:00
Safihre
c50e2a4026 Small tweak of where set_download_report is called 2020-12-10 16:06:28 +01:00
Safihre
69ffa159c7 Correctly use dict.keys()
Solves https://forums.sabnzbd.org/viewtopic.php?f=2&t=25087
2020-12-08 10:11:35 +01:00
Sander
81089fc20a obfuscated rar sets: better handling missing rars (#1688)
* obfuscated rar sets: better handlin missing rars

* obfuscated rar sets: make black happy

* rarset: cleanup unused code

* rarset: cleanup unused code

* rarset: wrong is_obfuscated_filename
2020-12-06 16:39:43 +01:00
Sander
3d09f72c90 Fixed pattern obfuscation detection (#1691)
* obfuscated: recognize fixed pattern abc.xyz as obfuscated

* obfuscated: recognize fixed pattern abc.xyz as obfuscated

* obfuscated: recognize fixed pattern abc.xyz as obfuscated - extra test

* obfuscated: recognize fixed pattern abc.xyz as obfuscated - black happy

* obfuscated: recognize fixed pattern abc.xyz as obfuscated - r"bla"
2020-12-03 07:53:16 +01:00
SABnzbd Automation
ef7d84b24d Update translatable texts 2020-11-28 20:37:02 +00:00
Safihre
9b71f8ca4b Use fully customizable date ranges for server graphs
Closes #1645
2020-11-28 21:35:03 +01:00
Safihre
04c3fc77cb On Travis use Python 3.9 now it is stable
Closes #1677
2020-11-27 15:21:35 +01:00
Safihre
c6cc6f4537 Correct Git-commit detection when running in different folder
Closes #1676, #1675
2020-11-27 15:19:29 +01:00
Sander
f31a4440f1 diskspeed: follow pylint's advice, and more pytesting (#1678)
* diskspeed: follow pylint's advice, and more pytesting

* diskspeed: improved hint, catch relevant exceptions

* diskspeed: lower tun time to 0.5 s (as we run it twice)

* diskspeed: make black and pylint happier

* Delete somefile.txt
2020-11-27 14:34:42 +01:00
jcfp
84b1e60803 fix sabnews regex deprecation warning (#1685) 2020-11-26 21:11:33 +01:00
jcfp
a434a5f25d Explicitly set mode for gzip.GzipFile() (#1684) 2020-11-26 21:10:46 +01:00
Safihre
09e844a63f Do not crash in Queue Repair if there was no resulting NZO
Closes #1649
2020-11-22 12:49:04 +01:00
jcfp
c55e114131 normalize shebang for utils, example script (#1679) 2020-11-17 08:55:37 +01:00
Sander
575fbc06aa IPv4 IPv6 library based testing (#1673)
* IPv4 IPv6 library based testing

* IPv4 IPv6 library based testing ... make black happy again
2020-11-13 17:19:52 +01:00
Sander
19376805de Ssdp for real ... more improvements (#1656)
* Add base implementation of SSDP util

* SSDP+XML: working setup #1

* SSDP+XML: with socket ... as sock

* SSDP+XML: unique UUIDs

* SSDP+XML: simpler constructions of XML URL

* SSDP+XML: cleaner SSDP and XML, steady UUID in XML, better logging

* SSDP+XML: UUIDs into __init__(). Better, innit?

* SSDP+XML: Make black happy again

* SSDP+XML: Make black happy again ... now for interface.py

* SSDP+XML: creation of SSDP message and XML to __init__()

* SSDP+XML: changes based on feedback

* SSDP+XML: no more SABnzbd references in ssdp.py. No network is OK now.

* SSDP+XML: references to specs for SSDP and the XML

Co-authored-by: Safihre <safihre@sabnzbd.org>
2020-11-13 15:17:15 +01:00
jcfp
5ea6a31bc2 Api tests (#1668)
* fix deprecation warning in sabnews regex

* enable text, xml returns from get_api_result

* add api tests

* add functional api tests

* add tavern.yaml files to test data

* explicitly add lxml to work around pip dependency issues

* prevent pytest from picking up the tavern files

* Revert "fix deprecation warning in sabnews regex"

This reverts commit 4f0b7131e7.

* address minor issues

* integrate fixtures into conftest

* black :/

* harden queue repair test

* try a workaround for extremely slow test runs on windoze

* Correct server detection in functional tests

* move scripts dir inside SAB_CACHE_DIR

* also relocate the generated script

Co-authored-by: Safihre <safihre@sabnzbd.org>
2020-11-08 18:37:48 +01:00
Safihre
2714ffe04d Do not crash if we cannot format the error message 2020-11-08 15:09:52 +01:00
exizak42
c38eac0e46 Separate email message lines are with CRLF (#1671)
SMTP protocol dictates that all lines are supposed to be separated
with CRLF and not LF (even on LF-based systems). This change ensures
that even if the original byte string message is using `\n` for line
separators, the SMTP protocol will still work properly.

This resolves sabnzbd#1669

Fix code formatting
2020-11-06 16:19:38 +01:00
Safihre
fccc57fd52 It was not possible to set directory-settings to empty values 2020-11-06 16:15:08 +01:00
jcfp
fea309da11 fix order for sorting queue by avg_age (#1666) 2020-11-01 19:37:30 +01:00
Safihre
d867881162 Deobfuscate-during-download did not work
https://forums.sabnzbd.org/viewtopic.php?f=3&t=25037
2020-11-01 15:39:41 +01:00
SABnzbd Automation
af9a7d2fb3 Update translatable texts 2020-11-01 13:22:36 +00:00
Safihre
259584b24f Less strict validation in test_functional_downloads due to #1509 2020-11-01 14:21:29 +01:00
SABnzbd Automation
38f61f64c7 Update translatable texts 2020-10-30 16:40:42 +00:00
Safihre
3e9bfba4d6 Improve handling of binary restarts (macOS / Windows) 2020-10-30 17:39:48 +01:00
Safihre
be26c7f080 mode=reset_quota api call returned nothing
Closes #1661
2020-10-28 16:16:49 +01:00
jcfp
6b8befdc67 Fix nzbstuff scan_password, expand tests (#1659)
* fixes for scan_password, expand tests

* correct typ0

* correct check for index of {{
2020-10-27 07:31:07 +01:00
Safihre
423e4e429b Add functional test for Queue Repair
Relates to #1649
2020-10-24 12:03:24 +02:00
SABnzbd Automation
53aba47915 Update translatable texts 2020-10-23 16:24:37 +00:00
jcfp
87f90b004f randomize age for generated nzb files in sabnews (#1655)
* randomize age for generated nzb files

Useful for testing queue sorting function of the api. Timestamp values are randomly chosen between september '93 and now.

* Sigh.
2020-10-23 18:23:56 +02:00
SABnzbd Automation
0b96afb055 Update translatable texts 2020-10-22 16:35:48 +00:00
Safihre
8e99ebe5ef Remove path length limitation on admin_dir and download_dir 2020-10-22 18:34:59 +02:00
Safihre
6e06d954fe Refactor of config.py and added typing hints to config.py and others 2020-10-22 16:10:24 +02:00
jcfp
497abb83da only replace the first occurence of "script_" (#1651)
* only replace the first occurence of "script_"

Use of str.replace() without a count replaces all occurences. As a result, scripts with filenames such as "my_script_for_sab.py" would be mangled when trying to set them as action on queue completion.

* also modify the check of the action var
2020-10-22 16:03:31 +02:00
Safihre
7ffebd97b9 Use constant for all localhost-definitions 2020-10-22 12:04:07 +02:00
SABnzbd Automation
55a5855720 Update translatable texts 2020-10-21 09:02:34 +00:00
Safihre
adc828dc8a Pin GitHub-actions versions 2020-10-21 11:01:28 +02:00
Safihre
6c5c9e0147 After pre-check the job was not restored to the original spot 2020-10-16 16:15:42 +02:00
Safihre
baa9ffb948 Applying Filters to a feed would result in crash
Closes #1634
2020-10-15 18:07:18 +02:00
Safihre
92541fec23 Allow failure of download_unicode_made_on_windows test due to bug #1633 2020-10-13 12:35:49 +02:00
Safihre
b1f6448ae0 Update import of sabnzbd.getipaddress 2020-10-12 23:52:34 +02:00
Safihre
fc72cf0451 Use same AppVeyor image as used for the releases 2020-10-12 23:18:30 +02:00
Sander
c76d931b01 bonjour/zeroconf improved (#1638)
* bonjour/zeroconf improved

* bonjour/zeroconf improved black formatting

* bonjour/zeroconf improved import
2020-10-12 23:17:56 +02:00
jcfp
02ef37d381 localhost is all of 127.0.0.0/8 not just /16 2020-10-11 11:42:11 +02:00
Safihre
329b420c0d Use same AppVeyor image as used for the releases 2020-10-09 22:43:32 +02:00
SABnzbd Automation
10049d0c1f Update translatable texts 2020-10-09 20:27:13 +00:00
Safihre
1e602d86bd Only start Direct Unpack after all first-articles are recieved 2020-10-09 22:26:23 +02:00
Safihre
f22ab0068e Notify Plush users that the skin is no longer maintained 2020-10-09 09:42:37 +02:00
SABnzbd Automation
3700e45e7f Update translatable texts 2020-10-09 07:37:00 +00:00
Safihre
36196a176e Update text for "Post-Process Only Verified Jobs"
Closes #1632
2020-10-09 09:36:18 +02:00
Safihre
72907de5ef Use newer version of black pipeline 2020-10-08 10:53:11 +02:00
Safihre
9a7385789e Show commit hash when running from GitHub sources 2020-10-07 20:50:25 +02:00
Safihre
d13893d1c7 Direct Unpack parsing was broken
Closes #1630
2020-10-07 20:31:34 +02:00
Safihre
1a8031c75d Use browser URL on last page of Wizard
Closes #1617
2020-10-07 12:35:24 +02:00
Safihre
9d10261a9f Reset decoded_data variable in Decoder and some style changes 2020-10-04 22:27:18 +02:00
Safihre
d0a7ff00fc Reference the right GitHub-issue 2020-10-04 22:27:18 +02:00
Safihre
b80d0ee458 URLGrabber would leave reference to NzbObject 2020-10-04 22:27:18 +02:00
Safihre
53069492b1 Add tests to verify no objects are left in memory after downloading 2020-10-04 22:27:18 +02:00
Safihre
3e2dad4a7e Properly manage all references to Nzo/Nzf/Article objects 2020-10-04 22:27:18 +02:00
Safihre
fca1e5355e Remove unused code 2020-10-02 11:42:49 +02:00
SABnzbd Automation
47c0fd706f Update translatable texts 2020-10-02 09:35:35 +00:00
Safihre
4c4ffb2f54 For reliability use internal webserver to test RSS feed parsing
We already have all the dependencies due to pytest-httpbin
2020-10-02 11:34:43 +02:00
SABnzbd Automation
ade477c6e5 Update translatable texts 2020-10-02 08:24:35 +00:00
Safihre
719b966709 Reset updated .pot files after pytest 2020-10-02 10:23:37 +02:00
SABnzbd Automation
2085c04717 Update translatable texts 2020-09-30 20:30:08 +00:00
Safihre
12a4e34075 Remove unused global DIR_APPDATA variable 2020-09-30 22:29:27 +02:00
SABnzbd Automation
13dd81ebbd Update translatable texts 2020-09-30 11:56:39 +00:00
Safihre
a9492eb25f Small refactor of the GUI-logger 2020-09-30 13:55:52 +02:00
SABnzbd Automation
4dabbb7590 Update translatable texts 2020-09-29 20:38:18 +00:00
Safihre
64b78bddd6 CI pipeline optimizations
Remove PPA (not needed)
Remove LGTM (not used)
Stop logging all API-requests
2020-09-29 22:37:15 +02:00
Safihre
5a02554380 Allow aborting at any point during external post-processing
Closes #1271
2020-09-29 22:37:15 +02:00
Safihre
c312f3917f Resolve unresolved references
dd
2020-09-29 22:37:15 +02:00
Safihre
30654af261 Scheduler refactor and add additional typing 2020-09-29 22:37:15 +02:00
Safihre
29aa329038 Notify users of Deobfuscate.py that it is now part of SABnzbd 2020-09-29 14:09:04 +02:00
Safihre
cfbb0d3bf6 Only set the "Waiting" status when the job hits post-processing
https://forums.sabnzbd.org/viewtopic.php?f=11&t=24969
2020-09-29 13:28:31 +02:00
Safihre
388f77ea52 Only run Windows Service code when executed from the executables
Could be made to work with the from-sources code.. But seems like very small usecase.
Closes #1623
2020-09-29 10:42:06 +02:00
SABnzbd Automation
139c2f3c14 Update translatable texts 2020-09-28 20:46:14 +00:00
Safihre
dab544bc93 Use HistoryDB as a contextmanager 2020-09-28 22:44:57 +02:00
Safihre
0070fce88d sqlite Row object does not support get-operation 2020-09-28 16:05:04 +02:00
Safihre
c27ecfe339 Revert "Fixes after the RSS and Rating-refactor"
This reverts commit 746de90700.
2020-09-28 15:09:22 +02:00
Safihre
746de90700 Fixes after the RSS and Rating-refactor 2020-09-27 17:57:29 +02:00
Safihre
c580f1aff7 Skip DirectUnpack parsing when there is nothing new yet 2020-09-27 17:57:10 +02:00
Safihre
93b429af8b We do not need to trim incomplete paths on Windows anymore 2020-09-27 17:57:10 +02:00
Safihre
f0e2e783a8 Force UnRar and Multipar to output UTF8 2020-09-27 17:57:10 +02:00
Safihre
9c2af4281a Set execute bit on Deobfuscate.py 2020-09-27 17:18:47 +02:00
SABnzbd Automation
c12e25217b Update translatable texts 2020-09-27 11:32:35 +00:00
Safihre
d5d0903591 Handle failing RSS-feeds for feedparser 6.0.0+
Closes #1621
Now throws warnings (that can be disabled, helpfull_warnings) if readout failed.
2020-09-27 13:31:51 +02:00
Safihre
72bde214a3 Missed one RSSReader replacement
Closes #1625
2020-09-27 12:46:44 +02:00
Safihre
3ae2cbcd2c Prevent unnecessary trackbacks from Rating.py 2020-09-27 09:29:24 +02:00
Safihre
82b3f210f6 Refactor RSS to fit the rest of the threads 2020-09-27 09:22:51 +02:00
Safihre
b8e67c558d Add NzbRatingV2 to rating.py for backwards compatibility
Closes #1624
2020-09-27 09:02:33 +02:00
Safihre
371bcfbf5b Correct function-calls in scheduler.py
Leftover from previous refactor.
2020-09-27 08:58:34 +02:00
Safihre
d75f1ed966 Small refactor of unpack_history_info 2020-09-26 11:34:49 +02:00
Safihre
5e4c3e0fa4 Small refactor of diskspace function 2020-09-26 10:13:32 +02:00
Safihre
2c2642a92a Small changes to rating.py and additional typing 2020-09-25 15:30:07 +02:00
SABnzbd Automation
afa0a206bc Update translatable texts 2020-09-25 11:47:00 +00:00
Safihre
57a8661988 Existing files were not parsed when re-adding a job 2020-09-25 10:49:20 +02:00
Safihre
a57b58b675 Do not crash if attributes file is not present 2020-09-25 10:43:21 +02:00
Safihre
8b051462a8 Do not crash if we can't save attributes, the job might be gone 2020-09-25 10:02:28 +02:00
Safihre
3bde8373a3 Correctly parse failed_only for Plush 2020-09-23 16:56:45 +02:00
Safihre
73df161cd0 Remove redundant "do" attribute 2020-09-23 15:40:36 +02:00
Safihre
9c83fd14bc Improve typing hints after rework of main threads 2020-09-23 13:13:36 +02:00
Safihre
ab020a0654 Rework the naming of the main SABnzbd threads 2020-09-23 13:13:36 +02:00
Safihre
14e77f3f9b Add typing hints to some SABnzbd-specific objects and general functions
Bye, Python 3.5.
Also includes fixes that I found because I added these type hints!
2020-09-23 13:13:36 +02:00
SABnzbd Automation
730d717936 Update translatable texts 2020-09-21 20:12:52 +00:00
Safihre
91a7a83cd5 Assume RarFile parses the correct filepaths for the RAR-volumes
Parsing UTF8 from command-line still fails.
https://forums.sabnzbd.org/viewtopic.php?p=122267#p122267
2020-09-21 21:31:25 +02:00
Safihre
6fb586e30f work_name would not be sanatized when adding NZB's
Closes #1615
Now with tests, yeah.
2020-09-20 11:57:29 +02:00
SABnzbd Automation
05b069ab8e Update translatable texts 2020-09-19 09:12:20 +00:00
Safihre
33a9eca696 More text-file updates for 3.2.0-develop 2020-09-19 11:11:38 +02:00
SABnzbd Automation
2b969c987c Update translatable texts 2020-09-19 08:59:41 +00:00
Safihre
f6c15490cc Set version to 3.2.0-develop and drop Python 3.5 support 2020-09-19 10:58:49 +02:00
SABnzbd Automation
da5e95595d Update translatable texts 2020-09-19 08:49:15 +00:00
Safihre
56343b9d19 Update text files for 3.1.0RC1 2020-09-19 10:48:33 +02:00
SABnzbd Automation
d2a4f5cbe5 Update translatable texts 2020-09-18 14:03:31 +00:00
Safihre
bf5f071e9d Show a clear error if user tries to set the Complete Folder as a subfolder of the Complete folder 2020-09-18 16:02:42 +02:00
Sander Jonkers
5d14aac430 deobfuscate: exclude BR files stuff, subdir unittest 2020-09-18 16:02:29 +02:00
Sander
f69f895418 Deobfuscate newfiles (#1612)
* deobfuscate: based on newfiles

* deobfuscate: based on newfiles, black-cleaned

* deobfuscate: yet another black try

* deobfuscate: with upgraded black module

* deobfuscate: improved unittests

* deobfuscate: improved unittests

* deobfuscate: improved unittests

* deobfuscate: removed deobfuscate_dir()

* deobfuscate: extra unittests: lite and nasty

* deobfuscate: black try again

* deobfuscate: black try again, and again
2020-09-16 22:08:10 +02:00
jcfp
e572c34743 show program name and version in tooltip (#1611) 2020-09-14 10:47:46 +02:00
SABnzbd Automation
822f3a760f Update translatable texts 2020-09-13 14:39:37 +00:00
Safihre
274c236860 Add Python 3.9 to Travis and limit feedparser for Python 3.5 2020-09-13 16:38:50 +02:00
SABnzbd Automation
29d074732d Update translatable texts 2020-09-13 11:05:24 +00:00
Safihre
097cec5283 Remove fallback in load_attribs
As it was included in 3.0.x, it can already be removed.
2020-09-13 13:01:54 +02:00
Safihre
f0ee73f03b Only check for ratings when rating (indexer integration) is enabled 2020-09-12 17:37:10 +02:00
Safihre
691110af2c Refactor the fetching of the history
Remove "completeness", make sure the active post-proc queue is also filtered.
Closes #595
sdfsdfsd
2020-09-12 17:37:10 +02:00
Safihre
1c7d3cc66d Update text files for 3.1.0Beta2 2020-09-12 11:09:02 +02:00
Safihre
58df97961b Do not crash on par2-only jobs
Closes #1608
2020-09-12 10:49:27 +02:00
Safihre
61cefb3308 Warn about Python 3.5 support being dropped after 3.1.0
Closes #1607
2020-09-12 10:31:43 +02:00
Safihre
694b0178e6 Revert "Add typing hints to some SABnzbd-specific objects"
This reverts commit b143767f8d.
2020-09-12 10:21:53 +02:00
Safihre
48ae414941 Skip counting of downloaded bytes of postponed files
So we no longer see 110/100MB completed.
Articles could keep coming in after the par2 files were already postponed. When postponing the articles the bytes_tried are already decreased.
2020-09-11 17:28:45 +02:00
Safihre
b143767f8d Add typing hints to some SABnzbd-specific objects 2020-09-11 17:26:30 +02:00
Sander
11de24ad4f Deobfuscate final files: more intelligence, default obfuscated = True, (#1603)
* Deobfuscate final files: more intelligence, default obfuscated = True, more unit testing

* Deobfuscate final files: typo's

* Deobfuscate final files: cleanup of is_probably_obfuscated
2020-09-11 16:39:24 +02:00
Safihre
a9c5f2e184 Move priorities constant to constants 2020-09-11 16:08:51 +02:00
Safihre
ed3ad27560 Show version in Windows tray icon tooltip
Closes #1604
2020-09-11 15:56:49 +02:00
Safihre
a6632b6e3e Consistency in build_history_info
Would show long-path notation for active history
2020-09-11 15:56:49 +02:00
SABnzbd Automation
2d49e7b4ce Update translatable texts 2020-09-11 13:31:09 +00:00
Safihre
c097ad828d Rework ArticleCache locking
Closes #1602
2020-09-11 15:29:52 +02:00
Safihre
7125ee469f Correct: Duplicate Detection doesn't look at History filenames
fbb637e5e3
Closes #1601
2020-09-08 12:44:25 +02:00
Safihre
f91646f956 Log when sending a notification 2020-09-08 09:27:09 +02:00
SABnzbd Automation
5bd86b6fb7 Update translatable texts 2020-09-07 14:25:10 +00:00
Safihre
e12ed3e6f1 Style changes of database.py 2020-09-07 16:20:48 +02:00
Safihre
33a5d34bbf Regression: Duplicate Detection doesn't look at History filenames
In py3-merge this code was lost.
fbb637e5e3
2020-09-07 16:05:13 +02:00
SABnzbd Automation
94662f5831 Update translatable texts 2020-09-06 17:07:41 +00:00
Safihre
a37ffe5b4d Remove unnecessary WARNING label workaround 2020-09-06 19:04:14 +02:00
Safihre
fa1b421dad Special files-in-nzb sorting for Unwanted Extensions did not work
And general rework of the sorting.
2020-09-06 19:00:01 +02:00
SABnzbd Automation
93727c52ae Update translatable texts 2020-09-06 14:41:19 +00:00
Safihre
0108730004 Set a maximum on the maximum length of a foldername
Closes #1597
2020-09-06 16:40:39 +02:00
Safihre
10b97e708a Move the parsing of priority=PAUSED when adding NZB's
Closes #1600
2020-09-06 16:27:04 +02:00
SABnzbd Automation
cfa23ca27e Update translatable texts 2020-09-05 09:03:12 +00:00
Safihre
5290eaefc7 Fix styling of mult-edit box
Closes #1596
2020-09-05 11:02:34 +02:00
Safihre
2626b715ab Skip os.makedirs on Windows if the folder already exists
https://bugs.python.org/issue41705
https://forums.sabnzbd.org/viewtopic.php?f=3&t=24939&p=122017
2020-09-03 21:40:54 +02:00
Safihre
99bc350f5f Input for run_command needs to be a list in unrar_check
https://www.reddit.com/r/SABnzbd/comments/ilocdd/unrar_version_warning/
2020-09-03 15:35:04 +02:00
Safihre
ee38441779 On Windows we do need startupinfo in POpen to prevent popups
https://forums.sabnzbd.org/viewtopic.php?f=11&t=24944
2020-09-03 15:29:58 +02:00
Safihre
f0d31e0dc2 Update text files for 3.1.0 Beta 1 2020-09-02 10:48:39 +02:00
Safihre
4a08b47c07 Allow all versions of feedparser again 2020-09-02 10:03:27 +02:00
Safihre
2d588a6498 Disable the relative URL resolver in feedparser
kurtmckee/feedparser/issues/209
2020-09-01 14:52:31 +02:00
Safihre
510ec977b8 Compatibility with feedparser 6.0.0
Closes #1567
2020-09-01 13:54:58 +02:00
Safihre
420a3d385d Let CherryPy handle relative URL-redirection
Need for proxies!
https://forums.sabnzbd.org/viewtopic.php?f=2&t=24925
https://forums.sabnzbd.org/viewtopic.php?f=11&t=24790
2020-09-01 09:29:29 +02:00
Safihre
30185d1dbe Strip slash of the end of url_base as it breaks the code
Closes #1590
2020-08-31 14:00:40 +02:00
Safihre
642f949ae9 Add more locking to ArticleCache
Recieved bug-reports
2020-08-30 20:33:29 +02:00
Safihre
872804e1f4 Remove the article_list from ArticleCache 2020-08-30 20:16:02 +02:00
Safihre
b5a1575d5a Do not crash in Assembler when file already deleted
Relates to #1509
Hopefully it stops the failing tests.
2020-08-30 19:57:02 +02:00
SABnzbd Automation
95197f94be Update translatable texts 2020-08-30 14:05:42 +00:00
Safihre
fedab57f29 Skip repair if all sets were previously verified succesfully
Closes #1580
2020-08-30 16:05:04 +02:00
Safihre
3054c568ac Move Post-Processing notification to the right spot 2020-08-30 15:54:07 +02:00
Safihre
c0fcc34f52 Do not use long-path notation in real_path on Windows
Turns out long-path notation makes os.path.abspath not trim the final \ of a path. It does remove it on Linux or on non-long-paths. So we just remove the long path during modification and add it back at the end.
Closes #1588.
2020-08-29 10:09:53 +02:00
Safihre
521e2bd7aa Rename TOP_PRIORITY to FORCE_PRIORITY
To match the front-end naming.
2020-08-29 09:12:18 +02:00
Safihre
db4db08550 Update UnRar to 5.91
Relates to #1544
2020-08-29 09:07:29 +02:00
Safihre
977f0204a7 Update Multipar to 1.3.1.0
Relates to #1544
2020-08-29 09:03:04 +02:00
Safihre
78d12ddb03 Propagation delay label was shown even if no delay was activated 2020-08-28 21:36:49 +02:00
Safihre
433dcab02b Update code-style 2020-08-28 10:12:29 +02:00
Safihre
c57563d5ca Reading RSS feed with no categories set could result in crash
Closes #1589
2020-08-28 10:02:43 +02:00
Safihre
fcc4a44695 Removed logging in macOS sabApp that resulted in double logging 2020-08-28 09:52:56 +02:00
Safihre
7d9f9b4d1f Add UTF8 BOM manually to NSIS file 2020-08-26 14:58:38 +02:00
Safihre
f790a9601f Change the macOS power assertion to NoIdleSleep 2020-08-26 08:50:43 +02:00
Safihre
13d44d1ed9 Correct tests for build_and_run_command 2020-08-26 08:49:21 +02:00
Safihre
d57ecd4eaa Add test for build_and_run_command 2020-08-25 15:27:27 +02:00
Safihre
f14e5ba400 No longer use shell=True in Popen-calls on Windows and use python.exe
I cannot find a reason why we should.
2020-08-25 15:27:27 +02:00
SABnzbd Automation
5638f435ba Update translatable texts 2020-08-25 12:12:00 +00:00
Safihre
6b7b8a8203 Refactor usage of Popen-calls 2020-08-25 13:27:14 +02:00
Safihre
942f95364e End-of-queue-script did not run on Windows due to long-path
https://forums.sabnzbd.org/viewtopic.php?f=3&t=24918

Will refactor this so they all call 1 function.
2020-08-24 11:28:25 +02:00
Safihre
e997fb6679 Check if name is a string before switching to nzbfile in addfile
Closes #1584
2020-08-24 09:05:02 +02:00
Safihre
3b8a96de23 Very basic unittests of NZO-object 2020-08-23 09:04:28 +02:00
Safihre
75d6d10649 Link to 3.1.x Configuration pages on Wiki 2020-08-22 17:28:53 +02:00
SABnzbd Automation
26736657fd Update translatable texts 2020-08-22 15:19:19 +00:00
Safihre
27b6194d53 Set version.py to develop again
As not to trigger update checks
2020-08-22 17:18:35 +02:00
SABnzbd Automation
5c158db350 Update translatable texts 2020-08-22 15:15:10 +00:00
Safihre
f54c173479 Refactor Deobfuscate final filenames
Now uses standard SABnzbd functions.
@sanderjo
2020-08-22 17:14:26 +02:00
SABnzbd Automation
d51b337045 Update translatable texts 2020-08-21 18:16:17 +00:00
Safihre
3d693a7b8d Move deobfuscate_final_filenames to Config > Switches
Right where it belongs
2020-08-21 20:15:35 +02:00
Sander
99f34ab71d Deobfuscate / rename final files (#1558)
* Deobfuscate / rename final files

* black formatted ...

* Deobfuscate / rename final files: unittests

* Deobfuscate / rename final files: unittests

* Deobfuscate / rename final files: unittests formatting

* Deobfuscate / rename final files: unittests of real renaming

* Deobfuscate / rename final files: unittests of real renaming - black formatting ...

* Deobfuscate / rename final files: unittests of real renaming - no subdir "data" as travis was complaining

* Deobfuscate / rename final files: into other directory, nicer logging, nicer naming

* Deobfuscate / rename final files: black formatting

* Deobfuscate / rename final files: other order of tests

* Deobfuscate / rename final files: only if all_ok and not nzb_list

* Deobfuscate final files: retry commit

* Deobfuscate final files: feedback from Safihre

* Deobfuscate final files: create option in Special interface

* deobfuscate filenames: better logging, typo's
2020-08-21 19:54:50 +02:00
SABnzbd Automation
cd2f95ac90 Update translatable texts 2020-08-21 17:44:51 +00:00
Safihre
bacea59c0c Remove ABOUT.txt as all info is in README 2020-08-21 19:43:39 +02:00
SABnzbd Automation
f7e84a8f11 Update translatable texts 2020-08-21 13:22:05 +00:00
Safihre
1452ddd5e4 Do not crash if certifi certificates are not available
This could happen on Windows, due to overactive virus scanners
2020-08-21 15:21:21 +02:00
Safihre
abdbdd63f4 Priority was not parsed correctly if supplied as string 2020-08-21 15:08:39 +02:00
Safihre
a92d2b585e Permissions would be set even if user didn't set any
Windows developers like me shouldn't do permissions stuff..
2020-08-21 15:04:46 +02:00
Safihre
3dae1bd104 Converting jobs from 3.0.1 to 3.0.2/3.1.0 would fail 2020-08-20 11:23:53 +02:00
Safihre
e07c0c0981 Set version to 3.1.0-develop 2020-08-19 22:22:28 +02:00
Safihre
b7dcd051b1 Split the make_mo.py command for NSIS 2020-08-19 22:21:19 +02:00
Safihre
25223c8b85 Make sure we force the final_name to string on legacy get_attrib_file 2020-08-19 16:20:46 +02:00
Safihre
d7b1a73777 NzbFile comparison could crash when comparing finished_files
https://forums.sabnzbd.org/viewtopic.php?f=3&t=24902&p=121748
2020-08-19 08:37:10 +02:00
Safihre
df19d4d323 Extend tests of create_all_dirs to cover apply_umask=False 2020-08-18 13:59:39 +02:00
Safihre
10bc4ed611 Combine pip calls 2020-08-17 15:37:00 +02:00
Safihre
b063055e78 Redesigned the saving of attributes
Now uses pickle, so that the type of the property is preserved.
Made flexible, so that more properties can be easily added later.
Closes #1575
2020-08-16 18:27:29 +02:00
jcfp
4f1f422701 set appname for notify2 2020-08-16 16:43:17 +02:00
SABnzbd Automation
7e44a3759f Update translatable texts 2020-08-16 07:53:43 +00:00
Safihre
0a5a4ec0da List Cheetah minimal version in requirements.txt 2020-08-16 09:52:53 +02:00
SABnzbd Automation
c9a5280c7a Update translatable texts 2020-08-16 07:06:42 +00:00
Safihre
c953498a9d Correct spelling error warning_helpful
1f554816b6
Thanks @albino1
2020-08-16 09:05:58 +02:00
SABnzbd Automation
c0ec8fcea2 Update translatable texts 2020-08-15 06:33:49 +00:00
Safihre
7562444763 Convert functions to staticmethod if applicable 2020-08-14 22:45:34 +02:00
Safihre
747add419e Permissions should only be applied if requested
Corrects 050b925f7b
2020-08-14 22:41:00 +02:00
Safihre
f242053d6c Also parse warning_helpfull correctly for translations 2020-08-14 22:27:09 +02:00
Safihre
235df91a37 Improvements for "Redesigned job availability-check"
Always check for every failed article. Fixed bug in loading of NZO from pickled files.
2020-08-14 22:25:26 +02:00
Safihre
97ffa0bac2 Temporarily set cheroot version due to it breaking our tests
cherrypy/cheroot/issues/312
2020-08-14 15:22:22 +02:00
Safihre
c6bc7d93f4 Redesigned job availability-check
Closes #1505
More efficient and works on single-file-jobs
2020-08-14 15:11:59 +02:00
SABnzbd Automation
bcc7573756 Update translatable texts 2020-08-12 15:34:17 +00:00
Safihre
1f554816b6 Add option to disable helpful warnings
Closes #1112
2020-08-12 17:33:35 +02:00
Safihre
411463bc57 All Errors and Warnings should be translated 2020-08-12 17:07:28 +02:00
Safihre
1c26685c8c Remove unused parameter of bpsmeter.update 2020-08-12 16:42:58 +02:00
Safihre
1dd4afa5e2 Generalize use of certifi module 2020-08-12 10:45:48 +02:00
Safihre
f9d4477cb1 Basic authentication option was broken
Closes #1571
2020-08-10 15:32:52 +02:00
Safihre
6cbee09950 Also retry "Access Denied" on Windows due to virus scanners
Closes #1569
2020-08-09 17:50:44 +02:00
Safihre
bcf6a5bd09 Permissions were not set correctly when creating directories (#1568)
Restores changes made in d2e0ebe
2020-08-07 15:22:27 +02:00
kaiffeetasse
a00092f5cc Also find passwords which are not at the end of the file (#1562)
* Also find passwords which are not at the end of the file

* reformat file according to black code formatter

* Revert "reformat file according to black code formatter"

This reverts commit c7b16a12

* reformat file according to sabnzbd code conventions in black code formatter

* add tests for scan_password in nzbstuff.py

* add instructions on how to format code when contributing to this repo

* Revert "add instructions on how to format code when contributing to this repo"

This reverts commit ef6efd25

* add tests for file name extraction

* fix tests
2020-08-01 15:01:17 +02:00
Safihre
b36b345ef3 Function from_units should always return float
Probably closes #1557
2020-07-20 08:39:43 +02:00
Safihre
029d97e21c Add forgotten value for new notification option on MacOS
Oopsie
68ad931728
2020-07-19 22:17:03 +02:00
SABnzbd Automation
13331e0709 Update translatable texts 2020-07-19 16:38:28 +00:00
Safihre
68ad931728 Added separated notification for "Added NZB" and "Pause / Resume"
Closes #1049
2020-07-19 18:37:46 +02:00
Safihre
475aa60bcd Update translate-link in SABnzbd 2020-07-19 13:01:27 +02:00
Safihre
2937d8a022 Password input box on "Add NZB" screen
Closes #1554
2020-07-19 09:30:21 +02:00
Safihre
6627510a59 Default-text for Automatically sort queue 2020-07-16 22:29:21 +02:00
Safihre
ac9448cacc RAR-renamer should be run on badly named RAR-files
https://forums.sabnzbd.org/viewtopic.php?f=2&t=24514&p=121433
2020-07-15 14:02:10 +02:00
Safihre
2d7b6717a9 Only really run pre-script when it is set 2020-07-12 14:20:44 +02:00
Safihre
c4aad2a4bd Always use Default-priority when creating NZB-objects
Closes #1552
2020-07-12 14:02:42 +02:00
Safihre
4566f23984 Revert "Use pyOpenSSL for HTTPS in CherryPy"
This reverts commit 084b2b357f.
2020-07-12 08:44:24 +02:00
Safihre
b6621fc333 Feedparser 6.0.0 not yet supported
Our custom parsers need to be ported for Feedparser 6.0.0 support.
2020-07-04 11:14:29 +02:00
Safihre
084b2b357f Use pyOpenSSL for HTTPS in CherryPy
Closes #1548, #1519
2020-07-04 11:11:38 +02:00
Safihre
aa5c63f467 Run Transifex push/pull in GitHub actions
The GitHub integration of Transifex isn't feature-complete. Using the client on every commit gives us more control over all the settings.
2020-07-01 20:23:22 +02:00
Safihre
c365065cdb Search-icon would be shown on top of drop-downs
Closes #1545
2020-06-30 12:57:48 +02:00
Safihre
e4a42de095 Always report API paused status as a boolean
Closes #1542
2020-06-30 10:26:06 +02:00
SABnzbd Automation
245935b7ac Update translatable texts 2020-06-29 15:58:04 +00:00
Safihre
2540a8174f Squashed Transifex update (3) 2020-06-29 17:57:22 +02:00
SABnzbd Automation
38c0a75759 Update translatable texts 2020-06-29 11:56:29 +00:00
Safihre
eac5f20937 Use GNU gettext formatting for POT-translation files 2020-06-29 13:56:06 +02:00
transifex-integration[bot]
a71a2a7a4b Translate /po/main/SABnzbd.pot in fr
translation completed for the source file '/po/main/SABnzbd.pot'
on the 'fr' language.
2020-06-28 10:44:51 +00:00
SABnzbd Automation
856fdd3493 Update translatable texts 2020-06-28 10:25:00 +00:00
Safihre
cbd54bdfe8 Add Github workflow to automatically update translatable texts 2020-06-28 12:24:00 +02:00
Safihre
f294f8c740 Unify header used in POT-files
Removing header generated by pygettext so it doesn't change all the time
2020-06-28 12:19:19 +02:00
transifex-integration[bot]
3079976165 Translate /po/main/SABnzbd.pot in de
translation completed for the source file '/po/main/SABnzbd.pot'
on the 'de' language.
2020-06-28 08:42:46 +00:00
Safihre
020005e89b Squashed Transifex update (2) 2020-06-28 09:46:23 +02:00
Safihre
b73a6d2a7f Squashed Transifex update
Oops, sorry guys.. Setting up the new service takes a bit of trial and error.
2020-06-27 23:06:52 +02:00
Safihre
af5acd16f7 Correct translation template file 2020-06-27 21:17:09 +02:00
transifex-integration[bot]
9d98dbb2a6 Translate /po/main/SABnzbd.pot in he
translation completed for the source file '/po/main/SABnzbd.pot'
on the 'he' language.
2020-06-27 17:05:20 +00:00
Safihre
01406ca2e7 Switch to Transifex for translations 2020-06-27 19:00:09 +02:00
SABnzbd Automation
ca7010abb9 Automatic translation update 2020-06-26 09:41:04 +00:00
SABnzbd Automation
48c57d3d47 Automatic translation update 2020-06-26 09:16:53 +00:00
SABnzbd Automation
51b421c2b5 Automatic translation update 2020-06-26 08:59:46 +00:00
Safihre
e3fc2a159a Update text files for 3.0.0RC1 2020-06-26 10:51:58 +02:00
Safihre
a624669b4d On Windows only support Multipar for verification
And make startup logging nicer: #1506
2020-06-25 23:31:16 +02:00
Safihre
6c9862c634 More settings for default sort when new item is added
Closes #1480
2020-06-22 23:27:30 +02:00
SABnzbd Automation
525c7ade7c Automatic translation update 2020-06-22 13:35:01 +00:00
Safihre
73d3f7b5c2 Validate ionice and nice parameters 2020-06-21 16:20:00 +02:00
Sander Jonkers
db13ae5fc8 Revert ""3" in SABnzbd logo on frontpage"
This reverts commit e95e9d52
2020-06-21 15:25:52 +02:00
jcfp
e37c517f79 set utf-8 encoding in systemd service 2020-06-21 13:22:20 +02:00
Sander
4a9093e0e9 Block unwanted extensions inside an NZB (#1515) 2020-06-19 16:54:57 +02:00
Safihre
4420c36889 Speed-up selenium tests by re-using open browser window 2020-06-18 14:18:11 +02:00
Safihre
6098eb6eac Make the RSS-feed test more stable 2020-06-18 08:40:18 +02:00
Safihre
50b7c8a00c Allow failure for unstable unicode-rar download 2020-06-18 08:40:09 +02:00
Safihre
48d18b3866 Replace test files with smaller files
Closes #1511
2020-06-17 22:33:21 +02:00
Safihre
c0627f342c SABNews handle filenames fully in unicode 2020-06-17 22:33:21 +02:00
Safihre
92efc9ed8a Improve automated download-testing
- Catch all Selenium exceptions while waiting for the download to complete
- Correctly set autodisconnect=0
- Make job-name even more unique
- Wait for the RSS-added job to finish fetching
- Move sabnzbd.basic.ini to data folder
- Use new SAB_DATA_DIR
- Optimized imports
2020-06-17 22:33:21 +02:00
Safihre
00a0d35020 Use sabnzbd.__version__ consistently 2020-06-17 21:49:02 +02:00
Safihre
1cac9ad559 Use sabnzbd.org address when checking for new version 2020-06-17 21:22:35 +02:00
Safihre
0f2c485d05 Set correct User-Agent when making HTTP-calls 2020-06-17 21:19:14 +02:00
Safihre
c4635f99c7 Update text files for 3.0.0Beta4 2020-06-17 10:38:21 +02:00
Safihre
b31803780a Correctly detect filenames of existing files when retrying a job (2)
Oops, it also included directories.
2020-06-16 17:33:18 +02:00
Safihre
86fe3aae1a Restore attributes when retrying a job that failed post-processing
Closes #1510
2020-06-16 17:33:18 +02:00
Safihre
9d0dda7fac During retry only check the Complete folder for missed recursive unpack
Otherwise it would try to unpack the files in the Incomplete folder twice on every Retry.
2020-06-16 17:17:21 +02:00
Safihre
5bc93be26d Rename folders of failed jobs to _FAILED_
This code was always here, but never used. Why?
Relates to #1510
2020-06-16 17:02:51 +02:00
Safihre
140aded113 Correctly detect filenames of existing files when retrying a job 2020-06-16 15:50:12 +02:00
Safihre
3faa0f4f42 Add logging to reading and writing of attribute files 2020-06-16 13:12:47 +02:00
SABnzbd Automation
59b293c398 Automatic translation update 2020-06-16 10:54:40 +00:00
Safihre
18f42b60b6 Category was not parsed correctly when using "addfile"
Relates to #1507
2020-06-15 08:14:36 +02:00
Safihre
aa6c254997 Restore compatibility with Couchpotato and Headphones
Closes #1507
2020-06-15 08:13:22 +02:00
SABnzbd Automation
44f7295830 Automatic translation update 2020-06-14 11:14:28 +00:00
Safihre
22a75a886d Update text files for 3.0.0 Beta 3 2020-06-14 13:06:23 +02:00
Safihre
7e5a43e95c Revert "Code-formatting: optimize imports"
This reverts commit db5ff8c7e1.

Does not work on Python 3.4/3.6. Not really sure why, but don't want to investigate right now.
2020-06-14 11:29:54 +02:00
Safihre
db5ff8c7e1 Code-formatting: optimize imports 2020-06-14 10:21:33 +02:00
Safihre
d9758a7358 Refactor the reusing NZO's
Closes #1289
What a mess again. Hope I broke nothing.
2020-06-14 09:53:46 +02:00
Safihre
8ce6c26f9c Do not scan incomplete directory recursively
Also renamed the recursive_listdir function so it can also be non-recursive. Which was very easy due to the extensive test-set by @jcfp!
Relates to #1304 (that NZB triggered invalid reading of sub-dirs in incomplete folder)
2020-06-13 21:36:48 +02:00
SABnzbd Automation
9040b56ada Automatic translation update 2020-06-13 19:10:35 +00:00
Safihre
15ad60f8a9 Refactor the adding of NZB's (#1502)
- All is handled by sabnzbd.add_nzbfile
- Moved the actual file-processing to nzbparser
- We always support gzip in URLGrabber
- Remove upload.py, all handled by add_nzbfile
- Rework the dirscanner and urlgrabber to the new reality
- Retry job was broken if you added a file
2020-06-13 18:35:50 +02:00
Safihre
3b178d2645 Correctly correct double API-arguments
So many mistakes I made in this little bit of code.
Closes #1503
2020-06-13 18:00:24 +02:00
Safihre
21b7acd60b Proper error-handling of bad email templates
Closes #1431
2020-06-13 09:53:22 +02:00
Safihre
18a96d3286 Make super-sure we have a random job-name in functional tests
Yes, it turned out the job names were not random enough!
https://travis-ci.com/github/sabnzbd/sabnzbd/jobs/348060280
Shows that there are 2 jobs named "testfile_973"
2020-06-12 17:30:18 +02:00
Safihre
2fd72cbd82 API-method addurl should return list of nzo's
https://github.com/theotherp/nzbhydra2/issues/585
2020-06-12 17:16:51 +02:00
Safihre
329a67cb21 Queue-file was saved twice when a job was removed from the queue 2020-06-12 16:28:22 +02:00
Safihre
9155ade937 Correct logging formatting in errors/warnings 2020-06-11 10:54:02 +02:00
Safihre
9bcbcaefdf Black code-style everything 2020-06-11 10:16:53 +02:00
William Friesen
63794869a4 fix variable name that broke pausing (#1500)
this was introduced in 3259f83b9 and broke pausing

Co-authored-by: William Friesen <will@williamfriesen.com>
2020-06-11 09:01:36 +02:00
Safihre
3631138978 Small delay is needed when adding RSS job
It seems sometimes it doesn't right away detect the job in the queue because it is fetching the URL: https://travis-ci.com/github/sabnzbd/sabnzbd/jobs/347249629
2020-06-11 09:00:27 +02:00
Safihre
c2ba998e7b Show all output so maybe at some point we can fix tests 2020-06-10 14:30:46 +02:00
Safihre
93c62c6827 The tests are just.. flaky
Marking them like this will cause them to be retried once if they fail. This also happens from time to time with the happyeyeballs test.
2020-06-10 13:21:30 +02:00
Safihre
593c6ec09c Lower log-level in SABNews and keep SABnzbd connected for test stability 2020-06-10 11:49:39 +02:00
Safihre
8bb6ba2285 Windows: test only on recent Python version 2020-06-10 09:57:25 +02:00
Safihre
39e2254cd5 Add new sets to functional tests 2020-06-09 21:52:50 +02:00
Sander Jonkers
51f361f8d9 tests/data/unicode_rar: simplied chinese chars at two levels: rar and par2, and payload itself 2020-06-09 20:59:11 +02:00
Safihre
0c26af66d7 Correctly name the QuickCheck function 2020-06-09 16:57:41 +02:00
Safihre
1f412fc1c6 Use new sabyenc3.encode function for massive speedup 2020-06-09 12:35:27 +02:00
Safihre
1150f1af71 Test higher number of connections 2020-06-09 12:35:27 +02:00
Safihre
d0510509a4 Compatibility of sabnews with Python 3.5 2020-06-09 12:35:27 +02:00
Safihre
d84444ae73 Convert tests to sabnews 2020-06-09 12:35:27 +02:00
Safihre
8ef7dee0b5 SABnews implementation 2020-06-09 12:35:27 +02:00
Safihre
d658f70d2b Add black as GitHub action 2020-06-09 10:04:31 +02:00
Safihre
308c0ec621 Clean-up of old API code 2020-06-09 08:39:18 +02:00
Safihre
2f45a87f12 API-method addurl only supports adding 1 URL at a time 2020-06-09 08:39:18 +02:00
jcfp
75ddba076f add unittests for urlgrabber._build_request (#1495)
* add unittests for urlgrabber._build_request

* add explicit check for absence of Authorization header
2020-06-08 21:36:14 +02:00
Safihre
a2aefe5242 Remove WinError and use OSError
Removed in Python 3.3
https://www.python.org/dev/peps/pep-3151/
2020-06-08 10:17:11 +02:00
Safihre
3259f83b9d Do not use variable names that shadow built-in ones
Maybe fixes https://forums.sabnzbd.org/viewtopic.php?f=11&t=24785
2020-06-08 09:25:52 +02:00
Sander
65cd41b3c1 happyeyeballs.py: no more -X dev ResourceWarning with unreachable port (#1493) 2020-06-07 17:30:41 +02:00
Sander
8a7d3e8d2a INSTALL.txt: updated details installation from source (#1485)
* INSTALL.txt: updated details installation from source

* INSTALL.txt: updated details installation from source on Linux and PyPI
2020-06-07 11:34:31 +02:00
Safihre
ce29c1f5cb Updata Javascript libraries in the Config 2020-06-07 10:44:34 +02:00
Safihre
f738469444 Update Javascript libraries in Glitter
But not Bootstrap, because the icons are still bad.
2020-06-07 10:44:34 +02:00
Safihre
4ec25f7a60 Queue-item labels no longer part of name but separate API-property 2020-06-07 09:49:16 +02:00
jcfp
c6ccffd1df fix urllib deprecation warning, base64 encoding in _build_request() (#1490)
* fix urllib deprecation warning, base64 encoding in _build_request()

* set user_passwd from urllib supplied values
2020-06-06 22:02:08 +02:00
Sander
539be8fca9 newsunpack.py: is_sfv_file() fix DeprecationWarning in regexp (#1491) 2020-06-06 19:56:15 +02:00
Safihre
f53bf6a4a4 Add automatic closing of stale issues 2020-06-05 10:11:32 +02:00
jcfp
e9b4340a25 extend filesystem tests (#1481)
* extend filesystem tests

* fix test failure when no explicit umask was set

* have black uglify the code

* require case-sensitive fs for test_capitalization_linux

* run black with -l120 instead

* make windows-compatible, fix some minor issues

* mark xfail rather than comment out part of trim_win_path
2020-06-03 15:57:52 +02:00
Safihre
a5b075426b Force Python 3.5 compatibility in black-check 2020-06-02 12:00:46 +02:00
Safihre
b58d26354d Request access to the HOME folder in the snap
https://forums.sabnzbd.org/viewtopic.php?f=3&t=24168
2020-06-02 09:10:01 +02:00
Safihre
75f5066941 Move black to the Python 3.8 job 2020-06-02 07:46:33 +02:00
Sander
d40cebd34d pytest: postproc -> rar_renamer() (#1469)
* pytest: postproc -> rar_renamer()

* pytest: postproc -> rar_renamer(): remove trailing slash

* pytest: postproc -> rar_renamer(): remove trailing slash

* pytest: postproc -> rar_renamer(): check on matching filenames

* pytest: postproc -> rar_renamer(): appveyor Windows compatible, cleaner coding

* pytest: postproc -> rar_renamer(): appveyor Windows compatible, cleaner coding

* pytest: postproc -> rar_renamer(): try without minus

* pytest: postproc -> rar_renamer(): try with distutils.dir_util.copy_tree() instead of shutil.copytree()

* pytest: postproc -> rar_renamer(): formatting to make Travis happy

* pytest: postproc -> rar_renamer(): correct printing in pytest.fail()
2020-06-01 20:54:23 +02:00
Safihre
4b5c0a6e87 Update .gitignore to match new build results 2020-06-01 10:31:18 +02:00
Safihre
faedd22329 Update text files for 3.0.0 Beta 2 2020-06-01 10:20:27 +02:00
Safihre
2aafa1d30d Remove executable and special permissions for files (#1481) 2020-06-01 10:05:32 +02:00
Safihre
331395f665 Rename article_found to article_success 2020-05-31 09:41:10 +02:00
Safihre
ac4a643a8f Remove debug_log_decoding special setting
Just use --log-all if you want everything.
2020-05-31 09:41:10 +02:00
Safihre
e43622fd66 Refactor the decoder failure handling - Retry all CRC errors 2020-05-31 09:41:10 +02:00
Safihre
d8cb71eaf4 Add hover color for queue and history in Glitter Night
Closes #1478
2020-05-31 09:18:52 +02:00
SABnzbd Automation
57afca7fc2 Automatic translation update 2020-05-31 07:06:13 +00:00
Safihre
7cda4d9ce2 Remove unused code in ArticleCache 2020-05-29 23:51:36 +02:00
Safihre
5a7eb4c462 Correctly check for duplicate files inside NZB using first article
This reverts commit 58f20959cc.
2020-05-29 22:29:01 +02:00
Safihre
53003d5289 Update repr of nzf and nzo objects 2020-05-29 14:52:29 +02:00
Safihre
58f20959cc Importing NZB's could crash due to not having a first article 2020-05-29 14:48:41 +02:00
Sander
586168fbb3 internetspeed: run twice to get best result (#1468) 2020-05-27 16:22:21 +02:00
Safihre
53292f07b1 Correct correcting of double parameters in API-calls
Closes #1465
2020-05-27 07:53:01 +02:00
Safihre
4d1f36d60d Update text files for 3.0.0 Beta 1 2020-05-26 14:30:06 +02:00
Sander
c67ec03d5e rar_renamer: Handling of No matching earlier rar file (#1463) 2020-05-26 13:13:33 +02:00
Safihre
1cd6023600 Styles changes to is_sfv_file 2020-05-26 12:45:55 +02:00
Safihre
05501d8c8d Make decoder and postproc more robust against weird data
Relates to #1351
2020-05-26 11:12:16 +02:00
Safihre
44bfcf1106 Unwanted extension check was overly aggressively deleting folders 2020-05-26 11:12:16 +02:00
Safihre
e6ae17445c Remove handling of missing username/password that was never used
Because higher up this status-code is already handled!
2020-05-26 11:12:16 +02:00
Sander
f0ef984276 find and use obfuscated SFV files (#1459)
* isSFVfile(): Checks if given file is a SFV file, and returns result as boolean

* Obfuscated SFV files: find and use them

* Obfuscated SFV files: rename to is_sfv_file()

* is_sfv_file(): regexp based, minor stuff, pytest

* is_sfv_file(): pytest according to black
2020-05-26 10:52:58 +02:00
Safihre
99090bb731 Correct formatting of nzbparser and update texts 2020-05-25 12:30:36 +02:00
Safihre
8b818e1eb5 Prevent saving and editing through API when config is locked 2020-05-25 12:30:36 +02:00
Safihre
f20e7137e6 Remove qstatus-call 2020-05-25 12:30:36 +02:00
Safihre
fbde994106 Replace "session" by "apikey"
Out with the old crap
2020-05-25 12:30:36 +02:00
Safihre
51c9da73fe Remove tapi and replace by api 2020-05-25 12:30:36 +02:00
Safihre
83cbab6318 Remove older cfg items 2020-05-24 21:06:45 +02:00
Safihre
739e86b6b0 Incomplete NZB's always throw parse-errors
So we don't really have "Incomplete" ones anymore.
2020-05-23 10:20:53 +02:00
Safihre
491d1111a2 implementing __eq__ also requires __hash__
Closes #1458
2020-05-23 09:46:57 +02:00
Safihre
e7ca53447a Automatically skip truly duplicate files when adding NZB's
We now compare byte size and ID of first article of the file. If those match, we assume it's the same file. No more need for reject_duplicate_files.
Closes #1453
2020-05-22 16:58:30 +02:00
Safihre
4f79dd70e6 Remove unused property article_count 2020-05-22 16:55:32 +02:00
jcfp
e09b7e2c45 correct regex in check_mount 2020-05-22 15:16:16 +02:00
Safihre
52c4dce922 Re-work handling of non-decodable articles
These used to be send to the Decoder, now handled directly
2020-05-22 11:33:41 +02:00
Safihre
75111c11cb Use lock when reading from Direct Unpacker to prevent crash on delete 2020-05-22 11:29:47 +02:00
Safihre
9d5f3b69bd Always use Chrome and chromedriver from PPA 2020-05-22 10:54:06 +02:00
Safihre
3cd6a71256 Hopeless jobs checks could interfere with eachother
The check based on first articles and based on files differ on opinions!
2020-05-22 10:53:51 +02:00
Safihre
e8b4ab2c18 Do not trigger Direct Unpack for sets we can't parse 2020-05-21 09:37:59 +02:00
Safihre
55b1a41f49 Update the constants to better respond in real-world tests 2020-05-21 08:38:22 +02:00
Safihre
d6f5d33411 Add debug logging when delaying the download 2020-05-21 08:38:22 +02:00
Safihre
d5e03833f0 Rework caching based on decoder and assembler queues 2020-05-21 08:38:22 +02:00
Safihre
68118e3a03 Separate the Decoder threads from the Downloader
Much prettier. Also, remove some weird notation that I introduced myself where I would use the whole sabnzbd.articlecache.ArticleCache, so much typing. Don't know why I would like that?!
2020-05-21 08:38:22 +02:00
Safihre
10b36e9db6 Clear all saved articles when job gets removed from the queue
This somehow got removed in a refactor, could result in massive memory leaks
2020-05-21 08:38:22 +02:00
Safihre
3a74fcdc40 Aborting missing downloads would crash 2020-05-19 13:28:18 +02:00
jcfp
b9210a2801 svg icons for sabtraylinux 2020-05-18 15:12:28 +02:00
Safihre
d2c3a51aac Highlighting of Sorting enabled/disabled status was not triggered onload 2020-05-18 11:05:03 +02:00
Safihre
a2c23f24cf Reworked SFV-verification and support SFV-based deobfuscation
Closes #1438
2020-05-17 16:48:36 +02:00
Safihre
e862918889 Do not crash if no data was found 2020-05-15 20:21:40 +02:00
Safihre
e1cc083a15 Prevent RarFile from reading incomplete files 2020-05-15 20:21:40 +02:00
Safihre
00d0e19b0c Convert 2.x.x jobs to new structure 2020-05-15 20:21:40 +02:00
Safihre
abc9cc6cc4 Article Cache Flusher 2020-05-15 20:21:40 +02:00
Sander
6ca2352666 Deobfuscate: Scan rar files in workdir, but not subdirs (#1447)
Closes #1446
2020-05-15 14:20:04 +02:00
Sander
dfcba6e2fb isFAT: first check it's a dir or file (#1445) 2020-05-15 07:45:58 +02:00
Safihre
0a2de2743b Prevent crash if RSS feed was changed during readout
Closes #1444
2020-05-14 13:54:02 +02:00
Safihre
3d5d38a898 SABYenc is always available in 3.x 2020-05-13 14:02:17 +02:00
jcfp
c353d4b102 fix deprecation warning about escape sequences (#1440)
* fix deprecation warning about escape sequences

* correct patch for CH_ILLEGAL_WIN

* docstrings are string literals too
2020-05-13 13:20:18 +02:00
SABnzbd Automation
40df38f08b Automatic translation update 2020-05-11 12:03:11 +00:00
Safihre
2189a03bc1 Less logging for non-error nw-reset
Closes #1435
2020-05-09 21:27:36 +02:00
jcfp
99f91269b3 check existence of XApp.StatusIcon class (#1433) 2020-05-09 21:25:13 +02:00
Safihre
bfd2ad363a More graceful handling of closed Direct Unpacker 2020-05-09 13:54:11 +02:00
Safihre
bbe9737502 Remove Python 2 support from utils.internetspeed 2020-05-09 13:40:55 +02:00
Safihre
20643da250 Only try to cancel Direct Unpack instance if it is there 2020-05-08 18:00:25 +02:00
SABnzbd Automation
a7552c28c8 Automatic translation update 2020-05-08 06:15:39 +00:00
Safihre
fa5c40e477 Update text files for 3.0.0 Alpha 2 2020-05-07 21:04:02 +02:00
Sander
9ce63fa941 directunpacker: process and filehandles are closed nicely (#1428)
* directunpacker: process and filehandles are closed nicely

* directunpacker: process and filehandles are closed nicely: show traceback
2020-05-06 20:29:27 +02:00
Sander
7a58038842 test_ipv6(): solve a ResourceWarning: unclosed socket.socket (#1426)
* test_ipv6(): solve a ResourceWarning: unclosed socket.socket

* test_ipv6(): solve a ResourceWarning: unclosed socket.socket
2020-05-05 17:21:31 +02:00
Safihre
72130d8fa7 Update translatable texts 2020-05-05 14:09:46 +02:00
SABnzbd Automation
4012c35100 Automatic translation update 2020-05-05 10:08:32 +00:00
Safihre
e5c1a89492 Wrap Selenium functions with a retry-mechanism for stability
Super duper ugly. Blegh, Selenium.
2020-05-05 12:02:49 +02:00
Safihre
b38a3cc97c Add extra command line parameter to improve Selenium stability 2020-05-05 11:14:53 +02:00
Safihre
adcb690662 Move apireg to utils directory 2020-05-05 11:14:53 +02:00
Safihre
233ab2ee6e Restore Windows Service functionality 2020-05-05 11:14:53 +02:00
jcfp
e192c7e7a2 prevent blocking in dbus when there's no active notification daemon 2020-05-04 19:58:28 +02:00
jcfp
59c5838333 fix deprecation warnings in linux sabtray
* DeprecationWarnings in Gtk.StatusIcon fixed by switch to XApp.StatusIcon (with fallback);
* PyGIDeprecationWarning in GObject.timeout_add fixed by using GLib instead;
* PyGTKDeprecationWarning about positional args in Gtk.MenuItem fixed by adding label;
* PyGTKDeprecationWarning about buttons in Gtk.FileChooserDialog fixed by moving these to a seperate call to add_buttons()

Note that XApp requires a recent OS with (the equivalent of) Ubuntu package 'gir1.2-xapp-1.0' >= 1.6 installed
2020-05-04 19:58:06 +02:00
Safihre
5b3d932232 Move functions out of __init__ that don't belong there (1) 2020-05-03 22:06:29 +02:00
Safihre
bd6db4707d Move parsing of CMDLINE 2020-05-03 22:06:29 +02:00
Safihre
14bd790747 Warn about qstatus being deprecated
See #1415
2020-05-03 13:59:01 +02:00
jcfp
d87c4bba83 use svg logo as icon for notify_osd
the ico file it replaces appears distorted or corrupted in notifications on multiple desktop environments
2020-05-02 18:16:15 +02:00
Safihre
07fe1104bd Fix qstatus API-call
Closes #1417
2020-05-02 11:52:50 +02:00
Sander Jonkers
3b16d58ecc checkdir -> isFAT(): solve ResourceWarning 2020-05-01 08:49:50 +02:00
Sander Jonkers
9761154938 getipaddress: solve ResourceWarning: unclosed socket.socket 2020-05-01 08:46:09 +02:00
Safihre
6f2c60e092 Use contextmanager when opening files as much as possible 2020-05-01 00:15:20 +02:00
Safihre
3ed8f967f4 Update snapcraft file 2020-04-30 17:07:40 +02:00
Safihre
ea73ade1d3 Use threadpool as context to close resource properly 2020-04-30 15:57:03 +02:00
Safihre
379602fbb9 Remove six dependency 2020-04-30 15:39:41 +02:00
Safihre
efcb09a5b7 Correct deprecated regex format (1) 2020-04-30 15:13:34 +02:00
Safihre
e3720b31f0 Update releasenotes and print missing module
Closes #1411
2020-04-30 09:11:04 +02:00
Safihre
b8ef195d69 Update snapcraft for SABnzbd 3.x 2020-04-28 23:26:44 +02:00
Safihre
c33cabdff6 Update text files for 3.0.0 Alpha 1 2020-04-28 16:38:35 +02:00
Sander Jonkers
e71bd8370d newsunpack -> run_simple(): solves ResourceWarning: unclosed file on Popen() 2020-04-28 11:22:29 +02:00
jcfp
4592a1e723 remove cruft from licenses dir 2020-04-28 08:36:10 +02:00
Sander Jonkers
57c42320ce getcpu(): solves unclosed '/proc/cpuinfo' 2020-04-28 08:34:36 +02:00
Safihre
bb56f859f0 Correctly use is_alive instead of isAlive
isAlive is deprecated
2020-04-28 08:33:02 +02:00
Safihre
fba38a880f On macOS always use latest ChromeDriver as we use latest Chrome
Travis will install the latest Chrome for us, but not chromedriver
2020-04-27 11:19:52 +02:00
Safihre
6d8c264e90 Update copyright year to 2020 2020-04-25 16:30:38 +02:00
Safihre
9f777c12ce Code-style corrections for recent commits
Closes #1401
2020-04-25 16:23:05 +02:00
Sander Jonkers
3d2e6904a5 Introduction of unittest for happyeyeballs() 2020-04-22 17:08:35 +02:00
Safihre
46f05f5a6d Update translatable texts 2020-04-20 23:40:52 +02:00
SABnzbd Automation
f1667398ec Automatic translation update 2020-04-19 16:37:11 +00:00
Safihre
af6e6c30f5 Update unrar for macOS to 5.90 (correction) 2020-04-19 18:28:02 +02:00
Safihre
fed8747e04 Correct getattr usage to hasattr 2020-04-19 16:15:45 +02:00
Safihre
1c94db79b0 Restore macOS menu options 2020-04-19 16:15:28 +02:00
Sander
26e1a7222d Make happyEyeballs work again on Python 3.8 / Ubuntu 20.04 with SSL
wrap_socket(s) without extra parameter works on both Python 3.5 / Ubuntu 16.04 and Python 3.8 / Ubuntu 20.04
Solves https://github.com/sabnzbd/sabnzbd/issues/1396
2020-04-19 16:01:56 +02:00
Sander
cdde5eed6d Describe python version needed in README 2020-04-19 15:56:17 +02:00
Sander
a3ce436244 Pre-check HTTPS CERT and KEY files. Give warning if not good. (#1393)
* Pre-check HTTPS CERT and KEY files. Give warning if not good.

* Pre-check HTTPS CERT and KEY files: include traceback info

* Pre-check HTTPS CERT and KEY files: auto-launch browser with HTTP
2020-04-13 15:14:30 +02:00
Safihre
350ea662b5 Fix the loading of alternative skins
Closes #1392
2020-04-13 11:29:37 +02:00
Sander Jonkers
ac70bd890a Make Pre-Check Work Again 2020-04-12 09:18:33 +02:00
Safihre
f301afe4da Stop Direct Unpacker if unrar can't open files
Closes #1359
2020-04-12 09:05:03 +02:00
thezoggy
c0d0964300 Upgrade unrar to 5.90 (#1383) 2020-04-04 16:45:46 +02:00
thezoggy
aeabbe4085 Upgrade multipar to 1.3.0.7 (command line still reports it is version 1.3.0.6 // https://github.com/Yutaka-Sawada/MultiPar/issues/1) (#1384) 2020-04-04 16:45:28 +02:00
Sander
f0abcc4ae7 On Linux 5.4+, "exfat" with native driver is now correctly recognized as NOT FAT. (#1380) 2020-03-30 23:49:44 +02:00
Sander
0662fd70e2 Detect and reports whether running inside Docker (#1378)
* Detect and reports whether running inside Docker

* Detect and reports whether running inside Docker

* black-compliant formatting

Co-authored-by: Sander Jo <sanderjonkers+github@gmail.com>
2020-03-26 21:25:14 +01:00
Safihre
721976eb43 Handle non-RAR jobs in the RAR-deobfuscater 2020-03-20 14:36:14 +01:00
Safihre
f068919266 Code-style postproc 2020-03-20 14:01:20 +01:00
Sander Jo
ef91138e27 rar3-format: corrected to rNN (instead of rNNN) 2020-03-19 09:27:26 +01:00
Sander Jo
be5be641ed Deobfuscate mixed rar sets 2020-03-18 17:41:02 +01:00
Safihre
2a8aea43e6 Correct formatting in notifier 2020-03-15 18:05:51 +01:00
Sander Jo
face626896 RSS-feed: correctly handle strange dates on Windows 2020-03-15 17:50:46 +01:00
Safihre
07d0731a5e Add ES_CONTINUOUS flag to avoid going sleep while downloading on Windows
Closes #1370
2020-03-06 14:20:17 +01:00
jcfp
d1e2986510 Switch from pynotify to notify2 (#1366)
* switch from pynotify to notify2

* remove gntp leftovers

* ensure DISPLAY is set
2020-03-06 14:03:56 +01:00
Safihre
b0a50a2eac Remove deprecated parameter from gettext 2020-02-28 16:57:26 +01:00
SABnzbd Automation
c8b26a7b76 Automatic translation update 2020-02-28 15:25:23 +00:00
Safihre
4740fc8745 Remove unused filename extractions from newsunpack 2020-02-28 13:10:01 +01:00
Safihre
33819ef547 Update UnRar to 5.80 2020-02-28 11:58:25 +01:00
Safihre
38dc0f54cc Correct parsing of UnRar 5.80 password errors
Closes #1365
2020-02-28 11:56:19 +01:00
Safihre
cf8d2676a4 Pass the error of create_real_path to the user
Closes #1363
2020-02-28 11:43:51 +01:00
Bas Nijholt
47b99cfc13 use lock as a contextmanager (#1364) 2020-02-28 08:09:56 +01:00
Safihre
e7efb3f804 Use PyObjC instead of C-module to send notifications on macOS 2020-02-26 13:50:19 +01:00
Safihre
1a494cbf14 Move sleepless-test to the right directory 2020-02-26 11:27:38 +01:00
Safihre
25efb7018c Remove Growl
Project hasn't been updated in 5 years or more.
2020-02-26 11:21:54 +01:00
Alex Hermann
002bdc0793 Py3: Replace xrange with range
https://docs.python.org/3.0/whatsnew/3.0.html#views-and-iterators-instead-of-lists
2020-02-25 21:36:32 +01:00
Safihre
8a62e325a1 Py3: macOS specific fixes
More will be needed
2020-02-25 21:33:52 +01:00
Safihre
5a7e1a1699 Use PyObjC instead of C-module to keep macOS awake
Super duper awesome if I may say so!
2020-02-25 21:04:30 +01:00
Safihre
1445bc3a90 Keep system awake also when post-processing is active 2020-02-25 18:30:27 +01:00
SABnzbd Automation
612c378bb8 Automatic translation update 2020-02-22 09:16:03 +00:00
Safihre
0f25ec018e Update translatable texts 2020-02-22 10:14:27 +01:00
SABnzbd Automation
85baf39bfc Automatic translation update 2020-02-21 15:40:19 +00:00
Safihre
441cb042a2 Py3: Restore translating of Windows-installer file 2020-02-21 16:25:31 +01:00
Sander Jo
22084de58e detect, inform and abort uuencoded posts (KISS) 2020-02-21 15:32:46 +01:00
jcfp
4dab43721d comment out pygobject, add note about pycairo deps 2020-01-29 22:43:56 +01:00
jcfp
efaa4c7647 add version and environment marker for pygobject 2020-01-29 22:43:56 +01:00
jcfp
58d2c54823 convert linux systray to python3 and gi 2020-01-29 22:43:56 +01:00
Safihre
50a5cdfac2 Py3: Remove lines from newswrapper
We only use the raw-socket-data in Py3 version
2020-01-29 22:19:53 +01:00
Safihre
97df88a5ad Skip failing daemon test on MacOS
Trying to figure out what is going wrong, it just results in a hard kill of the Python process.
2020-01-29 21:47:28 +01:00
Safihre
b7e5df1356 Update translation base files 2020-01-24 15:31:13 +01:00
SABnzbd Automation
efcee62fa5 Automatic translation update 2020-01-17 17:04:09 +00:00
Safihre
17719b1b5b Add PyObjC to macOS requirements 2019-12-27 20:06:39 +01:00
Safihre
c08dd7bdee Merge branch 'feature/selenium' into develop 2019-12-26 09:50:55 +01:00
Safihre
5c0815728e Add PyCache to gitignore
Strange it wasn't there
2019-12-26 09:31:38 +01:00
Safihre
5df525ce6b Py3: Pre-queue parameters need to be strings
On WIndows this always happened due to list2command, so I never noticed. In Py2 version this used the unicoder() function, so also on other platforms it was fixed.
Closes #1344
2019-11-27 23:11:45 +01:00
Safihre
4e1a06c78a Notification queue_done was not implemented
Closes #1330
2019-11-22 15:47:36 +01:00
Safihre
2118e996d4 Py3: Don't long-path script-paths on Windows
Not all shall be longgg
Closes #1318
2019-11-22 15:28:22 +01:00
Safihre
bc8f3e527a Add Python 3.8 to CI-tests 2019-11-22 15:09:30 +01:00
Safihre
7bf71ee85e Depend on pywin32 227 to fix Python 3.8 errors
Closes #1340
2019-11-18 08:51:39 +01:00
Safihre
1671ca5e5e Create FUNDING.yml 2019-11-05 14:20:22 +01:00
SABnzbd Automation
428f6e75a8 Automatic translation update 2019-10-24 12:56:37 +00:00
Safihre
7e87a0c759 Add 452 as failed login NNTP code
See https://forums.sabnzbd.org/viewtopic.php?f=2&t=24223&p=119648#p119648
2019-09-29 17:31:46 +02:00
Sander Jo
e95e9d5254 "3" in SABnzbd logo on frontpage 2019-09-25 10:52:12 +02:00
Safihre
d3c9adc69f Warn about .pyc files
Relates to #1332
2019-09-22 11:23:20 +02:00
Safihre
6ffcb478b4 Py3: Make black code-formatter happy again 2019-09-20 16:40:40 +02:00
Safihre
613b8216a7 Integrate get_rar_extension in SABnzbd 2019-09-20 16:40:40 +02:00
Sander Jo
3873b9a11b Introduction of get_rar_extension 2019-09-20 16:40:40 +02:00
Safihre
dc7d15e704 Implement basis RAR-renamer
Now we need old/new-style numbering support and multiple sets support.
2019-09-20 16:40:40 +02:00
Safihre
9b4769b54a Py3: No need to check for Unicode-errors when listing files
I hope.
2019-09-20 16:40:40 +02:00
Safihre
71e9645346 Testing RAR-based volume detection 2019-09-20 16:40:40 +02:00
Sander Jo
a5c8318b5f new module rarvolnum: finds volume number of (obfuscated) rar 2019-09-20 16:40:40 +02:00
Safihre
33eccf3e5d Correct the CI-tests 2019-09-20 15:28:36 +02:00
Safihre
826c4057ea Merge branch 'py3' into develop 2019-09-20 14:31:02 +02:00
Safihre
7c3c17ff85 Py3: Add test for SFV-check functions 2019-09-20 14:26:35 +02:00
Hydranet
9a63410e20 Py3: Correct SFV-check CRC calculation 2019-09-20 14:15:09 +02:00
Safihre
e7367b30f5 Py3: Correctly parse passwords from NZB filename
Closes #1301, #1315
2019-08-17 23:01:38 +02:00
Safihre
3efd595fc6 Run CI-tests less verbose and only on Chrome 2019-08-17 21:58:32 +02:00
Safihre
815703181a Py3: NZB Meta-tags can occur multiple times
Closes #1314
2019-08-17 21:40:48 +02:00
Safihre
928b239a80 Py3: Fallback to latin1 when loading pickle fails to handle Python2 data
Closes #1321
2019-08-17 21:20:55 +02:00
Sander
5e7ff9b20a Protect against non-defined 7za binary (#1309)
* protect SABnzbd against non-defined 7za binary

* protect SABnzbd against non-defined 7za binary: formatting

* protect SABnzbd against non-defined 7za binary: wording

* protect SABnzbd against non-defined command[0]: extra check

* protect SABnzbd against non-defined command[0] in build_command

* Style changes
2019-07-14 09:03:22 +02:00
Safihre
b12a723a44 Prevent traceback if requested robots.txt with parameters
Like http://localhost:8080/robots.txt?test=1
2019-07-08 12:31:02 +02:00
Safihre
a8e50421e5 Py3: CherryPy now fixed the SSL Error 0 2019-06-23 12:02:28 +02:00
Safihre
52ae8c2236 Py3: Fix typo when decoding headers for DMCA check
Closes #1302
2019-06-23 11:28:21 +02:00
Safihre
76f0896029 Py3: Always decode a POpen readline 2019-06-23 11:23:11 +02:00
Safihre
27af3fe99a Update SABYenc reference to v3.3.6 2019-06-22 12:23:16 +02:00
Safihre
d7fc7f02de Sample deletion didn't work for 1 sample file
Relates to #1284, #1063, #157, https://forums.sabnzbd.org/viewtopic.php?f=4&t=24259
2019-06-17 07:55:11 +02:00
Safihre
1c107e021c Update text of Remove samples 2019-06-10 09:41:13 +02:00
Safihre
1f02eff383 Py3: Apply renamer-fix 2019-06-08 16:46:07 +02:00
Safihre
f666332913 Correct 2 "Don't try move between different disks on Windows" 2019-06-08 16:45:19 +02:00
Safihre
67454359ba Correct "Don't try move between different disks on Windows" 2019-06-08 12:26:53 +02:00
puzzledsab
e803fb256b Don't try move between different disks on Windows 2019-06-08 11:45:26 +02:00
Safihre
563173a325 Merge branch 'develop' into py3 2019-05-24 09:23:08 +02:00
Safihre
a50a65ee7c Remove unneeded get_bps
Removes overhead, gets called a lot
2019-05-23 10:54:03 +02:00
Safihre
8665af91f2 Remove unneeded lock
Get's called a lot, adds overhead due to lock.
2019-05-23 10:54:03 +02:00
Safihre
8641f86631 Remove print statement that slipped in with commit
Again.. Sigh.
2019-05-19 13:45:00 +02:00
SABnzbd Automation
45de8c7206 Automatic translation update 2019-05-18 08:01:28 +00:00
Safihre
4bdaddc003 remove_all could fail if it got None
https://forums.sabnzbd.org/viewtopic.php?f=11&t=24202
2019-05-17 21:30:05 +02:00
Safihre
55f811289d Prevent false-positive removing of samples
Closes #1284, #1063, #157
2019-05-17 15:14:18 +02:00
Safihre
fbb637e5e3 Duplicate Detection doesn't look at History filenames
Closes #1288
2019-05-17 15:14:18 +02:00
Safihre
f628dda4e7 Propgation delay could show even if it was not configured 2019-05-12 09:23:35 +02:00
Safihre
129d3eaf07 Handle "Unexpected end of archive" from UnRar
Closes #1282
2019-05-07 11:01:16 +02:00
Safihre
350db4afc0 Unpacking could hang forever on unicode downloads 2019-05-07 09:47:58 +02:00
Safihre
0a8ffd233e Use Python 2.7 for TravisCI tests 2019-05-07 09:29:34 +02:00
Safihre
a74b500e96 Update MultiPar to v1.3.0.5 and UnRar to 5.71 2019-05-07 09:21:48 +02:00
Safihre
1298e7ccce Non existing categories should result in Default being returned 2019-05-07 09:12:14 +02:00
Safihre
e1c61c41ca Display of Bytes/second speeds was incorrect
Not really relevant, but still
2019-05-07 09:11:25 +02:00
Safihre
3da76e15d2 Pause longer before registering single click
Closes #1210
2019-05-07 09:02:25 +02:00
Safihre
b116c24b84 Only log pre-check once 2019-05-07 09:01:07 +02:00
Safihre
a43810ec46 Rename Server Load-balancing
See #1249
2019-05-07 09:00:52 +02:00
Safihre
d4954b52ec Remove over-active unrar-stop detection
Too many false-positives.
2019-05-07 08:58:53 +02:00
Sander Jo
9446cf97b8 Make SAB-py3 detect par2-tbb correctly again 2019-05-02 08:38:11 +02:00
Safihre
d0572893eb Only log pre-check once 2019-04-28 10:06:08 +02:00
Safihre
d2e0ebebc9 Py3: Reworking of removal of files and other tweaks 2019-04-22 14:52:24 +02:00
Saurav Kumar
7fcdad0e69 Added new tests for utils (#1266)
* Added util tests

* FIxed build failures

* Incorportaed review comments

Added new tests

* Test added for generate_key

* Updated module name

* Correct newly added tests
2019-04-22 12:06:26 +02:00
Safihre
82ba687eb2 Py3: Restore pre-check functions 2019-04-22 09:07:05 +02:00
Safihre
6655b53373 Py3: Small fixes and style changes to database.py 2019-04-21 23:22:25 +02:00
Safihre
3e672857ee Py3: Remove unused functions and code 2019-04-21 23:10:31 +02:00
Safihre
6b3f8bd255 Py3: Remove error.log if it is too big
Including tests
2019-04-21 12:00:51 +02:00
Safihre
b0332e141c Remove error.log if it is too big 2019-04-21 10:52:40 +02:00
Safihre
80a181816e Only delete completed jobs from history when using max number of jobs
See https://forums.sabnzbd.org/viewtopic.php?f=3&t=24144&p=118606#p118605
2019-04-20 21:43:10 +02:00
Safihre
585912cc53 Only delete completed jobs from history when using max number of jobs
See https://forums.sabnzbd.org/viewtopic.php?f=3&t=24144&p=118606#p118605
2019-04-20 21:41:25 +02:00
Sander Jo
277df287f4 improved handling in case of no internet connection (py3) 2019-04-19 23:47:08 +02:00
Safihre
0dec3b7ec3 Remove bad print statement of par2 files
Closes #1269
2019-04-19 09:00:04 +02:00
Safihre
5e287f838c Pause longer before registering single click
Closes #1210
2019-04-05 16:39:52 +02:00
Safihre
2c92a7621c Test Download could fail if clicked on icon instead of button
Closes #1263
2019-04-02 08:26:53 +02:00
Safihre
9ded5e88dd Py3: Fix badly removed unicoder-function
Closes #1261
2019-03-27 08:51:09 +01:00
Safihre
fe902aa3f7 Py3: Set pickle to highest protocol 2019-03-23 18:05:30 +01:00
Safihre
cc3a2d205f Rename Server Load-balancing
See #1249
2019-03-22 14:20:11 +01:00
Safihre
1caca8c08d Py3: Remove folder-length limit on Windows 2019-03-22 14:05:08 +01:00
Safihre
eb33d4d02b Py3: Always use Status-constant 2019-03-22 11:23:15 +01:00
Sander
6978ac2ca5 Diskspeed: better handling if directory is unwritable (#1259) 2019-03-21 08:12:40 +01:00
Safihre
e05beb71e6 Only get series info when adding to the database 2019-03-20 14:29:06 +01:00
Safihre
7e80004843 Py3: Update black code-formatter settings 2019-03-20 13:40:34 +01:00
Safihre
0756531cab Always use Status-constant to check job status 2019-03-20 13:06:01 +01:00
Safihre
6d82c7e542 Series Duplicate detection did not work as result of Direct Unpack
The Post-Processing time would be 0 seconds, so it would never store duplicate-check information. Oops.
2019-03-20 12:57:44 +01:00
Safihre
fb238af7de Notify develop-users that we will switch to Python 3 2019-03-18 18:45:05 +01:00
Safihre
6b9e3cd9d8 Merge branch '2.3.x' into develop 2019-03-18 18:44:09 +01:00
Safihre
0dd1f647d8 Update text files for 2.3.8 2019-03-18 09:23:24 +01:00
Safihre
465a881541 Py3: Code-format multiple files 2019-03-14 14:28:06 +01:00
Safihre
788c185bd0 Log why we can't remove job folders 2019-03-14 12:56:34 +01:00
Safihre
2bd9419927 Py3: Refactor Dirscanner
WIP!
2019-03-13 16:47:16 +01:00
Safihre
c4e7ab2df8 Py3: Speed set in Config was not applied at start-up 2019-03-13 15:31:12 +01:00
Safihre
309bccec9b Py3: Decode state-files using system codepage
Closes #1256
2019-03-13 15:14:24 +01:00
Safihre
7034fb27a6 Py3: Fix HTML login
Closes #1246
2019-03-13 12:41:39 +01:00
Safihre
052762fd03 Py3: Re-organize forking/daemonizing for Python 3
And added basic tests that it can fork.
Closes #1237 and #1255
2019-03-13 11:56:40 +01:00
Safihre
6c15eea28c Py3: TimeoutError when getting IPv4 was not caught 2019-03-13 09:44:35 +01:00
Safihre
8d5ad1d94f Merge branch 'develop' into py3 2019-03-13 09:24:47 +01:00
Safihre
6999872ec3 Update text files for 2.3.8 RC 1 2019-03-13 09:03:02 +01:00
Safihre
83ccc0a765 Merge branch 'develop' into 2.3.x 2019-03-13 08:19:58 +01:00
Safihre
bf4b06f620 Update MultiPar to v1.3.0.4 2019-03-12 08:31:32 +01:00
Safihre
8f290a11ce Update 7zip to 19.00 2019-03-12 08:31:04 +01:00
Safihre
0c12f2fbbd Py3: Internetspeed debug info to logging 2019-03-07 21:27:38 +01:00
Sander
0d0ab9647d Measure Internet speed (module: internetspeed) (#1253)
* measure Internet speed (module: interspeed)

* measure Internet speed (module: interspeed) ... now in corrected format
2019-03-07 21:27:38 +01:00
Safihre
80e4b6e044 WIP: Add Internet Bandwidth Test 2019-03-07 21:27:38 +01:00
Safihre
a9185b4aee Py3: Add pygettext to repo and basic test of POT extraction
Python is deprecating pygettext.py so we better have our own, just like msgfmt.py
2019-03-06 08:54:22 +01:00
Safihre
919315cb8e Don't do anything special when API output-mode isn't defined 2019-03-04 16:47:38 +01:00
Safihre
973483930b Py3: Fix parsing of newznab/nZEDb/nntmux in feedparser and added tests 2019-03-04 15:35:18 +01:00
Safihre
27e1323d9e Py3: Remove obsolete inheriting from object when creating class 2019-03-02 17:59:30 +01:00
Safihre
543458abde Py3: Code-format rss.py 2019-03-02 17:21:10 +01:00
Safihre
e5553e254b Py3: Test and code-format Sample-PostProc 2019-03-02 13:18:00 +01:00
Safihre
a92f94d560 Py3: Test and code-format apireg 2019-03-02 12:07:33 +01:00
Safihre
5e80c2aab9 Py3: Get rid of SSL error when HTTPS enabled
cherrypy/cherrypy/issues/1618
2019-03-01 14:52:43 +01:00
Safihre
db6a6798e7 Py3: Show Logging should just be bytes only
Let's not do any unicode stuff!
Closes #1248
2019-02-28 11:51:21 +01:00
Safihre
50ad203aa8 Py3: Fix Show Logging
Closes #1247
2019-02-26 22:21:15 +01:00
Safihre
b8d7ba8995 Py3: mailslot test was unstable 2019-02-26 21:57:59 +01:00
Safihre
72fda0117f Update WinRAR to 5.70
#1238
2019-02-26 17:40:10 +01:00
Safihre
d1cfa51a46 Always use correct supported file types
Closes #1227
It's also clear without the "Formats"
2019-02-26 17:27:33 +01:00
Safihre
33d64fc152 Py3: Require Python 3.5+
Closes #1245
2019-02-26 17:08:44 +01:00
Safihre
082d7047c3 Py3: Convert mailslot to Python 3
If we ever wanted, we can now also communicate using unicode!
Also added basic test.
2019-02-26 11:37:22 +01:00
Safihre
e558101709 Py3: Force code-style check for successful build 2019-02-26 09:39:45 +01:00
Safihre
d713ba74b1 Py3: Code-format utils-files 2019-02-26 08:33:41 +01:00
Safihre
20ea1d0284 Py3: Code-format tools-files 2019-02-26 08:29:00 +01:00
Safihre
27a123c688 Py3: Code-format tests-files 2019-02-26 08:20:01 +01:00
Safihre
845c608d2b Py3: Faulty login handler didn't report NNTP-code
And added tests.

Closes #1241
2019-02-25 20:46:25 +01:00
Safihre
223914f002 Py3: download_time needs to be integer 2019-02-25 12:57:59 +01:00
Safihre
62a4f3429a Py3: Add pypiwin32 as conditional requirement 2019-02-25 10:35:31 +01:00
Safihre
872a6d3031 Renaming in sanitize_foldername and sanitize_filename were not the same
Closes #1240
2019-02-24 19:24:06 +01:00
Safihre
a903679dfb MultiPar doesn't need special colon handling
Closes #1239
2019-02-24 18:58:56 +01:00
Safihre
f31e4f9d01 Rework time_format function and add tests 2019-02-24 18:15:24 +01:00
Safihre
b5f391e3fb Remove Glitter pre-loading of Queue and History
In Python 3 CherryPy is now so fast with serving requests.
2019-02-21 09:32:51 +01:00
Safihre
3b80a2cf08 Py3: Add portend to requirements.txt
Closes #1236
2019-02-21 07:39:10 +01:00
Safihre
38a2b76987 Py3: Integer division changed 2019-02-20 17:17:22 +01:00
Safihre
f8eb6e7776 Py3: Updated sabyenc3 version to 4.0.0
See https://github.com/sabnzbd/sabyenc/issues/12
2019-02-19 10:21:00 +01:00
Safihre
1fd7c2199f Automatically log setname when setting post-processing info 2019-02-17 21:38:37 +01:00
Safihre
91a472130f Py3: Running post-processing scripts
Needs a functional test!
2019-02-17 20:45:53 +01:00
Safihre
7c45050e05 Py3: Remove dead code and fix some minor mistakes
Found by the vulture-tool
2019-02-17 20:17:06 +01:00
Safihre
c03436a566 Py3: Correct the same_file function
With tests!
2019-02-17 18:15:35 +01:00
Safihre
97cb572332 Py3: Fix the Retry-button in History
Oopsie
2019-02-17 17:23:56 +01:00
Safihre
d0d1beab88 Py3: Rework displaying of long-paths in interface 2019-02-17 17:00:34 +01:00
Safihre
917221ea3f Py3: Fix bug in split_host 2019-02-17 16:34:14 +01:00
Safihre
dbff981050 Py3: Rework Email notification
Also applied code-formatter on it.
2019-02-17 16:09:20 +01:00
Safihre
75386cd9cd Py3: Switch to using sabyenc3 2019-02-15 16:24:24 +01:00
Safihre
1cb7770897 Py3: Also run AppVeyor on Python 3.5 2019-02-15 14:46:53 +01:00
Safihre
d6a5f4c0dc Include SSL-ciphers when testing a Server
Closes #1231
2019-02-14 08:32:15 +01:00
Safihre
124701c118 Fix README typo 2019-02-14 08:16:45 +01:00
Safihre
a844c303e5 Py3: Re-enable duplicate detection and update NZB loading
Can still be improved.
2019-02-11 20:22:15 +01:00
Safihre
d1adc8abc1 Update text files for 2.3.8 Beta 1 2019-02-11 08:07:45 +01:00
Safihre
0c2cfd6225 Revert "Notify develop-users that we will switch to Python 3"
This reverts commit 6ed9dcfc95.
2019-02-11 07:46:36 +01:00
Safihre
f280363df5 Merge branch 'develop' into 2.3.x 2019-02-11 07:46:21 +01:00
Safihre
c62025bfca Py3: Link to wiki-page on start-up errors 2019-02-09 11:08:05 +01:00
Safihre
6ed9dcfc95 Notify develop-users that we will switch to Python 3 2019-02-09 10:09:47 +01:00
Safihre
6d2b7ee6f0 Py3: Fix reporting of errors in 7Zip unpacking 2019-02-08 17:01:47 +01:00
Safihre
24c7707fc0 Py3: Incorrect warning about not being UTF-8 2019-02-08 16:42:55 +01:00
Safihre
e34a464835 Py3: Add new tests to download-test - zip, passworded 2019-02-08 16:12:50 +01:00
Safihre
3b9f3ba378 Py3: Check for required modules and general refactoring 2019-02-08 12:30:27 +01:00
Safihre
baa9d3634f Py3: Reshuffle functional download-tests
To be able to add more later
2019-02-08 10:17:14 +01:00
Safihre
4008bd004f Update 7zip to 18.06 2019-02-08 09:59:25 +01:00
Safihre
b124f2a2a9 Py3: Add functional test of basic RSS-feed flow 2019-02-07 10:17:39 +01:00
Safihre
743e660395 Py3: Add additional misc-tests 2019-02-06 14:58:46 +01:00
Safihre
a63aff20f2 Display of Bytes/second speeds was incorrect
Not really relevant, but still
2019-02-06 09:25:58 +01:00
Safihre
cbbdccca81 Link supported file types in template
Closes #1227
2019-02-05 13:34:22 +01:00
Safihre
f555c682eb Reformat the getipadress module 2019-02-05 13:06:56 +01:00
Safihre
aa51b51531 Correct the split_host function for IPv6 notation 2019-02-05 11:44:24 +01:00
Safihre
2e8ca99980 Py3: Add a whole bunch of misc-unittests 2019-02-05 11:44:09 +01:00
Safihre
f801c9f938 Remove unused spaces-option in to_units 2019-02-04 23:15:02 +01:00
Safihre
6c7aa50dc8 Non existing categories should result in Default being returned 2019-02-04 22:52:56 +01:00
SABnzbd Automation
0168d8870c Automatic translation update 2019-02-04 11:56:02 +00:00
Safihre
d6269099aa Sorting would fail on root-folders
It would try to make "C:Folder" instead of "C:\Folder"
2019-02-04 09:29:23 +01:00
Safihre
38eca9a7d4 Py3: Add test for new encoding function 2019-02-03 11:30:26 +01:00
Safihre
0ae5b11773 Py3: Introduce proper unknown-encoding handling 2019-02-02 16:36:26 +01:00
Safihre
771244db07 Py3: NZBParser do not crash on empty subject 2019-02-02 16:35:51 +01:00
Safihre
c2fcc488ac Py3: Split functional tests 2019-02-02 11:18:42 +01:00
Safihre
152f1daffe Py3: Handle unicode files created on Windows but processed on Linux 2019-02-02 10:20:21 +01:00
Safihre
e053aa9343 Py3: Remove platform_encode
Surely we will need it in other places
2019-02-01 20:44:33 +01:00
Safihre
0d49dbc6e9 Py3: Remove unicoder-function 2019-02-01 20:19:24 +01:00
Safihre
a6170536eb Py3: Remove the need for Cheetah-template Filters 2019-02-01 15:54:41 +01:00
Safihre
6a9e8663dc Py3: Let configobj handle the file-opening so it fixes encoding 2019-02-01 15:49:06 +01:00
Safihre
b2a299522f Py3: Remove xml_name where it is not needed
Outputting XML is where we will transform it.
2019-02-01 15:17:43 +01:00
Safihre
e7471b4def Unpacking could hang forever on unicode downloads 2019-02-01 14:11:21 +01:00
Safihre
638e87515a Py3: Add submitting of Config pages to basic functional test
Easy way to find crashes
2019-02-01 12:29:51 +01:00
Safihre
2c095e97c9 Py3: Encoding-parameter of POpen is not available in Python 3.5 2019-01-29 09:26:29 +01:00
Safihre
2285a9b7d9 Py3: Fully activate functional tests 2019-01-29 09:19:29 +01:00
Safihre
989341009d Py3: Issues fixed found using functional tests
Dict's keep their original sorting, not like in Python 2 were they were sorted.
2019-01-27 17:18:41 +01:00
Safihre
3063ec0e1e Py3: Re-enable Travis and AppVeyor, including functional tests 2019-01-27 17:16:40 +01:00
Safihre
6107c06ac5 Py3: Fix small point of failure in replace_win_devices 2019-01-27 14:10:40 +01:00
Safihre
155fb8e5d2 Py3: Further extend testing-framework and use PyTest style 2019-01-27 13:35:33 +01:00
Safihre
1619a0f99e Merge branch 'develop' into py3 2019-01-27 13:12:09 +01:00
Safihre
5afb468795 Py3: Saved attributes should be read/write using UTF 2019-01-27 12:49:05 +01:00
Safihre
c728360a3c Py3: Add basic testing support 2019-01-27 12:36:34 +01:00
Safihre
5548bd9c7e Filenames would not be sanitized with "Make Windows compatible" 2019-01-27 11:20:25 +01:00
Safihre
e5c1250310 Py3: Remove special_fixer and deunicode
Should not be needed anymore
2019-01-25 17:16:20 +01:00
Safihre
b0de7e4c61 Py3: Remove decode_factory from database 2019-01-25 17:07:45 +01:00
Safihre
fb4c413ab5 Py3: Remove (most) uses of unicoder
Not needed anymore, everything IS unicode now inside the application. Transforms should be performed when data is read.
2019-01-25 16:55:05 +01:00
Safihre
b6c4a48497 Py3: First fix of running external tools (unrar/par2/multipar)
Closes #1224
2019-01-25 16:16:55 +01:00
Safihre
1e786a1576 Merge branch 'develop' into py3 2019-01-25 13:42:34 +01:00
Safihre
5c8483f393 Update LGTM config a bit more 2019-01-25 08:57:45 +01:00
Safihre
b9a344992b Remove Email Templates Folder from Notifications page
This way we can hide it
2019-01-22 13:37:38 +01:00
Safihre
a85a988b22 Lower connections in CI-test to prevent failures
Travis rotates between 10 IP's every few ms.. Madness. https://twitter.com/travisci/status/1085214062152159232
Because of that we can't use more than 2 connections, otherwise the newsservers get very cranky.
2019-01-22 08:48:56 +01:00
Safihre
d9808a7550 Wake up downloader when updating server-details
Through CI I found that updates to servers (including deleting servers) were processed with a delay because the downloader could be sleeping.
2019-01-22 08:44:34 +01:00
Safihre
92894e9301 Update LGTM based on feedback
See #1221
2019-01-22 07:45:00 +01:00
Safihre
e59a28b617 Add LGTM code-analysis 2019-01-20 18:02:10 +01:00
Mitchell Cash
e9bfc541a6 Py3: Remove unused imports (#1218)
* Remove unused imports
* Remove unused std_time function
2019-01-17 16:26:32 +01:00
Safihre
27429a1415 Update TravisCI/AppVeyor newsserver information 2019-01-12 10:55:47 +01:00
Safihre
8f9e1b2eb7 Set snapcraft grade to stable so it can be published
This snapcraft stuff is just a developer's nightmare. They pretend it is easy, but for developers that introduced way to much customization and weird features..
2019-01-12 10:48:10 +01:00
Safihre
663330e251 Merge branch 'master' into 2.3.x 2019-01-12 09:31:44 +01:00
Safihre
4432e5684a Set version to 2.3.7 2019-01-12 09:31:11 +01:00
Safihre
92ecc2d0d4 Merge branch 'develop' 2019-01-12 09:30:05 +01:00
SABnzbd Automation
7ea897ef39 Automatic translation update 2019-01-12 08:25:58 +00:00
Safihre
7a8df5ee91 Update text files for 2.3.7 2019-01-12 09:19:55 +01:00
Safihre
4c851b458a Wait a bit before reporting failed unrar kill 2019-01-10 14:09:58 +01:00
Safihre
43ad83cee4 Prevent rare race-condition in DirectUnpack and Par2-renamer 2019-01-10 14:09:35 +01:00
Safihre
6f69bfd9ce Wrongly calculated Fast Fail percentage 2019-01-08 14:23:40 +01:00
SABnzbd Automation
f2423fd8a1 Automatic translation update 2019-01-07 14:26:07 +00:00
SABnzbd Automation
845d5cbaf2 Automatic translation update 2019-01-04 12:39:41 +00:00
Safihre
d1052ca7e0 Update text files for 2.3.7 RC 1 2019-01-04 13:34:55 +01:00
Safihre
d7c76a3b43 Send graceful Quit for UnRar first when aborting 2019-01-04 12:49:52 +01:00
Safihre
4c7f74b356 Show Details on Servers page could break graph display
Closes #1207
2019-01-01 12:02:06 +01:00
Safihre
b3dc74a07b Update Multipar to v1.3.0.3 2018-12-31 14:57:02 +01:00
Safihre
e9fa56a635 Log error-line in Direct Unpack
See https://forums.sabnzbd.org/viewtopic.php?f=16&t=23923
2018-12-30 10:34:25 +01:00
Safihre
eec00d8b7a Py3: Corrections in dowloader and rarfile 2018-12-29 10:03:20 +01:00
Safihre
54eca2b977 Py3: Update bpsmeter
Mostly removed legacy support code.
2018-12-27 21:22:03 +01:00
Safihre
1fae7acb34 Py3: Fix config 2018-12-27 17:43:27 +01:00
SABnzbd Automation
6729e94f14 Automatic translation update 2018-12-27 15:47:34 +00:00
Safihre
8cd9de94ea Py3: First correction of par2file
Probably needs more work once we get to rest of download process.
2018-12-27 12:11:48 +01:00
Safihre
6951d65194 Py3: FIx urlgrabber
Remove the derefer.me, since they shutdown in 2019.
2018-12-27 11:43:36 +01:00
Safihre
1273190c89 Py3: Improve sabtray
Add "Pause for" options
2018-12-26 23:51:58 +01:00
Safihre
71dc1b5310 Add option to quickly add test NZB 2018-12-26 22:44:53 +01:00
Safihre
eae88478fd Py3: Fix wrong merge in diskspeed 2018-12-26 22:37:20 +01:00
Safihre
88770ae6eb Py3: Fix certgen and typos in servertests 2018-12-26 22:33:47 +01:00
Safihre
d564323ac1 Py3: Update incorrect shebang 2018-12-26 11:36:34 +01:00
Safihre
946871b9b8 Py3: Update upload 2018-12-26 11:01:02 +01:00
Safihre
3bbe2665ad Py3: Update pathbrowser 2018-12-26 10:56:54 +01:00
Safihre
2bbc286154 Py3: Remove smpl-skin 2018-12-26 10:43:01 +01:00
Safihre
fe8065a7ef Remove unused translatable texts 2018-12-26 00:40:11 +01:00
Safihre
50cf85d17e Py3: Remove RSSLib 2018-12-25 22:57:46 +01:00
Safihre
22e270c649 Py3: Fix getperformance 2018-12-25 22:50:33 +01:00
Safihre
e827487c11 Py3: Simplify multi-language support
No more need for unicode tricks
2018-12-25 22:50:21 +01:00
Safihre
8f47230933 Py3: Cross-compatible pickling
Well, on Python 3.7 that is.
2018-12-25 12:59:47 +01:00
Safihre
d7bea6f134 Merge branch 'develop' into py3 2018-12-25 10:54:56 +01:00
Safihre
9e98168588 Remove unused translatable texts 2018-12-24 17:40:57 +01:00
Safihre
60afb7f444 Update copyright year to 2019 2018-12-24 11:51:48 +01:00
Safihre
3945eafb76 Update text files for 2.3.7 Beta 1 2018-12-24 11:46:23 +01:00
Safihre
763088e6a6 Add option to fail jobs based on first-articles 2018-12-24 09:13:57 +01:00
Safihre
a6ac88d5da Improve History information of failed jobs 2018-12-24 09:13:57 +01:00
Safihre
d35ebec8f9 Snapcraft uses the devel keyword 2018-12-24 08:53:44 +01:00
Safihre
aee2747220 Update Snapcraft config
Based on feedback in #1201
2018-12-24 08:33:28 +01:00
Safihre
eae68bd6ba RSS feedwithout ID would crash
See https://forums.sabnzbd.org/viewtopic.php?f=2&t=23910
@OneCDOnly
2018-12-23 11:44:08 +01:00
Safihre
1875cbcb52 Correct parsing of Snap-grade
See #1201
2018-12-21 09:49:59 +01:00
Safihre
92410fc1ef Merge branch 'master' into 2.3.x 2018-12-20 22:53:42 +01:00
Safihre
ee7e209a8b Set version to 2.3.6 2018-12-20 22:52:52 +01:00
Safihre
9bc1601939 Merge branch 'develop' 2018-12-20 22:51:54 +01:00
Safihre
190ec0a472 Update text files for 2.3.6 2018-12-20 22:33:13 +01:00
Safihre
468f01d839 Make clear that require_modern_tls is TLS 1.2 and above
@sanderjo
2018-12-19 11:17:25 +01:00
Erik Berkun-Drevnig
5bbbf602f9 Fix missing unrar, fix Python encoding 2018-12-19 08:58:29 +01:00
Erik Berkun-Drevnig
b03d68b434 Fix missing unrar, fix Python encoding 2018-12-19 08:57:59 +01:00
Safihre
0298beac15 Update text files for 2.3.6 RC 1 2018-12-17 13:56:34 +01:00
SABnzbd Automation
be6f047e31 Automatic translation update 2018-12-16 18:01:50 +00:00
Safihre
e8206371e4 Update Wizard example URL 2018-12-14 08:41:00 +01:00
SABnzbd Automation
6609248fce Automatic translation update 2018-12-06 08:32:33 +00:00
Safihre
0ae5c7f8aa Code improvements 2018-11-28 09:23:11 +01:00
Sander Jo
02b6f63156 Option require_modern_tls if you want TLS 1.2 or higher for NNTPS 2018-11-23 15:28:03 +01:00
Safihre
8ab3ebd5f6 Merge branch 'master' into 2.3.x 2018-11-21 15:53:21 +01:00
Safihre
2b665667af Unavailable feeds would crash reading 2018-11-20 09:42:13 +01:00
jcfp
ad7fc240c7 help output: add -1 param for logging, 7z as supported file ext (#1192)
* help output: add -1 param for logging, 7z as supported file ext

* stop the universe from expanding
2018-11-18 09:02:37 +01:00
jcfp
aef878a0f2 update snapcraft url
the old link only displays a 'your session has expired' message...
2018-11-01 13:08:47 +01:00
Erik Berkun-Drevnig
2a967b62d9 Add Travis and AppVeyor badges (#1186)
* Add Travis and AppVeyor badges

* Add snap, issue resolution and license badges

* Switch master to develop branch

* Update README.md
2018-10-31 09:48:57 +01:00
Erik Berkun-Drevnig
19946684d5 Add initial snap support (#1183)
* Add initial snap support
* Apply review feedback
* Fix armhf and arm64 builds
* Use PPA and build lang files
* Add openssl for x86
* Remove unnecessary stage-packages
* Improve arch grammar
* Add back dev packages for building extensions
* Add back missing SSL
* Add icon
* Update snapcraft.yaml
2018-10-31 07:53:12 +01:00
Safihre
4c5ca149ba Update MultiPar to v1.3.0.2 2018-10-30 09:09:05 +01:00
jcfp
54d6e0dc21 fix extension filters in linux tray
correct typo (nbz) in filter name and bring the extension filters in line with the supported types (cf. sabnzbd/constants.py:99-100)
2018-10-29 22:17:23 +01:00
Erik Berkun-Drevnig
ecb1403776 Add initial snap support (#1183)
* Add initial snap support
* Apply review feedback
* Fix armhf and arm64 builds
* Use PPA and build lang files
* Add openssl for x86
* Remove unnecessary stage-packages
* Improve arch grammar
* Add back dev packages for building extensions
* Add back missing SSL
* Add icon
* Update snapcraft.yaml
2018-10-29 09:50:28 +01:00
Safihre
7e5c6d1c04 Update text files for 2.3.6 Beta 1 2018-10-26 09:27:59 +02:00
Safihre
96b140dee0 Update included Python license 2018-10-26 09:27:42 +02:00
Safihre
2e098b641f Update UnRar to 5.61 for macOS and Windows 2018-10-26 09:15:43 +02:00
Sander Jo
6678cb9d56 Remove \x00 from par2 creator info: uniformed method 2018-10-25 07:58:06 +02:00
Sander Jo
4b67405d16 Remove \x00 from par2 creator info 2018-10-19 08:45:58 +02:00
Safihre
7463a4abdc Existing RSS-feeds don't have the infourl yet
Rookie mistake.
2018-10-14 09:39:38 +02:00
Safihre
dc74f472ed Py3: More fixes 2018-10-14 09:38:00 +02:00
svms
24cef0b5aa Fix locale compilation in Python 3 (#1176)
* fix locale generation for Python 3

* remove unused import

* Fix compilation on Windows
2018-10-12 21:48:19 +02:00
Safihre
2341ea44ec Py3: Fixes after merge from develop
And set the shebang to Python 3 specifc
2018-10-12 21:05:19 +02:00
Safihre
579e07adc3 Merge branch 'develop' into py3 2018-10-12 10:10:10 +02:00
SABnzbd Automation
163523048b Automatic translation update 2018-10-09 13:55:06 +00:00
Safihre
4892bc18f3 Prevent endless loop when disk-space is exceeded
It was a nice idea, to keep retrying to save the job, but it also breaks the pp-actions as it gets removed before it is ready to be removed.
Closes #1095
2018-10-09 15:14:49 +02:00
Safihre
217b2436f2 Detect RSS-feed login redirect and show specific error
Before it would overwrite specific errors detected above by general "No entries" warning.
2018-10-09 14:26:49 +02:00
Safihre
a9247ba934 No URL-encoding of RSS-URL's with comma's
Some indexers don't like that!
2018-10-09 13:55:58 +02:00
Safihre
8b2a6ef825 Link to details page of RSS-feed item if provided 2018-10-09 10:04:21 +02:00
Safihre
320495671b Add RSS-source icon to all tabs 2018-10-08 13:22:34 +02:00
Safihre
5ab872afa0 Assume correct SSL if test-host disabled
Closes #1179
2018-10-03 08:04:43 +02:00
Safihre
7ecb31805e Add API-capability to modify RSS filters
Closes #1154
2018-09-16 14:51:11 +02:00
Safihre
e8ebeb843c Retry All would not Retry URL's
Closes #1164
2018-09-16 13:32:13 +02:00
Safihre
3840678913 Rename thread-database getter
Each thread needs it's own DB-connection (see Python-docs). So for each CherryPy-thread we need to store the thread connection. The name of the function made it sound like we create a whole new connection, which isn't the case.
2018-09-16 13:31:43 +02:00
Safihre
da7082b17e Sending Retry for already completed jobs would give traceback
Due to missing file/folder.
See: https://forums.sabnzbd.org/viewtopic.php?f=2&t=23587
2018-09-16 10:11:32 +02:00
Safihre
6198f95e1e Do not log null-bytes in par2-creator
#1153
2018-09-11 16:21:06 +02:00
Safihre
4075b1accb Set version to 2.3.5 2018-09-07 10:44:18 +02:00
Safihre
6d8a774443 Merge branch 'develop' 2018-09-07 10:41:57 +02:00
Safihre
76c7a6ce95 Update text files for 2.3.5 2018-09-07 10:11:20 +02:00
Safihre
01bd0bdce0 Small cleanup of generated POT file 2018-09-07 10:11:00 +02:00
Safihre
fa908de6e9 Test a unicode download
Broken-unicode job is still work-in-progress
2018-09-05 15:08:50 +02:00
Safihre
f05a6c6f76 Add seperate servers for each test-OS 2018-09-05 15:05:47 +02:00
Safihre
d86fb42d28 Code-style changes 2018-09-05 14:51:16 +02:00
Safihre
7a7ce47769 Remove redundant parentheses 2018-09-05 11:26:38 +02:00
Safihre
40e57845a7 Correctly sort additional blocks to be added
Oops, .pop() gets the last one not the first one.
2018-09-03 13:50:38 +02:00
Safihre
884dedc9d1 Failed file join would not result in failed job 2018-09-03 13:14:29 +02:00
Safihre
8e1f4e14a2 MultiPar repair of joinable files doesn't join them 2018-09-03 13:06:07 +02:00
Safihre
1190742127 Correctly report CRC errors in (7)zip archives
They were reported as password errors.
2018-09-03 09:43:59 +02:00
Safihre
e6d481a2ba Perform functional tests also on macOS 2018-08-28 07:47:33 +02:00
Safihre
0958caf5ed If no newsserver-info, skip tests 2018-08-28 07:47:33 +02:00
Safihre
e2761d967e Functional testing using Selenium 2018-08-28 07:47:33 +02:00
Safihre
b4f36be170 Update text files for 2.3.5RC2 2018-08-23 20:54:12 +02:00
Safihre
5e722b27f3 Fix more errors and warnings found by code validation 2018-08-23 14:31:15 +02:00
Safihre
367a73ef29 Fix errors found by code validation tool 2018-08-22 09:52:58 +02:00
Safihre
9228bc28ff Typos in stylesheets 2018-08-22 07:58:24 +02:00
Sander Jo
02e18be5e1 Better pystone calculation 2018-08-22 07:58:08 +02:00
Safihre
531ef59e0a Small Config > General styling fix 2018-08-21 15:39:31 +02:00
Safihre
54e03fb40a Update text files for 2.3.5RC1 2018-08-08 20:35:01 +02:00
Safihre
904bb9f85a Remove unused imports 2018-08-07 17:10:13 +02:00
Rik Smith
b011e1a518 Direct Unpack would abort if single-file unpack was too slow (#1165) 2018-08-06 08:40:59 +02:00
Rik Smith
f83f71a950 Fix Deobfuscate.py script (#1166)
* Fix deobfuscate script

* Rename for code check

* Rename for code check
2018-08-06 08:35:01 +02:00
Safihre
4dbf5266ef Par2 files with same number of "+x" blocks were not counted seperatly
Strange why I did that before. It does create the possibility that if we have a huge NZB with many sets with similar filenames that we take forever to repair, but for normal NZB's with lot's of "volXX+40" we would ignore all those extra blocks.
2018-08-04 10:38:02 +02:00
Safihre
05aac4e01e Remove redundant integer conversion 2018-08-04 10:36:03 +02:00
Safihre
267c48f9a7 Update gitignore for PyCharm 2018-08-04 10:00:46 +02:00
Safihre
5168915a65 Manualy par2 parsing in Deobfuscate.py for major performance increase
By @P1nGu1n, thanks!
2018-08-03 15:13:20 +02:00
Safihre
71017d0d55 Diskspeed test did not remove test file 2018-08-03 15:06:19 +02:00
Safihre
a5db51a2c5 Windows-tray also show queue size left info when paused 2018-08-01 21:25:17 +02:00
Safihre
0bf2968e6a Windows installer language wasn't parsed for the wizard
It needs a translation table and it was fetched from the wrong register location
2018-08-01 11:42:23 +02:00
Safihre
2ec5918f5e Extend disk-speed time to 1 second for more stable results 2018-08-01 07:57:24 +02:00
Safihre
04f5a63cd7 Backported new-style speed-test from Py3 branch
Old-style would create bad file on Windows. This is more robust. Thanks @albino1 for report!
2018-07-31 22:25:14 +02:00
Safihre
43d8283f5b Wizard final page not linking to Folders config page
Closes #1163
2018-07-31 22:07:01 +02:00
SABnzbd Automation
f8111121c4 Automatic translation update 2018-07-14 20:49:01 +00:00
Safihre
b53b73c135 Only abort active DirectUnpackers
Only when we have assigned a setname we are doing something, otherwise we might just as well leave the files and not delete too much. For example see: https://forums.sabnzbd.org/viewtopic.php?f=2&t=23440
2018-07-14 22:24:06 +02:00
Safihre
bd7b8a975b Wrap is_rarfile so it can't crash when files are gone
Seen in users log-files. Possible when deleting job during assembly-steps.
2018-07-14 21:20:11 +02:00
Safihre
7ca765f276 Lock start and stop of DirectUnpack so they can't overlap
In high-speed situations this could happen.
2018-07-14 21:18:57 +02:00
Safihre
b918a53af5 Add env-variables to pre-queue call 2018-07-14 17:28:37 +02:00
Safihre
525809afc9 Always add basic env-variables to external calls 2018-07-14 17:28:14 +02:00
Safihre
a7048cdc8e Use server hostname in logs and warnings
Closes #1159
2018-07-14 12:14:48 +02:00
Safihre
02888568bd Log par2 creator
Closes #1153
2018-07-02 10:29:07 +02:00
Safihre
203409f02f Update MultiPar to 1.3.0.1 2018-06-29 10:06:15 +02:00
Safihre
ecc8e6ac0e Update UnRar to 5.60 for Windows and macOS
Closes #1156
2018-06-29 10:01:40 +02:00
Safihre
852636acda Add VPN problems to known-issues 2018-06-12 11:14:07 +02:00
Safihre
281acce610 Py3: Fixes after merge of develop 2018-06-09 19:29:40 +02:00
Safihre
bc18369552 Spelling fix in Deobfuscate.py
Closes #1152
2018-06-08 10:45:17 +02:00
Safihre
6cf701599c Merge branch 'develop' into py3 2018-05-30 15:07:10 +02:00
Safihre
4c6dab62a8 Py3: Pre-develop merge patches 2018-05-30 14:53:04 +02:00
Safihre
8f248a2219 Could not set single Indexer Tag for a category
"TV > HD" would become ['TV', '>', 'HD'].
See https://forums.sabnzbd.org/viewtopic.php?f=3&t=23409
2018-05-30 07:53:51 +02:00
Safihre
0d8d5daff6 Merge branch 'master' into 2.3.x 2018-05-24 22:27:03 +02:00
Safihre
82857afed6 Set version to 2.3.4 2018-05-24 20:18:53 +02:00
Safihre
4e7f0a6a1e Merge branch 'develop' 2018-05-24 20:15:14 +02:00
Safihre
2a113f7f58 Update text files for 2.3.4 2018-05-24 20:11:34 +02:00
Safihre
6b8b9e0238 Update 7zip for Windows to 18.05
Closes #1140
No update for p7zip so far. Still on old old version.
2018-05-24 20:09:57 +02:00
Safihre
1e3e4b4118 Update text files for 2.3.4RC1 2018-05-19 18:24:01 +02:00
Safihre
87dfbe34d4 Use local Windows MailSlot address
In WIndows 10 April Creators update this stopped working.
https://forums.sabnzbd.org/viewtopic.php?f=3&t=23370
2018-05-14 20:11:22 +02:00
Safihre
c56bcfaf61 Only the HTTP status code 200 is required
Closes #1146
2018-05-14 19:45:28 +02:00
Safihre
a947a1d88b Always send NNTP QUIT after server-test 2018-05-14 11:07:48 +02:00
Safihre
ad0d5726ec Add option "--disable-file-log" to disable file-based logging
Closes #1103.
2018-05-10 10:52:56 +02:00
Safihre
c52ce58b6d Handle filenames in redirected URL's better
Originated from https://www.reddit.com/r/usenet/comments/8gfjky/this_started_happening_recently_what_could_be/
2018-05-10 10:17:40 +02:00
Sander
a90356c6e7 Automatically whitelist ".local" or ".local.", aka mDNS name (#1141)
Closes #1138
2018-05-04 16:53:57 +02:00
Safihre
5c78c7855b Use 64bit unrar 5.5.0 compatible with ElCapitan 2018-05-03 08:02:52 +02:00
Safihre
915ee650ee Add CORS * header
Closes #1136
2018-04-30 08:38:53 +02:00
Safihre
58bd12b083 Correctly lowercase host_whitelist
@sanderjo is right, this should always happen no matter how option saved.
2018-04-28 18:02:14 +02:00
Safihre
ecc334360a Auto-detected hostname should be lowercased
https://forums.sabnzbd.org/viewtopic.php?f=3&t=23352
2018-04-25 19:14:45 +02:00
Safihre
309f8e0044 Merge branch 'master' into 2.3.x 2018-04-22 19:20:50 +02:00
Safihre
730652e3e1 Set version to 2.3.3 2018-04-22 19:15:41 +02:00
Safihre
1aed59d52e Merge branch 'develop' 2018-04-22 19:14:52 +02:00
Safihre
1f04343a4d Update text files for 2.3.3 2018-04-22 18:56:38 +02:00
SABnzbd Automation
70f8509f6e Automatic translation update 2018-04-21 18:57:45 +00:00
jcfp
74a97296a5 Accept cheetah version newer than 2.x
I'm going to update cheetah to v. 3.x in debian soonish. All seems to work fine with sab in a quick test, apart from this version check.
2018-04-21 16:41:28 +02:00
Safihre
45d3440443 Multi-archive and split-files can also have more than 999 parts
https://forums.sabnzbd.org/viewtopic.php?f=3&t=23338
2018-04-18 09:23:19 +02:00
Safihre
c872ee16ab Changing Server priority would give JSON-page 2018-04-17 15:53:09 +02:00
Safihre
da473424f2 Bump SABYenc to 3.3.5 2018-04-17 15:52:20 +02:00
Safihre
e0dc988f94 Update text files for 2.3.3RC2 2018-04-13 13:24:24 +02:00
sanderjo
4021e6098c Improved SAN in SAB's self signed cert.
Closes #1127
Closes #1128
2018-04-13 13:05:14 +02:00
Safihre
f521037669 Files unpacked from 7zip/zip were not sorted
Closes #1124
Introduced new function to recursive list all files in a directory.
2018-04-13 10:04:45 +02:00
Safihre
246e9e421b Re-shuffle deriving of script from category
Closes #1125
2018-04-12 11:54:27 +02:00
Safihre
8aaee09652 Increase some logging and history update 2018-04-10 16:22:28 +02:00
Sander
e36450a666 Better IPv6 address handling in hostname check 2018-04-02 10:38:23 +02:00
Safihre
d84f31c116 Update text files for 2.3.3RC1 2018-03-27 12:52:37 +02:00
Safihre
e5fc51e9d7 Add option to disable X-Frame-Headers
Closes #1118
Now only added to page-requests, not also to every API-request. Only needed for real pages.
2018-03-27 10:51:51 +02:00
Safihre
291a72ec63 Bump SABYenc to 3.3.4 2018-03-25 17:16:47 +02:00
SABnzbd Automation
4dd5115b03 Automatic translation update 2018-03-23 20:09:30 +00:00
Safihre
3bdb8407d2 Hide smpl as option in Config General 2018-03-23 11:38:00 +01:00
Safihre
a88055c491 Restructure interface.py
Such a mess.
Time to clean up bit by bit.
2018-03-23 11:24:56 +01:00
Safihre
8a676aeab4 Use general shutdown_program function everywhere 2018-03-23 11:01:42 +01:00
Safihre
d41276aa82 Make maximum retries of URL fetches configurable
As a Special-option for now.
Closes #1115.
2018-03-21 22:57:04 +01:00
Safihre
96cb0aa8db Run PostProc on failed URL fetches in order to also run scripts
Closes #1108
Linked #1115
2018-03-21 10:06:23 +01:00
Safihre
03e7889d5c Evaluate cat/pp/script/priority also for placeholder NZO's
Needed to resolve #1108.
Also made small changes to improve readability of init() function.
2018-03-20 16:42:34 +01:00
Safihre
5c161b884c Remove unnecessary code from set_cat in interface
Need to get rid of SMPL.
2018-03-20 16:25:21 +01:00
Safihre
f77cc43b7d Indicate that SMPL skin may lose functionality in future releases 2018-03-20 15:15:37 +01:00
Safihre
bd709a7bdd Use VALID_NZB_FILES constant 2018-03-20 11:36:32 +01:00
Safihre
c3832a85f7 Job would stay forever if URLGrabber grabbed nonsense 2018-03-18 18:36:58 +01:00
SABnzbd Automation
52aa7a08d7 Automatic translation update 2018-03-16 12:27:43 +00:00
Safihre
ee0358cf06 Update text-files for 2.3.3Beta1 2018-03-16 13:16:21 +01:00
Safihre
2344a50f6c Update SABYenc to 3.3.3
Fix a problem with false CRC errors.
2018-03-16 11:52:24 +01:00
Safihre
a2774ce762 Prepare text-files for 2.3.3Beta1 2018-03-15 13:44:51 +01:00
Safihre
2cdf284578 Update copyright to 2018 2018-03-15 13:14:08 +01:00
Safihre
3fd9e85236 Warning when we refuse connection to unlisted hostname 2018-03-15 09:06:56 +01:00
SABnzbd Automation
f08eaa4e53 Automatic translation update 2018-03-15 07:27:56 +00:00
Safihre
f47a6a889e Mitigate DNS re-binding attacks by introducing hostname whitelist
By default add the current hostname to the list, since we also show this URL as an option in the wizard. 
Closes #1092
2018-03-14 16:51:23 +01:00
Safihre
14b32f30f0 Remove callback from API
It was only half-implemented.
2018-03-14 09:59:32 +01:00
Safihre
902f67ef02 Merge remote-tracking branch 'origin/master' into 2.3.x 2018-03-13 16:29:46 +01:00
Safihre
20fbea6e31 Rework security flow of webpages
Have 1 wrapper that checks all secuirty checks and exposes the package for CherryPy.
Cleaner code that can then be used to implement global security checks.
Merged wizard.py into interface.py and removed lots of overhead code that is handled by the general system.
2018-03-13 16:03:49 +01:00
Safihre
53261ad311 Correct creation of Server-instance during test
Forgot to fix after 0b9b28112d
2018-03-13 15:19:12 +01:00
Safihre
4686bc1fa6 Indicate that SMPL is no long supported 2018-03-13 08:21:17 +01:00
sanderjo
0d806305c2 Usage: show NZB adding via command line 2018-03-12 19:58:44 +01:00
Safihre
ee0623d68b Set priority level of Windows subprocess from Config
Closes #1109.
Default changed from IDLE to NORMAL.
2018-03-12 16:34:10 +01:00
Safihre
0b9b28112d Make SSL-Ciphers a per-server setting
Closes #1110
2018-03-12 08:44:04 +01:00
Safihre
3ebe7dff45 Remove references to old 'fillserver'
It's been more than 3 years now.
2018-03-12 08:27:27 +01:00
Safihre
7d4b665cd9 Refresh translation cache also when changed via API
Linked #1106
2018-02-27 15:48:08 +01:00
shypike
5b7224bf4c Add Special option to ignore empty file definitions in NZB
Called "ignore_empty_files".
2018-02-18 21:42:27 +01:00
Safihre
1b67c9c13d 99 is the highest server priority
Closes #1100
2018-02-14 15:15:34 +01:00
Safihre
fe849d8805 Correct error display during adding of server 2018-02-13 08:26:55 +01:00
Safihre
07c3ff9710 Add X-Frame-Options header to prevent click-jacking
Linked #1092
2018-02-07 00:37:50 +01:00
Safihre
f3e18ac355 Set httpOnly for cookies to not allow scripts to access login cookies 2018-02-07 00:14:43 +01:00
Safihre
2bafefa795 Warn about the amount of time server is ignored on failing lookup
And also only look-up when actually something in the queue.
2018-02-05 09:39:14 +01:00
Safihre
c9fcd4cecc Do not assume bad SSL setup due to no network at program start
Close #1091
2018-02-05 09:38:28 +01:00
Safihre
343d9b10cf Prevent false-positives of "password" detection in common media files
Closes #1096
2018-02-02 09:17:29 +01:00
Safihre
3d219c9382 Improve non-resolving server detection 2018-02-02 08:53:12 +01:00
Safihre
031ed3f01e Update 7zip to 18.01 for Windows 2018-02-02 07:35:03 +01:00
Safihre
f20a30cfc2 Show warning and block non-resolving newsservers
Closes #1098
2018-02-01 14:53:01 +01:00
Safihre
b5dcfe0238 Show JSON-returned errors also to user in Config 2018-02-01 09:09:08 +01:00
Sander
d169bb5e28 64-bit version of unrar (for MacOS) 2018-01-31 10:47:21 +01:00
Safihre
25429b5b19 Detect '502 Byte limit exceeded' as payment problem
Was now detected as too-many-connections problem, while it's actually a permanent problem.
Related to: https://forums.sabnzbd.org/viewtopic.php?f=2&t=23151&p=114795#p114795
2018-01-11 17:26:15 +01:00
Safihre
9638eab564 Full server-lookup was not performed during server testing
Because of this, Happy Eyeballs or any other server-load balancing that is performed during downloading was not applied. 
Closes #1089
2018-01-10 14:52:10 +01:00
Safihre
c6b84660e3 Add tooltip to Force Disconnect 2018-01-09 08:08:21 +01:00
Safihre
cc61e669ef Catch checksum errors of MultiPar 2017-12-25 17:27:31 +01:00
Safihre
3a19741edb Add traceback information to Invalid NZB error 2017-12-25 17:11:13 +01:00
Safihre
3c87fd45c3 Set version to 2.3.2 2017-12-21 20:41:52 +01:00
Safihre
d0a258ce28 Merge branch 'develop' 2017-12-21 20:38:19 +01:00
Safihre
1cac5799eb Update text files for 2.3.2 2017-12-21 20:19:15 +01:00
Safihre
a56e4f3650 Small reduction of the unused encoding functions 2017-12-20 15:07:50 +01:00
Safihre
9970d2ee6f Remove obsolete UNTRANS function
We now use subprocessww, to pass real unicode to new processes on Windows.
2017-12-20 14:10:39 +01:00
Safihre
f2695e9305 Correctly handle unicode/deunicode in pre-queue script 2017-12-20 14:10:13 +01:00
Safihre
d333f1b56b Deunicode should make string of everything 2017-12-20 14:10:13 +01:00
shypike
00f5b29caa Fix CP850-Latin1 mapping, prevent "f" from being converted to 0x9F 2017-12-20 13:46:32 +01:00
Safihre
16aa43c120 Also extract password from job filename
Closes #1084
2017-12-19 22:27:36 +01:00
Safihre
b2179d5b3e Small patch of Categorie Config highlights 2017-12-14 15:36:43 +01:00
Safihre
8e2e9fd5c9 Remove extra logging for missing article DB errors
Closes #952
2017-12-14 10:36:17 +01:00
Safihre
2e3181779a Correct highlighting in Config for each sub-section 2017-12-14 10:19:52 +01:00
Safihre
8a270e49be Add caller name to logging for purging of job data 2017-12-11 15:15:47 +01:00
Safihre
32e26c804b Correctly update row colors when selecting Advanced Settings 2017-12-10 15:35:25 +01:00
Safihre
5cf87be51e Update README typo 2017-12-10 15:35:11 +01:00
SABnzbd Automation
781c45bf3b Automatic translation update 2017-12-09 15:32:43 +00:00
Safihre
df5a85f851 Correctly update text files for 2.3.2RC2
Typo!
2017-12-09 16:23:49 +01:00
Safihre
8373994be6 Add extra logging when folder wasn't removed in purge 2017-12-09 16:20:36 +01:00
Safihre
437ff427f8 Improvements to Advanced Settings switching in Config 2017-12-09 15:16:38 +01:00
Safihre
ea5e4dfee1 If Download all par2 was enabled jobs would get orphaned
Mistake in fd1975617b
Jobs were incorrectly re-added after QC failure because already downloaded par2 files were "added" as new ones, resulting in orphaned jobs because there were no new files.
2017-12-09 14:18:22 +01:00
SABnzbd Automation
2e45f4028c Automatic translation update 2017-12-08 11:17:18 +00:00
Safihre
d7cdce9278 Update text files for 2.3.2RC2 2017-12-08 11:49:33 +01:00
Safihre
38c329ade2 Hide Advanced Settings
Closes #1082
2017-12-08 10:15:18 +01:00
Safihre
933d0c073c If wizard started with already setup servers, select the right one 2017-12-06 16:10:50 +01:00
Safihre
1f49bba343 Make warning about SABnzbd possibly being exposed more prominent 2017-12-06 15:49:12 +01:00
Safihre
0ac712dce1 Add 'Job Name as Folder Name' as Sorting Preset for de-obfuscation
Also rename internal variable `dirname`, since it's really just the job-name.
2017-12-06 10:57:36 +01:00
Safihre
f1ae9060c3 Remove white space before some warnings
Closes #1081
2017-12-04 10:30:09 +01:00
Safihre
263231bb62 Lower upper-bound for auto-detected Article Cache to 1G
2G is a bit too much and should only happen in extreme cases
2017-12-03 20:36:30 +01:00
SABnzbd Automation
a7b964c153 Automatic translation update 2017-12-03 16:42:42 +00:00
Safihre
78035eed12 Wizard server test with existing server would require re-entering pass 2017-12-03 13:47:42 +01:00
Safihre
0e7ac8ec5e Add new %dn to Pattern Key for Date Sorting
Closes #1080
2017-12-03 10:49:38 +01:00
Safihre
00f262c90e Rename tvsort.py to sorting.py for consistency 2017-12-03 10:44:20 +01:00
Safihre
68df476603 Rename Generic Sorter to Movie Sorter to match interface name 2017-12-03 10:38:48 +01:00
Safihre
5da03f506d Replace ".avi" by ".mkv" in examples for Sorting 2017-12-03 10:34:40 +01:00
Safihre
0c9540e41e Add %dn to DateSorter 2017-12-03 10:29:59 +01:00
Safihre
c6226c6adb Add per-day download-stats to server_stats API-call
Linked #1079
2017-12-01 19:03:52 +01:00
Safihre
b8aab5c0f8 Lower bound for auto-detected article cache set to 32M again
For systems with 256MB or 512MB memory the auto-detected values are valid (e.g. 64MB and 128MB) and would otherwise be discarded.
2017-12-01 00:22:51 +01:00
Safihre
e29e7a65b5 Limit auto-detected article cache to 2GB
Users can set more if they want, or if they are on 32bit system it will be limited automatically to 1GB.
2017-11-30 23:59:44 +01:00
Safihre
eb46ed80b6 Also use 1/4th of memory on macOS for Article Cache 2017-11-30 23:45:32 +01:00
Safihre
50b2d558eb Also use 1/4th of memory on Windows for Article Cache 2017-11-30 23:45:20 +01:00
Fish2
3b4b3dcca2 Add moment.js Language he.js - Hebrew 2017-11-27 20:54:16 +01:00
Fish2
e0f8410918 Remove Unused Language Files 2017-11-27 20:54:16 +01:00
Fish2
581942ca11 Update bootstrap3-typeahead.js to V4.0.2, Update jQuery Form Plugin To 4.2.2, Update jquery-qrcode To v0.14.0 2017-11-27 20:54:16 +01:00
Fish2
005fd399d0 Update Glitter moment.js to 2.19.2 2017-11-27 20:54:16 +01:00
Fish2
6ff00bc992 Update Six to 1.11.0 2017-11-27 20:54:16 +01:00
Safihre
ca66eb04ad Note restoring of OSX 10.11.6 compatibility for 2.3.2RC1
Closes #1075
2017-11-26 11:07:24 +01:00
Safihre
91a2532c95 Show warning in wizard when language files are not present
Closes #1074
2017-11-25 10:51:31 +01:00
SABnzbd Automation
cb49f7bb53 Automatic translation update 2017-11-23 17:12:04 +00:00
Safihre
0049f14d7f Update text files for 2.3.2RC1 2017-11-23 17:31:22 +01:00
Safihre
e414874910 Only report missing UnZip when missing 7Zip 2017-11-23 13:39:04 +01:00
Safihre
5931beaa5c Quote all arguments to external processes on Windows 2017-11-23 13:36:47 +01:00
Safihre
b3d80b7c65 Remove unzip from Windows distribution 2017-11-20 20:24:01 +01:00
shypike
9aa90083b2 When available, use 7zip instead of built-in unzip.
7zip supports passwords, many old platform unzips do not.
2017-11-20 20:24:01 +01:00
Safihre
0b939a9519 Notification category Default only means "all categories" if non other 2017-11-20 20:08:32 +01:00
Safihre
501867137a Reset also article try-list on dropped server connections
Test release for these users showed that "server dropped connection" also needed a reset of the article trylist.
Linked:
https://forums.sabnzbd.org/viewtopic.php?f=2&t=23111
https://forums.sabnzbd.org/viewtopic.php?f=2&t=23109
2017-11-20 12:06:56 +01:00
Safihre
75d4b5deca Add tooltip to server graph month selector 2017-11-19 15:02:17 +01:00
Safihre
442591f20c Link server graphs (month and scale) and show monthly total
Closes #1028
2017-11-19 14:58:43 +01:00
Safihre
74b7f383db Always show 1 decimal for MB and above
So it is similar to the JS filesize function
2017-11-19 14:55:46 +01:00
Safihre
b966707247 Implement fast and slow queue in postprocessor
So I implemented this in a kind of cheeky easy way: 
There is a fast and a slow queue in the `PostProcessor`, if we see it has completed Direct Unpack or if it is still active (might be unpacking that last volume) it is put in the fast queue.
We always check the fast queue first, then the slow one. To not have slow jobs be stuck in the post-proc queue forever, every 3 fast jobs we force a slow job (if present).
Closes #1014
2017-11-18 19:00:52 +01:00
Safihre
eada7286d1 Small optimization in registering of article for first articles 2017-11-18 16:31:47 +01:00
Safihre
b9c312961b listdir can fail on Windows for C: instead of C:\ and crashing postproc 2017-11-18 09:55:56 +01:00
Safihre
8389b4fedb Re-evaluate filenames after first par2 file is finished
Just in case it came in after all first articles were downloaded.
2017-11-18 00:57:15 +01:00
Safihre
7720cd60ec Decode first articles of each file first to find filenames
Get first article of each file first, so that we can use the par2 information to get the filename. This way on obfuscated posts we can faster start Direct Unpack.
In a bit convoluted way so that we can also stay performance tuned.
Closes #1044
2017-11-18 00:45:40 +01:00
Safihre
d1d437074a Do not flush article cache to disk on pause
Overly cautious
2017-11-18 00:13:50 +01:00
Safihre
30d3d62e09 Correct MultiPar Extra Par2 Option passing 2017-11-17 22:29:15 +01:00
Safihre
fd1975617b Simplify and comment code on par2 errors
Closes #1070 (read for details)
2017-11-17 22:24:55 +01:00
SABnzbd Automation
1d037dcb62 Automatic translation update 2017-11-16 22:12:35 +00:00
Safihre
bd5fb3e88f Remove unused crash_msg postproc code 2017-11-16 22:21:39 +01:00
Safihre
5ca66bfeef Only require SABYenc to match minor version and bump to 3.3.2 2017-11-16 20:27:32 +01:00
Safihre
c9fbadd097 Improve progressbar on new Firefox 2017-11-15 15:33:44 +02:00
Safihre
f4568ad7dd Do not warn about disk-errors when job is deleted/done
Only happens in really fast situations with many server connections for small downloads completed within 1 or 2 seconds.
2017-11-15 13:02:01 +02:00
Safihre
74a395f584 Increase wait-time in URLGrabber and stop after 10 tries
Closes #1069
2017-11-13 18:10:18 +02:00
Safihre
dd703ace7f Fully parse output of Pre-Q script correctly
PP/Priority are different, since 0 is also a valid value for these settings.
2017-11-12 14:19:10 +02:00
Safihre
ddc8396260 Empty values in Pre-Q script should not just be ignored 2017-11-12 13:07:41 +02:00
Safihre
e6724e347c Do not 'fix' sending of priority and pp-setting, removes the 0 setting
Priority Normal and PP-setting Download have a value of 0, so they were not send to the pre-Q script.
2017-11-11 17:26:14 +02:00
Safihre
7fa0508ae8 Show tooltip to explain 'Show Logging' anonymized the data 2017-11-11 17:03:53 +02:00
Safihre
06c6f7d38e Auto-history-purge on start-up
Closes #1065
2017-11-11 16:46:11 +02:00
Safihre
59ef400fec Log history-status of failure during repair
For easier debugging
2017-11-11 16:40:04 +02:00
Safihre
0acdf15755 Always show user-entered password in History-info
People like to have this info, some users want to only unpack later etc.
2017-11-11 16:31:38 +02:00
SABnzbd Automation
40128f59dd Automatic translation update 2017-11-07 13:33:01 +00:00
Safihre
286914f253 Correctly report when repair is performed, but fails
Strange, but it can happen. There has been an uptick in this kind of failing downloads. Seems to be a problem with the original par2-files, but not sure yet what it is.
 https://forums.sabnzbd.org/viewtopic.php?f=2&t=23048&p=114059
2017-11-06 13:02:23 +01:00
Fish2
f9bd58bb74 lossless compression of images 2017-11-04 11:47:21 +01:00
Safihre
180b4c9538 Py3: Convert cmp-based sorting to new key-based sorting 2017-10-28 14:58:13 +02:00
Safihre
bac5523ce3 Py3: Move all filesystem operations to seperate file 2017-10-28 14:58:13 +02:00
Safihre
b2508f3fd1 Py3: Use long-paths everywhere and fix diskspeed test 2017-10-28 14:56:05 +02:00
Safihre
da5eacba31 Py3: Basic NZB-adding support 2017-10-28 14:56:05 +02:00
Safihre
8ea79934b8 Py3: Optimize JSON output 2017-10-28 14:54:53 +02:00
Safihre
056f82a2ae Py3: Basic running of external programs and fixing startup on Linux 2017-10-28 14:54:53 +02:00
Safihre
3b36cfe4c9 Py3: Remove over-active 2to3 dictionary items/keys/values conversion 2017-10-28 14:54:53 +02:00
Safihre
80559e1f1c Py3: Basic support for creating NNTP connections 2017-10-28 14:54:53 +02:00
Safihre
83bf6f05a0 Py3: Update text-files 2017-10-28 14:54:53 +02:00
Safihre
714c5e15ba Py3: Fix Config pages 2017-10-28 14:54:42 +02:00
Safihre
1499932625 Py3: Only support sabyenc, do not start without sabyenc/par2/unrar 2017-10-28 14:54:42 +02:00
Safihre
d963988fc6 Py3: Correct JSON output for interface 2017-10-28 14:54:42 +02:00
Safihre
134aa6f6b3 Py3: No longer check for ancient queue-files 2017-10-28 14:54:13 +02:00
Safihre
938a34600b Py3: Remove subprocessww 2017-10-28 14:53:31 +02:00
Safihre
c451f15afe Py3: Get SABnzbd to start 2017-10-28 14:53:31 +02:00
Safihre
15c2a7e9ef Py3: Update PyBonjour and PyStone 2017-10-28 14:53:31 +02:00
Safihre
c6054e622c Py3: First 2to3 conversion 2017-10-28 14:53:31 +02:00
Safihre
960494cfa6 Py3: Rely on external packages during Python 3 transition
Use: "python3 -m pip install --upgrade -r requirements.txt"
2017-10-28 14:50:11 +02:00
Safihre
30cfb9c6fc Prevent potential pause/unpause loop after tray click 2017-10-27 23:39:01 +02:00
Safihre
5c54b873bf Merge branch 'master' into 2.3.x 2017-10-27 10:13:20 +02:00
Safihre
5ca4811689 Set version to 2.3.1 and resolve merge conflicts 2017-10-27 10:12:36 +02:00
Safihre
043e5966ff Merge branch 'develop' 2017-10-27 10:07:42 +02:00
Safihre
f1695ec875 Set Windows tray double click timeout to user double-click timeout 2017-10-26 20:30:49 +02:00
Safihre
a3db910a4d Update text files for 2.3.1 Final 2017-10-26 20:15:21 +02:00
Safihre
80a29c50c9 In the binaries (macOS/Windows) getmodule does not work
Because the files are compiled, they loose this info it seems.
2017-10-26 14:23:58 +02:00
SABnzbd Automation
d693e20e1a Automatic translation update 2017-10-26 11:23:00 +00:00
SABnzbd Automation
1a36f548df Automatic translation update 2017-10-25 23:23:37 +00:00
Safihre
a6f6d88ab9 Move get_from_url to sabnzbd.misc 2017-10-25 23:00:32 +02:00
Safihre
aa7fb17b4e Reduce standard timeout of new servers to 60 seconds
In line with other usenet software.
2017-10-25 22:08:14 +02:00
Safihre
a99d333272 Fix racing-condition for files coming in after post-proc is started
Files could still come in after post-proc is already started. Post-proc could even have already deleted the job folder, resulting in Assembler errors for these new files. So when post-proc is active, it is safe to ignore write-errors.
Linked topic: https://forums.sabnzbd.org/viewtopic.php?f=3&t=23049
2017-10-25 11:21:59 +02:00
Safihre
801aadecfc Add logging to stop_idle_jobs 2017-10-24 10:46:18 +02:00
Safihre
124e2b253c Do not crash when unrar gets stopped or killed in Direct Unpacker 2017-10-24 10:32:17 +02:00
Safihre
39cceed580 NZF completed is a property method, not an attribute 2017-10-24 10:07:45 +02:00
Safihre
bfcf56ec45 Log traceback on assembler disk error 2017-10-23 21:58:24 +02:00
Safihre
01603b24f5 Do not log decoding of articles by default to reduce logging density
The Debug logs were getting way too confusing with all the "Decoding X" in there, when 99% of the time it is of no importance.
2017-10-23 20:42:17 +02:00
Safihre
d93d2591b7 Do not pause after sending notifications 2017-10-23 11:33:11 +02:00
Safihre
c17fcec499 Correctly handle single and double clicks on Windows tray-icon
On Windows, double click is actually 1 single click followed by a double-click event, no way to differentiate that first click-event of a double-click from an actual just single-click. So we need a timed callback to cancel when we do get the double-click event. Luckily the win32api provides this function.
2017-10-23 11:11:39 +02:00
Safihre
6804ac20da Remove unused is_utf8 function 2017-10-23 11:09:55 +02:00
Safihre
4ed7ac3dea Do not crash when directory creation fails in Direct Unpack 2017-10-22 13:23:57 +02:00
Safihre
eae8056366 Remove old par2cmdline/par2tbb options for MultiPar 2017-10-22 12:58:07 +02:00
Safihre
df4680b6d0 Simply function-caller detection for performance
Much much faster.
#1059
2017-10-22 11:46:41 +02:00
Safihre
b8f5861044 Add new translatable text 2017-10-22 11:24:46 +02:00
Safihre
8e01ceca7a Show current output of running script in History
For long-running scripts.
2017-10-21 14:31:22 +02:00
Safihre
0e1cdec78f Log actual filename and ID of new files 2017-10-21 14:07:06 +02:00
Safihre
13e5e93953 Tweak display of Direct Unpack and Fetching jobs 2017-10-20 21:56:26 +02:00
Safihre
02d08f38eb Correct handeling of jobs fetching extra blocks
Always need to set status to Fetching when getting more blocks and not show the priority selector in Glitter to prevent it from updating the priority. 
@OneCDOnly
2017-10-20 21:03:58 +02:00
Safihre
770951bfe6 Update text files for 2.3.1RC2 2017-10-20 10:59:21 +02:00
Safihre
022898bf63 ENV fields of 0 should be listed as 0 and not empty
So first convert to string, then de-unicode.
2017-10-20 10:58:48 +02:00
Safihre
4fd2d8505b Reset last_volume_linebuf for multi-sets in Direct Unpacker
And log in case of duplicate lines in Unrar output
2017-10-19 22:32:11 +02:00
Safihre
cc72bb743a Use C for [C]ontinue in Direct Unpack 2017-10-19 17:24:06 +02:00
Safihre
d7869fc3a1 Make Direct Unpack icon always visible
Add also the info to the hover, to somehow still explain the icon. Having this info always visible is more important than being able to hover over it directly.
Closes #1013
2017-10-19 15:07:47 +02:00
Sander Jo
4fbf870028 Example Post-Processing Script, written in Python. 2017-10-16 10:21:08 +02:00
Safihre
306558b52f Tracing of function caller only on Debug level logging
And add caller-name to NzbQueue-remove
2017-10-15 16:26:04 +02:00
Safihre
db19875f5d Add caller name to more logging 2017-10-15 10:46:44 +02:00
Safihre
f8061dc9c8 Log caller of history delete and pickle loading/saving
#1054
2017-10-15 10:30:38 +02:00
Safihre
c73591eb20 Allow up to 4GB Article Cache on 64bit systems 2017-10-15 09:58:51 +02:00
Safihre
ec132374a6 Resolve locking situation by only using 1 lock 2017-10-14 15:06:45 +02:00
Safihre
262964c6c2 Add path to gzipped NZB to script environment variables 2017-10-14 10:42:15 +02:00
OneCDOnly
cdaad3ed90 Correct spelling of 'separate' in a few contexts 2017-10-14 09:51:25 +02:00
SABnzbd Automation
84f54f5c57 Automatic translation update 2017-10-13 14:36:36 +00:00
Safihre
00436dfb2c Update text files for 2.3.1RC1 2017-10-13 16:07:21 +02:00
Safihre
c3ce87bd10 TRANS/UNTRANS fails when input is None 2017-10-13 14:03:55 +02:00
Safihre
c3a48a61b6 Correctly fix deadlock of NZBQUEUE_LOCK and DOWNLOADER_CV 2017-10-13 14:03:49 +02:00
Safihre
0c03476d76 Always send failure_url, like we say in the documentation 2017-10-12 16:23:26 +02:00
Safihre
6148cd5445 NZBQUEUE_LOCK in DirScanner causes lock-up when changing prio during add 2017-10-12 15:39:44 +02:00
Safihre
7f72e2042c Add 'Accept' to 'From Show SxxEyy' 2017-10-12 15:28:06 +02:00
Safihre
638b29819c 'From Show SxxEyy' is an Accept filter
Oops.........
2017-10-11 22:23:25 +02:00
Safihre
b950820099 Testing notification email and limiting to certain categories was broken 2017-10-11 13:27:01 +02:00
Safihre
96adf76ef1 Show NZF-ID in warning to find where files got deleted
Linked: #1034 and #952
2017-10-11 11:59:53 +02:00
Safihre
556a4db186 Log all file and folder removal
Linked: #1034 and #973
2017-10-11 11:55:53 +02:00
Safihre
b9fbd19064 Prevent downloader crash when performing slowdown check 2017-10-11 10:13:30 +02:00
Safihre
167e7f2870 Do not warn too much when renames can't be saved
Probably happens after the sucessfull finishing of the job anyway.
2017-10-10 16:25:19 +02:00
Safihre
4dba5b8caa Make sure that Category folders are not a sub-folder of Incomplete
We only check during adding or updating of categories, but that's already better than before.
Example: #1047
2017-10-09 23:11:11 +02:00
SABnzbd Automation
831b64daa8 Automatic translation update 2017-10-09 21:04:38 +00:00
Safihre
38fd5cde29 Unicode needs to be de-unicoded on all platforms 2017-10-09 22:34:47 +02:00
Safihre
e39456cca1 Filter out any unicode in ENV variables 2017-10-09 22:21:19 +02:00
andofrjando
8e9425855b Much nicer icon and colour 2017-10-08 11:39:37 +02:00
andofrjando
89add6edac New feature: Safari pinned tab icon 2017-10-08 11:39:37 +02:00
SABnzbd Automation
16b85429ae Automatic translation update 2017-10-06 09:14:40 +00:00
Safihre
2482c8e70a Update text files for 2.3.1Beta1 2017-10-06 10:58:23 +02:00
Safihre
ad2bb6c3a7 Also remove trailing .par2 from final folder
Otherwise Deobfuscate.py fails due to bug in par2cmdline that can't handle folders with "par2" in it.
2017-10-06 10:32:53 +02:00
SABnzbd Automation
2c7e725e39 Automatic translation update 2017-10-05 13:29:56 +00:00
Safihre
123f05f164 Use internal list2cmdline to correct path escaping on Windows
More info: #1043
Closes #1043
2017-10-05 14:46:13 +02:00
Safihre
4ade2e0c60 Special Windows-names can break RarFile 2017-10-05 14:29:04 +02:00
Safihre
c908a396df Correct the Deobfuscate script 2017-10-04 19:51:28 +02:00
Safihre
15f2370bca Leave undefined ENV variables empty 2017-10-04 19:51:04 +02:00
Safihre
a5e208eb11 Abort Direct Unpack if stuck for more than 2 minutes
Safety measure
2017-10-04 15:21:22 +02:00
Safihre
d59b3b3679 Also parse extracted files during DirectUnpack 2017-10-04 15:21:22 +02:00
Safihre
476542463a Start-up check for subprocessww 2017-10-04 15:21:21 +02:00
Safihre
52267a9565 Use special patched version of subprocess for Unicode POpen on Windows 2017-10-03 14:31:49 +02:00
SABnzbd Automation
972e708810 Automatic translation update 2017-10-02 20:48:06 +00:00
walgarch
a636f7f18e Added 'with' to list of lowercase words in titles 2017-10-02 14:02:47 +02:00
Safihre
9d5b3e9621 When re-adding set status to Downloading so time left is calculated
@OneCDOnly
2017-09-30 22:54:20 +02:00
SABnzbd Automation
9e2d8e5e55 Automatic translation update 2017-09-30 19:32:39 +00:00
Safihre
d9899cc5cd Increase delay to 2 seconds between sub-processes on Windows
1 was not enough, or something else is wrong
2017-09-30 21:18:44 +02:00
Safihre
650e83e1b8 Datetimes in history/warnings were displayed in UTC and not local time 2017-09-30 17:55:22 +02:00
Safihre
4296e1628b Add NZBQUEUE_LOCK to importing of NZBs
So that nothing can happen between uploading/adding and when they are actually in the Queue. Before this it would show the job as "orphaned" while it was being added.
2017-09-28 17:17:16 +02:00
Safihre
5dddc7ab61 Re-introduce NZBQUEUE_LOCK
There seems to be no performance impact.

Linked #1034 and #952 

Reverts partially 02ebb97a8b
2017-09-28 16:52:31 +02:00
Safihre
529ba69584 Do not save to disk when pausing due to import error
Linked #1034
2017-09-28 16:22:49 +02:00
Safihre
9f35568a24 UnRar prints path including folder, even when set to flat-unpack 2017-09-28 11:13:23 +02:00
Safihre
fe40d49c26 Update server-info on every update
https://forums.sabnzbd.org/viewtopic.php?f=3&t=23003
@OneCDOnly
2017-09-28 10:25:14 +02:00
Safihre
6c0b32004a Update RecursivePar2 to be more general deobfuscation
On top of scanning for the "rename.par2", it will also rename the largest file to the job-name. But only if there's 1 large file, otherwise it could get messy. If they want more, they can do it themselves or submit a PR.
2017-09-27 14:32:12 +02:00
Safihre
bda4e102d6 Correctly display Force priority icon in Glitter Night 2017-09-27 10:27:14 +02:00
Safihre
5e03204dbc The From SxxEyy filters need integers, not strings 2017-09-26 11:53:08 +02:00
Safihre
b5deda4195 Revert "Improve display of quota"
This reverts commit 5076892d83.
2017-09-25 21:57:42 +02:00
Safihre
5076892d83 Improve display of quota 2017-09-25 21:17:17 +02:00
Safihre
6c3a3e1694 Update translatable texts 2017-09-25 21:02:32 +02:00
Safihre
edbbcec272 Remove unused imports 2017-09-24 17:45:08 +02:00
Safihre
aced381763 Add example script for users that will handle "rename.par2" after unpack 2017-09-24 11:46:43 +02:00
Safihre
cdd3f9cc8a Add also program information to PostProcessing-ENV vars 2017-09-24 11:46:33 +02:00
Safihre
a2074f06d5 Only run Pre-Queue script section when it is set 2017-09-24 11:02:06 +02:00
Safihre
39aa3a9c51 Fix the priority assigment when uploading file
Thanks @OneCDOnly

https://forums.sabnzbd.org/viewtopic.php?f=3&p=113482#p113482
2017-09-24 11:02:00 +02:00
Safihre
c6cf3cc45d Left-click on Windows-tray now toggles Pause/Resume (did nothing before) 2017-09-22 13:50:41 +02:00
Safihre
0378f6f8b1 Show pop-up on Windows for some start failures like port occupied 2017-09-22 10:50:01 +02:00
Safihre
d6b48803a6 Priority of category was ignored when adding NZB 2017-09-22 09:42:37 +02:00
Safihre
6da23930bf Let browsers do part of the input validation 2017-09-22 09:19:11 +02:00
Safihre
d4e1464cc0 Server priority is maxium 99, not 100
Otherwise the sorting and selecting does not work.
https://forums.sabnzbd.org/viewtopic.php?f=3&p=113467
2017-09-22 09:10:12 +02:00
Safihre
e8dc3ebd51 Bump version to 2.4.0 2017-09-22 09:05:30 +02:00
onno.vos.dev
4009d855c3 Ensure that Pushover works for Emergency prio as well 2017-09-21 21:12:57 +02:00
Safihre
d69796d351 Set version to 2.3.0 and resolve merge conflict 2017-09-21 10:13:56 +02:00
Safihre
a2d5713477 Merge branch 'develop' 2017-09-21 10:10:45 +02:00
Safihre
ba7d906bea Update text files for 2.3.0 2017-09-20 23:16:26 +02:00
Safihre
68f78b0e71 Subprocess on Windows needs at least 1 second timeout globally 2017-09-20 11:50:41 +02:00
Safihre
d5cd0180d8 Update SABYenc to 3.3.1 2017-09-19 17:23:29 +02:00
Safihre
10265bdfb4 Always use save-routine in database.execute so we can catch locked DB
Linked #1034
2017-09-19 09:18:22 +02:00
Safihre
3d0d67bffc Update SABYenc to 3.3.0
Faster!
2017-09-19 08:31:31 +02:00
Safihre
11bd16a653 Accidentally removed HTML-cleaning from error display
Linked #1034
2017-09-19 06:44:29 +02:00
Safihre
248f2da8a6 Pause job in case of failing imports
Linked #1034
2017-09-19 06:19:06 +02:00
Safihre
7b7aaaf467 Widen Confg Servers month selector
Closes #1032
2017-09-16 10:15:20 +02:00
SABnzbd Automation
0030e4dd36 Automatic translation update 2017-09-15 13:51:26 +00:00
Safihre
c3013d67b4 Show NZB name from RSS-feed when fetching
Of course not the name of the RSS-feed itself.
2017-09-15 14:21:45 +02:00
Safihre
ddb7f2a40c Require SABYenc 3.1.1 due to PyPi mixup
Broken source-distribution resulted in heaving to create new release, PyPi does not allow to re-upload files.
2017-09-15 12:59:24 +02:00
Safihre
167a94736e Update text files for 2.3.0RC2 2017-09-15 09:41:12 +02:00
Safihre
8b3e30f0a1 Require SABYenc 3.1.0 and no longer list CRC values
Since SABYenc 3.1.0 doesn't calculate them anymore for speed improvements.
2017-09-15 09:36:24 +02:00
Safihre
c383fa88fb Update ISSUES to match the website and list Synology being special 2017-09-13 20:51:07 +02:00
Safihre
ee72c1e4d5 Correct the testing-releases feedback slider 2017-09-11 22:13:06 +02:00
Safihre
a80bd826d6 Use the NZO password to save in database
build_history_info is called on every interface update to pretend the post-processing job is a history-job. So a password file (if set) would be loaded every second. Thanks @sanderjo!
2017-09-11 20:43:27 +02:00
Safihre
63e6d45bb1 Make sure users are warned that their settings could be unsafe 2017-09-10 21:45:19 +02:00
SABnzbd Automation
61300db1fb Automatic translation update 2017-09-10 18:24:12 +00:00
Safihre
23d005fc36 Update texts and links for 2.3.0 release to come 2017-09-10 20:01:45 +02:00
Safihre
871b351656 Set could potentially be missing from extrapars
Some bad handeling of newsunpack possibly
2017-09-10 19:29:58 +02:00
Safihre
6b53b9934e Waiting for URL would result in 100% CPU usage due to constant looping 2017-09-10 12:45:30 +02:00
Safihre
e038e08a60 Revert "Permanent notice in Plush to upgrade to Glitter"
6fdeab6948
2017-09-09 23:51:23 +02:00
Safihre
8300cb7762 Correct command-line help 2017-09-09 17:31:00 +02:00
Safihre
ec8302717f Warnings API-call now returns a dict like it should 2017-09-09 16:27:55 +02:00
Safihre
6b872b44db MultiPar can report both "PAR File(s) Incomplete" and "Need more blocks" 2017-09-09 16:20:35 +02:00
Safihre
6e48ebccc7 Correctly display time if server and brower are not in same timezone
#989
2017-09-09 13:16:11 +02:00
Safihre
1cd24d1fd0 Locking when iterating over extrapars for queue-stats
But only when we request all the files.
Closes #1029
2017-09-09 10:45:39 +02:00
Safihre
fa6bb79f53 Fix Chrome 61 table border change 2017-09-08 14:51:43 +02:00
Safihre
22e9086e09 Add AppVeyor for Windows testing
#999
2017-09-08 12:07:28 +02:00
Safihre
408b84e02d Basic NZB adding via upload or from disk 2017-09-08 10:28:01 +02:00
Safihre
16ac4dce21 Use requests module for testing 2017-09-08 10:28:01 +02:00
Safihre
5ce1554a46 Hide/Show Details in Config > Servers 2017-09-08 10:27:46 +02:00
Safihre
2d84ed6813 Always have something in RSS jobs storage 2017-09-07 00:26:59 +02:00
Safihre
06dc5b181e Do not leave rss.jobs empty to prevent crash later on
See: https://forums.sabnzbd.org/viewtopic.php?f=11&t=22952
2017-09-06 20:54:21 +02:00
Safihre
37b759fece Only notify upon testing failures 2017-09-06 20:50:27 +02:00
Safihre
3f8430780d Add test requirements 2017-09-06 20:44:47 +02:00
Safihre
9e9bc5f3b0 Very basic testing
Does it start, does it serve pages, does it serve api-requests
2017-09-06 20:44:47 +02:00
Safihre
85204105c2 Check input when setting priority of job
There was no input validation, via the API you could set any value.
2017-09-06 20:25:08 +02:00
SABnzbd Automation
f13339d64d Automatic translation update 2017-09-05 19:53:42 +00:00
Safihre
fa5b44be99 Update text files for 2.3.0Alpha2 2017-09-05 16:36:12 +02:00
Safihre
08bc7c5b9d Use NZO_LOCK to limit possible dir conflicts when adding NZBs
Hopefully resolving problems with possible overlapping directory names and import errors.
2017-09-05 16:07:43 +02:00
Safihre
d9b5dd549a Revert "Only allow 1 NZB to be added at the same time"
Could result in deadlock for some reason.
This reverts commit e64df8ed60.
2017-09-05 16:05:48 +02:00
Safihre
8ec53a3bce Giving up on elegant solutions to prevent stalling, just use a check
This stupid nightmare still wasn't fixed.
The proper solution creates slowdown on many systems because it's not efficient enough. Instead just do a check every 90 seconds if there's stalled stuff.
2017-09-05 16:05:19 +02:00
Safihre
0aac9a5e5c Correct display of download percentage
No need to calculate in javascript, we get it from API
2017-09-05 16:03:58 +02:00
Safihre
11a880d040 MultiPar shows 'PAR File(s) Incomplete' on verification success
When there are Par2-files with very similar filenames in the folder.
2017-09-05 13:21:48 +02:00
Safihre
67b66beb13 Only count really extra files during Multipar 2017-09-04 22:43:59 +02:00
Safihre
1da633442b Correct byte counts when retrying 2017-09-04 22:43:01 +02:00
Safihre
13de40881e Correct display of Forced items 2017-09-04 21:44:00 +02:00
Safihre
1c6419ea65 Revert "Paused status for individual download trumps Force priority"
Oops, I was wrong. This reverts commit d06c11673f.
2017-09-04 20:51:05 +02:00
Safihre
a2adeffc1a Correctly count all bytes and drop 'missing' use 'mbmissing'
Reporting number of missing articles makes 0 sense, it's the MB that matters.
2017-09-04 20:39:15 +02:00
Safihre
71fa3c544a Also shjow scanning of extra files for par2cmdline/tbb 2017-09-04 14:54:41 +02:00
Safihre
b739fb7f07 Do not count overhead-bytes for NZO statistics 2017-09-04 14:18:55 +02:00
Safihre
860728beae Show counter when Multipar is scanning other files in the directory 2017-09-04 13:58:50 +02:00
Safihre
1bdbf1c6a8 Show different icon when priority is Force 2017-09-04 10:59:48 +02:00
Safihre
abbed4cd77 Show missing articles starting at 2% 2017-09-04 10:59:18 +02:00
Safihre
d06c11673f Paused status for individual download trumps Force priority 2017-09-04 10:57:02 +02:00
Safihre
67d67f5ff6 Correct typo in reject_duplicate_files
Closes #1021
2017-09-03 17:07:41 +02:00
Safihre
2386d65b84 Extrapars could be empty if not +Repair set for job 2017-09-03 16:54:07 +02:00
SABnzbd Automation
be638ecca1 Automatic translation update 2017-09-03 08:23:45 +00:00
Safihre
c32bcea3f6 Re-update text files for 2.3.0 Alpha 1 2017-09-03 10:16:08 +02:00
Safihre
bf0aa6569b Need to do comparison to true number of servers
Previous solution was too simple and could still fail.
2017-09-03 10:12:52 +02:00
Safihre
e64df8ed60 Only allow 1 NZB to be added at the same time 2017-09-02 19:18:13 +02:00
Safihre
f7c3a4381d More efficient to compare TryList sizes
Only less is more.
2017-09-02 17:45:32 +02:00
Safihre
55efb34f03 Allow duplicate filenames by default 2017-09-02 15:39:55 +02:00
Safihre
ae8e9d83f1 Less CPU intensive anti-stall fix 2017-09-02 15:27:31 +02:00
SABnzbd Automation
c4406df73f Automatic translation update 2017-09-02 09:23:23 +00:00
Safihre
12004802b6 Allow users to set custom basepath
Closes #904
https://forums.sabnzbd.org/viewtopic.php?f=11&t=22511
2017-09-02 11:10:13 +02:00
Safihre
6068ca6376 Disable CherryPy timeout monitor
Besides throwing errors, it doesn't really help anything. The actions still get performed. 
See also: https://github.com/cherrypy/cherrypy/issues/1625
2017-09-02 09:50:55 +02:00
Safihre
613ba49165 Only really count passwords that came from the passwords file 2017-09-01 21:21:48 +02:00
Safihre
9cd21d84ee Only reset trylist once when reset of nw
Also happens within the decode()
2017-09-01 13:36:04 +02:00
SABnzbd Automation
8d813f125e Automatic translation update 2017-08-31 14:44:35 +00:00
Safihre
cb66bc28ab create_default_context only availble on Python 2.7.9+ 2017-08-31 13:14:29 +02:00
Safihre
30b13b1856 Small tweaks to startup logging 2017-08-30 23:59:27 +02:00
Safihre
67a133068c Move logging of number of certificates to Debug only
It's a bit slow, can take up to 1.5 seconds of startup time.
2017-08-30 23:48:07 +02:00
Safihre
731a3bcb22 Move Bonjour/ZeroConfig to after SABnzbd start
Slow to mount or to fail (1-2 seconds)
2017-08-30 23:25:49 +02:00
Safihre
724ec8ca9f ZeroConfig could crash due to UTF8 hostname 2017-08-30 23:21:54 +02:00
Safihre
d28f775c71 Remove information about SSL/TSL Protocols because it is inccorect
There is no way to get the actually enabled SSL/TLS protcols on a system, let along from Python. It's not even possible from the `openssl` command line.
See also #994
And: https://stackoverflow.com/questions/45924030/get-available-ssl-tls-protocols-in-python-2-7
2017-08-30 23:15:19 +02:00
Safihre
a834c1c7a7 Add Refresh button to Glitter when Refresh Rate > 2
Linked #842
2017-08-30 15:28:17 +02:00
Safihre
04e595e706 Update text files for 2.3.0Alpha1 (2) 2017-08-29 23:53:36 +02:00
Safihre
46c28dbf68 Do not show dropdown for URL-grabs that are paused
Setting changes are not propegated to the actual downloading, could be optimized.
2017-08-29 23:50:54 +02:00
Safihre
8594bfe817 Timing of try-list check could cause stalling
My god I hate this stalling problem, it haunts me in my dreams.
2017-08-29 23:42:27 +02:00
SABnzbd Automation
e61a01512b Automatic translation update 2017-08-29 16:04:48 +00:00
Safihre
657e3bb594 Update text files for 2.3.0Alpha1 2017-08-29 16:42:34 +02:00
Safihre
bbbdca6a00 Update INSTALL.txt 2017-08-29 16:01:59 +02:00
Safihre
a95c705e4c Auto-disconnect if the last item was deleted from the Queue 2017-08-29 10:02:25 +02:00
Safihre
446c5ba80f Block for more reasons so that try-lists get reset 2017-08-29 09:06:38 +02:00
Safihre
7641c0e1cc Correct Retry function after par2-changes 2017-08-27 23:56:24 +02:00
Safihre
42fdd9c890 Flexible block-search
Also add blocks from setnames that are a lot a like. Especially in those cases with multi-sets where the sets have the same filenames.
2017-08-27 22:48:30 +02:00
Safihre
dca63878db Force priority should be listed as 'Downloading' even if Queue paused
Closes #1012
2017-08-27 22:37:13 +02:00
Safihre
dc67fc414c Do not rely on par2/Multipar parsing to detect par2 files of the parset
We know much bettter now we do full parsing of each par2 file that comes in.
2017-08-27 20:09:40 +02:00
Safihre
90be3cc5a0 Only remove par2's that really belong to the set 2017-08-27 18:49:03 +02:00
Safihre
42cdba5ce3 Improve Prospective Par2 to handle multisets better
Now we get too many blocks, but before the second set wouldn't get enough blocks
2017-08-27 18:32:13 +02:00
Safihre
9c069cfb2c Let par2/MultiPar only remove used par2-files
In case of duplicae filenames we don't want "base.1.par2" to be removed when checking "base.par2".
2017-08-27 17:41:44 +02:00
Safihre
544b420baa Correct get_files API-call to only show really queued files 2017-08-27 16:18:48 +02:00
Safihre
094c96f270 Improve obfuscated and broken par2 handeling
Linked #998.
- In case of full obfuscation we detect the files directly after assembling and rename it such that par2 will pick it up
- Turns out we do need 'partable' to keep track what is the main par2 file
- Handle missing of first par2 file, automatically fetch next one
2017-08-27 14:49:01 +02:00
Safihre
aa7bad56f0 Fix get_unique_filename function 2017-08-27 14:42:08 +02:00
Safihre
977f4e1036 Rework par2-handeling
See #998
- Seperate par2 functions in new file
- Always check for par2-signature if file is not a rar-file
- Always parse par2 contents for signatures (hash -> filename)
- Use the signatures to keep track of par2-packs, not basenames
- Remove seperate 'extrapars' for NZF's, all in the NZO
- Remove 'partable' for NZO, it's all in it's 'extrapars'
2017-08-27 12:23:17 +02:00
Safihre
e05a98d22b Do not show 'Apply filters' from the start
Nothing more we can do to speed up the RSS evaluation.
Closes #679
2017-08-26 18:57:47 +02:00
Safihre
452e955a1e Disable extra features of feedparser
NZB-feeds do not contain the properties that feedparser has fancy parsing for.
The reduces the time spent in feedparser by 40%. 
Linked #679
2017-08-25 22:59:40 +02:00
Safihre
29ec4d9a23 Set 2.2.1 version and update translations 2017-08-25 22:11:47 +02:00
Safihre
22517a7cd7 Merge branch '2.2.x' 2017-08-25 22:07:15 +02:00
Safihre
a724f6a979 Revert "Remove locks from ArticleCache"
This reverts commit 5e7558ce4a.
2017-08-25 21:59:11 +02:00
Safihre
715b25b52f More logging when adding NZB's 2017-08-25 21:59:07 +02:00
Safihre
bcc4dd75cf Update text files for 2.2.1 2017-08-25 21:58:48 +02:00
Safihre
97711ca82e Revert "Remove locks from ArticleCache"
This reverts commit 5e7558ce4a.
2017-08-25 21:57:16 +02:00
Safihre
e782237f27 More logging when adding NZB's 2017-08-25 21:49:24 +02:00
SABnzbd Automation
4d3f370b3a Automatic translation update 2017-08-25 16:04:37 +00:00
Safihre
07f6717728 Duplicate files in NZB could result in broken unpack after repair
Because par2 would detect them, but not use them. So ".1" files would later be used for unpack, even though it's not a real set.
2017-08-25 16:59:01 +02:00
Safihre
35b4aa6b7a Ignore unpack errors in duplicate rarsets
Multipar and par2tbb will detect and log them so we can remove them, but par2cmdline will not.
2017-08-25 16:58:56 +02:00
Safihre
52bb156c08 Ignore unpack errors in duplicate rarsets
Multipar and par2tbb will detect and log them so we can remove them, but par2cmdline will not.
2017-08-25 16:58:38 +02:00
Safihre
4361d82ddd Duplicate files in NZB could result in broken unpack after repair
Because par2 would detect them, but not use them. So ".1" files would later be used for unpack, even though it's not a real set.
2017-08-25 16:57:47 +02:00
Safihre
a7a04d912c Use fileobj to prevent having to chdir, which can crash on macOS
If something is "wrong" with the current directory, for example when SABnzbd is started after downloading in a sandbox by macOS security, this function can error and break the adding of NZB's.
Have to use a fileobj, otherwise GZip will put the whole path inside there.
2017-08-25 10:51:52 +02:00
Safihre
ce558b0850 Original files would be deleted after a MultiPar rename 2017-08-25 10:51:25 +02:00
Safihre
8ab7c294ee Do not fail a job if recursive unpack fails
The user can handle it, we did our part.
2017-08-25 09:19:29 +02:00
Safihre
306228462e Use existing texts for wizard ad translations
Yeah, my fault. I deleted them in a clean-up of the skintext during 1.0.0 development. Very stupid.
2017-08-25 09:19:15 +02:00
Safihre
017cf8f285 Do not fail a job if recursive unpack fails
The user can handle it, we did our part.
2017-08-25 09:15:14 +02:00
Safihre
03cdf6ed5d Sync translatable texts from develop
To avoid conflicts on Launchpad
2017-08-24 23:40:37 +02:00
Safihre
cf347a8e90 Original files would be deleted after a MultiPar rename 2017-08-24 23:36:36 +02:00
SABnzbd Automation
9e7a8468e2 Automatic translation update 2017-08-24 15:24:59 +00:00
Safihre
f06afe43e1 Use fileobj to prevent having to chdir, which can crash on macOS
If something is "wrong" with the current directory, for example when SABnzbd is started after downloading in a sandbox by macOS security, this function can error and break the adding of NZB's.
Have to use a fileobj, otherwise GZip will put the whole path inside there.
2017-08-24 16:36:13 +02:00
SABnzbd Automation
4c2445485a Automatic translation update 2017-08-23 23:13:38 +00:00
Safihre
103c46e2b4 Translation fix for unpack warning 2017-08-23 22:54:40 +02:00
Safihre
b4922d69a2 Pause between unpacks on Windows, otherwise subprocess_fix overloads
Strange but true, but on jobs with many small files to unpack, it would just fail.
2017-08-23 22:50:40 +02:00
Safihre
110a06a3cd Handle '482 Download limt exceeded'
Closes #1009
2017-08-23 22:50:27 +02:00
Safihre
fb301eb5c8 Update text files for 2.2.1RC2 2017-08-23 22:49:59 +02:00
Safihre
6f0f67110f Only auto-disconnect after first run of verification 2017-08-23 22:48:53 +02:00
Safihre
1562c3560b Handle '482 Download limt exceeded'
Closes #1009
2017-08-23 22:48:15 +02:00
Safihre
848721da84 Clean last functions from the real anti-stalling fix 2017-08-23 22:10:06 +02:00
Safihre
9813bc237f Only auto-disconnect after first run of verification 2017-08-23 21:42:56 +02:00
Safihre
b39fe059c6 Pause between unpacks on Windows, otherwise subprocess_fix overloads
Strange but true, but on jobs with many small files to unpack, it would just fail.
2017-08-23 21:42:17 +02:00
Safihre
a56c770a8b The real anti-stalling fix
Woohoo!
For each NZF (file) make sure all articles have tried a server before marking it as tried. Before if articles were still in transit they could be marked as tried on NZF level before the server could get to them,
2017-08-23 16:02:01 +02:00
Safihre
127d7ab40c The real anti-stalling fix
Woohoo!
For each NZF (file) make sure all articles have tried a server before marking it as tried. Before if articles were still in transit they could be marked as tried on NZF level before the server could get to them,
2017-08-23 15:43:54 +02:00
Safihre
4fb7246082 TryList reset at NZO level also nessecary
Timing issue between when a new server is selected and when a job is added to the NZO-level try-list. Locks were tried, but failed.
2017-08-23 09:11:34 +02:00
Safihre
8c42237d51 Correct handeling of TryList when server has timeout 2017-08-23 09:11:29 +02:00
Safihre
6a87f0c4e4 Correctly remove + from INFO label in all languages 2017-08-23 09:11:24 +02:00
Safihre
e3bf0edad8 TryList reset at NZO level also nessecary
Timing issue between when a new server is selected and when a job is added to the NZO-level try-list. Locks were tried, but failed.
2017-08-23 09:11:01 +02:00
Safihre
e35d9e4db3 Correct handeling of TryList when server has timeout 2017-08-23 08:32:47 +02:00
Safihre
c617d4321a Correctly remove + from INFO label in all languages 2017-08-22 16:13:24 +02:00
Safihre
0fd3a2881f Correct redirect after ports change 2017-08-22 10:19:42 +02:00
Safihre
f8630a878c Correct redirect after ports change 2017-08-22 10:11:41 +02:00
Safihre
7f6ef5e204 Only iterate over RSS feeds when there are feeds 2017-08-22 09:52:25 +02:00
Safihre
0c1f7633de Only discard really non-unique hashes from md5of16k 2017-08-22 09:43:33 +02:00
Safihre
b7d5d49c84 Show hover-title that the compress icon is Direct Unpack 2017-08-22 09:43:26 +02:00
Safihre
9911b93ece Add error when NZO creation fails 2017-08-22 09:43:11 +02:00
Safihre
eeaad00968 Also hide email-accounts in logging 2017-08-22 09:43:06 +02:00
Safihre
e1bb8459e3 Take the risk of allowing up to 5 bad articles in jobs without Par2 2017-08-22 09:42:47 +02:00
Safihre
65c3ac0cc0 Warn in case the password file has too many passwords 2017-08-22 09:42:16 +02:00
Safihre
413c02a80f Do not run get_new_id forever in case of problems
#984
2017-08-22 09:41:40 +02:00
Safihre
547d4dbf0a Only discard really non-unique hashes from md5of16k 2017-08-22 09:25:34 +02:00
Safihre
65e70a431c Show hover-title that the compress icon is Direct Unpack 2017-08-22 09:13:40 +02:00
Safihre
f85f4de5ff Error when applying changes to RSS-feeds
Closes #1005
2017-08-21 20:25:34 +02:00
Safihre
97644dea16 Show more clear error message when UnRar of Par2 is missing 2017-08-21 16:27:04 +02:00
SABnzbd Automation
0a6105ebc1 Automatic translation update 2017-08-21 07:18:33 +00:00
Safihre
de3d4f8d14 UnRar is required to read some RAR files 2017-08-21 08:26:12 +02:00
Safihre
80f118f304 UnRar is required to read some RAR files 2017-08-21 08:23:10 +02:00
Safihre
f337053aea Add error when NZO creation fails 2017-08-20 20:45:55 +02:00
Safihre
2a4b49a679 Warning "Invalid par2 files" can also be due to bad Par2-parameters 2017-08-20 16:41:18 +02:00
Safihre
ebe526f8cf Also hide email-accounts in logging 2017-08-20 10:33:24 +02:00
Safihre
926cd7b132 Take the risk of allowing up to 5 bad articles in jobs without Par2 2017-08-20 01:35:06 +02:00
Safihre
99667aa410 Remove obsolete code from RSS 2017-08-20 01:20:56 +02:00
Safihre
67cab3465e Remove extra checks from RSS file-store loading 2017-08-20 00:31:22 +02:00
Safihre
ce68a0654b Scheduler Priority/Category Pause/Resume also affects URL-grabbing
Linked #988
2017-08-19 23:59:14 +02:00
Safihre
dffdc3ae1f Extend Scheduler to Pause/Resume based on category
Closes #549
2017-08-19 23:56:51 +02:00
Safihre
28e5311c6c Change logging line of SSL-protocols
Linked #994
2017-08-19 22:52:33 +02:00
Safihre
ebf0526420 Do not show NZB-age when it is nonsense
For example with a grabbing NZB.
2017-08-19 21:49:03 +02:00
Safihre
a2f73ca1f0 Add feed name to URL-grabbing title
Closes #988
2017-08-19 21:40:43 +02:00
Safihre
8ca150c48d Allow pausing of URL-grabbing
Linked #988
2017-08-19 21:20:28 +02:00
Safihre
d765fa09f1 Change certificate-file location for distributions 2017-08-19 20:33:46 +02:00
Safihre
878d68d343 Warn in case the password file has too many passwords 2017-08-19 16:06:06 +02:00
Safihre
fc7bd78dfa Translation changes 2017-08-19 13:28:21 +02:00
SABnzbd Automation
aca6ed360c Automatic translation update 2017-08-19 09:17:50 +00:00
Safihre
5c0a10e16b Update text files for 2.2.1RC1 2017-08-19 11:06:40 +02:00
Safihre
d9b32261e7 Reset all NZO TryList when doing Prospective Add
I thought in c14b3ed82a that this was enough, but clearly it is not.
2017-08-19 11:03:22 +02:00
Safihre
8d8ce52193 Stall prevention by checking TryList 2017-08-19 11:03:15 +02:00
Safihre
53672d1d73 Reset all NZO TryList when doing Prospective Add
I thought in c14b3ed82a that this was enough, but clearly it is not.
2017-08-18 19:36:20 +02:00
SABnzbd Automation
07d316ed4f Automatic translation update 2017-08-18 15:44:05 +00:00
Safihre
8aa57bf406 Update Config jQuery to 3.2.1 and Peity to 3.2.1 2017-08-17 11:00:47 +02:00
Safihre
d369097573 Update KnockoutJS to 3.4.2 2017-08-17 11:00:47 +02:00
Safihre
f4960715fa Do not run get_new_id forever in case of problems
#984
2017-08-17 11:00:47 +02:00
Safihre
83ba676c43 Correct loading of extra certificate files
Also include logging of number of found certificates
2017-08-17 11:00:47 +02:00
Safihre
12cca9dea1 Provide certificates with macOS and Windows build
We have to bring our own certficates on Homebrew Python 
The certifi package brings the latest certificates on build 
This will cause the create_default_context to load it automatically
We also use this on Windows so users are always up-to-date
2017-08-17 11:00:47 +02:00
Safihre
5f52535c44 Faster look-ups when restoring queue 2017-08-17 11:00:47 +02:00
Safihre
2f95410ab4 Allow for older queue-files 2017-08-17 11:00:47 +02:00
Safihre
5749c0c008 Keep TryList state
Part 1 of #973
2017-08-17 11:00:47 +02:00
Safihre
73c71ef4bf Allow filenames with also 1-char file extension 2017-08-17 11:00:47 +02:00
Safihre
6bc1c51013 Remove server specific categories
Finally. This feature has only caused problems.
2017-08-17 11:00:47 +02:00
Safihre
bcdd3302a6 Stall prevention by checking TryList 2017-08-17 11:00:47 +02:00
Jonathon Saine
0fc3b60054 Add propercheck to allow PROPER/REAL/REPACK releases to bypass the series episode dupe check. 2017-08-17 10:54:57 +02:00
Safihre
e9b0d4d691 On to 2.3.0 we go 2017-08-17 10:53:32 +02:00
Safihre
1cc2e25cda Update to 2.2.0 2017-08-17 10:47:04 +02:00
SABnzbd Automation
0dc2c6687d Automatic translation update 2017-08-17 08:43:38 +00:00
Safihre
b061e582b6 Update text files for 2.2.0 2017-08-16 22:56:10 +02:00
Safihre
690731fd79 Update wizard Ad URL 2017-08-16 13:34:01 +02:00
Safihre
068b7ed7f5 Disk-speed test for Direct Unpack would cause restart 2017-08-15 21:53:24 +02:00
Safihre
aae2fdcd32 Update Unrar to 5.5.0 for Windows and macOS
Right on time.
Closes #935
2017-08-14 20:37:11 +02:00
Safihre
d3628a1eb7 CherryPy 8.1.2 - Catch the [Errno 0] Error
Untill a fix is found.
2017-08-13 16:58:20 +02:00
Safihre
9cc8176d87 Server-tests were broken due to deprecation warning
Linked #996
2017-08-12 14:52:34 +02:00
Safihre
27f83f21be Update text files for 2.2.0RC3 2017-08-12 11:39:28 +02:00
Safihre
5e31a31a21 Make Server charts timezone-proof
Closes #997
2017-08-12 21:23:18 +12:00
Safihre
a077012478 Windows fix for subprocess would break when options were not specified 2017-08-12 09:42:47 +02:00
Safihre
fed0e0f765 Use win32api for power-options on Windows 2017-08-12 09:39:25 +02:00
Safihre
fbdbf7ab22 Improve par2 handeling by always parsing md5of16k and checking new sets
- We postpone only par2-files with actual blocks, in case of duplicate named par2 files that are of different sets we want all base-par2 files.
- The md5of16k is now calculated for every par2 file we get so we can rename everything.
- We also check during assembly if maybe a md5of16k is now available, in case the par2 file came in later.
- If a par2 file comes in, we double check if maybe this pack was not known yet. The setname might not be unique. This way we make sure that everything gets verified at the end.

Still need obfuscation improvements, but that's for later.
Linked #998
2017-08-12 00:33:32 +02:00
SABnzbd Automation
f013d38d00 Automatic translation update 2017-08-10 11:45:54 +00:00
Safihre
93b9c8a6da Correctly escape the values in EN.po 2017-08-10 13:33:11 +02:00
SABnzbd Automation
e3a779bbc6 Automatic translation update 2017-08-09 21:44:13 +00:00
Safihre
adfce8c8b6 Update text files for 2.2.0RC2 2017-08-09 23:03:44 +02:00
Safihre
a49d68c0db Double check that we have pynotify version we can work with
Closes #992
2017-08-09 22:56:07 +02:00
Safihre
e4156e76d1 Disable auto-zoom on mobile for adaptive pages 2017-08-09 22:50:53 +02:00
Safihre
35b66eea0e Add more space to Config header just in case 2017-08-09 18:45:01 +03:00
Safihre
4d0cf8d45f Correct naming and small style fix 2017-08-09 18:36:20 +03:00
Safihre
ad9fef5f41 Prevent SQL injection via category-argument with ' in them 2017-08-09 17:43:17 +03:00
Safihre
6235174995 CherryPy 8.1.2 - Correct f6c163b: macOS "Protocol wrong type for socket"
https://github.com/cherrypy/cheroot/pull/31
https://github.com/cherrypy/cheroot/pull/44
2017-08-09 09:55:04 +03:00
Safihre
4b9ca989c4 Correctly log the rar-files used by DirectUnpack
Not just assume we used them all.
2017-08-08 13:39:03 +03:00
Safihre
4d54aecceb Check the workdir after extraction if we got everything
Sometimes there might be a file left that we did not extract. For example there are NZBs that have the main download in abc.part01.rar etc but also a abc.rar file with the NFO or other things. 
SABnzbd would detect this as 1 set and not unpack both.
2017-08-08 13:37:09 +03:00
Safihre
11eeb6f2e9 Glitter filelist would not show 100% for very small files
Plus some cleanup of move-to-top/bottom code
2017-08-08 12:19:07 +03:00
Safihre
00364b1317 Only update RSS URI if it was modified
See #993
2017-08-08 12:04:54 +03:00
shypike
6666663f78 Fix typo in text about "allow duplicate files" 2017-08-08 09:17:25 +02:00
Safihre
3d6dfec47a Disk-space check in Assembler and check if space to write current file 2017-08-06 19:01:59 +03:00
Safihre
0f3d44aa4b safe_fnmatch should only do the matching
Oops, globber and globber_full are not the same!
2017-08-06 12:57:23 +03:00
SABnzbd Automation
d2d2471950 Automatic translation update 2017-08-06 09:42:54 +00:00
Safihre
b71343e8ab Safe fnmatch everywhere, just to be sure
Linked #990
2017-08-06 11:46:00 +03:00
Safihre
489f3f4ba0 Catch special chars like "[]!*" to break fnmatch and thus repair
Closes #990
2017-08-06 11:25:27 +03:00
Safihre
3765e8c350 Add warning when many duplicate files were discarded
Linked #531, Closes #986
2017-08-02 12:50:26 +02:00
Safihre
28d4f527b8 Fix the server-graphs
They did not display anything if it was the first of the month. Plus some style-fixes.
2017-08-01 13:31:18 +02:00
Safihre
1d8af8f97d Correct counts if one_folder is enabled 2017-08-01 11:28:34 +02:00
Safihre
829ef4bee8 Only one_folder is a reason not to delete the folder in DircetUnpack 2017-08-01 11:06:40 +02:00
Safihre
7e40c12e47 Get rarfiles to delete from both RarFile and parsing Unrar output
RarFile will fail to list all volumes when the job is encrypted, it will only list the first volume. But parsing the output of Unrar will fail on special-char filenames (probably limited to Windows). So now only jobs that are encrypted *and* have many special-chars will not have all rars deleted correctly,
2017-07-31 23:45:56 +02:00
Safihre
37d8d659f5 Show deprication warning for Server Categories 2017-07-31 22:26:21 +02:00
Safihre
0a29291be2 Abort all direct unpackers when disk-full 2017-07-31 22:26:04 +02:00
Safihre
7f3a5f309b Don't postpone if all par2 are desired and should be kept
Prevents downloading of all par2 in case people just wanted to keep some par2, but not all. If people really want all and no-cleanup, they should enable 'All par2'
2017-07-31 16:51:48 +02:00
Safihre
60ec5f9191 Less aggresive cache-busting 2017-07-31 10:38:45 +02:00
Safihre
d03e801e74 Only show import warnings when not gone
Can be removed if #952 is resolved
2017-07-30 20:29:28 +02:00
Safihre
56bf484e77 Also show Verifying Repair status for par2cmdline 2017-07-30 16:51:28 +02:00
Safihre
66674469d5 Return of the DIR_LOCK
Yeah, turns out we probably do need that. In case automation adds a new job while the old one is still getting deleted. Hopefully solving #952
2017-07-30 15:57:34 +02:00
Safihre
09a86683e5 Retry icon was too red in Glitter Night 2017-07-30 15:56:49 +02:00
Safihre
fc9a13879e CSS Tweaks to Night theme 2017-07-30 11:32:35 +02:00
Safihre
73f0885566 Schedule to deprecate Categories setting for Servers in next release
This option only gives headaches because users do not use it correctly or edge cases where downloads stall. 
If users report that they really want to keep this option, we can of course consider it.
2017-07-29 13:29:10 +02:00
Safihre
090b22f193 Revert "CherryPy 8.1.2 - Catch error of Python 2 in combination with new OpenSSL"
Not catching the right error because it's of the general Error class, not SSLError.
2017-07-28 18:46:46 +02:00
Safihre
f9c092ae8f Move Notification Script up on the Config page and add Wiki-link
So they can see other services
2017-07-28 09:52:25 +02:00
Safihre
4246bc2aea Move enable_meta to more logical spot 2017-07-27 16:00:40 +02:00
Safihre
c4fa047393 Automatic redirect to login page in Glitter 2017-07-27 14:56:34 +02:00
SABnzbd Automation
22e4d24a71 Automatic translation update 2017-07-27 12:29:06 +00:00
Safihre
96fccff63b Update text files for 2.2.0RC1 2017-07-27 13:50:41 +02:00
Safihre
6b46a15b49 Include indexer-hostname in the API-key missing warning 2017-07-27 11:50:12 +02:00
Safihre
98cc0dad55 API-key was always required for Indexer-feedback
Remove oznzb specific links for realy now.
Indexers should provide their rating-url in the headers/meta-data. Keeping the Specials setting for backwards compatibility for current OZnzb users.
2017-07-27 11:48:00 +02:00
Safihre
6fdeab6948 Permanent notice in Plush to upgrade to Glitter 2017-07-27 10:35:26 +02:00
Safihre
553dd04cea Restore 'Use tags from indexer' switch
https://forums.sabnzbd.org/viewtopic.php?f=11&t=22864
2017-07-27 09:52:59 +02:00
Safihre
0baa316a72 Revert "Remove enable_meta"
This reverts commit ff3c46fe1f.
2017-07-27 08:35:06 +02:00
Safihre
3ac209f9a9 CherryPy 8.1.2 - Catch error of Python 2 in combination with new OpenSSL
Closes #853
2017-07-26 16:34:45 +02:00
Safihre
ec55f64a8a Correctly remove files when flat_unpack or no-job-folders set
Results could be pretty bad otherwise: https://forums.sabnzbd.org/viewtopic.php?f=11&p=112774
2017-07-26 09:30:39 +02:00
Safihre
932e1e577b Do not double check 'part' in RAR filename
Already caught by the regex, otherwise filenames that have "part" somwhere in the name will not be used for direct-unpack.
2017-07-26 08:59:26 +02:00
Hellowlol
56d5b1d9f8 Make bonjour easier to setup. 2017-07-25 15:52:30 +02:00
Hellowlol
28bdebb147 Let zeroconf know if we are using https. 2017-07-25 15:52:30 +02:00
Safihre
827fc7b64e Direct Unpack would block forever if file was missing 2017-07-25 11:58:29 +02:00
Safihre
f5dde93644 Change History Retention label to fit
Closes #978
2017-07-24 19:21:43 +02:00
Safihre
60c574828e Sort Servers in Download Report
Closes #979
2017-07-24 19:14:31 +02:00
Safihre
14ca8342f9 Update wiki URL to 2.2 2017-07-24 13:36:16 +02:00
Travis
5d5b1bf053 Automatic translation update 2017-07-24 08:16:18 +00:00
Safihre
ea4cdba3eb Update text files for 2.2.0Beta2 2017-07-24 10:08:21 +02:00
Safihre
d6ecebc75a Use existing texts for Tag duplicate 2017-07-24 10:07:15 +02:00
Jonathon Saine
b0af6a1761 User requested a way to track dupes but not have sab block/discard/pause the items (as he doesnt want to have to manually unpause). Figured we could add a 'Tag' switch for the Dupe detection. Works same way as Pause (shows duplicate tag in queue/adds warning/internally tags it) but does not pause the item.
Once the file is done downloading and makes it to the queue, you have no idea it was a duplicate.
You would have to use the 'Warning' and search for that.. and then assume the newer one was the dupe... we really should expose in the History that an item was a duplicate. Right now the 'search' box only looks at the name.. and I dont think we should be messing with the name to add duplicate there. I'd rather us just add a tag/flag whatever to notate this.. and can filter/sort on it. We also should do the same to the Queue as well.. since changing the name of the item to be `DUPLICATE / XXXXX` is a little jarring.

Now if we just exposed the dupe flag in the history, then the whole 'tag' option really isnt needed as it was just a means to an end.
2017-07-24 10:00:15 +02:00
Safihre
6e350f30fc Add midnight auto history-purge and modify texts 2017-07-24 09:47:05 +02:00
Safihre
169137c631 Implement History Retention setting
Closes #678
2017-07-24 09:47:05 +02:00
Safihre
6393dc0dca Remove history_limit from Specials 2017-07-24 09:47:05 +02:00
Safihre
1a27b4824b Style improvements to Queue and Server Graphs
Closes #977
2017-07-24 09:36:48 +02:00
Safihre
2b59a383cf Change label in History-status to 'Direct Unpack' 2017-07-24 09:05:02 +02:00
Safihre
efbaaade22 Correct server graph timezone effects and only show months that we have 2017-07-23 23:14:10 +02:00
Safihre
cf7e7b1f62 Only show usage data for days that have passed 2017-07-23 23:14:10 +02:00
Safihre
2c1746a92d Show Montly usage graphs per server in Config 2017-07-23 23:14:10 +02:00
Travis
a2e57fd3d8 Automatic translation update 2017-07-22 17:27:02 +00:00
Safihre
932f8d9176 Wizard access was not limited by login and external access rules
Bad bad 
Closes #972
2017-07-22 18:54:33 +02:00
Safihre
5ffd82da89 Show vote up/down instead of Video/Audio score 2017-07-22 00:19:40 +02:00
Safihre
8b3de191d9 Add Retry All Failed button to Glitter 2017-07-22 00:11:13 +02:00
Travis
83d8a23e2c Automatic translation update 2017-07-20 22:13:49 +00:00
Safihre
58b107a4b5 Allow up to 5 missing/CRC'ed errors before cancelling Direct Unpack
Sometimes a CRC error is not so bad it turns out
2017-07-20 23:55:36 +02:00
Safihre
a40609b39d Direct Unpack was started before whole file was written to disk
In case part 2 came in before part 1.
2017-07-20 23:55:36 +02:00
Sander Jo
0faa5d3dff Print applied permissions in octal 2017-07-20 21:04:00 +02:00
Travis
374239777e Automatic translation update 2017-07-19 07:55:50 +00:00
Safihre
9a7701d7e6 Update text files for 2.2.0Beta1 2017-07-19 09:33:00 +02:00
Safihre
01ff04f338 Allow Aborting of Direct Unpack during PP and add Completed label 2017-07-19 09:27:24 +02:00
Safihre
eac39767dd Renames on Retry only when defined
Otherwise if it's None, later this will happen:
original_filename = self.renames.get(nzf.filename, '')
AttributeError: 'NoneType' object has no attribute 'get'
2017-07-19 09:23:58 +02:00
Safihre
0d0adf99fa Proper counting of bad articles for DirectUnpack & Prospective Par2 2017-07-18 22:07:56 +02:00
Safihre
16905ce34f Show filename for Unzip instead of Path and show start of Verification 2017-07-18 21:16:05 +02:00
Safihre
5287fa8a0c Stability improvements for Direct Unpack
Now shows the time spent in unpacking and many other bugs squased.
2017-07-18 21:15:30 +02:00
Safihre
b72ab4fb8e Allow concurrent unpacking 2017-07-18 15:14:28 +02:00
Safihre
81054c675c Mimimum speed for Direct Unpack lowered to 40MB/s
It is tested during downloading, so if 40MB/s is still possible then we should be good to go.
2017-07-18 13:51:13 +02:00
Safihre
7362be8748 Group cfg settings by Config section
It was a big mess. 
Now they still could be sorted within each section.. next time.
2017-07-17 20:42:54 +02:00
Travis
b4ba2b3463 Automatic translation update 2017-07-17 18:33:42 +00:00
Safihre
8bed6938c1 Change text in DirectUnpack Enabled message
See also #966
2017-07-17 20:11:50 +02:00
Safihre
ecf16f6201 Show DirectUnpack progress the same as Unpack progress: xx/xx 2017-07-17 17:07:44 +02:00
Safihre
bf240357df Regressions in preparation of extraction path
Thanks @Cpuroast
2017-07-17 16:45:58 +02:00
Safihre
ddcf447957 Add missing save_config after modifying settings
Closes #966
2017-07-17 10:10:20 +02:00
Safihre
d9642611e2 Correct error in missing notify options
#966
2017-07-16 20:28:15 +02:00
Safihre
0018c6f263 Move regex to top and increase save-timeout 2017-07-16 19:26:35 +02:00
Safihre
6398bfa12f Use speed from download-log instead of re-calculating
Closes #829
2017-07-16 19:22:52 +02:00
Safihre
01dfb7538d Correct FileList Move to Top/Bottom CSS for Firefox 2017-07-16 14:28:04 +02:00
Safihre
3f0d4675b6 Fix CSS for Direct Unpack and Move to Top/Bottom 2017-07-16 14:18:50 +02:00
Safihre
f23c5caf80 Fix typo in DirectRenamer for non-Windows 2017-07-16 13:55:36 +02:00
Safihre
bd22430b26 Update text files for 2.2.0Alpha3 2017-07-16 11:04:17 +02:00
Safihre
1189a7fdbc Use tuple in endswith for Direct Unpack
Thanks @hellowlol
2017-07-16 10:59:00 +02:00
Safihre
f3aa4f84fc Remove waiting-time between URLGrab's
Other newsreaders grab multiple URL's at once, so no need for us to wait.
2017-07-16 10:40:39 +02:00
Safihre
ea26ce4700 Remove non-seperator RSS-url commas by detecting if they are valid URLs
Closes #965
2017-07-16 10:30:09 +02:00
Safihre
a1e649b7e2 Correct error in PAR_Verify with renames 2017-07-15 23:43:32 +02:00
Safihre
3b9f2b2cf0 Remove par2classic/cmdline for Windows and macOS 2017-07-15 23:33:20 +02:00
Safihre
7333d19e1c Notifications selection based on Categories
Closes #716
2017-07-15 22:22:20 +02:00
Safihre
232d537d23 Correct Direct Unpack locking behavior for multisets 2017-07-15 17:02:20 +02:00
Safihre
c6e17e7bcb Duplicate par2-16k values need force-remove 2017-07-15 17:02:20 +02:00
Safihre
54c6fd55dd Detection of forbidden-Windows names altered
Now we already sanatize the name during Assembler and when we have to make decisions for Unrar/Par2 we need to know if they might create something unsafe.
2017-07-15 17:02:20 +02:00
Safihre
0625aa1ca8 Make sure all Par2-16k signatures are unique, also in multisets 2017-07-15 17:02:20 +02:00
Safihre
83643f3298 Remove allow_streaming
Bit redundant now we have DirectUnpack
2017-07-15 17:02:20 +02:00
Safihre
ff3c46fe1f Remove enable_meta 2017-07-15 17:02:20 +02:00
Safihre
0930f0dcee Test disk-speed first time DirectUnpack is called 2017-07-15 17:02:20 +02:00
Safihre
3221257310 UnRar's ERROR is also an error
And add starting file to log.
2017-07-15 17:02:20 +02:00
Safihre
8048a73156 Handle active DirectUnpacker in postproc better 2017-07-15 17:02:20 +02:00
Safihre
ea552cd402 Cancel DirectUnpack when the final name changes 2017-07-15 17:02:20 +02:00
Safihre
dcb925f621 Case insensitive matching for DirectUnpack sets 2017-07-15 17:02:20 +02:00
Safihre
cce91e1985 DirectUnpacker should stay to listen to new sets 2017-07-15 17:02:20 +02:00
Safihre
e17d417c2e Re-introduce locks for TryList
After studying everything, it really needs it. Closes #738
2017-07-15 17:02:20 +02:00
Safihre
a69f5bd2df Prevent DirectUnpack locking the PostProcessing 2017-07-15 17:02:20 +02:00
Safihre
97e53eb4d3 Better DirectUnpack percentage counter 2017-07-15 17:02:20 +02:00
Safihre
a6da2b7bee Prevent possible crash in par2_repair 2017-07-15 17:02:20 +02:00
Safihre
4a21e7c217 Show percentage of DirectUnpack, when available 2017-07-15 17:02:20 +02:00
Safihre
9bd3c7be44 Increase maximum number of unpackers
Unrar takes almost no memory anyway
2017-07-15 17:02:20 +02:00
Safihre
434f5c4b2d Remove Audio/Video quality rating icons from Queue 2017-07-15 17:02:20 +02:00
Safihre
d3cc4f9f07 Direct Unpack indicator for Queue 2017-07-15 17:02:20 +02:00
Safihre
a16aa17c17 Don't start when not set to +Unpack and abort if Category changed 2017-07-15 17:02:20 +02:00
Safihre
68445d0409 Full working implementation of DirectUnpack with multi-sets 2017-07-15 17:02:20 +02:00
Safihre
32b68a45cc Integrate with PostProc 2017-07-15 17:02:20 +02:00
Safihre
345f8359cc Unpack to the right directory (with Sorter support) 2017-07-15 17:02:20 +02:00
Safihre
81f9886584 Add Direct Unpack to Config 2017-07-15 17:02:20 +02:00
Safihre
adbc618808 Improvements to detection of volumes 2017-07-15 17:02:20 +02:00
Safihre
41eafc6b4b Become set-specific 2017-07-15 17:02:20 +02:00
Safihre
9f18d8e8c1 Basic working Direct Unpack
Lots to do
2017-07-15 17:02:20 +02:00
Safihre
8c2c853166 Make sure to always have lowest part number 2017-07-15 17:02:20 +02:00
Safihre
97914906a0 Also handle GNTP errors during sending 2017-07-14 14:43:39 +02:00
Safihre
f1ce4ed19b Correctly handle new GNTP errors 2017-07-14 14:41:03 +02:00
Safihre
99185d8151 Update GNTP to 1.0.3
Closes #334
2017-07-14 14:25:07 +02:00
Safihre
385b6b7ade Remove QCHECK_FILE again 2017-07-14 14:25:07 +02:00
gwyden
81ea513f8c Added buttons and logic to move to top and bottom of download queue (#962)
* added buttons and logic to move to top and bottom of queue
* allowed for a larger control box for the new buttons
* Cleanup of unnecessary code
* Simple top and bottom of queue using existing queue data
2017-07-13 23:52:43 +02:00
Safihre
336b1ddba3 Always remove forbidden Win-devices from filenames
This breaks support for par2cmdline on Windows with forbidden names. Assuming no users that have disabled both Multipar *and* par2_multicore
2017-07-12 18:38:19 +02:00
Safihre
7274973322 Shorten par_cleanup code 2017-07-12 18:38:19 +02:00
Safihre
af132965de Revert "Remove QCHECK_FILE, not needed"
This reverts commit 4f8cc3f697.
2017-07-12 18:38:19 +02:00
Safihre
5586742886 Use RarFile.volumelist to get list of used rar-volumes 2017-07-12 18:38:19 +02:00
Safihre
5868b51490 Use fix to allow unicode arguments to POpen on Windows 2017-07-12 18:38:19 +02:00
Travis
7f17a38b9b Automatic translation update 2017-07-12 15:10:14 +00:00
Safihre
415e843ebb Remove 'WARNING:' label from Assembler warnings
It was inconsistent with other messages
2017-07-11 13:33:50 +02:00
Safihre
7ffc1192bb Only par2-rename when actually different 2017-07-11 12:00:36 +02:00
Safihre
945e769a03 Also performe prospective-par2 on renamed files 2017-07-10 23:06:05 +02:00
Safihre
86c7fb86cc Ignore first-16k par2 info if it's not unique 2017-07-10 22:51:17 +02:00
Safihre
ff20f3f620 Fix possible unicode error in tvsort and typo in newsunpack
Closes #950
2017-07-10 21:56:07 +02:00
Safihre
e8bef94706 Correctly handle renames on (multiple) retries 2017-07-10 21:03:37 +02:00
Safihre
d05fe2d680 More uniform handeling of renames 2017-07-10 20:53:31 +02:00
Safihre
4f8cc3f697 Remove QCHECK_FILE, not needed 2017-07-10 19:54:59 +02:00
Safihre
6fa619fa37 More robust renaming based on par2 first-16k info
Also when the correct name is
2017-07-10 17:40:39 +02:00
Safihre
a43f5369ea Do not rename .par2 filenames from NZB
They are usually correct, if mentioned at all
2017-07-10 17:29:34 +02:00
Safihre
2040173dc2 Rename parts of Assembler to be more coherent 2017-07-10 17:20:03 +02:00
Safihre
a15b7ec7ac Remove Windows utf8 detection using par2
Obsolute now we have Multipar
2017-07-10 17:17:12 +02:00
Safihre
6adcf2ce10 Stylistic changes from previous commits 2017-07-10 17:11:32 +02:00
Safihre
e756b9b5c1 Correct filenames while downloading using first-16kb par2 info
Maybe we can also do DirectUnpack!
2017-07-10 17:07:16 +02:00
Safihre
b3de745849 Do not use article-filename if it looks obfuscated 2017-07-10 15:54:17 +02:00
Safihre
77f3dc18b5 Corrections of Move To Top for filelists 2017-07-09 19:51:18 +03:00
gwyden
6b2f15f82e Move To Top/Move To Bottom buttons for filelists (#959)
* Control creation

* JQuery to make the buttons work

* minor text fixes

* tab to spaces cleanup

* style additions and removed hard text from code

* Moved button control to modal finish render event, gave file details a little more room

* Moved control to replace age and size on mouseover

* Added margins and color corrected for the night theme

* resolved night theme readability

* move to working top and bottom

* controls would lose event bindings after the append.  Detach first then insert

* Move to Top and Bottom buttons for files in each NZB
2017-07-09 18:34:33 +02:00
Safihre
570e58611d Repair would fail if extrapars were deleted by previous run
Closes #961
2017-07-06 18:30:31 +03:00
Safihre
6b69010aec Add logging for missing NZF database to debug #952 2017-06-28 11:35:52 +02:00
Travis
e3e2fb7057 Automatic translation update 2017-06-27 09:23:17 +00:00
Safihre
ece04909e7 Add latest changes to changelog 2017-06-27 00:13:24 +02:00
Safihre
963920eb88 Semi-correct missing MB counter for Pre-check
It's still off (for Precheck only), but not sure why
2017-06-26 22:03:50 +02:00
Safihre
cf5fa542b6 Don't show import errors when NZO is gone 2017-06-26 21:36:49 +02:00
Safihre
1be7e99754 Remove last hashlib workaround 2017-06-26 21:00:17 +02:00
Safihre
14e3334682 Correctly handle disk-space calculations
No more glitches in the interface during downloading.
2017-06-26 16:25:03 +02:00
Safihre
b1e033dd55 Update text files for 2.2.0Alpa2 2017-06-26 14:28:22 +02:00
Safihre
111feb1b57 Show missing articles as MB instead of number of articles 2017-06-26 13:46:54 +02:00
Safihre
886b23d034 Update translatable texts 2017-06-26 10:40:02 +02:00
Safihre
f2590792b3 Download all par2 always when enable_par_cleanup is disabled
https://forums.sabnzbd.org/viewtopic.php?f=2&t=22744
2017-06-26 09:19:05 +02:00
Safihre
02a497ed74 Only set Post-processing Completed/Failed at the very end
To prevent race-issues
2017-06-25 20:32:45 +02:00
Safihre
48df0eed84 Add logging for user-actions
We were missing way too many things
2017-06-24 23:18:14 +02:00
Travis
0f58cbb671 Automatic translation update 2017-06-24 18:51:32 +00:00
Safihre
9d71670f59 Full hearted 2017-06-24 20:33:16 +02:00
Safihre
7f838ebb38 Move Donate-link in Glitter 2017-06-24 13:51:19 +02:00
Safihre
ef1cb05bc8 Store result of MultiPar verification
Just in case prospective par2 didn't catch them all
2017-06-24 10:47:33 +02:00
Safihre
c14b3ed82a Prospective Par2 correct TryList reset
I think
2017-06-24 00:34:57 +02:00
Safihre
792e337936 Rename increase_last_history_update to history_updated 2017-06-23 22:58:29 +02:00
Safihre
6cd2e66052 Use actual counter for LAST_HISTORY_UPDATE
Would otherwise miss some updates
2017-06-23 12:49:40 +02:00
Safihre
728022b86d Show Verifying Repair stage for MultiPar 2017-06-23 11:10:47 +02:00
Safihre
7718446313 Convert HTML to text in warning messages
Related: #952
2017-06-23 08:30:54 +02:00
Travis
66dea54053 Automatic translation update 2017-06-22 20:34:50 +00:00
Safihre
f19b60bd41 Also don't list line numbers for NSIS pot file 2017-06-22 21:46:55 +02:00
Safihre
09f1c92856 Move enable_multipar to Specials
Moving forward to make MultiPar the only used par2-solution on Windows.
2017-06-22 11:03:53 +02:00
Safihre
589715901d Correct counting during Checking/Verification in MultiPar 2017-06-22 10:50:00 +02:00
Safihre
3f1a5ff5e0 Fix typo in extract_pot.py 2017-06-22 09:32:59 +02:00
Safihre
49cd956d4c Do not list line-number for POT files
To avoid commit-overhead when updating texts
2017-06-21 22:17:49 +02:00
Safihre
f9acde862f Correct counting in MultiPar Checking 2017-06-21 21:40:24 +02:00
Safihre
503e1dd899 Re-work NZO_LOCK to actually lock when saving 2017-06-21 20:54:00 +02:00
Safihre
c8e12b948d Mixed up application of use_pickle 2017-06-21 17:18:16 +02:00
Safihre
18949d68c0 Fix wrong addition to en.po
Thx @thezoggy!
2017-06-21 17:12:19 +02:00
Safihre
0c51b6c016 Add Donate links to main Config page and Glitter help modal 2017-06-21 09:57:56 +02:00
Safihre
63a5c22c1f Don't continue when fetching failed
Possibly: #914
2017-06-21 09:19:25 +02:00
Safihre
f76e2a7b56 All links to sabnzbd.org should be HTTPS 2017-06-20 23:15:15 +02:00
Safihre
bab151d6f5 Properly fix redirect after enabeling/disabeling HTTPS 2017-06-20 22:46:48 +02:00
Safihre
d43fec088b Fix typo in Correct redirect when enabeling HTTPS 2017-06-20 19:48:18 +02:00
Safihre
a8ca1cbcd7 Correct redirect when enabeling HTTPS 2017-06-20 19:47:45 +02:00
Safihre
ada3494483 Fix typo in Config JavaScript 2017-06-20 19:04:38 +02:00
Safihre
43c238b7f1 Update translations 2017-06-17 11:23:50 +02:00
Safihre
128d10c51e Restart-text was always shown in English 2017-06-17 11:19:59 +02:00
Safihre
1a1e01f9f6 Correct upgrade-notice 2017-06-17 11:13:53 +02:00
Safihre
8483e4ab8a Add last minor change to changelog 2017-06-17 09:01:53 +02:00
Safihre
f6c163b505 CherryPy 8.1.2 - Catch OSX "Protocol wrong type for socket" 2017-06-17 08:40:14 +02:00
Safihre
8f30173db0 Update text files for 2.2.0Alpha1 2017-06-16 15:38:17 +02:00
Brendan Ball
0372ff95bb Added support for systemd power controls
added systemd support to powersup.linux_shutdown, linux_hibernate, linux_standby
2017-06-16 15:19:32 +02:00
Safihre
6fa29c7877 Update translatable texts 2017-06-15 20:58:48 +02:00
Safihre
d4c9121593 Remove NZB_LOCK
Not required
2017-06-15 20:54:13 +02:00
Safihre
76a8df0282 Make it more clear that Hostname verification is a server problem 2017-06-15 20:51:27 +02:00
Safihre
0b6d8309a0 Format the SSL certificate messages more for humans 2017-06-15 20:51:21 +02:00
Safihre
10a9bc0817 Don't show Advanded on Config>General if HTTPS disabled 2017-06-15 16:09:01 +02:00
Safihre
2a14af4ffa Firefox doesn't suck at animations anymore 2017-06-15 14:47:04 +02:00
Safihre
d1a4a292e3 Prevent log-flooding when job is too old for server 2017-06-13 21:40:45 +02:00
Safihre
14c0efa151 Fix error in MultiPar repair when first .par2-file was broken 2017-06-13 21:40:45 +02:00
Safihre
4fc03f2581 Discard all articles at once when too old for server 2017-06-13 21:40:45 +02:00
Safihre
3205b9fda9 Don't fill anything for bandwith limit if nothing is set
Now it would just fill "M" when nothing was set.
2017-06-13 21:40:45 +02:00
Safihre
953e0d6c22 Remove DIR_LOCK
The operations it was locking were always performed from 1 thread anyway.
2017-06-13 21:40:45 +02:00
Safihre
b50ce54ca9 Reformat IO_LOCK to really only protect against NZO-saving collisions
The main intent was not to read/write to same file, but this can (as far as I can see) never happen anyway. 
Before this change 2 threads could not be writing data at the same time, even if they were writing to completly different directories.
2017-06-13 21:40:45 +02:00
Safihre
5e7558ce4a Remove locks from ArticleCache
All operations on the list are atomic or modify objects in place that can't be read at the same time.
2017-06-13 21:40:45 +02:00
Safihre
8aa6362432 Remove NZBQueue wrapper functions
Direct-access!
2017-06-13 21:40:45 +02:00
Safihre
02ebb97a8b Remove NZBQUEUE_LOCK and only use synced wrappers when needed
Less locks = Less waiting
2017-06-13 21:40:45 +02:00
Safihre
b36063403d Remove legacy asserts and work-a-rounds 2017-06-13 21:40:45 +02:00
Safihre
526ffa2afb Add new translation to Changelog 2017-06-13 17:26:37 +02:00
Safihre
5b3fd812d8 Don't break MO-creation on missing Email templates 2017-06-13 14:40:47 +02:00
Safihre
af6dac9cdc Refresh Config > General when submitting language change 2017-06-13 14:14:26 +02:00
Safihre
bc25d936bb Show Hebrew in language menu
Correction of previous commit: I intended to write that it's an experiment because Hebrew is RTL. It seems to work!
2017-06-13 14:14:01 +02:00
Safihre
b497fe1444 Add Hebrew as language
This is an experiment, since Hebrew is LTR language. But a translator translated almost all the texts, so we want to use his efforts!
2017-06-13 11:43:18 +02:00
Safihre
3f456cce05 Move max_art_opt to Specials
Only for special cases (don't know which ones, but I can imagine it could be usefull..)
Deprecate later!
2017-06-13 00:40:02 +02:00
Safihre
4dd2f089ec Move replace_illegal to Specials
Who doesn't want that
2017-06-13 00:37:20 +02:00
Safihre
b1b1bc248d Reformat startswith() to use tuples when testing multiple options 2017-06-11 22:01:45 +02:00
Safihre
d9e675469c Don't throw errors when silent-saving fails 2017-06-11 22:01:45 +02:00
Safihre
ede0ca1772 Catch new way of par2 reporting bad parameters
See: https://forums.sabnzbd.org/viewtopic.php?f=2&t=22713&p=112209#p112209
2017-06-11 22:01:45 +02:00
Safihre
2d098a1477 Defend against possible NTFS crash
Closes #930
2017-06-11 22:01:45 +02:00
Safihre
e5f014b68e Replace spaces/dots in the order written in the Config 2017-06-11 22:01:45 +02:00
Safihre
b3a9dc9eeb Fix old code throughout 2017-06-11 22:01:45 +02:00
Safihre
2a06cec27c Seperate compatibility-check logic in NZBQueue 2017-06-11 22:01:45 +02:00
Safihre
19230c889d Remove unused functions and constants (vulture) 2017-06-11 22:01:45 +02:00
Safihre
c969ce552c Remove unused constants (vulture) 2017-06-11 22:01:45 +02:00
Safihre
2def600d21 Remove unused imports and functions (pyflakes) 2017-06-11 22:01:45 +02:00
Safihre
02aa8f18c8 Trylist doesn't need locks, all atomic operations 2017-06-11 22:01:45 +02:00
Safihre
fcd9522dae Remove unused import and define NzbQueue as proper class 2017-06-11 22:01:45 +02:00
Safihre
72d3ce885e Remove un-used version definitions from __init__ 2017-06-11 22:01:45 +02:00
Safihre
b428996eb7 Convert pickles and keep queue order
Also restore future jobs


dewd
2017-06-11 22:01:45 +02:00
Safihre
2b4eb58fad Correctly show message about old Queue-version
Now it's also upgrade-proof, and not just works for 1 version.
2017-06-11 22:01:45 +02:00
Safihre
240e8dff60 Bump Queue-Version to force Queue-Repair 2017-06-11 22:01:45 +02:00
Safihre
1c286afde6 Implement __slots__ to conserve memory
Objects such as Article() get created a lot. By using the __slots__ property, python will only reserve space for the give keywords instead of a whole diectonary. 

Testing showed that (on WinX64) 1 job now takes between 2-3MB of memory when loaded, compared to 4MB before.
2017-06-11 22:01:45 +02:00
Safihre
2eeb908540 Revert "Remove enable_par_cleanup"
This reverts commit f5ab4a2253.
2017-06-11 16:10:25 +02:00
Safihre
562e6ecce9 Fix Untill typos in texts and comments
Closes #943
2017-06-11 11:51:50 +02:00
Safihre
4bd0d32508 Bump version to 2.2.0-develop 2017-06-11 11:46:36 +02:00
Safihre
6f2ccbef80 Always show Par2-Multicore status on first Config page on Linux 2017-06-09 16:04:30 +02:00
Safihre
4605c3fd30 Set version to 2.1.0 and make identical to develop 2017-06-09 11:35:46 +02:00
Safihre
ed7dc3f827 Merge branch 'develop' 2017-06-09 11:30:43 +02:00
Safihre
61a6cb6d96 Update translations 2017-06-09 11:27:46 +02:00
Safihre
443efb5eda Update text files for 2.1.0 2017-06-09 11:10:48 +02:00
Safihre
ba3c731fee Correctly switch HTTPS port if occupied on first start 2017-06-08 10:50:26 +02:00
Safihre
e55f72dd1d Limit the maxium extension of the bps_list with zeros
If the last bps measurment was very long ago, this could cause thousands of zeros to be pre-loaded. This could cause MemoryErrors on low-spec devices: 
https://forums.sabnzbd.org/viewtopic.php?f=3&t=22709&p=112149
2017-06-07 18:36:36 +02:00
Safihre
b28c0a60a1 Remove option to disable Par2 Multicore on macOS
In the hope to remove par2-classic from the macOS packages in later stage.
2017-06-04 20:30:54 +02:00
Safihre
b7a80bf026 Remove nr_decoders
2 seems to be perfect for now, it was always intended as a temporary setting.
2017-06-04 00:14:52 +02:00
Safihre
fe7218e64b Remove log_new
Not used anywhere..
2017-06-04 00:11:15 +02:00
Safihre
0857a9046d Remove login_realm
Never used nor shown to users to be able to modify it
2017-06-04 00:08:02 +02:00
Safihre
354131b78a Remove prio_sort_list
Nobody seems to care about it
2017-06-04 00:05:06 +02:00
Fish2
e3ae91a4f8 lossless compression of images saved 40KB (87%) 2017-06-04 00:00:25 +02:00
Safihre
52cc5e2e4f Remove create_group_folder NZO attribute 2017-06-03 23:53:48 +02:00
Safihre
0c04451442 Remove create_group_folder
Latest forum topic about this was in 2008
2017-06-03 23:52:54 +02:00
Safihre
f5ab4a2253 Remove enable_par_cleanup 2017-06-03 23:48:51 +02:00
Safihre
1303dfe17a Remove allow_64bit_tools
None of the tools have ever shown problems on their intended platform. We can opt to remove them from their respective builds for the releases, to reduce download-size.
2017-06-03 23:38:57 +02:00
Safihre
55d80f26fa Update wiki links for 2.1
Only tiny changes, but still different from 2.0.
2017-06-03 23:30:52 +02:00
Safihre
7aee585748 Remove depricated functionality to remove samples when adding NZB
Was removed long ago because removing Sample files before downloading could give verification problems.
2017-06-03 14:07:47 +02:00
Safihre
196858409c Update text files for 2.1.0RC1 2017-06-01 22:44:34 +02:00
Safihre
21467dd62f Only download all par2 when there was a problem 2017-06-01 22:43:24 +02:00
Safihre
bb30eb7d11 Always enable QuickCheck 2017-06-01 22:35:54 +02:00
Safihre
fb9f4a7373 User Par2 Parameters for Multipar 2017-06-01 22:35:29 +02:00
Safihre
ccd5c1c75e Show par2 Extra Parameter problems as Error 2017-06-01 22:02:00 +02:00
Safihre
015c578cdd Add par2_multicore to Specials (just in case)
#902
2017-05-30 23:04:18 +02:00
Safihre
8eb4ce2914 On Windows, only show MultiPar 2017-05-30 22:45:26 +02:00
Safihre
a6b8108ee6 Support macOS >= 10.9 (removes 32bit support) 2017-05-30 14:16:34 +02:00
Safihre
181a56218a Support macOS >= 10.8 2017-05-30 14:01:34 +02:00
Safihre
24feaaebd6 Remove macOS PPC support 2017-05-30 13:56:13 +02:00
Safihre
e1945e7a35 Add license file and README for MultiPar 2017-05-28 10:15:12 +02:00
Safihre
072f65dd9c Show history status if par2 was aborted due to Disk full 2017-05-27 19:04:22 +02:00
Safihre
bde03ecc63 False-positive showing disk-full in Glitter 2017-05-27 17:10:00 +02:00
Safihre
73c2e23da4 Remove 'never_repair'
Should just use only Download feature
2017-05-27 14:32:17 +02:00
Safihre
e6233831d1 Fix typo in Multipar text 2017-05-27 01:15:20 +02:00
Safihre
82ccbdaa7b Make human-readable dates the default date-format 2017-05-25 12:24:34 +02:00
Safihre
bf5212a81c Allow aborting running PP-script
Closes #313
2017-05-25 12:23:46 +02:00
Safihre
5c6cc932cf Update text files for 2.1.0Beta1 2017-05-25 11:02:03 +02:00
Safihre
ed4430a7e0 Update translatable texts 2017-05-24 12:39:29 +02:00
Safihre
eb73f78b1f Remove unused try/except and allow cancelling of MultiPar 2017-05-24 12:39:29 +02:00
Safihre
314aad0009 Bring back unique-unpack staging 2017-05-24 12:39:29 +02:00
Safihre
98d0c5c52f Update versioning 2017-05-24 12:39:29 +02:00
Safihre
4d4da889ec Clear text in Config > Switches about Multipar 2017-05-24 12:39:29 +02:00
Safihre
4a622f59ba Updates to Multipar code and unpack-info saving 2017-05-24 12:39:29 +02:00
Safihre
913b92088a Update Multipar to v1.2.9 2017-05-24 12:39:29 +02:00
Safihre
80f4690df8 Enable and notify users about Multipar 2017-05-24 12:39:29 +02:00
Safihre
f552531703 Adding MultiPar interpreter 2017-05-24 12:39:29 +02:00
Safihre
707d4a7a0c Adding Multipar executables 2017-05-24 12:39:29 +02:00
Safihre
e69eeebdd8 Merge branch 'develop' - Update to 2.0.1 2017-05-24 12:14:56 +02:00
Safihre
be5bebb574 Update text files 2.0.1 - Nr2 2017-05-23 13:12:02 +02:00
Safihre
4ca2a7a65e Also match 'proof' when ignoring samples 2017-05-22 22:07:33 +02:00
Safihre
eed8c9bf50 Update text files for 2.0.1 2017-05-22 21:14:17 +02:00
Safihre
11d5855430 Always show Script box on Categories config page
Otherwise people might not be aware of it
2017-05-22 21:10:17 +02:00
Safihre
b13413b1e5 Only perform end-of-queue action when one is set 2017-05-22 10:38:52 +02:00
Safihre
9809474615 Remove cache from first Config page
It's a dynamic thing, not static like the Config. It can be observed live from the Status and Interface window.
2017-05-21 21:23:10 +02:00
Safihre
9ee3a61ae9 Convert HTML &quot; in Repair confirmation 2017-05-21 21:05:12 +02:00
Safihre
c71ffa02f8 Remove ending \ in extraction path after long-path unrar retry
So, turns out that when not using the \\?\ notation, Unrar does not like the \ at the end of the path (which it does need otherwise). Linked #771
2017-05-21 13:53:38 +02:00
Safihre
2e862da292 Remember all unpack/repair info, no more overwrite
Keeps forgetting all the previous stages, no idea why that's usefull
2017-05-21 13:00:20 +02:00
Safihre
08d762c6c9 No longer try to verify using SFV and/or RAR-check when Par2 failed 2017-05-21 12:23:06 +02:00
Safihre
2ef6f9e0e7 Repair would be skipped if first par2-file was not downloaded 2017-05-20 19:14:04 +02:00
Safihre
b8f84cf18d Renames of QuickCheck were not saved if following files failed
Now we do as much as possible in QuickCheck before moving on, much faster then letting par2 do it
2017-05-20 15:52:36 +02:00
Safihre
7e88af7047 Small cleanup of par2repair code 2017-05-20 14:52:18 +02:00
Safihre
2fc365dd57 Update text-files for 2.0.1RC2 2017-05-20 11:45:59 +02:00
Jonathon Saine
434170862c Upgrade moment 2.10.6 -> 2.18.1 (inc locales). Corrected filename to reflect its minified.
> https://github.com/moment/moment/blob/develop/CHANGELOG.md
2017-05-20 09:51:18 +02:00
Safihre
1eb6c426fd Correctly handle already bound port with proper command-line message
Closes #921 
Closes #923
2017-05-20 00:03:57 +02:00
Safihre
e2c46d73e4 Remove unused panic message 2017-05-19 23:44:05 +02:00
Safihre
eef02ac7ce Properly handle Queue-finish-action in Glitter
Could get lost, now it sticks of first try. Closes #924
2017-05-19 23:27:20 +02:00
Safihre
0d9614755e Make DateJS bugfix more general for m/h/d etc notations 2017-05-19 23:07:42 +02:00
Safihre
aa0557656c Optional tag on dark theme not visible
Closes #905
2017-05-19 23:03:28 +02:00
Safihre
2c750f98cb Do not remove folder on re-use
This can cause issues on some file-systems, resulting in infinite loops: https://forums.sabnzbd.org/viewtopic.php?f=2&t=22637#p111875
2017-05-19 15:14:52 +02:00
Alishan Ladhani
82cf2b33cf Fix bug with DateJS
Fix DateJS bug where sometimes >12 minutes/hours/days converts into the wrong timestamp. Removing the space makes DateJS work properly.
2017-05-19 14:36:10 +02:00
Phil R
b9cfe0d6f0 URL Grabber crashes on unhandled socket exceptions
URL grabber handles `httplib.IncompleteRequest` exceptions.
This exception is not returned when the HTTP responses closes in the body, rather than the headers.
2017-05-19 13:57:33 +02:00
Safihre
a0166a4011 Correct command-line parameters 2017-04-21 15:53:24 +02:00
Safihre
c9f765813c Exit more cleanly when ports are occupied 2017-04-21 15:35:10 +02:00
Safihre
2f52590587 Update translations 2017-04-19 16:09:15 +02:00
Safihre
fd581fffa5 Prepare text-files for 2.0.1RC1 2017-04-19 15:58:43 +02:00
Safihre
fcdac1cb32 On retry, make sure we also do a check for failed recursive unpacks
Closes #900
2017-04-19 11:26:00 +02:00
Safihre
a824fa617b Proper messages in case of 7zip encryption 2017-04-19 11:05:24 +02:00
Safihre
1fd0c23e55 Apply overwrite_files() setting also to 7zip 2017-04-19 11:04:27 +02:00
Safihre
884d4ee91b Remove Special-switch prospective_par_download
It works, no need to disable anymore.

Possibly also fixes #903
2017-04-18 21:28:29 +02:00
Safihre
0c7d303568 Stop further Assembler processing after IOError 2017-04-18 21:15:49 +02:00
Safihre
a8ac8609d6 Revert "Don't use decoder for missing articles"
Turns out that it is really slow for some people

https://forums.sabnzbd.org/viewtopic.php?f=2&t=22592
2017-04-18 15:43:54 +02:00
Safihre
0d98a24c67 Only search for free port when SAB is started for first time
Closes #875. Removed 'fixed_ports' from Specials because now it's just an internal variable.
2017-04-18 13:56:21 +02:00
Safihre
31eeb5e539 Filter out tab-char (\t) for filenames on Windows
Closes #897
2017-04-18 13:29:46 +02:00
Safihre
82dacda359 Need to wait longer after restart is triggered in Config 2017-04-18 13:15:55 +02:00
Safihre
c3f82e49bf Log X-Forwarded-For in API calls and logins
Closes #884. But we don't overwrite the other found IP otherwise it might be used to remove correct logging.
2017-04-18 13:00:17 +02:00
Safihre
86a0e734b1 Avoid ZeroDivisionError in PP-script call
See #900
2017-04-18 09:00:17 +02:00
Safihre
934db752bf Restore Downloader-slowdown to more conservative value
More slowdown was causing problems for some users
2017-04-14 17:07:54 +02:00
Safihre
ed379da657 Update versioning file
On to 2.1.0!
2017-04-09 12:39:36 +02:00
Safihre
5da5f1adc1 Set version to 2.0.0 2017-04-09 12:25:05 +02:00
Safihre
f47e92dec0 Merge branch 'develop' 2017-04-09 11:59:13 +02:00
shypike
55c4bef524 Update translations 2017-04-09 10:22:25 +02:00
Safihre
ccb329160d Update text files for 2.0.0 Final (again) 2017-04-08 07:53:24 +02:00
Safihre
424626d64b Correct the SABYenc version matching 2017-04-07 08:56:45 +02:00
SanderJo
026893e10d SABYenc: explicitly define "SABYENC_VERSION = None" if none installed 2017-04-07 07:45:42 +02:00
Safihre
840b03c875 Update text files for 2.0.0RC3 2017-04-06 09:49:56 +02:00
Safihre
325f876010 Bump SABYenc to 3.0.2
Because the source-distribution on PyPi failed (missing .h file), on pypi are not allowed to replace a file for a release.
2017-04-06 09:35:22 +02:00
Safihre
91606a24b8 Correct translatable texts formatting 2017-04-06 08:55:21 +02:00
SanderJo
f001d8b749 SABYenc: Reporting of Required and Found version. Plus better var naming. 2017-04-06 08:47:20 +02:00
SanderJo
31c0c239f9 getformance.getcpu(): if no cpu info, fallback to platform.platform() 2017-04-05 17:34:34 +02:00
Safihre
918c4dbfce Save renames on join and move the join
It needs to happen first, so it doesn't get canceled
2017-04-05 14:41:56 +02:00
Safihre
f587319ef0 Only retry once after joining files 2017-04-05 13:59:01 +02:00
Safihre
b4dd942899 Fix problems with joinable files and par2cmdline
Closes #885. For some magical crazy reason, par2cmdline just doesn't scan .001 files, only all the other ones. Causing unjust verification failures.
2017-04-05 13:39:04 +02:00
Safihre
97a6720fba SABYenc bump to 3.0.1
Clumsy
2017-04-05 10:08:32 +02:00
Safihre
f05c1ef9e8 Bump SABYenc to 3.0.0
Important changes.
2017-04-05 09:35:24 +02:00
Safihre
91c1ea97fd Update display of Certificate Validation
Unfortunately requires new translations. "Default" is just not correct anymore.
2017-04-03 15:24:58 +02:00
Safihre
74faa159e7 Rename 'Default' Certificate Validation setting to 'Minimal' 2017-04-03 12:52:10 +02:00
Safihre
7e9892bb8d Prepare text files for 2.0.0 Final
@sanderjo @thezoggy @shypike: Let me know if things are missing or should be formulated better!
2017-04-02 17:43:54 +02:00
Safihre
0a9e54e5c5 Update some general text-files 2017-04-02 17:16:51 +02:00
Safihre
0f0d16a104 Update translatable texts
@shypike, I updated, the pot-file, can you send it to LP?
2017-04-02 13:25:01 +02:00
Safihre
7d7ee6ca6a When detecting cloaked job, tell this to the user 2017-04-02 12:47:46 +02:00
Safihre
0d96cd3fe8 Better handeling of filetypes-to-ignore during QuickCheck
@thezoggy Closes #880
2017-04-02 12:05:33 +02:00
Safihre
596244543c Config - Specials did not show default-values for lists
Linked to #880
2017-04-02 11:20:50 +02:00
Safihre
237d6b9414 Revert "Bump SABYenc to 2.9.0"
Staying with 2.8.0 for compatibility untill we can do another SABnzbd release.
2017-03-31 15:12:43 +02:00
Safihre
a7c42779f8 Bump SABYenc to 2.9.0 2017-03-31 13:50:04 +02:00
Safihre
c49e5f2054 Also remove IPv4/6 address from logs 2017-03-31 10:54:10 +02:00
Safihre
6ca6037aa0 Don't sort when loading Queue from disk on start-up 2017-03-31 09:57:22 +02:00
Safihre
cc7f360c04 Only trigger Script change in Glitter when there are scripts 2017-03-31 09:39:54 +02:00
Safihre
75991bffea Stray unicode in CRC should not crash the decoder
This actually happened..
2017-03-30 15:11:59 +02:00
Safihre
afd1b1968c Update text files for 2.0.0RC2 2017-03-29 17:22:27 +02:00
Safihre
746e9d2a6d Bump required SABYenc 2017-03-29 16:46:40 +02:00
Safihre
36b5b5d0f3 RarFile needs path to unrar before starting 2017-03-28 21:34:39 +02:00
Safihre
dd603cfcc8 Non-SABYenc situations could result in crashes 2017-03-28 17:00:35 +02:00
Safihre
cefce9913a QuickCheck would fail renaming when file does not exist
For example if par2 already renamed it before
2017-03-28 16:44:33 +02:00
Safihre
0b29f27fcd Use popen instead of system for diskspeed initialization on Windows
In the binary otherwise a command window pops up
2017-03-23 16:18:47 +01:00
Safihre
f3f3e27bfe Move dot-stripping to last step of sanatizing 2017-03-22 17:20:33 +01:00
Safihre
519c44a72a skip_dashboard=1 default for fullstatus API-call 2017-03-22 11:35:24 +01:00
Safihre
7e28da0530 Set a develop-version to distinguish which develop users are on
Closes #872
2017-03-22 09:13:30 +01:00
Jonathon Saine
af70d98b50 Fixes: #860
Handle: `SSLError: [SSL: HTTPS_PROXY_REQUEST] https proxy request (_ssl.c:661)`
2017-03-21 12:53:16 +01:00
Safihre
3f0b84ea22 Update text files for 2.0.0RC1 2017-03-20 22:33:01 +01:00
sanderjo
e58abd45ec newsunpack: unrar says "too large" => give error 2017-03-20 21:55:49 +01:00
Safihre
abeee263f0 Use constants.REC_RAR_VERSION in all checks 2017-03-20 15:10:44 +01:00
Safihre
30f68bd7b9 Warning about bad Unrar was never shown in Glitter
Now it's a proper warning
2017-03-20 15:04:03 +01:00
Safihre
f13394d27f Change Error to Warning for missing SABYenc
In preperation of RC1
2017-03-19 16:59:36 +01:00
shypike
88e0617429 Update translatable texts 2017-03-18 22:34:29 +01:00
shypike
ab94ffc055 Update translatable texts 2017-03-18 22:13:56 +01:00
shypike
265ab99cc7 Remove unused languges 2017-03-18 21:12:53 +01:00
shypike
738adbe38e Update translation 2017-03-18 21:09:36 +01:00
Safihre
a894ca5171 Set version to 1.2.3 2017-03-18 13:05:04 +01:00
Safihre
5abe1140ae Merge branch '1.2.x' 2017-03-18 13:03:36 +01:00
Safihre
4e6862cef9 Chain certificates not loaded in all situations of extra servers 2017-03-18 12:23:48 +01:00
Safihre
7aff60b24d CherryPy would fallback to (non-existing) pyopenssl for extra servers
Causing failed starts
2017-03-18 12:23:12 +01:00
Safihre
d34e14370c Chain certificates not loaded in all situations of extra servers 2017-03-18 11:43:46 +01:00
Safihre
c4f4a3131c Update 1.2.3 text files for extra bugfix 2017-03-18 11:40:57 +01:00
Safihre
dcbd9b57f3 CherryPy would fallback to (non-existing) pyopenssl for extra servers
Causing failed starts
2017-03-18 11:39:40 +01:00
Jonathon Saine
8819e38073 We only used 1 line from listquote, just copied over that line to eliminate the need for the superfluously import. 2017-03-18 11:10:44 +01:00
Safihre
aad3b54a17 Update Text Files for 1.2.3
These patches were already tested within 2.0.0Alpha/Beta, so considerd safe.
2017-03-18 11:04:57 +01:00
Safihre
cde142a371 Windows paths can't end in a dot 2017-03-18 11:02:14 +01:00
Safihre
8bfc98ffc6 Glitter server unblock button wasn't working
Closes #864
2017-03-18 11:01:51 +01:00
Jonathon Saine
e46f21d566 Fix -w option as it no longer needs arguments. 2017-03-18 11:00:46 +01:00
Safihre
0e45fdcdfd Fix BPS manager breaking the downloader due to Quota 2017-03-18 10:28:31 +01:00
Safihre
eec7af16d7 Improve log obfuscation
It needs to match any charachters not just alpha-numeric
2017-03-18 10:28:03 +01:00
Safihre
6532425902 Kill the UnRar after a Windows failure
On Windows Server it seems unrar otherwise won't stop: https://forums.sabnzbd.org/viewtopic.php?f=3&t=22492
2017-03-18 10:27:57 +01:00
Safihre
44b896522c Unzip needs clipped paths
(7zip doesn't)
2017-03-18 10:26:32 +01:00
Safihre
2bbac91436 Fix BPS manager breaking the downloader due to Quota 2017-03-18 09:41:01 +01:00
Safihre
cf4dea432b Fix SMPL after reverting qstatus 2017-03-17 22:47:55 +01:00
Safihre
bd70df1f05 Remove non queue/history info from those API calls 2017-03-17 22:29:10 +01:00
Safihre
b2638c1fac Make API call qstatus identical to queue call 2017-03-17 21:39:24 +01:00
Safihre
4aa9409f5d Revert "Remove API-call 'qstatus'"
CouchPotato also uses it and doesn't get updated.
2017-03-17 21:35:38 +01:00
Safihre
dfa863a54a Reame cat_list > categories and script_list > scripts 2017-03-17 20:40:40 +01:00
Safihre
626c04df48 Don't need password parameter 2017-03-17 20:19:17 +01:00
Safihre
6026fa57f0 Remember password in history
Closes #855
2017-03-17 20:17:45 +01:00
shypike
0db28fb5e2 Add new column to database.
Bump version to 2.
Add "password" column in new database.
Insert "password" column in existing databases.
2017-03-17 19:34:13 +01:00
Safihre
c9bf8ced99 Remove unused function format_history_for_queue 2017-03-17 16:58:11 +01:00
Safihre
18a55db245 Remove undocumented 'sort' and 'trans' options from queue API call 2017-03-17 16:30:44 +01:00
Jonathon Saine
efb9664761 Update windows section to use win32api 2017-03-17 15:09:09 +01:00
Safihre
3ee412c7a5 Update translatable texts 2017-03-17 13:22:18 +01:00
Safihre
5afc00a502 Remove API-call 'qstatus'
SMPL specifc thing that can also be done from data in regular queue call. To keep SMPL working.
2017-03-16 22:09:33 +01:00
Safihre
e5ca0e6415 Remove legacy detection when not to show API warnings 2017-03-16 22:09:33 +01:00
SanderJo
98f121258c Everything in a try/except as we're dealing with OS calls. 2017-03-16 22:06:47 +01:00
Safihre
b2474c51fd Glitter server unblock button wasn't working
Closes #864
2017-03-16 14:19:37 +01:00
Jonathon Saine
1bd6ebdb41 Fix -w option as it no longer needs arguments. 2017-03-16 08:24:36 +01:00
SanderJo
20ef99326d Check if Completed Download Folder is on FAT. If so, give a warning 2017-03-15 08:58:58 +01:00
Safihre
171a1b9ae3 Do not handle first article seperate
Was build to detect filename early on, but we can also do this later. This way not everything gets loaded into memory right away. Part of #535
2017-03-14 16:48:27 +01:00
Safihre
cd2c9d151a Correctly check for NOT is_gone when deleting
Oops
2017-03-14 16:41:26 +01:00
Safihre
8fbfe9a76a Always provide nzf_id to get_files
Otherwise we can loose track of which file we are talking about. Especially because nowadays files are obfuscated on article-level.
2017-03-14 16:16:56 +01:00
Safihre
63cf0d4f97 Top-only now really really only downloads the top job 2017-03-14 13:55:20 +01:00
Safihre
faa98126f8 More general multicore-par2 detection 2017-03-11 20:24:02 +01:00
Safihre
0dd70249b9 Windows paths can't end in a dot 2017-03-10 16:48:09 +01:00
Safihre
aadd99cac3 Update text files for 2.0.0Beta1 2017-03-10 15:16:11 +01:00
Safihre
5bede842ba Avoid double checks for saving SABnzbd password 2017-03-09 17:37:45 +01:00
Safihre
1f2ac77b5e SABnzbd password should show stars
Closes #851
2017-03-09 17:29:27 +01:00
Jonathon Saine
3f4f35c6d1 More PEP8 cleanup, spelling fixes in comments and reserved word changes, and make IDE ignore debug asserts. 2017-03-09 16:22:30 +01:00
Jonathon Saine
9575ddbdb4 PEP8 cleanup -- compare instance not type 2017-03-09 16:22:25 +01:00
Jonathon Saine
3ed918d98d PEP8 related cleanup (most whitespace) 2017-03-09 16:22:18 +01:00
Safihre
89d5af3372 Correct typo (Successful) 2017-03-09 15:55:24 +01:00
Safihre
fa8f40eee3 Detect multicore par2 and show link how to install
Now also available in @jcfp's new PPA (both MT and TBB) versions. Installing MT is also very easy on other platforms. For example SynoCommunity also uses it for their packages.
2017-03-08 18:24:48 +01:00
Safihre
8f06035500 Log succes and failure of logins
Might consider adding a special later to stop the warnings... https://forums.sabnzbd.org/viewtopic.php?f=2&t=22494
2017-03-08 16:59:21 +01:00
Safihre
8f7d969099 Do the Restart async to allow finishing of request to browser
For Shutdown this does not seem to be required
#843
2017-03-08 16:19:13 +01:00
Safihre
5422785feb Improve log obfuscation
It needs to match any charachters not just alpha-numeric
2017-03-08 15:26:08 +01:00
Safihre
911f82c00b Kill the UnRar after a Windows failure
On Windows Server it seems unrar otherwise won't stop: https://forums.sabnzbd.org/viewtopic.php?f=3&t=22492
2017-03-08 15:16:16 +01:00
Safihre
fbff8c991b Update translatable texts
@shypike Can you push to Launchpad? :)
2017-03-07 17:29:29 +01:00
Safihre
f1b139d55d Make extract_pot also work on Windows 2017-03-07 17:25:03 +01:00
Safihre
9c7f196e20 Incorrect detection of servers with same priority 2017-03-07 16:13:28 +01:00
Safihre
4d8a37006e CRC error is not the same as unknown encoding
With SABYenc it would report single-article files with CRC errors as 'Warning: unknown encoding'
2017-03-07 15:45:16 +01:00
Safihre
bc9d3d561f Missed to convert one Raiser() in interface 2017-03-07 15:02:54 +01:00
Safihre
fd9e80bdf5 CherryPy 8.1.2 - Also catch 'unknown error' from SSL
@sanderjo I forgot!
2017-03-04 16:50:12 +01:00
Safihre
aee2f71170 Log where a restart was triggered 2017-03-04 15:51:42 +01:00
Safihre
102160d651 Don't add prospective par2 on Pre-check 2017-03-03 23:08:34 +01:00
Safihre
e33f26d33c Log which server has the article
(in the hopes to debug the Check before download-feature)
2017-03-03 22:43:45 +01:00
Safihre
57113fa02f Check before download were decoded twice 2017-03-03 22:24:25 +01:00
Safihre
2be7575f98 Only show Multi-edit-Search when there is a Queue 2017-03-03 14:01:38 +01:00
Safihre
c5647b46e1 Show Queue search when Multi-editing
#842
2017-03-03 13:51:08 +01:00
Safihre
3450cff92f Unzip needs clipped paths
(7zip doesn't)
2017-03-02 15:41:40 +01:00
Safihre
1b16ee44cb Set version to 1.2.2 2017-02-28 11:17:24 +01:00
Safihre
d5f608c28c Merged branch 1.2.x into master 2017-02-28 11:16:59 +01:00
Safihre
13a11411a9 Update README 2017-02-26 20:20:44 +01:00
Safihre
6e7eb9dec4 Small Changelog typos 2017-02-26 12:37:52 +01:00
Safihre
c74eed7c0e Add new PP-script feature to Changelog
Url only for the Alpha, later information will be on Wiki
2017-02-26 12:31:50 +01:00
Safihre
2fc6811495 Remove enabled_sabyenc
Too much was intertwined. If users want to experiment with/without SAByenc they can download seperate releases.
2017-02-26 12:23:25 +01:00
Safihre
57e0dac45b If no SABYenc or _yenc, give ERROR
Performance of Python-yEnc is lower in 2.0.0, so people need to fix things
2017-02-26 12:23:24 +01:00
Safihre
537e31000e Python-yEnc cannot handle \n or \r in data
_yenc and SABYenc ignores them
2017-02-26 12:23:24 +01:00
Safihre
555d8418e7 Update text files for 1.2.2 2017-02-25 22:12:34 +01:00
Safihre
8c22e35da4 Script paths were not clipped correctly 2017-02-25 22:07:25 +01:00
Safihre
e0872f4536 Convert python types in environment fields
True/False=1/0 and None=''
2017-02-25 21:46:26 +01:00
Safihre
9dddf6dd2e Make more information available to PP-scripts via enviroment variables
Closes #785
2017-02-25 21:22:11 +01:00
Safihre
7a0c5feed3 Update text files for 2.0.0Alpha1 2017-02-25 14:21:33 +01:00
Safihre
42d154f0b7 Accidentally deleted StringIO import 2017-02-25 14:02:21 +01:00
Safihre
44b0ab2203 Remove macOS IOPolicy throttling
#830. Currently it's set to IOPOL_THROTTLE, meaning lowest priority. 
Have to await feedback from users, potentially we can create a Special option for it.
2017-02-25 13:39:48 +01:00
Safihre
4af59b50ad Update translatable texts 2017-02-25 13:28:45 +01:00
SanderJo
b309099f0b Warning in case of non-UTF-8 setting on Linux/Unix 2017-02-25 13:27:49 +01:00
Safihre
affea99cb1 Retry pickle-saving 3x
Especially on Windows the file sometimes gets locked, and users have reported 'dictionary changed size during iteration' errors, so somewhere a Lock is missing.
2017-02-25 13:11:45 +01:00
Safihre
9bc35a3026 Always use hashlib
Part of Python standard library now
2017-02-25 13:02:54 +01:00
Safihre
57e9d499fb Slowdown downloader more
Decoder doesn't use GIL, so all power now goes to the Downloader that loops too much
2017-02-24 17:36:06 +01:00
Safihre
95a7924b31 Set version to 1.2.1 and fix small discrepancies 2017-02-24 11:22:55 +01:00
Safihre
5830bebd95 Merge branch '1.2.x' 2017-02-24 11:16:18 +01:00
shypike
d32cf57c75 Update translations 2017-02-24 10:03:07 +01:00
shypike
d53cf598a4 Update translations 2017-02-23 19:55:51 +01:00
Safihre
6d9242ebc5 Update text files for 1.2.1 Final 2017-02-23 11:53:56 +01:00
Safihre
bdaca2bd37 When retry of unpack due to Windows bug, send the actual password
We converted the password to "-p<password>" and when we had to retry it due to a Windows long-path fail, it would become "-p-p<password" and would incorrectly report that the password was wrong.
2017-02-21 20:09:22 +01:00
Safihre
cbc4f6a964 When retry of unpack due to Windows bug, send the actual password
We converted the password to "-p<password>" and when we had to retry it due to a Windows long-path fail, it would become "-p-p<password" and would incorrectly report that the password was wrong.
2017-02-21 20:09:07 +01:00
Safihre
53e3af9b30 Update changelog for Script changes 2017-02-21 13:31:18 +01:00
Safihre
9cfef895f8 Don't shorten, but clip paths given to external scripts
Windows-only: Either we give long-path notation paths (\\?\) or we just give the path. Either way, user scripts have to be modified.
2017-02-20 16:12:11 +01:00
Safihre
2a3b2b9556 Forced diskspace check seperate from cached one
Closes #826. Otherwise the complete/incomplete get out of sync.
2017-02-20 15:43:55 +01:00
Safihre
56fa9644a5 Forced diskspace check seperate from cached one
Closes #826. Otherwise the complete/incomplete get out of sync.
2017-02-20 15:35:16 +01:00
Safihre
53a219f12b Tooltip for Download/Incomplete in Status Windows
Closes #827
2017-02-20 09:03:45 +01:00
Safihre
8eff51a96b Tooltip for Download/Incomplete in Status Windows
Closes #827
2017-02-20 09:03:24 +01:00
Safihre
d130a1d44a Update Wiki help links for 2.0.0 2017-02-19 17:17:04 +01:00
Safihre
48519dcfa0 Correct mistake in Diskspace calculation for Unix 2017-02-19 16:12:15 +01:00
Safihre
92542c58fe Diskspace for Complete folder was not calculated 2017-02-19 16:12:07 +01:00
Safihre
98316fd282 Correct mistake in Diskspace calculation for Unix 2017-02-19 12:36:36 +01:00
Safihre
59f1ea3073 Diskspace for Complete folder was not calculated 2017-02-19 11:47:11 +01:00
Safihre
270757f3bd Consistently check for cfg.use_pickle() 2017-02-19 10:20:13 +01:00
Safihre
7eafe730f9 Modify RarFile to properly handle testrar on Windows
Because unrar doesn't support \\?\ notation for the path to the rarfile we used to clip the path. However, the Python functions that RarFile uses then fail on unicode or jobs with '?' in the filename. Now this is handled correctly, at the very last moment before testing the RAR.
2017-02-19 01:47:29 +01:00
Safihre
843c6b36a8 Modify RarFile to properly handle testrar on Windows
Because unrar doesn't support \\?\ notation for the path to the rarfile we used to clip the path. However, the Python functions that RarFile uses then fail on unicode or jobs with '?' in the filename. Now this is handled correctly, at the very last moment before testing the RAR.
2017-02-19 01:45:03 +01:00
Safihre
f71a2a8fc2 Use pythonic-style for data reading/writing 2017-02-18 23:38:39 +01:00
Safihre
63fc763958 Don't use decoder for missing articles
Don't occupy the decoder-queue with all these empty articles, but handle them directly.
Requires less CPU.
2017-02-18 22:52:42 +01:00
Safihre
9bc0aac63d CherryPy 8.1.2 - Use relative HTTPredirects instead
CherryPy is using the oudated redirects with full URL, but that's not needed anymore and is much more flexable when used behind a proxy.
https://github.com/cherrypy/cherrypy/issues/1355#issuecomment-270669958
2017-02-18 22:52:42 +01:00
Safihre
ff529da874 Update Readme for changeset 2017-02-18 22:52:42 +01:00
Safihre
ff40944f00 Disable schedule items without deleting them
Requires conversion of the schedules!
2017-02-18 22:52:42 +01:00
Safihre
1d0ac46c7e More correct handeling of CherryPy logging
Use CherryPy's options to handle the logging.
2017-02-18 22:52:42 +01:00
Safihre
d62bb1e5b6 Move overwrite_files to Specials
Very special option, only usuefull if you dump all output in 1 directory. But this rarely happens.
2017-02-18 22:52:42 +01:00
Safihre
89f91e46b7 Add Certificate Validation option to Wizard
Otherwise a user would be stuck.
2017-02-18 22:52:42 +01:00
Safihre
bc2daa5f8b Enabled Hostname verification by Default
We will try this and see the feedback if users understand. We have improved the linked page with information for users: https://sabnzbd.org/certificate-errors
2017-02-18 22:52:42 +01:00
Safihre
0fbf240a58 Simplify CherryPy logging
No filter required anymore, CherryPy provides it's own config switches for it.
2017-02-18 22:52:42 +01:00
Safihre
83d57b33f7 Rewrite Raisers in Interface.py
Raisers don't need extra information anymore, there is only 1 type of redirect to be used.
2017-02-18 22:52:42 +01:00
Safihre
59ae23e315 Correct redirect for each situation
Some redirects were not performed correctly in the new situation.
2017-02-18 22:52:42 +01:00
Safihre
df26adfe89 Accidentally removed SSL-choice from Wizard 2017-02-18 22:52:42 +01:00
Safihre
d1a92aeb36 Restructure interface.py
We now only have 1 directory that has all the template files, so the directory does not have to be a variable for each page anymore.
There should be caution when doing redirects, to make sure the correct /sabnzbd/ or just / is used.
2017-02-18 22:52:42 +01:00
Safihre
c09f1b2f1c Move rating_host back to Specials
Possibly to be deprecated later on. Indexers should supply this info via the headers: https://sabnzbd.org/wiki/extra/indexer-feedback
Indexers like to use an URL, instead of just providen a host.
2017-02-18 22:52:42 +01:00
Safihre
a70a1e6290 Assume Rating feedback if Indexer integration enabled
With the changes in 1.1.0 we now have more indexers in the wild actually use the system, by sending the headers or using the fields in the NZB.
But nowadays very few files have actual audio/video ratings of users, so the main purpose of this feature has evolved to automatically report back if the download failed on the server.
The text is also updated as such, that enabling it will send to the indexer if a download failed, only if it failed.
2017-02-18 22:52:42 +01:00
Safihre
dde5258b59 Move 'Use tags from indexer' to Specials
The user should always use this, there is no bad thing about it.
This cleans up the Switches page a bit. Eventually the option can just be completly removed.
2017-02-18 22:52:42 +01:00
Safihre
dc438e6eb7 Remove Secondary Skin option
Major cleanup, now doesn't need any special links to file locations anymore.
Closes #778
2017-02-18 22:52:42 +01:00
Safihre
37a9a97f4f Move QuickCheck to Specials
Closes #788. It's been tested, it works, nobody should not use it.
2017-02-18 22:52:42 +01:00
Safihre
4fb6e3fe7b Remove check for ssl module
Any Python setup has it, it was only introduced to check for PyOpenSSL which is now dropped.
2017-02-18 22:52:42 +01:00
Safihre
7884848c78 Don't run PyStone for every Status Window update
Only diagnostic info, no need to refresh every time and blocks CPU when window is refreshed during downloading.
2017-02-18 17:54:12 +01:00
Safihre
2ece328e50 Update Cache-info in Status-window with Queue
Info is already in the API-call for queue, so can be updated with same frequency
2017-02-18 17:30:06 +01:00
Safihre
b8ac3cd22f Catch bad article from SABYenc 2017-02-18 00:56:40 +01:00
Safihre
9b4bd7a3f0 Only warn about _yenc when no SABYenc 2017-02-18 00:56:40 +01:00
Safihre
facefc5c58 Option to disable SABYenc didn't actually work
But now it does!
2017-02-18 00:56:40 +01:00
Safihre
5d6a6b1af7 Show SABYencversion in log 2017-02-18 00:56:40 +01:00
Safihre
916e0ead99 Ignore non-essential files during QuickCheck 2017-02-18 00:56:40 +01:00
Safihre
aff7b07f33 Make sure the error-code is logged 2017-02-18 00:56:40 +01:00
Safihre
8267b429ca Some cleanup of SABYenc code 2017-02-18 00:56:40 +01:00
Safihre
5759bee1df Small changes to Decoder 2017-02-18 00:56:40 +01:00
Safihre
f2648ec85c Require SABYenc 2.7.0 2017-02-18 00:56:40 +01:00
Safihre
e083722f0b Make sure to do DMCA/Pre-Check checks in right data 2017-02-18 00:56:40 +01:00
Safihre
f03e63fa54 Make sure Decoder's get shutdown 2017-02-18 00:56:40 +01:00
Safihre
f33c3e30eb Robust detection of end-of-article 2017-02-18 00:56:40 +01:00
Safihre
c9ee0b0fcb Check for specific SABYenc version 2017-02-18 00:56:40 +01:00
Safihre
7aaa8036bc Setup multiple Decoders 2017-02-18 00:56:40 +01:00
Safihre
00f2410d2d Show SABYenc detection at startup and in Config 2017-02-18 00:56:40 +01:00
Safihre
be77a494db Correctly handle end-of-article 2017-02-18 00:56:40 +01:00
Safihre
787a95bdd2 Reduce timeouts for decoder/assembler switches 2017-02-18 00:56:40 +01:00
Safihre
720ce591b7 First work on SABYenc integration 2017-02-18 00:56:40 +01:00
Safihre
af92797ba0 Fix small language bug 2017-02-17 22:58:59 +01:00
Safihre
6625365586 Update text files for 1.2.1RC1 2017-02-17 22:43:18 +01:00
shypike
3e88e33397 Update translatable texts 2017-02-17 22:26:36 +01:00
shypike
f155a9d4a4 Update translations 2017-02-17 22:24:33 +01:00
thezoggy
6ae118dcb5 Update self-signed cert code to use SubjectAltName (#822)
* PEP8 fix and spelling fixes

* Update certgen code off latest crypto tutorial including using SubjectAltName instead of legacy Common Name.
Populate SAN with localhost and local v4+v6 ips to make other apps not throw `RemoteCertificateNameMismatch`.
Self signed certs are not allowed to be valid CA, so the user must manually add cert as trusted CA to resolve `RemoteCertificateChainErrors` -- using SAN this allows it to be stored as `SABnzbd` now.

* Add `127.0.0.1` and drop local IPv6
2017-02-17 13:39:33 +01:00
Safihre
b8c4f1a09a Try os.rename 3 times, before using shutil.move() 2017-02-15 13:52:36 +01:00
Safihre
f0602aa6e4 RSS size field could be empty for old feeds 2017-02-15 13:05:19 +01:00
Safihre
61ac750dd7 Par2cmdline doesn't handle \\?\ or \\.\ notation, workaround for special
Linked to #771. par2cmdline doesn't actually support the \\.\ or \\?\ notation. It allows to specify the par2-file in this way, but it ignores any of the other files in the folder: "Ignoring non-existent source file: \\."
So now to prevent it crashing the system on special-Windows-names, we still use the \\.\ notation in case of that. But it will still crash if it's an obfuscated post that gets renamed by par2cmdline to a forbiden name. We can't detect that..
2017-02-15 08:17:58 +01:00
Safihre
23b660df6e CherryPy 8.1.2 - Catch general SSL-errors
Closes #820
2017-02-14 18:40:13 +01:00
Safihre
a5d1c6860c Cache result of disk free/total
#817
2017-02-14 09:32:09 +01:00
Safihre
50fe3f8db0 Correctly handle "jobname / password" notation
Now it was cut wrongly, leaving the / in the name
2017-02-13 09:27:17 +01:00
Safihre
875f878b42 CherryPy 8.1.2 - Another SSL error to catch 2017-02-13 09:03:18 +01:00
Safihre
76e6f6633f RarFile.testrar() needs clipped-paths
But now it won't handle special win-names, so we skip those.
2017-02-12 22:28:13 +01:00
Safihre
caf5adc42d Pass shortend path to scripts on Windows (for now)
Closes #815
2017-02-10 12:11:35 +01:00
Safihre
b70609c047 Don't quit when only 1 of multiple RSS-feeds fails
Closes #816
2017-02-10 08:58:17 +01:00
Safihre
80a2b1685a Add tooltip to CPU name
Closes #814
2017-02-09 08:49:17 +01:00
Safihre
de5c0be2c7 Update text files for 1.2.1Beta1 - Typo 2017-02-08 08:51:45 +01:00
Safihre
a12623dda8 Update text files for 1.2.1Beta1 2017-02-08 08:38:19 +01:00
Safihre
1b3146d69f Restore unrar to _UNPACK_JobName
It works again!
2017-02-07 22:56:52 +01:00
Safihre
b39c89d069 Unrar on Windows with normal-path notation in case of Unicode errors 2017-02-07 18:58:01 +01:00
Safihre
ed31e0952e Use temporary folder for UNPACK
To avoid any unicode problems with command-line tools.
2017-02-07 18:58:01 +01:00
Safihre
28a58433de Don't RAR-verify encrypted jobs 2017-02-07 18:58:01 +01:00
shypike
670b79269d Windows: use long-paths for external tasks
Use long paths as much as possible when running external software.

Both par2cmdline for Windows versions support \\.\ notation.
Unrar handles long paths without the prefix.
Both long-path notations allow long paths and also forbidden words like
"aux." and "con.".
Previously, threads would hang if they tried to open "con.par2".
2017-02-07 18:58:01 +01:00
Safihre
ad8abbc213 Avoid startup crash on possible incorrect localhost-probing 2017-02-07 17:17:45 +01:00
Safihre
8e2ebc84c8 Make message in Server-tests more clear
Remove the -1@news.someserver.com:563 part at the end and make the certificate-errors link clickable.
2017-02-06 16:50:54 +01:00
Safihre
c9fddf2907 CherryPy 8.1.2 - Catch another Safari SSL error 2017-02-06 11:39:34 +01:00
Safihre
207deebfd5 Don't re-evaluate whole RSS feed on manual download 2017-02-03 15:35:13 +01:00
Safihre
641371cd74 Fix TopOnly and don't double check if there are articles for a server
TopOnly setting was ignored after every restart
2017-02-03 15:26:59 +01:00
Safihre
1bf76279c7 Remove TryList at NZBQueue level 2017-02-03 15:26:59 +01:00
Safihre
907a252f74 Always start from first rar for encryption check 2017-02-02 13:19:33 +01:00
Safihre
4ef5c181db Add link to page with text about Certificate errors 2017-02-02 09:02:21 +01:00
Safihre
ae584703e4 Correct spelling error 2017-02-01 08:35:11 +01:00
Safihre
b38250a37e Update README 2017-01-31 16:51:46 +01:00
Safihre
60e00196be RarFile's setpassword() can fail with correct password 2017-01-31 10:14:04 +01:00
Safihre
84d3969ec3 Log Cryptography version, we need >=1.0
Closes #803
2017-01-31 09:28:38 +01:00
Safihre
8ebdc0bd8c Let dupes pass to Queue when Dupe-detection set to Fail
The queue will then send it as failed to history. Otherwise they get paused, instead of failed.
2017-01-30 16:23:21 +01:00
Safihre
c79d99d791 Also log Unrar output in case of failure 2017-01-30 10:09:12 +01:00
Safihre
a31da69771 Use userxbit also to list scripts 2017-01-29 17:58:00 +01:00
Sander Jonkers
50589edcd2 new userxbit() as workaround for certain mounted filesystems 2017-01-29 17:52:54 +01:00
Sander Jonkers
b227a0f388 Changed message in case of problem 2017-01-27 22:28:04 +01:00
Sander Jonkers
277d2e86a9 CPU reporting now also on Windows and MacOS (fka OSX) 2017-01-27 22:28:04 +01:00
Safihre
467d4321f4 Simple HTML-tag removal of script_line
Closes #793
2017-01-26 11:59:42 +01:00
Safihre
24bb90d279 Add QuickCheck-renamer to README 2017-01-24 14:53:39 +01:00
Safihre
4bfc78b984 Use QuickCheck to do fast renaming of obfuscated files 2017-01-24 14:20:00 +01:00
Safihre
ee1005c363 Add 1 more bugfix to README 2017-01-23 20:31:20 +01:00
Safihre
3e4237275c Add bugfixes for 1.2.1 to README 2017-01-23 12:39:43 +01:00
Safihre
fa4a041773 Also show progress with par2 scan of obfuscated files 2017-01-23 12:39:43 +01:00
Safihre
040c42705d Detect version of par2cmdline that needs -B parameter
See also: https://github.com/Parchive/par2cmdline/issues/77
2017-01-23 12:39:43 +01:00
Safihre
f3f5a0bfa2 Only show Source icon for RSS items with a Source
Old ones don't have one
2017-01-23 12:39:43 +01:00
Safihre
875462b619 Auto-downloaded RSS jobs broke RSS display
Closes #787
2017-01-23 12:39:43 +01:00
Safihre
7253cb111b PP-script was not called on Accept&Fail or Dupe detection
Closes #781
2017-01-23 12:39:43 +01:00
Safihre
d318844304 Small cleanup of BPSMeter 2017-01-23 12:39:43 +01:00
Safihre
a59ea3175b Don't add extra space to password when supplied as "name / password" 2017-01-21 10:22:38 +01:00
Safihre
15456f2c2d CherryPy 8.1.2 - Catch bad SSL client connections
Closes #783. Happens when client forces low-end encryption that's not supported. 
Fix will probably be implemented in CherryPy at some point https://github.com/cherrypy/cherrypy/issues/1552
2017-01-20 17:05:05 +01:00
Safihre
cc824a96e0 Check if file exists before moving
Fight possible delays of the OS in actually deleting the file:
https://github.com/sabnzbd/sabnzbd/issues/782#issuecomment-274002201
2017-01-20 16:46:07 +01:00
Safihre
18257e0835 Auto-detect Article cache limit on Unix systems 2017-01-20 12:06:14 +01:00
Safihre
f669a0ed60 Allow 15 seconds during server-test
Some servers (Altopia) use 10 second timeouts with wrong credentials to prevent flooding.
2017-01-18 18:16:06 +01:00
Safihre
e148a057f7 Hide HTTPS options behind 'Advanced' button
Simplicity FTW!
2017-01-18 18:16:06 +01:00
Safihre
799eae65d2 Do not assume a HTTPS port to be set when HTTPS enabled 2017-01-18 18:16:06 +01:00
Safihre
f1dc4108f8 Category-matching failed if list of indexer-tags was given
Oops
2017-01-18 18:16:06 +01:00
Safihre
08b0b9eb92 Remove unpack-check 2017-01-18 18:16:06 +01:00
Safihre
85ba545107 is_rarfile doesn't work with short paths 2017-01-18 18:16:06 +01:00
Safihre
2604e467e8 Only check unwanted extensions when action set 2017-01-18 18:16:06 +01:00
Safihre
bd2c54a38d Prepare text files for 1.2.1 and remove unused stuff 2017-01-18 18:16:06 +01:00
Safihre
5c83c939d3 Show more clear warning about External access
Closes #775
2017-01-18 18:16:06 +01:00
Safihre
f7a7589107 Only check files after unpacking
Closes #779
2017-01-18 18:16:06 +01:00
Safihre
2418c56212 Build safe-guard in newznab attr processing
Closes #777
2017-01-18 18:16:06 +01:00
Safihre
6e89584263 Leave HTTPS port empty so enabeling HTTPS does this on default port
Why open 2 ports?
2017-01-18 18:16:06 +01:00
Safihre
0b696409fc Shorter port-checks on startup 2017-01-18 18:16:06 +01:00
Safihre
6602d13c95 In case HTTPS = HTTP port, save the correct port when occupied 2017-01-18 18:16:06 +01:00
Safihre
f19e637780 Rename Generic Sorting to Movie Sorting
Forgot for 1.2.0
2017-01-18 18:16:06 +01:00
Safihre
7da33b1f93 Show source of a RSS download
Can also sort on it
2017-01-18 18:16:06 +01:00
Safihre
453b5e565c Use a dict instead of list for RSS template output
The list-based output for the template left it unclear what each item was. With a dict, it's much clearer.
2017-01-18 18:16:06 +01:00
Safihre
1827a2487b Sort RSS while building the lists
Instead of in the javascript later on
2017-01-18 18:16:06 +01:00
Safihre
edc01c3e2b Some cache-busting on version upgrade for JS/CSS 2017-01-18 18:16:06 +01:00
Safihre
720215ea05 Cloaked files were not detected 2017-01-18 18:16:06 +01:00
shypike
d5d40857f4 Revert "Use \\?\ long-path notation consistent and use \\.\ notation for commandline."
This reverts commit 94c2d50f70.
2017-01-17 22:30:43 +01:00
shypike
94c2d50f70 Use \\?\ long-path notation consistent and use \\.\ notation for commandline.
Both par2cmdline-multicore and unrar support \\.\ notation.
Both long-path notations allow long paths and also forbidden words like
"aux." and "con.".
Previously, threads would hang if they tried to open "con.par2".
2017-01-17 22:20:57 +01:00
Safihre
494e72a996 Update to 1.2.0 and set version 2017-01-13 17:00:51 +01:00
Safihre
1be50ebe59 Fix the workings of RSS matching 2017-01-13 15:11:47 +01:00
Safihre
80404b3148 Set hard limit on Decoder-queue 2017-01-13 10:28:32 +01:00
shypike
0f3c4d7363 Update translations 2017-01-13 06:58:57 +01:00
Safihre
939a5ab7c0 Update text files for 1.2.0 Final 2017-01-12 12:48:53 +01:00
Safihre
722161b6cd Handle Server prio-coloring in template instead of Javascript 2017-01-12 12:48:53 +01:00
Safihre
7c8dc6e0d9 Small improvement of icon-loading in RSS window 2017-01-12 12:48:53 +01:00
Safihre
efdd06b3e9 Add a link with DMCA information to failure messages
So we avoid people asking us on the forum
2017-01-12 12:48:53 +01:00
Safihre
ee689c231c Not having _yenc is bad
The difference in CPU load is just too big (3x fold)
2017-01-12 12:48:53 +01:00
Safihre
9e3db377fb Combine 'Skip' column to get more space for Title in RSS 2017-01-12 12:48:53 +01:00
Safihre
6cb4c93e89 Also support nntmux tags in RSS parser
On top of nZEDb and newznab
2017-01-12 12:48:53 +01:00
Safihre
15dcb274c3 Remove old jQuery
Closes #766
2017-01-12 12:48:53 +01:00
Safihre
d721476986 Update text files for 1.2.0RC1 2017-01-12 12:48:53 +01:00
Safihre
850a762905 Don't error on drag-and-drop Folders
Closes #765
2017-01-12 12:48:53 +01:00
shypike
7c1e4f8e41 Update main POT file 2017-01-08 12:44:51 +01:00
shypike
37182f07fb Update translations 2017-01-08 12:40:42 +01:00
Safihre
30519d92fc Huge recv() size can cause MemoryError
Seems there is some limit here.
2017-01-06 14:36:12 +01:00
Safihre
a1cbd76985 Hide Multicore par2 switch when not available
Only works on Win/OSX.
2017-01-06 14:36:12 +01:00
Safihre
6df8d7a30a Pause-countdown was broken in Glitter 2017-01-06 14:36:12 +01:00
Safihre
09568274b3 Update jQuery to 3.1.1 for Config
Not yet in Glitter, there it causes some side-effects
2017-01-06 14:36:12 +01:00
Safihre
fa6e02ee8e Try to avoid javascript error with many RSS Filters 2017-01-06 14:36:12 +01:00
Safihre
56346a3a64 Update Changelog 2017-01-06 14:36:12 +01:00
Safihre
fb1d9842d4 Fix link to set Max line speed in Glitter 2017-01-06 14:36:12 +01:00
Safihre
4642ff0cdb Update Translatable texts 2017-01-06 14:36:12 +01:00
Safihre
508ca1dbc0 Correct URL's for Config Search pre-loader
Otherwise it does a redirect
2017-01-06 14:36:12 +01:00
Safihre
997ed57188 Tweak to detect size in more cases for RSS 2017-01-06 14:36:12 +01:00
Safihre
8630c712bb Only enable CherryPy logging when enabled from command-line 2017-01-06 14:36:12 +01:00
Safihre
8b7134a650 Config Search improvements 2017-01-06 14:36:12 +01:00
Safihre
1850f47c13 Remove lower() from Notifications Config page
Closes #732
2017-01-06 14:36:12 +01:00
Safihre
2fb44827b0 Add Config Search function 2016-12-27 22:09:53 +01:00
Safihre
f0683e101b Combine RSS feeds to share filters
Closes #680
2016-12-27 22:09:53 +01:00
Safihre
e2fda89ab3 Account for menu-offset when jumping to Config items directly 2016-12-27 22:09:53 +01:00
Safihre
a8b3f721c9 Fix cherrypy_logging
Closes #758
2016-12-27 22:09:53 +01:00
Safihre
5948d6cf33 Use season/episode information from Newznab and store results
Getting it from the feed is much faster (50x)
2016-12-24 22:17:27 +01:00
Safihre
17b71bc7fb Use Newznab 'usenetdate' to determine age
RSS publish date is usually behind
2016-12-24 22:17:27 +01:00
Safihre
dd5fe708ae Don't re-download RSS feed when clicking Apply Filters 2016-12-24 22:17:27 +01:00
Safihre
d705ccbe80 Add support for Newznab/nZEDd attributes to feedparser 2016-12-24 22:17:27 +01:00
Safihre
b53f46e0a0 Adding URL using PP=Default would set PP to only Download
Because pp="" is not the same as pp=None, so the right PP-setting from the Default setting was never applied
2016-12-24 22:17:27 +01:00
Safihre
b497d1ab9a Need new translations for number of functional texts
It also needs to make sense in other languages, not just English
2016-12-24 22:17:27 +01:00
Safihre
2f86292503 Don't check port twice if HTTPS is served on HTTP port 2016-12-24 22:17:27 +01:00
Safihre
e804b157c8 Update text files for 1.2.0Beta1 2016-12-24 22:17:27 +01:00
Safihre
0ac801d00d Catch IncompleteRead in URLGRabber
Closes #754
2016-12-24 22:17:27 +01:00
Safihre
df6b9341ac Move UpdateCheck/AutoBrowser/CertificateCheck to General
That's where they belong
2016-12-24 22:17:27 +01:00
Safihre
749d18308b Catch more ways to correctly redirect after Config update 2016-12-24 22:17:27 +01:00
Safihre
d16166c27a Make 'Security' section in Config General 2016-12-24 22:17:27 +01:00
Safihre
edbd1e7e8f Add default Categories for new users
Same as newznab categories, so it's more clear for user's what is possible
2016-12-24 22:17:27 +01:00
Safihre
8855ce9414 Hide non-regular Server settings behind 'Advanced' button 2016-12-24 22:17:27 +01:00
Safihre
61b2a57925 Move 'Disable API-key' to Specials
Closes #755
2016-12-24 22:17:27 +01:00
shypike
f8d6286d2a Manual update of NL translation 2016-12-24 18:59:36 +01:00
shypike
389e8b6a48 Update translations 2016-12-24 18:32:34 +01:00
Safihre
ae39e754b0 Fixes for new OSX building 2016-12-19 21:48:44 +01:00
Will
3b398a7643 Fixes Tiny 1 Letter Typo (#752)
Fixes the tiniest of a Typo

Missed the s, whoops. ;)
2016-12-19 21:45:58 +01:00
Safihre
9f8784e66a Proper texts for Optional and SSL in Servers Config page 2016-12-16 10:30:15 +01:00
Safihre
7b2d56a4c7 CherryPy 8.1.2 - Catch another SSL error for Safari on OSX
User needs to add execption first
2016-12-16 10:30:15 +01:00
Safihre
f093dbef7a MacOS running from sources can use regular restart-path 2016-12-16 10:30:15 +01:00
Safihre
950f62de85 Fix Windows long-path problems after recursive unpack 2016-12-16 10:30:15 +01:00
Safihre
de159153f5 Include link to SSL Ciphers wiki-page 2016-12-16 10:30:15 +01:00
Safihre
814960c5f0 Also check if running SABnzbd version might be same as the new one
Closes #747
2016-12-16 10:30:15 +01:00
Safihre
ab66abb348 Accidentally removed 'Restarting SABnzbd' text
And small Glitter-Night fixes
2016-12-16 10:30:15 +01:00
Safihre
a5d139a820 Don't send Windows notification when icon already shutdown 2016-12-16 10:30:15 +01:00
Safihre
2c4c34afcf Update README regarding PR #745 2016-12-16 10:30:15 +01:00
Safihre
cbe4840ce2 Update Copyright year to 2017 2016-12-16 10:30:15 +01:00
Safihre
cdf378ff45 Remove unused CherryPy settings 2016-12-16 10:30:15 +01:00
Safihre
7919961b8a Remove NewRotatingFileHandler and move version_check to after startup 2016-12-16 10:30:15 +01:00
Safihre
8d3ddb6ac5 Add option to mark duplicates as failed
So Sonarr/Sickbeard etc can pick another release
Closes #591
2016-12-08 16:11:15 +01:00
Safihre
cf6f850586 Fix accept&fail action of pre-queue scripts
Closes #744
2016-12-08 16:11:15 +01:00
Safihre
4dbf00810f OrderedDict is part of Python 2.7 2016-12-08 14:41:32 +01:00
Safihre
96fc743f6a Log SSL-Context check and show when Cryptograhypy is missing 2016-12-08 14:41:32 +01:00
Safihre
06ac19915c Update wizard
No need to restart. 
Show the download-folders so users know where their files are going.
2016-12-08 14:41:32 +01:00
Safihre
c3b3ba4a9e Direct restarts also in API 2016-12-08 14:41:32 +01:00
Safihre
727aac9811 'Abort when cannot be completed' broke when files are removed from job
Gone is now really gone.
Closes #742
2016-12-08 14:41:32 +01:00
Safihre
6699c58d73 Faster re-connect-check after Config restart
Since we restart faster, we can check faster!
2016-12-08 14:41:32 +01:00
Safihre
d7a0147191 Implement direct restarts (when possible) 2016-12-08 14:41:32 +01:00
Safihre
a7697d4479 Remove web_watchdog
We shouldn't need this
2016-12-08 14:41:32 +01:00
Safihre
d603ad76b8 Stopping of DirScanner and PostProc doesn't need saving of state
save_state() already does this
2016-12-08 14:41:32 +01:00
Safihre
231dcea37e Move IPv6 and SSL checks to start of Downloader-thread
Reducing startup time by another 2 seconds
2016-12-08 14:41:32 +01:00
Safihre
d579c4d167 Shutdown CherryPy directly but gracefully without waiting 5 seconds
CP change to fix bug submitted as PR: https://github.com/cherrypy/cherrypy/pull/1528
2016-12-08 14:41:32 +01:00
Safihre
88e739606b Don't check port on startup twice
We just did it a few lines before!
2016-12-08 14:41:32 +01:00
Safihre
a922da5868 Significantly reduce startuptime by lowering CP check_port timeout 2016-12-08 14:41:32 +01:00
Safihre
5c329803aa Measure effects of slowdown over 10 seconds instead of 5 2016-12-08 14:41:32 +01:00
Safihre
0cb81d0642 Error when no x-bit and only add "python" when no shebang for .py
Closes #741
2016-12-08 14:41:32 +01:00
Safihre
b1b13f9b8b Update CherryPy License file 2016-12-08 14:41:32 +01:00
Safihre
cbfff5feea Update text files (readme/licenses)
Add RSS filter re-evaluation
Remove SSMTPlib license and the msgfmt (also mentioned in PythonParts license)
2016-12-08 14:41:32 +01:00
Safihre
dbe8e64b9e ssmtplib is part of Python 2.7 2016-12-08 14:41:32 +01:00
Safihre
dad46c06fb Update readme to reflect branch-usage better 2016-12-08 14:41:32 +01:00
Safihre
add7cafcb5 Notify if the port was changed
Closes #739
2016-12-08 14:41:32 +01:00
Safihre
e3d229104a CherryPy 8.1.2 - The .exe shouldn't restart with interpreter args 2016-11-30 10:34:38 +01:00
Safihre
ccf2ffb2d5 Update changelog for RSS changes 2016-11-30 10:34:38 +01:00
Safihre
d239b07900 Correct handeling of no Cryptography
When checking passwords and in the Config
2016-11-30 10:34:38 +01:00
Safihre
fe062f0b93 RarFile also requires patching of Crypto when packaging 2016-11-30 10:34:38 +01:00
Safihre
ab4103561f Disable RSS options for rules that don't accept 2016-11-30 10:34:38 +01:00
Safihre
8e447397b2 Add support for username:password in URLs
Closes #737
2016-11-30 10:34:38 +01:00
Safihre
7a746b6779 Show Category detected by SAB in RSS tables 2016-11-30 10:34:38 +01:00
Safihre
8e29b2a481 Add Sorting in RSS tables 2016-11-30 10:34:38 +01:00
Safihre
5434df4868 Show NZB post-age and time of Download 2016-11-30 10:34:38 +01:00
Safihre
780c7b6400 RSS page handles Add NZB on the same page 2016-11-30 10:34:38 +01:00
Safihre
ccca7f05c6 Show size and download-date in RSS Downloaded tab 2016-11-30 10:34:38 +01:00
shypike
489ca46fdf Add "From Show SxxEyy" accept filter.
Small optimization of the season/episode analysis by pre-compiling the regexes.
Show "Apply filters" button only when filters have changed or initial display.
2016-11-30 10:34:38 +01:00
shypike
01e8e64505 Don't re-evaluate RSS filters each time they change, use "Eval" button instead. 2016-11-30 10:34:38 +01:00
shypike
25998f1b0e Change RSS-filter "From-SxxEyy" from a Require to a Match filter
It now supports "Show.name.Sxx.Eyy" for matching show/season/episode in one filter.
This allows multiple independent show filters in one feed.
2016-11-30 10:34:38 +01:00
Safihre
97686dc14f Update files for 1.2.0 beta's 2016-11-25 15:06:31 +01:00
Safihre
6fbe450dcc Require x-bit to be set for scripts on non-Windows 2016-11-25 15:06:31 +01:00
Safihre
5f63b0c935 Test before applying downloader-delay 2016-11-25 15:06:31 +01:00
Safihre
04fa3c3115 MemoryError's should stop decoding 2016-11-25 15:06:31 +01:00
Safihre
36e2f28d51 Freeze-support for certgen
py2exe fails to build otherwise
2016-11-25 15:06:31 +01:00
Safihre
5c77f9d9b3 Rewrite speed-history to be more flexible 2016-11-25 15:06:31 +01:00
Safihre
a99a51e0d4 Re-use the same IP if server still has active threads
To avoid problems when re-connecting after for example a timeout. 

Closes #733
2016-11-25 15:06:31 +01:00
Safihre
2d091568f3 no_penalties now applies to all penalties
Closes #734
2016-11-25 15:06:31 +01:00
Safihre
a449b4b001 work_dir should not end on .par(2)
Otherwise par2cmdline gets angry.
2016-11-25 15:06:31 +01:00
Safihre
aa71dc1103 Improve texts for External access settings
Closes #729
2016-11-25 15:06:31 +01:00
Safihre
84cc86f1d3 Update to 1.1.1 and set version (#731) 2016-11-11 13:58:07 +01:00
shypike
0b0ff448d5 Update translations 2016-11-10 22:36:00 +01:00
shypike
b08e01f1c3 8th parameter for user-script wasn't passed correctly. 2016-11-03 10:51:26 +01:00
Safihre
fe0439382e Change tabs to 4 spaces in Config/Glitter 2016-11-03 09:28:36 +01:00
Safihre
bf89714926 Clean-up all par2 of a set
Closes #724
2016-11-03 09:28:36 +01:00
Safihre
25a9f9823d par2cmdline on Windows also needs -N 2016-11-03 09:28:36 +01:00
Safihre
bfb23b1dd5 RarFile needs shortened and de-unicoded filepaths
Normally we do this in build_command, but RarFile doesn't.
2016-11-03 09:28:36 +01:00
Safihre
f814f4cd8f QuickCheck would fail unicode files 2016-11-03 09:28:36 +01:00
Safihre
83ada782b8 Only shorten pathname on Windows for par2
Otherwise unicode paths are misformed and not detected. This is also how we do it for unrar.
2016-11-03 09:28:36 +01:00
Safihre
09ae033196 Unicode failed downloads are seen as Orphans due to xml_encoding
Need to force use of unicode, otherwise it incorrectly says they are orphaned
2016-11-03 09:28:36 +01:00
Safihre
ad1a8c302c Improve HTTPS on Config->General and improve Duplicates text 2016-11-03 09:28:36 +01:00
Safihre
c2f861146b Reduce Notifications template even more 2016-11-03 09:28:36 +01:00
Safihre
48ac57281c Significantly simplify Notifications template
They all have the same options..
2016-11-03 09:28:36 +01:00
Safihre
88f557f829 Update Categories page and texts 2016-11-03 09:28:36 +01:00
Safihre
8e0dae4d51 Implement user-sorting of Categories 2016-11-03 09:28:36 +01:00
Safihre
bfdd8e840d Adapt Glitter so it's not overwriting Categories 2016-11-03 09:28:36 +01:00
shypike
e1039f52e5 Improve category matching
When no other matches, try partial match of category name and indexer category.
Add comments and improve code.
2016-11-03 09:28:36 +01:00
shypike
a3e7076073 Update translations 2016-11-02 23:17:47 +01:00
shypike
3e2bded3c3 Update main POT file. 2016-11-02 23:16:50 +01:00
Safihre
a2a851d17f Detect and use all obfuscated par2 files
Using a trick to get handle_par2() to pick them up correctly.
2016-10-27 19:45:14 +01:00
Safihre
580e25de6d Use NZF's to do obfuscated check 2016-10-27 19:45:14 +01:00
Jonathon Saine
658544c305 When no parset defined (possible obfuscated), check for par2 signature.. rename first match. Repair, then repeat logic until all parsets have been processed.. then continue with processing as before. 2016-10-27 19:45:14 +01:00
Jonathon Saine
a872a2d2ee spelling fixes 2016-10-27 19:45:14 +01:00
Safihre
b1c5a28241 cryptography also nessecary to let RarFile open encrypted files 2016-10-27 19:45:21 +02:00
Safihre
df8046287e Check all passwords on first rar for definitive check
Closes #185
2016-10-27 19:45:21 +02:00
Safihre
627f998d25 Implement verification using unrar, when par2 and sfv not available
Closes #621
2016-10-27 19:45:21 +02:00
Safihre
52a30f5804 Log the executed command for Unzip and 7Zip 2016-10-27 19:45:21 +02:00
Safihre
b910574cdb Combine Encrypted/Unwanted files check 2016-10-27 19:45:21 +02:00
Safihre
de6d642b0d Adapt new rarfile for usage within SABnzbd
Closes #594
2016-10-27 19:45:21 +02:00
Safihre
7eb9dddf22 Update RarFile 2016-10-27 19:45:21 +02:00
Safihre
47b5f25dcf Merge pull request #711 from sabnzbd/bugfixes
Bugfixes and new features
2016-10-21 15:21:27 +02:00
Safihre
f5bb7d3cbe Glitter didn't allow removal of a set job-password
Closes #720
2016-10-20 11:04:06 +02:00
Safihre
b4a1d72013 Servertest broke on SSLError
For example when user had selected a bad cipher
2016-10-20 09:10:08 +02:00
Safihre
2faf951592 Revert UnRar licence to original 2016-10-20 08:58:39 +02:00
Safihre
063b2bcc5f Correct RegEx for par2-file detection 2016-10-19 15:26:16 +02:00
Safihre
fc2f527b15 Move SSL Ciphers option to Switches page
People should know it's possible. We put the explenation on the Wiki!
2016-10-19 10:35:29 +02:00
Safihre
47fa33a2a2 Fix on how aborted Par2/Unrar is reported 2016-10-14 15:32:27 +02:00
Safihre
6731d7be59 Enable certificate validation by default
When user has incorrect setup, the connect-to-well-known-host check will disable it anyway.
Closes #465 and #468
2016-10-14 15:03:25 +02:00
Safihre
91ce734d32 Cleanup of whitespace in Glitter/Config/wizzard 2016-10-14 14:54:58 +02:00
Safihre
b89394c819 Allow aborting of Par2/Unrar (Glitter only)
Closes #703
2016-10-14 14:48:53 +02:00
Safihre
2732edce09 Allow also "vol01-03.par" on top of "vol01+03.par" 2016-10-14 14:37:41 +02:00
Safihre
68f1b9234b Make sure we show results when less than 1 page
Closes #710
2016-10-14 08:42:16 +02:00
Safihre
81497e19ce Improve text on Delete-page button 2016-10-14 08:42:16 +02:00
Safihre
a0d3f8aa86 Update 7zip for Windows to 16.04 2016-10-14 08:42:16 +02:00
Safihre
4074ae3271 Update 7zip for macOS to 16.02
Best available for macOS
2016-10-14 08:42:16 +02:00
Safihre
7b197d93bc Update UnRar to 5.40 for Windows and Mac 2016-10-14 08:42:11 +02:00
Safihre
6b5cca4bb9 Avoid duplicates in build_filelists() that break 7zip support
Closes #706
2016-10-12 11:06:51 +02:00
Safihre
62971c0fd0 Remove Solaris Manifest
We don't really support it, nor does it seem in high demand
2016-10-12 10:18:47 +02:00
Safihre
8007d5a5d6 Remove Dockerfile (beter available from https://hub.docker.com) 2016-10-11 22:25:33 +02:00
Safihre
eb9421255d Check for Retry-After header when fetching fails
Closes #707
2016-10-11 09:25:17 +02:00
Safihre
8e97097dfd Only allow binding to IPv6 when ipv6_hosting enabled
For some reason it was always binding to IPv6, even when disabled (on Windows)
2016-10-10 15:59:38 +02:00
Safihre
b6972db5a7 CherryPy update long ago broke correct HTTPS port binding
The attach_server() could only bind HTTP ports because some change in CherryPy. Resulting of serving of HTTP on HTTPS port when set to localhost.
2016-10-10 15:31:07 +02:00
Safihre
755d904136 SSL handshake is performed automatically on connect() 2016-10-10 13:07:04 +02:00
Safihre
1052208d9e Verify the quality of certificate validation 2016-10-10 11:58:04 +02:00
Safihre
e259f624ad Detect when par2cmdline needs -N
Closes #705
2016-10-10 09:01:04 +02:00
Safihre
a77483ee31 Fix retry_all API-call 2016-10-09 17:55:58 +02:00
Safihre
201181ee6f Tiny change to Sorting debug logging
Closes #671
2016-10-07 14:42:41 +02:00
Safihre
2968b3c30e Change par2-classic to par2cmdline on Windows
Closes #702
2016-10-07 14:42:41 +02:00
Safihre
49a9fc7682 Avoid javascript error in Servers page 2016-10-07 14:42:41 +02:00
Safihre
0ff0c63903 Updates to INSTALL/ISSUES/README
Closes #676
2016-10-07 14:42:41 +02:00
shypike
0af084b4eb Fix emailer by converting account data to UTF-8 (#700)
It seems that the used libraries cannot handle Unicode, but only UTF-8.
2016-10-06 15:14:43 +02:00
Safihre
d75278b52b CSS fix for Config menu on mobile 2016-10-06 15:14:43 +02:00
Safihre
cf94729830 "Max line speed" more clear, using a select 2016-10-06 15:14:43 +02:00
Safihre
15d3ad5a96 Don't error out on Retry database errors
In case the job is somehow already gone
2016-10-06 15:14:43 +02:00
Safihre
bb231c7416 Fix ciphers input for older Python 2016-10-06 15:14:43 +02:00
shypike
a75b93699c Update .gitignore 2016-10-04 13:38:45 +02:00
Safihre
bf3e08868b Allow setting SSL cipher-string in Specials
For users who know what they are doing
2016-10-03 13:35:13 +02:00
Safihre
db9db1981c Log when creating new certificates
Closes #695
2016-10-03 13:35:13 +02:00
Safihre
4dff051927 Show SSL protocol and cipher in status window 2016-10-03 13:35:13 +02:00
Safihre
bb92059343 CherryPy 8.1.2 - LF in MIME records and don't crash on IPv6 in error msg
Even though it's against the protocol.
2016-10-03 13:35:13 +02:00
Safihre
1e72304c25 CherryPy 8.1.2 - Fix last SSL-bug 2016-10-03 13:35:13 +02:00
Safihre
692ed8fce8 CherryPy 8.1.2 - Update and set version 2016-10-03 13:35:13 +02:00
Safihre
6a12224b21 Don't choke when cryptography-module is not installed 2016-10-03 13:35:13 +02:00
Safihre
e8c7155c69 Update text-files and fix small CSS mistake 2016-10-03 13:35:13 +02:00
Safihre
a2e7e917d1 Custom error message when server doesn't speak SSL on specified port 2016-10-03 13:35:13 +02:00
Safihre
c73baaa3d2 Make "Certificate validation" option for each server 2016-10-03 13:35:13 +02:00
Safihre
09924a0f9c Fallback to non-verified connection when SSLContext is not available
For example on Python <2.7.9
2016-10-03 13:35:13 +02:00
Safihre
2a9a28cdb4 Improve error when bad certificate 2016-10-03 13:35:13 +02:00
Safihre
db6256c720 Use the correct hostname in case of happyeyeballs 2016-10-03 13:35:13 +02:00
Safihre
440a80c552 Generate certificates using Cryptography
Bye bye pyOpenSSL!
2016-10-03 13:35:13 +02:00
Safihre
a0e5eae244 Add option to set verification level 2016-10-03 13:35:13 +02:00
Safihre
6346ad96e4 First catch SSL errors, then general socket errors 2016-10-03 13:35:13 +02:00
Safihre
886803112d Remove option to choose SSL-level 2016-10-03 13:35:13 +02:00
Safihre
f277b8c534 Log SSL/TLS level and cipher after connecting 2016-10-03 13:35:13 +02:00
Safihre
a8d8db3a10 Remove pyOpenSSL from Config 2016-10-03 13:35:13 +02:00
Safihre
21549ab842 Switch CherryPy to use Python ssl instead of PyOpenSSL 2016-10-03 13:35:13 +02:00
Safihre
e8e2adcee0 Implement NNTPS using python ssl module
Removes need for PyOpenSSL for NNTPS connections, does require OpenSSL to be installed. This is the case on most modern systems (Linux/Windows/OSX), according to the Python docs!
2016-10-03 13:35:13 +02:00
shypike
3d4cdd7230 Merge pull request #693 from Safihre/develop
Safer limits for CPU limitation in Downloader
2016-10-01 16:56:33 +02:00
Safihre
5df3c24313 Fix order-selection box on Plush NZO-details page 2016-09-28 16:28:15 +02:00
Safihre
eb737619d9 RSS icon margin fix 2016-09-28 15:26:52 +02:00
Safihre
b120fb722d Safer limits for CPU limitation in Downloader 2016-09-28 15:02:10 +02:00
shypike
bd199627f9 Merge pull request #683 from Safihre/develop
Generate new HTTPS-certificates and more
2016-09-19 22:03:15 +02:00
Safihre
e27f0c5053 Show example for speedlimit in scheduler 2016-09-18 11:07:28 +02:00
Safihre
792d0ba319 Do not use Google to get RSS favicon 2016-09-17 20:17:12 +02:00
Safihre
e2a6517a89 #684 Update jQueryUi to 1.12.1 2016-09-16 18:52:27 +02:00
Safihre
1764fa29d1 Padding to None in tabbed warning section 2016-09-15 14:34:10 +02:00
Safihre
cdf0b0186a Add button re-generate self-signed certificates in Config 2016-09-15 14:34:10 +02:00
shypike
790bcd7bd6 Prepare text files for 1.2.0 2016-09-14 09:04:08 +02:00
shypike
a10a5a5f63 Fix crash in CherryPy when it reports problems with some IPv6 addresses.
A bug in Python's traceback logging causes a crash when an IPv6 address with an embedded % is reported.
2016-09-14 08:53:28 +02:00
shypike
53051a94ee Accept MIME records that have only LF line endings.
Some tool developers just ignore the rule requiring CRLF.
2016-09-14 08:53:14 +02:00
shypike
64479e2e5d Correct the merge of release 1.1.0 to the "master" branch. 2016-09-14 08:26:02 +02:00
shypike
13b523d9bd Merge pull request #681 from Safihre/master
Master to 1.1.0
2016-09-13 16:25:05 +02:00
Safihre
181881a21b Merge branch 'develop' 2016-09-11 22:16:42 +02:00
shypike
8abcf0856e Update translations 2016-09-10 10:37:36 +02:00
shypike
891798ec4d Update README.mkd 2016-09-10 10:34:37 +02:00
shypike
126321e431 Update text files for release 1.1.0 2016-09-09 23:25:31 +02:00
shypike
86348dee11 Update required CherryPy to 6.0.2 and correct INSTALL.txt 2016-09-09 23:09:06 +02:00
shypike
748ca0ea27 Re-use the NZO_ID after the pre-check run.
This lets 3rd party tools follow job progress through the API.
2016-09-06 20:53:33 +02:00
shypike
e63d5be38c Merge pull request #675 from Safihre/develop
Bugfixes after RC4
2016-09-05 21:55:17 +02:00
Safihre
b26a02371c Improve tabbed layout warnings/mobile 2016-09-05 21:37:06 +02:00
Safihre
f76a886622 More conservative decoding article-cache reserving 2016-09-05 17:36:09 +02:00
Safihre
2ee63f6c98 Testing server needs username/password obfuscation removed 2016-09-04 09:47:40 +02:00
Safihre
83164e221f Set can also not exist in partable 2016-09-03 20:43:41 +02:00
shypike
f9131f591f Force fail_hopeless_jobs to "enabled" by renaming it.
It's the best setting nowadays and most people don't change defaults.
2016-09-02 21:46:15 +02:00
shypike
e6b573e5ec Retries URL fetches should retain their Post-processing setting.
Closes #509
2016-09-02 19:42:19 +02:00
shypike
efa0d5590d Fix typos in README.mkd 2016-09-02 19:25:53 +02:00
shypike
e0189f0e6d Merge pull request #670 from Safihre/develop
Show Glitter tips only once
2016-08-30 10:03:40 +02:00
Safihre
4d34742f46 Show Glitter tips only once 2016-08-30 09:07:51 +02:00
shypike
34c24acb20 Update text files for 1.1.0RC4 2016-08-29 21:57:55 +02:00
shypike
7055b0a814 Merge pull request #668 from sanderjo/develop
Happy Eyeballs: Improved logging and comments
2016-08-26 21:06:08 +02:00
Sander
260c6b906c Happy Eyeballs: Improved logging and comments 2016-08-26 07:52:40 +02:00
shypike
adda8c8898 Merge pull request #660 from sanderjo/develop
Improved network stuff: unresponsive DNS and HappyEyeballs-with-memory
2016-08-25 18:14:58 +02:00
shypike
8e612d1945 Merge pull request #663 from Safihre/develop
Prospective par2 was broken
2016-08-25 18:13:51 +02:00
Safihre
1cf2c1a075 Don't count 'Checking' bytes in Queue-count 2016-08-23 20:05:49 +02:00
sanderjo
8db75be5a5 Happy Eyeballs: remember results to avoid redundant lookups 2016-08-23 18:42:14 +02:00
Safihre
732bf0cfa8 Par2 doesn't need to get removed again, done in add_parfile() 2016-08-23 18:17:39 +02:00
Safihre
6e803fa350 Multi-delete would refresh the queue for every deleted item
Wayyyyy too often
2016-08-23 18:17:39 +02:00
Safihre
a515194b1e Par2's were never really gone
This way postproc thinks that there were still par's left to try, putting the job back, causing a stall in the queue
2016-08-23 18:17:39 +02:00
Safihre
2485bf5c74 Don't start par2 with non-existing .par-file
If the first .par2 was corrupt, there can be a whole bunch more
2016-08-23 18:17:39 +02:00
Safihre
181969d4c6 True prevention of autofills 2016-08-23 18:17:39 +02:00
Safihre
4f972eeaf8 Prospective par2 was broken 2016-08-23 18:17:39 +02:00
Safihre
4ffc4d0879 Make bytes-downloaded correct after Retry 2016-08-23 15:55:53 +02:00
Safihre
604472afca Real bytes counter 2016-08-23 15:23:43 +02:00
shypike
96847baf08 Prevent crashes in dirscanner when encountering badly encoded file names.
Closes #644
2016-08-20 00:01:33 +02:00
sanderjo
332d3a9418 Solve delays in case of non-responding DNS 2016-08-19 23:55:28 +02:00
shypike
776a185fc5 Merge pull request #658 from Safihre/develop
Fixes and Rating upgrade
2016-08-19 14:25:26 +02:00
Safihre
0757706ad3 Stop and remove files in assembler when job removed 2016-08-19 13:58:24 +02:00
Safihre
12a622a21f Use NZO.is_gone() for status 2016-08-19 13:12:46 +02:00
Safihre
619f553de1 Don't send rating-apikey if not filled 2016-08-18 23:19:47 +02:00
Safihre
785bf3f2a3 Update Wiki-links to /1.1/ 2016-08-18 12:33:35 +02:00
Safihre
fbee96d62f SSL level will be set by default to v23 using ssl_method 2016-08-17 10:02:32 +02:00
Safihre
2253e7b09f Change Error to Warning for temporary server errors
Keep the Error for failed login, this is bad.
2016-08-17 10:01:56 +02:00
Safihre
eb3801a918 Extend Rating functionality
Fields can now also be submitted as X-RATING headers during the URL-grab. Instead of just supplying a host, it is also possible to send a X-RATING-URL for more flexability
More: https://github.com/nZEDb/nZEDb/issues/2235
2016-08-17 08:34:44 +02:00
Safihre
aaf3bbb631 Fix mistake in rating adding
Would never allow values longer than 1, like a score of 10. And all info is also in nzo_info.
2016-08-16 17:22:50 +02:00
Safihre
1a66372e9b #657 Add days when hours > 23 2016-08-16 11:06:55 +02:00
Safihre
f5a28a2e56 Proper Script-output escaping
urllib.quote() makes everything to go in an URL, that's not what we need. 
Now also there will not be shown a "(more)" button when there is just 1 output line
2016-08-16 09:25:22 +02:00
Safihre
1fd6a8b1ac Remove obsolete part of history 2016-08-16 08:46:47 +02:00
Safihre
e632f8065d Upgrade jQuery (2.2.2->2.2.4) and jQueryUI (1.11->1.12)
No real changes for us, we already didn't support IE lower than 10.
2016-08-15 10:30:28 +02:00
Safihre
2e0e94a164 #656 Move switches to Specials for Unrar/Unzip/7zip/FileJoin/TSJoin 2016-08-15 08:12:16 +02:00
Safihre
7078af7d23 SSL was not set to highest-possible by default 2016-08-13 12:21:48 +02:00
Safihre
0a8a22090c #649 Warnings in seperate tab when Tabbed Layout 2016-08-13 11:20:23 +02:00
shypike
4d193061cc Merge pull request #655 from Safihre/develop
Safhire's fixes.
2016-08-13 10:31:07 +02:00
shypike
14c6eeef69 Prevent issues when decoding unknown 8-bit ASCII names. 2016-08-13 10:13:10 +02:00
Safihre
2e7f2d2272 Downloader optimzation only when #con >= 8 2016-08-12 21:49:57 +02:00
Safihre
803a695c00 Lower CPU usage when maxing out connection 2016-08-12 21:39:52 +02:00
Safihre
cced1b317c Windows tray icon wasn't terminated properly on restart
So if you restart SABnzbd, the icon would stay untill you hover your mouse over it
2016-08-12 21:39:52 +02:00
Safihre
641b6ecf35 Encrypted=2 is wrong status code 2016-08-12 21:39:52 +02:00
Safihre
ba9952ca50 disk2 info would show sometimes due to timing
Sometimes if there's only once a tiny difference between disk1 and disk2, it will always show disk2 because it never gets removed again. This can be caused by slight timing issue when calculating free space for disk1 and disk2. Mostly on very fast connections.
2016-08-12 21:39:52 +02:00
paradix
5aac0999ed Handling archives with multiple NZBs from API add_url call (#502)
* archive file per url support

* archive file handling from url

* append .nzb extension when needed

* Update dirscanner.py
2016-08-12 20:33:10 +02:00
shypike
5c5b23ffb5 Update text files for 1.1.0RC3 2016-08-11 22:43:24 +02:00
shypike
96ba468012 Update translations 2016-08-11 19:17:24 +02:00
shypike
fcc9ac8590 Merge pull request #653 from Safihre/develop
Safihre's improvements.
2016-08-11 15:51:35 +02:00
Safihre
763a5f320d If keep_basic then keep the folder
Minor-minor bug I saw appearing in the log
2016-08-11 15:26:43 +02:00
Safihre
9f4387f003 Use Enclosures also for size in RSS 2016-08-11 11:35:17 +02:00
Safihre
f0e11f3024 History wasn't updated on url-grab-fail 2016-08-11 00:16:32 +02:00
Safihre
dda9e70fea Move Rating-host setting to Switches page
For more visability and to show we support more than just OZnzb, if the indexer supports it.
2016-08-10 18:30:00 +02:00
Safihre
0c012fc71c Remove references to OZnzb 2016-08-10 17:46:50 +02:00
Safihre
f17d3bd6b3 More thread-saftey for NZO 2016-08-10 16:31:13 +02:00
Safihre
6dcfb7c801 Only check first usable rar-file for password 2016-08-10 16:05:07 +02:00
Safihre
8096ff8636 Avoid double saves of NZO 2016-08-10 16:05:05 +02:00
Safihre
475b64abb8 Increase save-delay for NZO 2016-08-10 16:05:02 +02:00
Safihre
6b372d2cd7 Only check rar-contents when UnwantedExtensions enabled
Perfmance boost!
2016-08-10 16:04:55 +02:00
shypike
ed250ec379 Revert "Save totals must use copies of the dictionaries to prevent save errors."
This reverts commit c28a9ea192.
2016-08-10 14:35:32 +02:00
Safihre
d976ecbff4 More FAILED checks to be super-super-sure 2016-08-10 14:35:29 +02:00
shypike
d2588f206e Remove traces of obsolete crash detection. 2016-08-10 13:22:29 +02:00
Safihre
d3a8ad18a8 Allow also multiple files from the Upload-form 2016-08-10 12:16:21 +02:00
Safihre
9e65192918 Show actual working upload-counter 2016-08-10 12:16:21 +02:00
shypike
2cc7120ada Prevent a failed job from saving new admin files. (#652)
Can happen when a job is aborted due to the "abort if cannot be completed" option.
Some outstanding articles may still come in after the job is set to "failed".
2016-08-10 12:15:33 +02:00
shypike
4225e1a9eb make_mo.py now detects warnings about missing arguments in texts.
Program exit code will be 2 when any warning is detected.
2016-08-10 10:30:02 +02:00
shypike
7828258bf4 Fix error in Dutch translation 2016-08-09 23:57:30 +02:00
shypike
31288e570d Update translations 2016-08-09 23:50:39 +02:00
shypike
ee5130f9b2 Previous PyLint cleanup revealed hidden errors
The code used sabnzbd.SCAN_FILE_NAME instead of SCAN_FILE_NAME.
The code used sabnzbd.RSS_FILE_NAME instead of RSS_FILE_NAME.
The option --autorestarted wasn't recognized.
2016-08-09 23:46:54 +02:00
shypike
9e46f8adbc A lot of nonfunctional changes from PyLint advice.
One functional change: failed close file due to missing parenthesis.
2016-08-09 22:55:21 +02:00
shypike
4bdbf63866 Merge pull request #651 from Safihre/develop
Glitter and TryList fixes part 2
2016-08-09 21:20:14 +02:00
Safihre
6506646e00 Catch all needed update-times 2016-08-09 20:01:57 +02:00
Safihre
446e676ec1 "Delete page" also deleted jobs waiting for PP 2016-08-09 19:52:49 +02:00
Safihre
c0c645f366 #650 Only do new request after previous finishes 2016-08-09 19:52:46 +02:00
Safihre
9608702e75 The NZBQueue TryList also needs a reset 2016-08-09 19:47:36 +02:00
Safihre
2558fc33a7 Glitter can sort history without API change
Oops!
2016-08-09 19:47:36 +02:00
shypike
2811e5ae7d Fix potential crash when running user notification script
Also fix some other (minor) issues reported by PyLint.
2016-08-09 16:52:18 +02:00
shypike
3a426e9367 Restore capability of unpacking multi-volume 7Zip archives.
The security-related restriction "-t7z" must be "-tsplit" for multi-volume archives.
2016-08-09 16:20:39 +02:00
shypike
53abb84f5e Ignore .pyd too 2016-08-09 16:00:24 +02:00
Safihre
80e89ee1f0 Add index to history-API so Glitter sorting isn't stupid (#648) 2016-08-09 15:15:29 +02:00
shypike
c28a9ea192 Save totals must use copies of the dictionaries to prevent save errors. 2016-08-09 15:05:30 +02:00
shypike
4837d05217 "Prospective par2" must only reset try-lists of the nzo, not of the whole queue.
No need to reset whole queue.
Nasty side-effect: the queue-reset claims another lock, which can lead to deadlock.
2016-08-09 15:02:08 +02:00
shypike
380b5acaeb Update translatable texts. 2016-08-08 21:15:12 +02:00
shypike
657dc6d00c Thread-safety for NzbObject data.
Multi-threaded access to NZO objects may prevent disk saves from working.
Protect all critical NzbObject-methods with IO_LOCK.
Move bulk of prospective-par2 function to NzbObject.
2016-08-08 19:03:10 +02:00
shypike
620c493839 Add retries to database action, when database is locked.
Remove a few obsolete imports.
2016-08-08 19:03:10 +02:00
shypike
edafbeba8e Ensure script output is always HTML-safe. 2016-08-08 19:03:10 +02:00
shypike
8784faf119 Merge pull request #643 from Safihre/develop
Fixes
2016-08-08 19:01:32 +02:00
Safihre
e16bbc0362 SSL labels should be returned as a function 2016-08-08 17:41:28 +02:00
Safihre
3464450337 Add notification about (new) Glitter features 2016-08-04 13:48:26 +02:00
Safihre
ceefffa7f7 Change text to 'HTTPS certificate verification' 2016-08-01 14:58:27 +02:00
Safihre
a62789c4ea Remove code for v0.5.x
And remove a typo
2016-08-01 14:32:02 +02:00
Safihre
d92664e08d Human readable SSL labels on first Config page
Also set v23 first, since it means negotiate max
2016-08-01 14:17:56 +02:00
Safihre
2d5b885f1f Show Encoding on first Config page 2016-08-01 13:26:19 +02:00
Safihre
c43098d02f Encoding was logged twice (line 1250)
Also remove logging unwanted extensions, that's also included when exporting log
2016-08-01 13:11:27 +02:00
Safihre
c67278e3a5 Fix Wiki link 2016-08-01 13:09:10 +02:00
Safihre
dadef20fc9 Don't show Sanatize for Windows, on Windows. Format AllPar2 2016-08-01 12:55:30 +02:00
Safihre
d6218aa937 Move AM/PM switch to Specials
Only applies to SMPL template
2016-08-01 12:55:19 +02:00
Safihre
855a3393c7 fail_hopeless=True by default
Usefull for new users, since all the posts that are taken down by DCMA nowadays
2016-08-01 12:55:09 +02:00
Safihre
6fc95ada55 Update text to Scripts Folder 2016-08-01 12:54:58 +02:00
Safihre
ef483c7e01 Display message to help translate when user has non-English
Since there is almost no exposure anywhere else, this way we can recruit some translators.
2016-08-01 12:54:47 +02:00
Chris
01e01fb7ef Only redirect browser on restart if port configuration changed (#633)
* Only redirect browser on restart if port configuration changed

* Implement port config change detection & redirect on the client side
2016-07-26 19:00:00 +02:00
shypike
fbc8453483 Merge pull request #639 from Safihre/develop
Add HTTPS checkbox to Switches
2016-07-26 18:54:47 +02:00
Safihre
21c581af1f Fix the job index in the API/templates 2016-07-26 16:00:35 +02:00
Safihre
86504613dd Fix #634 by not HTML-converting the Script-stagelog 2016-07-26 15:11:37 +02:00
Safihre
feb7cd36b6 Add HTTPS checkbox to Switches 2016-07-26 12:45:28 +02:00
shypike
28dd8f374a Update translations 2016-07-23 13:25:20 +02:00
shypike
23b922e805 Add credit for XSS vulnerability discovery 2016-07-21 13:56:36 +02:00
shypike
5fc61f7e6d Update text file for 1.1.0RC2 2016-07-20 19:04:18 +02:00
shypike
9b5ae99e9c Erase server error and warning when an article has been received. 2016-07-20 18:45:21 +02:00
Safihre
fe579f61e0 Fix Notification Script and add Parameters-field (#629)
Improve User Notification script.

- Fix Notification Script and add Parameters-field
- The notification text was never send to the script and the return code and return-text of the script were reversed.
- Errors from the Notification script were not shown; if something is wrong, the user should know
- Not breaking existing translations for Script Error
2016-07-19 12:29:03 +02:00
shypike
ba3021132a Merge pull request #625 from Safihre/develop
XSS and stalling
2016-07-15 19:48:00 +02:00
Safihre
c602e46d8e Allow <br/> tags in History details 2016-07-15 19:15:59 +02:00
Safihre
092cc8141a Another anti stalling fix for Prospective 2016-07-14 22:46:10 +02:00
Safihre
d26b3bc351 Correctly handle HTML in filenames in History 2016-07-14 16:47:38 +02:00
shypike
67ccb721a1 Add the module "six".
This PyPi module is required by CherrPy 6.02+,
but is not available on all platforms.
2016-07-13 18:12:39 +02:00
shypike
d93db1dbd2 Make sure that the invoking window disappears 2016-07-13 08:36:05 +02:00
shypike
7ace55b9a7 Merge pull request #623 from Safihre/develop
Bug fixes after 1.1.0 RC1
2016-07-12 14:33:03 +02:00
shypike
3d45993d60 Fix README.mkd 2016-07-09 15:11:32 +02:00
Safihre
17500097f7 Add PID to shutdown URL 2016-07-08 09:56:32 +02:00
Safihre
be15e29d83 Fix passwords being forgotten on name edit 2016-07-06 11:03:10 +02:00
Safihre
7383c47791 CherryPy's urljoin was moved to different library 2016-07-06 11:02:58 +02:00
shypike
aa12e2190f Update text files for 1.1.0RC1 2016-07-05 21:41:41 +02:00
shypike
f32ba6fda9 Merge pull request #609 from sabnzbd/feature/cherrypy602
Feature/cherrypy602
2016-07-05 21:39:52 +02:00
shypike
c8b4b9db94 Patch CherryPy 6.0.2 : Implement 301 redirection for http-->https
Needed for Bonjour support.
2016-07-05 21:38:43 +02:00
shypike
7893f90d26 Patch CherryPy 6.0.2: Prevent crash when encountering a pathless URI. 2016-07-05 21:38:43 +02:00
shypike
5654569c22 CherryPy 6.0.2 patch: to avoid Unicode bugs in PyOpenSSL 0.14
On some systems this resulted in a crash.
2016-07-05 21:38:43 +02:00
shypike
811b625d52 CherryPy 6.0.2 patch: hard-code the version number 2016-07-05 21:38:43 +02:00
shypike
42bba99831 Move to CherryPy 6.0.2, official distribution 2016-07-05 21:38:43 +02:00
shypike
cb3dba196e Merge pull request #607 from Safihre/develop
Fixes and adding sabnzbd.ini to logging
2016-07-02 14:12:40 +02:00
Safihre
36fb621f44 Empty TryList when adding a new par2 file
Otherwise they don't get tried anymore for this file
2016-07-01 17:06:23 +02:00
Safihre
df02fcf519 Catch abort for history-update 2016-07-01 17:00:47 +02:00
Safihre
07e03bc7b9 Update Wiki-link 2016-06-30 15:59:52 +02:00
Safihre
cc2aab83f0 Anonymize more INI variables 2016-06-24 09:25:57 +02:00
shypike
8e0846a682 Require Python 2.7 only
Also fix a typo and remove obsolete debugging function.
2016-06-23 21:12:34 +02:00
Safihre
ba0a0045db Add anonymized sabnzbd.ini to the end of the log 2016-06-23 13:56:54 +02:00
Safihre
6a30ae0bd1 Fix time-left on second page of every skin 2016-06-23 13:56:52 +02:00
Safihre
68299ed1e7 Sometimes Glitter history wasn't updated after partial updates 2016-06-22 14:44:47 +02:00
Safihre
8324f7713f Small stylistic changes to code 2016-06-22 14:28:38 +02:00
Safihre
118fb1cd60 Show server warnings seperatly 2016-06-22 14:21:54 +02:00
shypike
528c7c1410 Fix missing attribute in NzbObject
Side-effect of previous commit.
2016-06-20 08:17:52 +02:00
shypike
a6cda3fe5c Windows: a job with accented chars would get a malformed name when retried.
The SABnzbd_attrib file is always encoded in UTF-8,
so independent of the file system encoding.
2016-06-18 14:09:33 +02:00
shypike
38f03a0c53 Solve race-condition in delete from history.
If an API call History-Delete wants to delete the running job while it has
just reached FAILED or COMPLETED, but not quite finished, things go wrong.
When the actively processed NZO has status FAILED or COMPLETED,
just set a flag and let the post-processor itself clean up the job afterwards.
2016-06-18 00:01:36 +02:00
shypike
6108f9c703 Prevent crashes when scanning non-conforming file names after unpack action. 2016-06-15 23:00:01 +02:00
shypike
abe35f9100 Restore compatibility with smpl skin 2016-06-15 22:51:00 +02:00
Safihre
2ce125789c Avoid auto-filling from password managers (#596) 2016-06-15 12:28:31 +02:00
shypike
5c88c9ae39 Correct typo in previous commit
Method execute() should return False in most error situations.
2016-06-14 08:43:14 +02:00
shypike
6c24a1c630 Make history database error recovery robust and improve code.
Make more robust:
- Put a lock on HistoryDB() class initialization to prevent re-entrant database creation
- Improved recovery from corrupt databases
- Add some exception handling to potential crash cases

Make code nicer.
- Add method comments
- Replace global variables with class-attributes
2016-06-13 22:13:04 +02:00
shypike
86d11095ac Merge pull request #592 from sabnzbd/1.0.x
Update master to 1.0.3
2016-06-10 19:01:03 +02:00
shypike
6f65d47360 Update text files for 1.1.0Beta1 2016-06-10 18:59:22 +02:00
shypike
7436ac75d6 Remove unused TryList method 2016-06-10 18:43:55 +02:00
shypike
f377f161c8 Pythonify config.py a bit more. 2016-06-10 18:43:55 +02:00
shypike
6682ba37d4 Prevent post-processor crash when end-of-queue script does not exist. 2016-06-10 18:43:55 +02:00
shypike
84a6b8f400 Log the preferred character encoding 2016-06-10 18:32:06 +02:00
shypike
927ba3cd9d Update text files for 1.0.3 2016-06-04 13:34:11 +02:00
Safihre
6296fc1762 #568 Add code 482 to check for too-many-connections 2016-06-03 23:24:07 +02:00
shypike
60fbe44724 Support X-DNZB-PASSWORD header. 2016-06-03 22:18:56 +02:00
shypike
29e45da431 Fix NZB association for Windows.
Make sure that the second SABnzbd instance sends an UTF-8 encoded URL to the first instance.
Otherwise CherryPy will reject the API call.
2016-06-03 22:07:44 +02:00
shypike
4f2db339ca Fix NZB association for Windows.
Make sure that the second SABnzbd instance sends an UTF-8 encoded URL to the first instance.
Otherwise CherryPy will reject the API call.
2016-06-03 21:55:30 +02:00
shypike
81c808b369 Handle checksum error reports from unrar. 2016-06-02 23:20:26 +02:00
shypike
d82e69eef4 Handle checksum error reports from unrar. 2016-06-02 23:19:57 +02:00
shypike
8c7d557252 Prevent job from hanging when adding back par2 files.
Sometimes already completed par2 files are being re-added to the queue as extra par2 files.
Because these files are already complete, there will be no attempt to download them
and as a result they will never leave the queue.
2016-06-02 22:11:59 +02:00
shypike
7beeb084a5 Prevent job from hanging when adding back par2 files.
Sometimes already completed par2 files are being re-added to the queue as extra par2 files.
Because these files are already complete, there will be no attempt to download them
and as a result they will never leave the queue.

Additionally: prevent a negative number for bytes to download.
2016-06-02 21:50:35 +02:00
shypike
a83e9f3a58 Merge pull request #584 from Safihre/develop
SFV verification fixes
2016-05-30 13:45:25 +02:00
Safihre
23b8685418 Glitter cut the stage-log texts incorrectly
It would put the last lines on top
2016-05-30 13:32:06 +02:00
Safihre
353758227b No status was displayed for SFV verification 2016-05-30 13:23:44 +02:00
Sander
36f3bdec8a Happy Eyeballs: typo's fixed (#583) 2016-05-29 23:21:21 +02:00
shypike
f5a017e82c Merge pull request #581 from Safihre/develop
Small fixes
2016-05-29 15:16:00 +02:00
shypike
4c6fa307a8 Support X-DNZB-PASSWORD header. 2016-05-29 15:13:42 +02:00
Safihre
9a077df6ae Updating cache-text cannot be done in skintext.py
It can only be updated in the places where the text is used, otherwise the translations brake.
2016-05-29 13:25:08 +02:00
Safihre
d5d5a9f2af Use already translated text for Restore Defaults
Show the section name to make clear that we only reset this section
2016-05-29 13:21:49 +02:00
Safihre
baa7c06250 Change icon of 'Restore Defaults' 2016-05-26 14:34:26 +02:00
Safihre
9acfbd616d Send 403 when denied access 2016-05-25 11:11:40 +02:00
Safihre
e70e0f16b1 Never show negative time left 2016-05-24 14:16:03 +02:00
shypike
a56d6e5517 Merge pull request #577 from sabnzbd/1.0.x
1.0.x to master
2016-05-23 18:11:23 +02:00
Safihre
fcbf0e6a8c Small fix in README 2016-05-23 15:01:15 +02:00
Safihre
bd7ac070ca Another check to make sure decoder doesn't stall 2016-05-23 15:01:15 +02:00
shypike
26fe174ba9 Merge pull request #576 from Safihre/develop-forpull
Fix error in article cache
2016-05-20 21:25:21 +02:00
Safihre
1f60cf8cd3 Download would halt when cache was filled 2016-05-20 21:04:37 +02:00
Safihre
e095bd9247 Stylistic text changes 2016-05-20 21:04:34 +02:00
Safihre
1e9e2f7d89 Downloader was not activated instantly when unpausing single
Had to wait up to 30 sec for the downloader to notice there was a new job.
2016-05-18 14:57:13 +02:00
Safihre
b741d780f7 Do not notify for resume on startup 2016-05-18 14:57:11 +02:00
shypike
90f0c4e21a Merge pull request #565 from Safihre/develop
Fixes part n+1
2016-05-17 21:32:56 +02:00
Safihre
fa496e45ac #558 Also anonymize username in log 2016-05-16 11:33:36 +02:00
shypike
2dc4e66a02 Update 7zip for Windows to latest release and enforce 7zip format when unpacking (part2)
Forgot the newsunpack.py change.
2016-05-15 12:52:03 +02:00
Safihre
fdeaf140a3 #558 Anonymized Debug Logs 2016-05-15 12:49:54 +02:00
Safihre
43ec0d1baf #568 Add code 482 to check for too-many-connections 2016-05-15 12:49:37 +02:00
Safihre
ed1ae75d66 #572 Update RSS interval directly - Fixed 2016-05-15 12:49:27 +02:00
shypike
462a47c927 Update 7zip for Windows to latest release and enforce 7zip format when unpacking.
To protect against recently discovered 7zip vulnerabilities we took some precautions.
http://blog.talosintel.com/2016/05/multiple-7-zip-vulnerabilities.html

The Windows version of 7za has been updated to a non-vulnerable version.
We force 7za to only unpack actual 7zip archives.
This should make exploitation of the UDF- and HFS-vulnerabilities in the 7zip tools impossible.
2016-05-15 12:47:19 +02:00
shypike
ad18406dd6 Don't add discarded duplicate segments to the total download amount. 2016-05-15 09:20:59 +02:00
Safihre
1849af92f5 Correct calculation of download size
Because files can already be partly downloaded before ending up on the extras-list!
2016-05-14 22:56:01 +02:00
Safihre
836aaa2271 Remove &nbps; from server details report 2016-05-14 20:11:14 +02:00
Safihre
af35ac318e Fix space reserved for decoder cache
Data only represented a list of references, not the size of actual text.
2016-05-14 20:11:14 +02:00
Safihre
f8075270be Add 'Restore Defaults' for Switches page 2016-05-14 20:11:14 +02:00
Safihre
fa18c1bda2 Change name of last_history_call to last_history_update
To make it a little more clear what it does
2016-05-14 20:11:14 +02:00
Safihre
5bc6f2b12c Remove asserts throughout code
These cause tremendous (20%) slowdown when run from Python files, especially in the downloader.
2016-05-14 20:11:14 +02:00
Safihre
a204bbe720 Make decoder-queue part of the article-cache
Especially with small article sizes the decoder queue could fill up very quickly causing the downloader to be delayed, even though the system could easily handle them
2016-05-14 20:11:14 +02:00
Safihre
35607d69e0 Drop support for UUencode and show notice when detected
UUencode would only be interesting if we actually supported multipart-UUencode, but we don't.. Only the (never seen) singlepart one.
2016-05-14 20:11:14 +02:00
Safihre
0b29596aab Show only 1 warning when server connection problem 2016-05-14 20:11:14 +02:00
shypike
80e317cad6 Correct calculation of download percentage.
Extra pars which are queued for actual download should not be subtracted from total.
2016-05-14 19:44:43 +02:00
shypike
7ae3a96fb7 Update main POT file. 2016-05-14 14:56:45 +02:00
shypike
9f89601c82 Prevent download percentage from going over 100%
When all par files are filed for download after a failed QuickCheck,
these par files need also to be removed from the extrapar collection of the job.
2016-05-14 12:44:49 +02:00
shypike
859273dec2 Use value from "Status" class for "Propagating" status. 2016-05-13 17:53:33 +02:00
shypike
414ce01424 Fix API compatibility of queue.
The new status DELETED should not be returned by the API.
Tools may not be able to handle it and it's only useful for internal purposes.
2016-05-11 19:12:05 +02:00
shypike
7b4965a940 Prevent Completed and Failed jobs from getting status Deleted. 2016-05-11 19:08:03 +02:00
shypike
a89c04c409 Prevent stalling at 100% when QuickCheck is Off and "Download-all-pars" is On.
The repair function sent all extra par2 files back to the queue
even though they were already downloaded.
2016-05-11 19:07:50 +02:00
shypike
d184d99026 Set default cache size to 450MB on Windows and OSX. 2016-05-11 19:07:20 +02:00
shypike
e1fc427573 Fix potential race condition in BPSmeter. 2016-05-11 19:04:13 +02:00
shypike
f03d3abf9a Accept MIME records that have only LF line endings.
Some tool developers just ignore the rule requiring CRLF.
2016-05-11 19:03:48 +02:00
shypike
3a42b4d02a Fix handling of changed "ignore_samples" option.
Closes #510
2016-05-11 19:00:45 +02:00
shypike
4db550c22c Fix crash in CherryPy when it reports problems with some IPv6 addresses.
A bug in Python's traceback logging causes a crash when an IPv6 address with an embedded % is reported.
2016-05-11 19:00:30 +02:00
shypike
4723b215e3 Fix --ipv6_hosting option.
Repairs commit 1cbff28
2016-05-11 19:00:05 +02:00
shypike
3723ba7c7d Disable listening on IPv6 addresses by the internal web server.
Setting Config->Special->ipv6_hosting to 1 will enable IPv6 listening.
Command line option --ipv6_hosting allows forcing the choice, should SABnzbd not start.
Closes #492
2016-05-11 18:59:47 +02:00
shypike
4fdd022959 Set default for https verification to off. 2016-05-11 18:43:32 +02:00
shypike
7548d9e975 Correct base version number for 1.0.x releases. 2016-05-10 14:43:14 +02:00
Sander
f12d4bb435 Log "Preferred Encoding", useful for debugging Unicode problems 2016-05-06 14:03:28 +02:00
shypike
b7e2bd9684 Update text files for 1.0.2 2016-05-03 19:39:45 +02:00
shypike
f0a243e3d3 Fix API status issues.
Remove the "ToPP" status, it serves no purpose.
Only truly deleted jobs should get the "Deleted" status,
not jobs moving from Download to PP queue.
2016-05-01 14:42:07 +02:00
shypike
6e108c9ef2 Prevent Completed and Failed jobs from getting status Deleted. 2016-04-30 11:47:03 +02:00
shypike
89edcc1924 Log the preferred character encoding 2016-04-30 11:18:32 +02:00
shypike
fd315693a9 Merge pull request #556 from jcfp/patch-1
systemd service: add wiki link, remove group handling, housekeeping
2016-04-29 16:11:37 +02:00
jcfp
d375e7901a systemd service: add wiki link, remove group handling, housekeeping
Removing Group=%I because it (wrongly) assumes every username always has a matching groupname. Not specifying a group will simply make systemd use the default group for the given user.
2016-04-29 00:10:21 +02:00
shypike
8a6aca47a1 Prevent stalling at 100% when QuickCheck is Off and "Download-all-pars" is On.
The repair function sent all extra par2 files back to the queue
even though they were already downloaded.
2016-04-28 22:42:51 +02:00
shypike
d03e5780b8 Fix API compatibility of queue statuses.
The new statuses TO_PP and DELETED should not be returned by the API.
Tools may not be able to handle them and they are only useful for internal purposes.
2016-04-27 12:03:37 +02:00
shypike
de26f63026 NNTP error 502 should not aways be interpreted as bad login.
It can also mean "too many connections".
2016-04-27 11:53:15 +02:00
shypike
209d8f9b40 NNTP error 502 should not aways be interpreted as bad login.
It can also mean "too many connections".
2016-04-27 11:52:56 +02:00
shypike
c257b1be3d Update text files for 1.0.1 2016-04-26 19:57:22 +02:00
Safihre
2c48c8de2e Force MIME types for CSS and JS files
Caused problems on Windows if external programs overwriten it in registery.
See: http://forums.sabnzbd.org/viewtopic.php?f=2&t=20490
And: https://www.reddit.com/r/usenet/comments/4fkmcx/my_sab_interface_is_text_only/
2016-04-26 19:48:47 +02:00
shypike
a767ef6aed Fix API compatibility of queue.
The new statuses TO_PP and DELETED should not be returned by the API.
Tools may not be able to handle them and they are only useful for internal purposes.
2016-04-26 19:47:38 +02:00
Safihre
ab5b240bde 'session' should also be allowed instead of just 'apikey'
Because of new check introduced previously
2016-04-26 10:13:03 +02:00
Safihre
a19829055d Move expensive for-loop to downloading proccess 2016-04-25 16:22:27 +02:00
Safihre
30cfa5b67a Fix some links in Plush 2016-04-23 16:31:59 +02:00
Safihre
7555eb4e25 Remove another for-loop and add nzf.subject if no nzf.filename 2016-04-23 16:23:47 +02:00
Safihre
78a999af34 Force MIME types for CSS and JS files
Caused problems on Windows if external programs overwriten it in registery.
See: http://forums.sabnzbd.org/viewtopic.php?f=2&t=20490
And: https://www.reddit.com/r/usenet/comments/4fkmcx/my_sab_interface_is_text_only/
2016-04-22 22:36:57 +02:00
Safihre
86339c4393 Create new ICO files 2016-04-22 22:36:57 +02:00
Safihre
5810d36079 NZB/API key are read-only
They always have been, but now the user won't have the illusion they can change it
2016-04-22 22:36:57 +02:00
Safihre
c677116992 Remove references to SourceForge in RSS 2016-04-22 22:36:57 +02:00
Safihre
69b6d5fead TAPI needs extra check
In case api-key is disabled but password enabled, it would give full access even though it shouldn't.
2016-04-22 22:36:57 +02:00
shypike
073f7afdf7 Remove tabs and trailing spaces.
These things give needless differences in commits.
Contributors: instruct your editor to use spaces instead of tabs and to remove trailing spaces.
2016-04-22 21:59:47 +02:00
shypike
36b7b4b26b Optimize by removing file lists from the queue API calls.
File lists per job are only needed to edit a single job,
so only supply them to the API call "get_files".
2016-04-22 21:59:47 +02:00
Safihre
2cf2406ecd Remove for's in gather_info 2016-04-22 21:59:47 +02:00
Safihre
da832c1a4a Glitter Limited refresh had no item limit or start
Causing slowdown in back-end on big queues
2016-04-22 21:59:47 +02:00
Safihre
55c6a98ab1 Remove queue verbosity option and clean up build_queue 2016-04-22 21:59:47 +02:00
Safihre
5d84067db4 Remove those legacy variables 2016-04-22 21:59:47 +02:00
Safihre
d9239fa0ac Extend CherryPy timeout to 10min for API-calls 2016-04-22 21:59:47 +02:00
Safihre
a62c498298 Only save article cache to disk on pause 2016-04-22 21:59:47 +02:00
shypike
890a093054 Optimize API by removing queue queries for functions that don't need it.
Config pages, History page and related API calls have no need for Queue info,
so don't waste time on it.
Optimize queue report by not formatting unneeded elements.
Reduce at the lowest level, so nzo.gather_info() should only return the requested selection.
Large impact on parameter passing.
It should remain compatible with the current API-s.
2016-04-22 21:59:47 +02:00
shypike
ad61d1dd03 The pre-queue script can now return an accept value of 2, meaning immediate failure.
Supports front-ends which need the signal that an NZB has been
rejected by the pre-queue script.
2016-04-22 21:54:45 +02:00
shypike
dd066f0fd3 The pre-queue script can now return an accept value of 2, meaning immediate failure.
Supports front-ends which need the signal that an NZB has been
rejected by the pre-queue script.
2016-04-22 21:54:26 +02:00
shypike
33c3d187a0 Add start script for portable Windows installations 2016-04-22 16:44:37 +02:00
shypike
52b6db8e93 Add start script for portable Windows installations 2016-04-22 16:38:29 +02:00
shypike
7755928e09 Merge pull request #515 from sabnzbd/feature/cherrypy5
Feature/cherrypy5
2016-04-16 18:14:03 +02:00
shypike
69ce6e3311 Patch CherryPy 5.1.0: Fix CherryPy's header parsing bug.
Due to a bug in its header parsing, uploaded files could not contain semicolons.
CherryPy bug: 1397
2016-04-16 18:13:15 +02:00
shypike
d694184cce Patch CherryPy 5.1.0: Prevent crash when encountering unexpected URI structure. 2016-04-16 18:13:15 +02:00
shypike
5522e59932 Patch CherryPy 5.1.0: Prevent crash when encountering a pathless URI. 2016-04-16 18:13:15 +02:00
shypike
69ea306967 Patch CherryPy 5.1.0: to avoid Unicode bugs in PyOpenSSL 0.14
On some systems this resulted in a crash.
2016-04-16 18:13:15 +02:00
shypike
cc08040774 Patch CherryPy 5.1.0 : Implement 301 redirection for http-->https
Needed for Bonjour support.
2016-04-16 18:13:15 +02:00
shypike
9f1d1c5cb7 Update CherryPy to official 5.1.0 release 2016-04-16 18:13:14 +02:00
shypike
a9a86969ef Merge pull request #544 from Safihre/propegation_delay
Propagation delay & Interfaces fixes
2016-04-16 18:11:39 +02:00
shypike
b28be4e6f2 Revert "#483-#326 Add option for Propagation Delay"
This reverts commit 1b384e8d70.
2016-04-16 18:10:25 +02:00
shypike
5b1dc8b1ff Revert "Harmonize checks in has_articles_for and get_article"
This reverts commit e2cc5ea3ca.
2016-04-16 18:10:14 +02:00
Safihre
e2cc5ea3ca Harmonize checks in has_articles_for and get_article 2016-04-16 15:37:21 +02:00
Safihre
1b384e8d70 #483-#326 Add option for Propagation Delay 2016-04-16 15:37:21 +02:00
shypike
4eb486d4e2 Update text files for 1.0.0RC1 2016-04-16 15:31:48 +02:00
shypike
bfb6c167a4 Another attempt to set the default cache to 450M. 2016-04-16 15:27:35 +02:00
Safihre
53b46cb56b Update favicons 2016-04-16 14:28:50 +02:00
Safihre
340b4c98e0 #521 Update iOS/Android logo 2016-04-16 12:06:15 +02:00
Safihre
ba709bd086 #521 Add new logo to wizard 2016-04-16 11:35:17 +02:00
Safihre
7c839b8b65 Remove un-used images 2016-04-16 11:20:33 +02:00
shypike
44abf3bdf6 Update text files for 1.0.1RC1 2016-04-15 23:12:22 +02:00
shypike
c950572592 Set default cache to 450M 2016-04-15 23:11:53 +02:00
Safihre
173aa430b3 Tiny fix of modal close button in Config 2016-04-15 21:59:33 +02:00
shypike
3999cb13fd Update text files for 1.0.1RC1 2016-04-15 21:06:55 +02:00
shypike
af65075f0c Update text files for 1.0.0RC1 2016-04-15 21:05:53 +02:00
Safihre
5f55b2efeb Clearly show if saving of Config failed 2016-04-14 22:16:04 +02:00
Safihre
17e69db915 Add message to login screen when session wil expire 2016-04-14 22:06:24 +02:00
Safihre
1c98c13b84 Redirect to login for Plush and smpl 2016-04-14 13:10:00 +02:00
Safihre
206d166cf4 Add notification that restart will require login again 2016-04-14 10:56:55 +02:00
Safihre
7c0d4eb77d #521 Add new logo to Plush and Glitter help 2016-04-14 10:56:01 +02:00
shypike
de2a2b465b Update text files for 1.0.1RC1 2016-04-13 22:41:13 +02:00
shypike
cd7a77f02d Revert "Set default cache size to 750MB on Windows and OSX."
This reverts commit 9b420e91c9.
2016-04-13 22:30:05 +02:00
Safihre
adde58101b Add Propagation Delay option 2016-04-13 18:49:31 +02:00
shypike
f4a5394b63 Prevent creating orphan items in "incomplete" when deleting downloading jobs.
Due to previous issues where articles could be lost,
the nzf.deleted and no.deleted flags were not obeyed.
This could lead to creation of orphans when lost articles would be flushed.

Better solution: drop articles only when job is in a final state.
Also prevent NZO files from being saved when job is in "deleted" state.
2016-04-13 18:32:23 +02:00
jdfalk
3fb6a8dedb Update sabnzbd@.service
1. Added requirement for network to be up before sab starts.
2. Explicitly set service type to simple.
3. Enabled sabnzbd restart on service failure via systemd.
2016-04-13 18:22:11 +02:00
Safihre
50c8f84eba #448-#126 Forced item with missing articles caused overflow in paused queue
Closes #448
Closes #126
2016-04-13 18:21:41 +02:00
Safihre
77c5237f06 Re-introduce label in download name
Turns out I accidentally deleted that in February when removing the
password from the name.. Oops!
2016-04-13 16:55:45 +02:00
shypike
350f8a64fa Merge pull request #541 from Safihre/develop
Safihre's fixes part 1
2016-04-13 12:32:01 +02:00
Safihre
f76e110701 #521 New logo in Glitter and Config preview 2016-04-13 09:39:02 +02:00
Safihre
8c557dfa19 Improve INFO message for verify/repair
Since if QuickCheck succeeds, par2 is not run.
2016-04-13 09:39:01 +02:00
shypike
4f3cd2fc50 Merge pull request #496 from Tremax/handle-ssl-beast
Handle 1/n-1 splitting
2016-04-12 21:25:07 +02:00
shypike
b0f3c8c766 Merge pull request #533 from Safihre/prospective_blocks
Prospective adding of par2 files when articles are damaged
2016-04-12 21:24:53 +02:00
shypike
a8788da698 Prevent creating orphan items in "incomplete" when deleting downloading jobs.
Due to previous issues where articles could be lost,
the nzf.deleted and no.deleted flags were not obeyed.
This could lead to creation of orphans when lost articles would be flushed.

Better solution: drop articles only when job is in a final state.
Also prevent NZO files from being saved when job is in "deleted" state.
2016-04-12 21:21:30 +02:00
shypike
239dcf98e2 Merge pull request #540 from jdfalk/systemdfix
Update sabnzbd@.service with network requirements
2016-04-10 23:09:24 +02:00
jdfalk
fc916a8824 Update sabnzbd@.service
1. Added requirement for network to be up before sab starts.
2. Explicitly set service type to simple.
3. Enabled sabnzbd restart on service failure via systemd.
2016-04-10 13:44:57 -07:00
Safihre
c4ee245934 #448-#126 Forced item with missing articles caused overflow in paused queue
Closes #448
Closes #126
2016-04-10 21:42:39 +02:00
Safihre
b199f83cd5 Incorporate while-loop to make sure we add enough 2016-04-08 10:45:24 +02:00
Safihre
2ad1564879 Prospective adding of par2 files when articles are damaged 2016-04-08 10:45:24 +02:00
shypike
c4eb06ab86 Merge pull request #531 from Safihre/noduplicatefiles
If file occurs twice in NZB, only add the larger
2016-04-07 21:48:50 +02:00
shypike
02cf6d5238 Prevent API crashes when 'mode' or 'name' have double entries. 2016-04-07 21:46:32 +02:00
Safihre
2c7ecdee92 #464 Grabbing items don't always have status=grabbing
But now they do!
2016-04-07 21:45:28 +02:00
Safihre
72390a793a Add Optional label to Retry password 2016-04-07 21:45:17 +02:00
Safihre
04ad4e5d3e Update cache text to more 2016 values 2016-04-07 21:45:05 +02:00
Safihre
5ef9c6a433 #530 do not ignore files in QuickCheck
Par2 wouldn't ignore them either
2016-04-07 21:44:51 +02:00
shypike
59b0fd2a9d Merge pull request #536 from Safihre/develop
Interface fixes part 18
2016-04-07 21:43:15 +02:00
shypike
e6baffc839 Prevent API crashes when 'mode' or 'name' have double entries. 2016-04-07 21:35:07 +02:00
Safihre
a68ced22fe #538 'Add all' for Orphaned Jobs 2016-04-07 20:29:49 +02:00
Safihre
d90e88c2a1 Add notification for succesfull login 2016-04-07 08:58:15 +02:00
Safihre
396f6ecd5d Change of username/password should cause restart
This way the security code is reset so any unwanted guests will be locked out.
2016-04-06 20:47:53 +02:00
Safihre
3e53049f39 #464 Grabbing items don't always have status=grabbing
But now they do!
2016-04-06 19:14:13 +02:00
Safihre
0e8f1b0f01 Tabbed/Compact setting was not remembered 2016-04-06 19:14:13 +02:00
Safihre
8ea69b70b6 #525 Better handeling of PP history events
Not everything was caught by 02eacb17180edd37010287f391a41aa2791f67e7
2016-04-06 19:14:13 +02:00
Safihre
090560671b Add Optional label to Retry password 2016-04-06 19:14:13 +02:00
Safihre
150e117f47 Add background information to Glitter 2016-04-06 19:14:13 +02:00
Safihre
ff65b6ccec #534 fix borders and show active connections 2016-04-06 19:14:13 +02:00
Safihre
9a66c0cb31 #525 Catch more history updates 2016-04-06 19:14:13 +02:00
Safihre
41176bd90f #530 do not ignore files in QuickCheck
Par2 wouldn't ignore them either
2016-04-06 19:14:13 +02:00
Safihre
29cbf1d15c Update cache text to more 2016 values 2016-04-06 19:14:13 +02:00
Safihre
c973d2b527 Split Glitter in sub-files
Was just getting too big of a file!
2016-04-06 19:14:13 +02:00
Safihre
0e71dd26a9 If file occurs twice in NZB, only add the larger 2016-04-02 17:51:36 +02:00
shypike
9ec35d2a25 Fix typo in user notification script code. 2016-04-02 15:30:51 +02:00
shypike
e361eb25a5 Fix potential race condition in BPSmeter. 2016-04-01 21:18:19 +02:00
shypike
9b420e91c9 Set default cache size to 750MB on Windows and OSX.
To make handling of posts with large files more efficient.
2016-04-01 21:09:15 +02:00
Safihre
3a4bf971b2 #529 Fix unicode strip in OptionStr 2016-04-01 20:47:11 +02:00
shypike
9540089f1b Merge pull request #525 from Safihre/nohistory
Do not calculate history every API call and more fixes
2016-04-01 20:46:25 +02:00
Safihre
2515712f59 Faster refresh on searching 2016-04-01 12:07:12 +02:00
Safihre
8c05cdd28f #521 Preview the new logo in Glitter 2016-04-01 12:07:11 +02:00
Safihre
8b3fb6913e Add Speed as Extra history column 2016-04-01 12:07:10 +02:00
Safihre
f2e2571d11 #529 Fix unicode strip in OptionStr 2016-04-01 12:07:09 +02:00
Safihre
6ce93743d0 Add option for Extra history column 2016-03-31 16:03:10 +02:00
Safihre
ec703f21e9 Stylistic changes to lowercase 2016-03-31 11:10:14 +02:00
Safihre
cbde31ea4b Small fixes of Glitter Compact&Tabbed combi 2016-03-31 11:10:13 +02:00
Safihre
1daa9e66f6 Also update history on end of postproc 2016-03-30 10:27:35 +02:00
Safihre
597efc661a Do not calculate history every API call 2016-03-30 09:52:31 +02:00
Safihre
1128691c5d #527 Fix "Download all par2 files" behavior 2016-03-29 21:03:48 +02:00
Safihre
15043aef3f DB Strings should be encapsulated in ' not " 2016-03-29 21:03:30 +02:00
shypike
a7fbdfb0a6 Merge pull request #526 from Safihre/develop
Interface fixes part 17
2016-03-29 20:59:31 +02:00
Safihre
68377b9754 Update jQuery 2016-03-29 14:48:34 +02:00
Safihre
03c2d7ef31 Small Glitter Night interface fix 2016-03-29 14:37:38 +02:00
Safihre
2e3fcac656 #527 Fix "Download all par2 files" behavior 2016-03-29 14:18:03 +02:00
Safihre
7ad01052a1 DB Strings should be encapsulated in ' not " 2016-03-29 14:15:23 +02:00
Safihre
f5191bb364 Improve Glitter Compact and Tabbed layouts 2016-03-29 14:15:23 +02:00
Safihre
f4d6776d77 Fix tabbed navigation for Glitter Night 2016-03-29 14:15:23 +02:00
Safihre
0e28bb2098 Fix #520 by removing space 2016-03-29 14:15:23 +02:00
Safihre
a671744873 Change description of 'Tabbed layout; 2016-03-29 14:15:23 +02:00
shypike
80742e4a0d Improve saving of BPSMeter.
Sometimes clearing of the server counters isn't saved to disk.
2016-03-26 16:40:10 +01:00
shypike
3435886fe7 Fix priority issue in PushOver and PushBullet.
Fixes error introduced in 91f5eea7ba
2016-03-24 21:36:13 +01:00
shypike
ac0821e71b Fix PushOver support.
Adjust priority levels to the current PushOver API.
Re-enable device field now that the PushOver API supports readable device labels.
2016-03-24 21:29:46 +01:00
shypike
122ae5ccfa Fix race-condition when deleting an actively downloading job.
Closes #237
2016-03-24 21:07:38 +01:00
shypike
c36e7edf3f Fix race condition when API and postprocessor both want to delete a history item. 2016-03-24 21:07:22 +01:00
shypike
8987265537 When urlgrabber receives a 404, stop trying. 2016-03-24 21:07:06 +01:00
shypike
5e6fb0e694 Prevent incompatibility due to missing 'script_log' field.
Fixes commit c0f2f59fc1
2016-03-24 21:06:51 +01:00
savef
2a3b4afa03 Treat ambiguous numeric values as number of minutes for custom pause time.
Currently if you just type "100" into the custom pause field it'll think you want 143015 minutes, that's useless. A lot of people are probably used to the old Plush behaviour of entering the number of minutes you want to pause for, it's also a much saner default. So in the case that the user just enters some numbers and nothing else, this assumes they want to pause for that many minutes.
2016-03-24 21:01:04 +01:00
shypike
00a98efa81 Fix race-condition when deleting an actively downloading job.
Closes #237
2016-03-24 20:57:27 +01:00
Safihre
3c4e553733 Dynamic sizing of the connections-tab 2016-03-24 20:32:17 +01:00
Safihre
8e6b30092c Add option for tabbed layout 2016-03-24 20:32:17 +01:00
Safihre
b6fcc2a466 Force close tooltips on closing job settings 2016-03-24 20:32:17 +01:00
savef
df2e24e6cd Treat ambiguous numeric values as number of minutes for custom pause time.
Currently if you just type "100" into the custom pause field it'll think you want 143015 minutes, that's useless. A lot of people are probably used to the old Plush behaviour of entering the number of minutes you want to pause for, it's also a much saner default. So in the case that the user just enters some numbers and nothing else, this assumes they want to pause for that many minutes.
2016-03-24 15:36:37 +00:00
shypike
f013dd7f0d Accept MIME records that have only LF line endings.
Some tool developers just ignore the rule requiring CRLF.
2016-03-23 23:29:12 +01:00
shypike
fb6fd1ab20 Bump signature for self-signed certificate to sha256 2016-03-23 23:08:17 +01:00
shypike
7b91b1c769 Fix race condition when API and postprocessor both want to delete a history item. 2016-03-23 23:03:28 +01:00
shypike
5583cce322 When urlgrabber receives a 404, stop trying. 2016-03-23 23:00:38 +01:00
shypike
b995c5f992 Fix PushOver support.
Adjust priority levels to the current PushOver API.
Re-enable device field now that the PushOver API supports readable device labels.
2016-03-22 21:25:05 +01:00
shypike
fa9b236dc5 Improve running of user's notification script.
Followup of commit ccba56e
2016-03-22 20:12:39 +01:00
shypike
e6887e8a0d extract_pot.py: Make NSIS file presence optional. 2016-03-20 18:32:52 +01:00
shypike
6bbf3f12d9 Update main POT file. 2016-03-20 18:31:24 +01:00
shypike
214ac4a53d Prevent incompatibility due to missing 'script_log' field.
Fixes commit c0f2f59fc1
2016-03-20 15:24:07 +01:00
Safihre
07a67521fa Fix breaking Glitter bug with large script_log 2016-03-19 17:09:38 +01:00
Safihre
83b78d8a3f Few more growler->notifier 2016-03-19 17:06:21 +01:00
Dominique Barton
ccba56e073 Added support for custom notification script
Closes #458
2016-03-19 17:00:48 +01:00
Safihre
91f5eea7ba Notifier: Use get_prio function to get priorities 2016-03-19 14:22:39 +01:00
Dominique Barton
4752790081 Bugfix for full disk Pushbullet notifications 2016-03-19 13:57:16 +01:00
shypike
aea04e8406 Improve handling of passwords embedded in the NZB.
Show first password from NZB in the title of the user hasn't set one.
Try them all: user password, NZB-passwords, from password file.
2016-03-19 13:25:21 +01:00
shypike
cc54006aa5 Remove "release" prefix
Don't want to rename existing release branches.
2016-03-19 12:49:44 +01:00
shypike
e10ca1c852 Update the workflow 2016-03-19 12:05:18 +01:00
shypike
fc7e87f0df Merge branch '1.0.x' 2016-03-19 11:49:11 +01:00
shypike
1d902885a8 Self-signed certificates are now signed with SHA1 instead of MD5.
Also bump size from 1024 to 2048.
2016-03-19 11:45:46 +01:00
shypike
809aebd2d7 Merge pull request #508 from Safihre/develop
Interface fixes part 16
2016-03-18 16:34:04 +01:00
Safihre
c0f2f59fc1 Fix breaking Glitter bug with large script_log 2016-03-18 14:11:54 +01:00
Safihre
ab0d8e0927 #446 IPv4 embedded in IPv6 for local detection
Closes #446
2016-03-18 09:57:56 +01:00
Safihre
38e74d6d24 Update version numbering in develop branch 2016-03-16 13:58:01 +01:00
shypike
b90a847a6f Fix omission in README.mkd 2016-03-15 21:42:16 +01:00
shypike
a58bb385f5 Update text files for 1.0.0 2016-03-15 20:12:50 +01:00
shypike
9754baeb1c Fix handling of changed "ignore_samples" option.
Closes #510
2016-03-15 20:08:35 +01:00
shypike
ffcd154966 Update text files for 1.0.0 Final. 2016-03-14 19:12:59 +01:00
Safihre
b2ca779996 Clean up Status and Interface code 2016-03-14 08:39:59 +01:00
Safihre
fba5131d66 #507 Create QR-code internally 2016-03-14 08:39:53 +01:00
shypike
97cfe9488c Update text files for 1.0.0RC5 2016-03-11 19:24:27 +01:00
shypike
374b6f616a Fix crash in CherryPy when it reports problems with some IPv6 addresses.
A bug in Python's traceback logging causes a crash when an IPv6 address with an embedded % is reported.
2016-03-11 19:22:49 +01:00
Sander Jonkers
e2f51595b6 Because of dual IPv4/IPv6 clients, finding the public ipv4 needs special attention 2016-03-10 22:52:22 +01:00
shypike
69cef6b006 Merge pull request #501 from sanderjo/ipv4_in_case_of_ipv6
Because of dual IPv4/IPv6 clients, finding the public ipv4 needs special attention
2016-03-10 22:51:09 +01:00
shypike
04091a16aa Fix display of SABnzbd's icon by OSX Notification Center.
El Capitan doesn't accept the -sender parameter, so just omit it.
2016-03-08 16:40:44 +01:00
shypike
c52d122984 Fix display of SABnzbd's icon by OSX Notification Center.
El Capitan doesn't accept the -sender parameter, so just omit it.
2016-03-08 16:40:17 +01:00
shypike
709a317f55 Suppress errors/warnings about bad "Rating" files when the feature is disabled. 2016-03-08 16:01:34 +01:00
shypike
9d9d2fd9a2 Revert "Fix Plush dashboard"
This reverts commit 42f1a4926c.
2016-03-08 16:00:24 +01:00
shypike
5746115331 Suppress errors/warnings about bad "Rating" files when the feature is disabled. 2016-03-08 15:53:52 +01:00
Sander Jonkers
205b908b8d Because of dual IPv4/IPv6 clients, finding the public ipv4 needs special attention 2016-03-06 01:39:41 +01:00
Safihre
42f1a4926c Fix Plush dashboard 2016-03-05 11:23:19 +01:00
Safihre
7d87fd461b Fix Glitter display in <1MB/s range 2016-03-05 11:22:57 +01:00
shypike
69f77ac733 Merge pull request #499 from Safihre/develop
Interfaces fixes part 15 (for the final)
2016-03-05 11:21:09 +01:00
Safihre
5a70d3f52e Fix Plush dashboard 2016-03-05 11:01:36 +01:00
Safihre
5b11d1c719 Fix Glitter display in <1MB/s range 2016-03-05 11:01:36 +01:00
shypike
1ba9976979 Update text files for 1.0.0RC4 2016-03-05 08:52:09 +01:00
shypike
659c199043 Fix --ipv6_hosting option.
Repairs commit 1cbff28
2016-03-05 08:50:13 +01:00
shypike
81a3f53226 Update text files for 1.0.0RC3 2016-03-04 20:39:01 +01:00
shypike
1cbff28f67 Disable listening on IPv6 addresses by the internal web server.
Setting Config->Special->ipv6_hosting to 1 will enable IPv6 listening.
Command line option --ipv6_hosting allows forcing the choice, should SABnzbd not start.
Closes #492
2016-03-04 19:26:50 +01:00
shypike
8e15acbf30 Update translations 2016-03-04 18:55:20 +01:00
shypike
61239a8f42 Update translations 2016-03-04 18:54:13 +01:00
Max
25a54fb593 handle 1/n-1 splitting to prevent Rizzo/Duong-Beast 2016-03-04 04:23:16 +02:00
Safihre
e07be60db6 #489 wrongly encoded & in the preload 2016-03-01 22:20:51 +01:00
Safihre
539c9662ff 'Default' not translated in Server-category 2016-03-01 22:20:35 +01:00
shypike
64b182ca9a Update main POT file 2016-03-01 22:00:57 +01:00
shypike
056fb39380 Merge pull request #493 from Safihre/develop
Interface fixes part 15
2016-03-01 21:58:43 +01:00
Safihre
7f03e2800e Visual feedback when testing server/notifications
Nice little spinner
2016-03-01 16:40:50 +01:00
Safihre
427661589a Use the Status-API in Glitter instead of fake-JSON 2016-02-29 21:41:15 +01:00
Safihre
417a333cdd Move Status-info to API like queue/history 2016-02-29 21:41:14 +01:00
Safihre
90131327c6 #489 wrongly encoded & in the preload 2016-02-29 21:41:13 +01:00
Safihre
121fd45bb8 Add notice when no 'Default' server-category
To make users aware of accidents
2016-02-27 12:40:26 +01:00
Safihre
f0121d526b 'Default' not translated in Server-category 2016-02-27 12:40:24 +01:00
Safihre
bfdf0b453c Unify config testing reports 2016-02-26 14:32:47 +01:00
Safihre
01a725d8bf Server status tweaks 2016-02-26 14:32:46 +01:00
Safihre
6b38ad9d37 Small config improvements 2016-02-26 14:32:44 +01:00
shypike
b396014f8d Fix IP test at startup.
Correction of problem introduced by commit afff88b "Use self-test.sabnzbd.org for connection tests".
2016-02-24 22:30:02 +01:00
shypike
bd991e1010 Fix IP test at startup.
Correction of problem introduced by commit afff88b "Use self-test.sabnzbd.org for connection tests".
2016-02-24 22:28:41 +01:00
shypike
1db32415b6 Update translations 2016-02-24 21:37:22 +01:00
shypike
c58774b341 Update translations 2016-02-24 21:16:22 +01:00
shypike
b24629db6b Update text files for 1.0.0RC2 2016-02-24 21:11:43 +01:00
Safihre
9b5cdcf8fb Add trailing "/" to href's 2016-02-24 21:05:12 +01:00
shypike
4831415d14 Use self-test.sabnzbd.org for connection tests 2016-02-24 20:34:04 +01:00
Chris Thorn
a4c51f0b20 Parse bandwidth limit as a float instead of an integer so that non-integer values can be used as bandwidth limit 2016-02-24 20:09:02 +01:00
shypike
ec3ba1fb93 Changing server priorities during a download could lead to unexpected results and lockups.
Target priority of articles must be kept at the TryList level so that they
are reset when the try_list is reset.
Closes #378
2016-02-24 20:08:51 +01:00
Safihre
61966f7036 Plush dashboard local IPv4 wouldn't show if external failed
Typo!
For 1.0.0
2016-02-24 20:08:38 +01:00
Safihre
4f69e81841 Add link to information about SSL/yEnc 2016-02-24 20:07:48 +01:00
Safihre
d0d90581df Tweak first Config page 2016-02-24 20:07:35 +01:00
Safihre
8ea5c27633 Improve display of message on blocked server 2016-02-24 20:07:16 +01:00
Chris Thorn
176affe115 Parse bandwidth limit as a float instead of an integer so that non-integer values can be used as bandwidth limit 2016-02-24 19:59:12 +01:00
shypike
30161c5f6c Merge pull request #486 from Safihre/develop
Interface fixes part 14
2016-02-24 19:53:19 +01:00
shypike
21320d9e22 Changing server priorities during a download could lead to unexpected results and lockups.
Target priority of articles must be kept at the TryList level so that they
are reset when the try_list is reset.
Closes #378
2016-02-24 19:37:46 +01:00
Safihre
03a918b93b Plush dashboard local IPv4 wouldn't show if external failed
Typo!
For 1.0.0
2016-02-24 15:36:04 +01:00
Safihre
058de93b36 Improve compact option in Glitter 2016-02-23 18:38:22 +01:00
Safihre
afff88be57 Use self-test.sabnzbd.org for connection tests 2016-02-23 18:38:21 +01:00
Safihre
699a518144 Add link to information about SSL/yEnc 2016-02-23 18:38:19 +01:00
Safihre
fd6fdd224c Tweak first Config page 2016-02-23 09:13:15 +01:00
Safihre
8b00762a98 Improve display of message on blocked server 2016-02-23 09:13:14 +01:00
Safihre
ac9d4f7451 Add trailing "/" to href's 2016-02-23 09:13:13 +01:00
Safihre
d8da78662a Connection refresh improvement
Make sure Connections get refreshed also after open->close->open
2016-02-22 11:23:02 +01:00
shypike
6c7cdfcf75 Update main POT file 2016-02-19 22:46:47 +01:00
shypike
517500fdf3 Add link to issue list on support site. 2016-02-19 22:42:30 +01:00
shypike
c4c1c9b6ab Prevent UI errors due to history_db handle not being available. 2016-02-19 22:22:42 +01:00
Safihre
2388889ede Filegrabber did not sanatize filename 2016-02-19 22:21:28 +01:00
shypike
a3bed4689f Prevent UI errors due to history_db handle not being available. 2016-02-19 22:17:08 +01:00
Jonathon Saine
f0852e192d Add Issues link back to config base page. Make sorting Key's look more like a button (not touching presets). Fix minor cosmetic issue with paths text being cut off. Remove bottom shadow from buttons when attached to inputs so it doesnt look so odd. 2016-02-19 21:56:01 +01:00
Safihre
e95b3c6eca Display password in skins 2016-02-19 11:17:40 +01:00
Safihre
b93f68146e Remove password from title 2016-02-19 11:17:39 +01:00
Safihre
d07fcee923 Connections tab auto-refresh 2016-02-19 11:17:38 +01:00
Safihre
d2a1a72fbb Filegrabber did not sanatize filename 2016-02-19 11:17:37 +01:00
Safihre
55cfe878d7 Catch failing Windows Notification
I assumed Windows notifications could not fail, but clearly they can:
http://forums.sabnzbd.org/viewtopic.php?f=11&t=20211&p=104438
When no tray-icon is available, it will fail and in the case of
completed NZB message it will restart the whole of SABnzbd.
2016-02-17 21:25:42 +01:00
Safihre
040d4c0454 Catch failing Windows Notification
I assumed Windows notifications could not fail, but clearly they can:
http://forums.sabnzbd.org/viewtopic.php?f=11&t=20211&p=104438
When no tray-icon is available, it will fail and in the case of
completed NZB message it will restart the whole of SABnzbd.
2016-02-17 21:23:39 +01:00
Safihre
a2daaee468 Add Pystone score to Glitter status 2016-02-17 21:06:43 +01:00
Safihre
2c360e395e Limit to max 250 items per page (realistic limit) 2016-02-17 21:05:55 +01:00
Jonathon Saine
399cfee594 Add pyOpenSSL info to startup/utility/config base. Add OpenSSL & yEnc to config base as well. 2016-02-17 21:04:13 +01:00
Safihre
f6fe2247fc Add Glitter option for Compact Layout
There is still some work to be done, but this is the first version!
2016-02-17 20:59:32 +01:00
Safihre
acb1fdb530 Notifications in Night-skin were not colored 2016-02-17 20:59:32 +01:00
Safihre
c5dcd5581f Orphan add/remove notification differs 2016-02-17 20:59:32 +01:00
Safihre
9a466e9180 Limit to max 250 items per page (realistic limit) 2016-02-17 20:59:32 +01:00
Safihre
d680aae4ec Make 'Show connections' persist after page refresh 2016-02-17 20:59:32 +01:00
Safihre
84bcdf2cd6 Add Pystone score to Glitter status 2016-02-17 20:59:32 +01:00
Safihre
7672a57209 Show sysload in Glitter
Kind of forgot about it since I'm a windows user..
2016-02-17 20:59:32 +01:00
shypike
be646ae6ab Set default for https verification to off. 2016-02-17 20:50:24 +01:00
Jonathon Saine
4905cd0cc4 Add pyOpenSSL info to startup/utility/config base. Add OpenSSL & yEnc to config base as well. 2016-02-17 09:11:07 -06:00
shypike
b470253d9f Disable https verification when uploading NZB to running instance of SABnzbd. 2016-02-13 16:12:04 +01:00
shypike
c7bc25b847 Disable https verification when uploading NZB to running instance of SABnzbd. 2016-02-13 16:11:17 +01:00
shypike
366725451d Update main POT file. 2016-02-12 21:37:43 +01:00
shypike
23208ab71a Merge pull request #471 from Safihre/let-the-sparks-fly
Adding overlay-notifications to Glitter
2016-02-12 21:11:49 +01:00
Safihre
1b5dada461 Adding overlay-notifications to Glitter 2016-02-12 15:09:04 +01:00
shypike
b83c493492 Update translations 2016-02-11 01:06:52 +01:00
shypike
41dad8b379 Update translations 2016-02-11 01:04:33 +01:00
Safihre
991277bb01 Glitter broke on empty preload strings
See
http://forums.sabnzbd.org/viewtopic.php?f=11&t=20192&p=104368#p104368
In case of UnicodeError
2016-02-10 22:59:11 +01:00
Safihre
5626013b81 Don't allow name change or filesview on grabbing 2016-02-10 22:58:56 +01:00
Safihre
2810d37758 Make disabled servers look more disabled 2016-02-10 22:58:40 +01:00
Safihre
c2f08f01e0 #408 Show red when Add-NZB left empty 2016-02-10 22:57:30 +01:00
Safihre
c82e586b05 Glitter broke on empty preload strings
See
http://forums.sabnzbd.org/viewtopic.php?f=11&t=20192&p=104368#p104368
In case of UnicodeError
2016-02-10 22:48:18 +01:00
Safihre
8cfb605931 Don't allow name change or filesview on grabbing 2016-02-09 09:16:31 +01:00
Safihre
184c350e16 Make disabled servers look more disabled 2016-02-07 13:22:04 +01:00
Safihre
1f116940fc #408 Show red when Add-NZB left empty 2016-02-07 10:54:59 +01:00
shypike
456fe124a9 Update main POT file. 2016-02-05 23:38:36 +01:00
Safihre
17ff087e06 Do not confirm clearing warnings 2016-02-05 23:36:47 +01:00
Safihre
77de565b7c Link in message about Orphans was broken 2016-02-05 23:36:36 +01:00
Safihre
54d238aa4d Message labels were not translated
INFO and WARNING
2016-02-05 23:36:23 +01:00
Safihre
379d09f8cc Improve message about no localStorage
It happens more than I expected, so better make a proper message.
2016-02-05 23:35:23 +01:00
Safihre
fdddcc9ab7 Do not confirm clearing warnings 2016-02-05 23:17:28 +01:00
Safihre
4afc23cd21 Link in message about Orphans was broken 2016-02-05 09:42:50 +01:00
Safihre
85aaf539e3 Message labels were not translated
INFO and WARNING
2016-02-05 09:32:25 +01:00
Safihre
9860e67ca0 Improve message about no localStorage
It happens more than I expected, so better make a proper message.
2016-02-05 09:22:44 +01:00
shypike
00de72b127 Update text files for 1.0.xRC1 2016-02-03 21:18:42 +01:00
shypike
f9c84fa7dd Fix trouble with disk speed meter (especially on Windows) Part 2.
Improve the benchmark by reducing Python overhead by writing larger blocks.
2016-02-03 21:08:47 +01:00
shypike
c8e46691bb Solve file name encoding issues for OSX.
- Names returned by unrar-commandline need to be Unicoded.
- For yEnc embedded names, only test for UTF-8 and CP1252, but not the local codepage.
- Suppress some bogus warnings
- Log the output of the unrar tool
2016-02-03 20:59:12 +01:00
shypike
df1bb636e5 Fix links in text files to pooit to 1.0.0 entries in the Wiki. 2016-02-03 20:51:19 +01:00
shypike
ff886fad0d Fix all links in the templates to point to 1.0.0 (or 1-0) entries in the Wiki. 2016-02-03 20:50:13 +01:00
shypike
386b59a755 Solve file name encoding issues for OSX.
- Names returned by unrar-commandline need to be Unicoded.
- For yEnc embedded names, only test for UTF-8 and CP1252, but not the local codepage.
- Suppress some bogus warnings
- Log the output of the unrar tool
2016-02-01 21:30:36 +01:00
shypike
7e95a7cd88 Fix trouble with disk speed meter (especially on Windows) Part 2.
Improve the benchmark by reducing Python overhead by writing larger blocks.
2016-02-01 20:08:54 +01:00
shypike
2c9232272a Bump default release to 1.1.x 2016-02-01 19:29:47 +01:00
shypike
3d0e7bf2a1 Fix links in text files to pooit to 1.0.0 entries in the Wiki. 2016-02-01 19:13:52 +01:00
shypike
e6bf540057 Fix all links in the templates to point to 1.0.0 (or 1-0) entries in the Wiki. 2016-02-01 19:13:16 +01:00
shypike
917b18ab09 Fix trouble with disk speed meter (especially on Windows) Part 2.
Move fix outside of the measurement loop.
Don't remove the test-file within the loop, but only after it's finished,
otherwise we'll still get a "Permission denied".
2016-01-30 10:55:35 +01:00
shypike
6dbee7a413 Fix trouble with disk speed meter (especially on Windows) Part 2.
Move fix outside of the measurement loop.
Don't remove the test-file within the loop, but only after it's finished,
otherwise we'll still get a "Permission denied".
2016-01-30 10:52:28 +01:00
shypike
3f8fcd7172 Fix trouble with disk speed meter (especially on Windows).
Better handling when folder is not available or writable.
Windows requires some access outside of the Python code to avoid "permission denied".
2016-01-29 23:54:32 +01:00
shypike
c6687163f0 Fix trouble with disk speed meter (especially on Windows).
Better handling when folder is not available or writable.
Windows requires some access outside of the Python code to avoid "permission denied".
2016-01-29 23:54:07 +01:00
shypike
e12378eae4 Update main POT file. 2016-01-29 19:56:56 +01:00
shypike
d94f7388e6 Add a link on the main Config page, to the "issues" page on the Wiki 2016-01-29 19:55:04 +01:00
shypike
6d2e7a0b96 Add a link on the main Config page, to the "issues" page on the Wiki 2016-01-29 19:54:39 +01:00
Safihre
ad8b49fea8 #408 Firefox-fix: word-wrap instead of word-break 2016-01-29 19:21:59 +01:00
Safihre
ce00270c12 #447 only show arguments-field for speedlimit 2016-01-29 19:21:41 +01:00
Safihre
8c501f8f58 #447 Servers in scheduler more clear 2016-01-29 19:21:30 +01:00
Safihre
ce313ebc65 #445 Reduce statusinfo timeout on startup 2016-01-29 19:21:18 +01:00
Safihre
887ad881a2 #444 HTTPS instead of HTTP for RSS favicon 2016-01-29 19:21:07 +01:00
Safihre
ce40827552 Fix breaking RSS page
Fixes http://forums.sabnzbd.org/viewtopic.php?f=11&t=20114
2016-01-29 19:20:52 +01:00
shypike
1c60b48c32 Merge pull request #443 from Safihre/develop
Interface fixes part 11
2016-01-29 19:00:55 +01:00
shypike
755420ba7a Merge pull request #442 from Safihre/newlogin
Add HTML login page
2016-01-29 18:57:42 +01:00
shypike
2777d89482 Fix typos that prevented notifications about disk full being sent. 2016-01-28 23:19:36 +01:00
shypike
3def1d76d2 Fix typos that prevented notifications about disk full being sent. 2016-01-28 23:18:51 +01:00
Safihre
006d10bd55 #408 Firefox-fix: word-wrap instead of word-break 2016-01-28 12:15:44 +01:00
Safihre
1a0cd88eca Update Glitter jQuery to 2.2.0 2016-01-27 22:25:58 +01:00
Safihre
d5f7827805 Grey out disabled Config sections when unchecked 2016-01-27 10:34:18 +01:00
Safihre
db0450509f #447 only show arguments-field for speedlimit 2016-01-26 10:57:45 +01:00
Safihre
6f5d6fcf33 Use SHA1 instead of Base64 for hashing cookie
A very obvious mistake I made! Base64 anyone could have 'cracked' the
code so easily, not with SHA1. I stuck with SHA1 and not better one
because it's much faster and safe enough for our application.
2016-01-26 10:35:02 +01:00
Safihre
1a2ee47901 Adding a link to the Login-info page 2016-01-25 14:54:14 +01:00
Safihre
62fd4cc838 Remember state of the 'Remember me' checkbox 2016-01-25 12:42:06 +01:00
Safihre
88d72d23b6 Logout link only when needed
So not when we have only external login turned on and we are internal.
2016-01-25 12:31:42 +01:00
Safihre
f5f3507626 Make HTML authentication default (can be disabled in specials)
Because the 'Only external access requires login' only works with the
HTML login.
2016-01-25 12:31:41 +01:00
Safihre
83e4cc1a4e Implement 'Remember me' for HTML login
Although after a restart or change of IP, it will be lost
2016-01-25 12:31:40 +01:00
Safihre
cc36843f9a #447 Servers in scheduler more clear 2016-01-24 23:19:17 +01:00
Safihre
bebe41a07a #445 Reduce statusinfo timeout on startup 2016-01-24 22:37:48 +01:00
Safihre
2a3ec43adc Add option to only require login for external IP's 2016-01-24 22:34:18 +01:00
Safihre
8918595776 #444 HTTPS instead of HTTP for RSS favicon 2016-01-24 20:46:30 +01:00
Safihre
e23d5234c5 Fix breaking RSS page
Fixes http://forums.sabnzbd.org/viewtopic.php?f=11&t=20114
2016-01-24 20:46:29 +01:00
Safihre
1e3c9e5576 Make cookie-secret more secret
The process-ID was too easy to 'guess', the new ID won't be that easy to guess.
2016-01-24 18:09:36 +01:00
Safihre
4afd0f2d84 Add HTML login page
Based on Cookies. We create an unique cookie based on user-IP,
SAB-process-ID and a salt to facilitate also log-out.
Yes, this cookie can be stolen when on a public wifi-network (same IP)
when not on HTTPS, but so can basic-auth requests.
2016-01-24 18:09:34 +01:00
shypike
727b300a0e Update translations 2016-01-24 16:34:40 +01:00
shypike
12801c57b6 Update translations 2016-01-24 16:30:36 +01:00
shypike
652b021a8e Update text files for 0.8.0Beta6 2016-01-24 16:26:26 +01:00
shypike
199f174adc Allow "None" as selection for secondary skin. 2016-01-24 16:15:25 +01:00
shypike
fdf33acfbb Allow "None" as selection for secondary skin. 2016-01-24 16:15:02 +01:00
shypike
b001bc9b6f Prevent multiple resume notifications.
Only report "Resume" when coming from Paused mode.
2016-01-24 15:18:24 +01:00
shypike
8802cb1d8c Notifications template contained two instances of "ncenter_enable", leading to problems.
The result was a list instead of a single value.
2016-01-24 15:18:07 +01:00
shypike
e19a2fbae7 Improve handling of an old queue when upgrading to 0.8.0+
Warn only for a non-empty queue.
For Windows, when using a relative "download_dir" based on the user profile,
prepend the path with "Documents".
No action when the -f parameter was used.
This way it will be easier to restore existing jobs.
2016-01-24 15:17:47 +01:00
Safihre
53e38f98f9 Firefox needs more time to process the Server AJAX 2016-01-24 15:16:52 +01:00
Safihre
e783e227f6 #438 Try to stop Firefox from checking checkboxes 2016-01-24 15:16:39 +01:00
shypike
f3dfbe4181 Fix problem where a stray RAR file would cause a failed unpack run.
When a job of which the RAR files are renamed by par2,
needs repair of one more more files, the original damaged files will stay behind.
This will cause SABnzbd to try a doomed attempt at unpacking.
SABnzbd should keep track of such files and delete them after repair.
2016-01-24 15:15:57 +01:00
shypike
bcd8ca8bc4 Fix potential crash when reverting par2 renames.
Can happen when files have been modified outside of SABnzbd's control.
2016-01-24 15:12:06 +01:00
shypike
816d6a63cd For SSL protocol choice, default to auto-negotiation.
The "V23" method is interpreted by OpenSSL as "negotiate the highest available protocol"
and should therefor be a safe choice (best chance of working and best security).
If a user wants to, it is possible to fix the protocol, to prevent interference in the negotiation.
We cannot just assume that we can use our highest fixed protocol, because some Usenet servers
are being slow with implementing TLS1.2
2016-01-24 15:11:30 +01:00
shypike
f5f982ed6d Prevent multiple resume notifications.
Only report "Resume" when coming from Paused mode.
2016-01-24 15:09:36 +01:00
shypike
d8abc2ad4b Notifications template contained two instances of "ncenter_enable", leading to problems.
The result was a list instead of a single value.
2016-01-24 14:53:13 +01:00
shypike
1cb9bbe7cc Improve handling of an old queue when upgrading to 0.8.0+
Warn only for a non-empty queue.
For Windows, when using a relative "download_dir" based on the user profile,
prepend the path with "Documents".
No action when the -f parameter was used.
This way it will be easier to restore existing jobs.
2016-01-23 23:54:53 +01:00
shypike
c2022e8fa4 Merge pull request #441 from Safihre/develop
Firefox workarounds
2016-01-23 17:34:22 +01:00
Safihre
24e075bf24 Firefox needs more time to process the Server AJAX 2016-01-23 16:41:04 +01:00
Safihre
2965e262a6 #438 Try to stop Firefox from checking checkboxes 2016-01-22 11:06:34 +01:00
shypike
2b71ce8927 Fix problem where a stray RAR file would cause a failed unpack run.
When a job of which the RAR files are renamed by par2,
needs repair of one more more files, the original damaged files will stay behind.
This will cause SABnzbd to try a doomed attempt at unpacking.
SABnzbd should keep track of such files and delete them after repair.
2016-01-21 22:25:41 +01:00
shypike
5a872c62df Fix potential crash when reverting par2 renames.
Can happen when files have been modified outside of SABnzbd's control.
2016-01-20 21:49:28 +01:00
shypike
db64ce75ad For SSL protocol choice, default to auto-negotiation.
The "V23" method is interpreted by OpenSSL as "negotiate the highest available protocol"
and should therefor be a safe choice (best chance of working and best security).
If a user wants to, it is possible to fix the protocol, to prevent interference in the negotiation.
We cannot just assume that we can use our highest fixed protocol, because some Usenet servers
are being slow with implementing TLS1.2
2016-01-20 20:47:06 +01:00
shypike
88d3f25700 Perform IPv6 test on port 443 instead of 80.
Works better with some proxies.
Closes issue #274
2016-01-19 18:13:42 +01:00
shypike
9457883707 Perform IPv6 test on port 443 instead of 80.
Works better with some proxies.
Closes issue #274
2016-01-19 18:12:55 +01:00
shypike
c5767b061d When trying to connect to another SABnzbd instance over HTTPS, don't verify certificates.
Very few SABnzbd installations will have valid certificates.
2016-01-19 18:04:09 +01:00
shypike
80f69b11db When trying to connect to another SABnzbd instance over HTTPS, don't verify certificates.
Very few SABnzbd installations will have valid certificates.
2016-01-19 18:03:33 +01:00
Safihre
81a11f20c8 Re-order Switches page 2016-01-19 17:30:01 +01:00
Safihre
9e2a839953 Config fixes 2016-01-19 17:30:01 +01:00
Safihre
3cefcde270 #408 Refresh on Config Special save to update the * 2016-01-19 17:30:01 +01:00
Safihre
87a1eacfe7 #408 Also close history-details on history-row click
Before it would only open
2016-01-19 17:30:01 +01:00
Safihre
7cbc1a8419 #408 Browser navbar to black on mobile 2016-01-19 17:30:01 +01:00
Safihre
7b5570eb0b #408 Extra space next to Folder icon 2016-01-19 17:30:00 +01:00
Safihre
1a43a4dcf0 #432 Change filename to name in Add NZB 2016-01-19 17:30:00 +01:00
Safihre
2c2a6592c7 End of queue script was forgotten in Glitter 2016-01-19 17:30:00 +01:00
shypike
f31de6ee4e The compiled OSX build wasn't restarted with original command line arguments.
Rare use case where the App was originally started with parameters.
Essential for correct preservation of the -f parameter.
2016-01-19 17:29:11 +01:00
Safihre
7e64c3af5f Re-order Switches page 2016-01-19 09:18:12 +01:00
Safihre
af36b81cd2 Config fixes 2016-01-17 23:31:50 +01:00
Safihre
e891d14873 #408 Refresh on Config Special save to update the * 2016-01-17 22:23:15 +01:00
Safihre
783e56d00d #408 Also close history-details on history-row click
Before it would only open
2016-01-17 22:19:54 +01:00
Safihre
2fbeb0ab1e #408 Browser navbar to black on mobile 2016-01-17 22:04:42 +01:00
Safihre
3df68ac9f9 #408 Extra space next to Folder icon 2016-01-17 22:02:44 +01:00
Safihre
911af303bf #432 Change filename to name in Add NZB 2016-01-17 21:57:44 +01:00
Safihre
2a380ad0db End of queue script was forgotten in Glitter 2016-01-16 19:26:52 +01:00
shypike
fc1ce199ca The compiled OSX build wasn't restarted with original command line arguments.
Rare use case where the App was originally started with parameters.
Essential for correct preservation of the -f parameter.
2016-01-16 16:09:01 +01:00
shypike
af6a50c27e Add Special option "fixedd_ports" to prevent auto search for a free web port.
Useful in debugging situations where there might be stray processes running.
The option will prevent moving to other ports, but will instead terminate SABnzbd.
2016-01-16 15:10:07 +01:00
shypike
b7a83eda68 Replace awkward PNFO/QNFO/ANFO list indexes with named tuples. 2016-01-16 13:02:28 +01:00
shypike
714cd9621c Use any() and all() functions where appropriate.
Better than creating a list with only True-s.
2016-01-16 12:33:19 +01:00
shypike
e309492e2a Improve code for version check.
Don't use a semicolon-separated string, but just a tuple.
2016-01-16 12:31:48 +01:00
shypike
8fcd1f6b6c Merge branch 'develop' into R0.8.0 2016-01-16 12:25:38 +01:00
shypike
1760a20671 Sometimes the "latest release" label shown wasn't the correct one.
Add some extra logging too.
2016-01-16 12:24:19 +01:00
shypike
d7f3a473d7 Merge branch 'develop' into R0.8.0 2016-01-13 21:51:51 +01:00
Safihre
f682f68966 Growl wrongly enabled on Linux 2016-01-13 21:50:30 +01:00
Safihre
2a849c0e97 Default skin not set correctly in Wizzard
On Linux 'Glitter - Night' is top of the list in Config, so on the first
opening of the Config it would switch the layout to 'Glitter - Night'
2016-01-13 21:50:30 +01:00
shypike
ab2eb0c94e Update text files for 0.8.0Beta5 2016-01-13 20:17:32 +01:00
shypike
e1e05b132d Update translations 2016-01-13 20:15:34 +01:00
shypike
04ef0beacf Update to 2016. 2016-01-13 20:04:21 +01:00
shypike
060815dabe Sometimes an uploaded filename contains the full URL, strip it down.
Closes #422
2016-01-12 21:44:11 +01:00
Safihre
c7d9e5ce90 FR #63: Option to show hidden folders on Unix 2016-01-12 21:21:27 +01:00
Safihre
8bc9fd821f Missing INCOMPLETE and UNWANTED for filter 2016-01-12 21:21:27 +01:00
Safihre
5a46c8f691 192x192 favicon causes problems in IE 2016-01-12 21:21:27 +01:00
jcfp
aced9d9241 Also update warning msg in part 1 of the wizard 2016-01-12 20:01:19 +01:00
jcfp
cdf8c42d3d Correct openssl package name in log message
Noticed someone using the incorrect package name in https://forums.sabnzbd.org/viewtopic.php?f=2&t=20018
2016-01-12 11:47:38 +01:00
shypike
5e81b85f21 Enable the use of extra par2 parameters in other platforms than Windows. 2016-01-09 17:08:23 +01:00
Safihre
9b1d44f98a Category names with " cause HTML problems 2016-01-07 21:23:51 +01:00
shypike
1b477f4885 CherrpPy patch: prevent crash on some special URI-s. 2016-01-07 21:09:21 +01:00
Jeff George
1618e029a7 Relocate the wizard ad to the new resources.sabnzbd.org subdomain, also switch it to HTTPS 2016-01-07 20:49:33 +01:00
Safihre
cc34656ffa Update README
New link to Multi-threaded par2.
configobj and feedparser are already included in source so not a
dependency.
2016-01-07 20:43:24 +01:00
Safihre
e045533d2b Display Filejoin stage 2016-01-07 20:43:24 +01:00
Safihre
d8047eaa12 Update multiedit when job finishes
To keep the counter correct
2016-01-07 20:43:24 +01:00
Safihre
bcf5a75d14 Correctly handle UnicodeDecodeError except 2016-01-07 20:43:24 +01:00
Safihre
a2afe43540 Split Glitter into files
It was getting way too long for 1 file
2016-01-07 20:43:24 +01:00
Safihre
1c419c7151 Instant-load for Chrome
Trick was to place the JavaScript before any DOM, so it would load the
JS first
2016-01-07 20:43:24 +01:00
Safihre
610e10d18e Preload the queue and history JSON
This makes the first load intant(!) in Firefox and IE, but Chrome is not impressed.
Template rendering is only few msec slower and size only increases little.
2016-01-06 00:02:23 +01:00
Safihre
1e5d44ba9e Fix error in previous pagination improvement 2016-01-06 00:02:17 +01:00
shypike
5a60c3f345 Make sure the download report has a sensible order of stages. 2016-01-05 21:17:06 +01:00
Safihre
18bd3e925c Increase pagination speed for large lists
Just a little bit.
2016-01-02 12:52:49 +01:00
Safihre
35f2b14216 Don't break on localStorage problems
Now uses the check like Modernizr does, more robust against special
cases.
2016-01-02 12:52:49 +01:00
Safihre
faf90c36d8 Change buttons in Status-window
The buttons only fitted in English, in all other languages it always
wrapped around to second line.
2016-01-02 12:52:49 +01:00
Safihre
d17f339d9a Allow manual passwords by name/pw or name{{pw}} 2016-01-02 12:52:49 +01:00
Safihre
7682e593e3 Job-details window improvements
Now has the same color as the job's progress bar and fixed exotic bug
with identical filenames.
2016-01-02 12:52:49 +01:00
Safihre
9aa927159a History status info More-link failed
Implemented proper solution
2016-01-02 12:52:49 +01:00
Safihre
ea87c29ad4 Decrease history loading time
Performance impact is smaller than with the queue, but still helps.
2016-01-02 12:52:49 +01:00
Safihre
e94fa7e710 Use strict Javascript setting 2016-01-02 12:52:49 +01:00
Safihre
e9200d2d89 Stage-log texts of 3+ lines behind More button 2016-01-02 12:52:49 +01:00
Safihre
779560789c Adding password for pre-labeled jobs was faulty
It would make 'DUPLICATE / Title' into: 'DUPLICATE / DUPLICATE / Title'
2016-01-02 12:52:49 +01:00
Safihre
45eccebd52 Mobile/Tablet CSS fixes 2016-01-02 12:52:49 +01:00
Safihre
cbacac1934 Properly hide tooltips on job-prio/cat change
Otherwise they stay forever
2016-01-02 12:52:49 +01:00
Safihre
91736f069c 'None' in list of script wasn't translated 2016-01-02 12:52:49 +01:00
Safihre
e4bf3acd90 CSS improvements 2016-01-02 12:52:48 +01:00
Safihre
92f9bcb61e Make RSS favicon work with more domains
Did not work when indexers use for example api.nzbgeek.com, since
there's no favicon there, only at the root domain.
2016-01-02 12:52:48 +01:00
Safihre
8fab1aa00d Improve initialization
Hopefully reducing the number of DOM-updates
2016-01-02 12:52:48 +01:00
Safihre
caf0d3606a Proper CSS for button alignment 2016-01-02 12:52:48 +01:00
Safihre
b4f369b213 Reduce flickering of queue and history
On deleting of entire pages of jobs/items or toggle of showing failed
jobs in history
2016-01-02 12:52:48 +01:00
Safihre
bb0ee57e1c Refresh on deleting of warnings
Otherwise they don't disappear on long refresh-rates
2016-01-02 12:52:48 +01:00
Safihre
a83e89c8b4 Handle single delete when multi-editing 2016-01-02 12:52:48 +01:00
Safihre
e4554192f7 Re-implement the Check All
Previous implementation with the trigger click caused slowdown on (un)check-all and many API calls in certain scenarios.
2016-01-02 12:52:48 +01:00
Safihre
57498c3fb3 Use 'indeterminate' Check All state
I did not even know this indeterminate state existed until yesterday.
Nice solution to better visualization of the state
2016-01-02 12:52:48 +01:00
Safihre
ac3b9951e0 Fixing the RSS config page (again) 2016-01-02 12:52:48 +01:00
Safihre
3aae3e7e54 Reduce size of MomentJS 2016-01-02 12:52:48 +01:00
Safihre
f3252d8156 Decrease the little element shifts during sorting 2016-01-02 12:52:48 +01:00
Safihre
66450d2b2b Only hide actually finished files in job-modal 2016-01-02 12:52:48 +01:00
Safihre
14beeb712c Set RAR-verson reporting to debug
Since the rar-version reporting at unpack is also at Debug only
2016-01-02 12:52:47 +01:00
shypike
3a1de11e42 Fix Unicode issue in date/time localization. 2016-01-02 12:47:23 +01:00
shypike
2cea65f36b Fix README.mkd 2015-12-28 09:05:11 +01:00
shypike
ac72568e4d Update text files for 0.8.0Beta
Also remove CHANGELOG.txt
2015-12-24 15:26:05 +01:00
shypike
f28bcbf801 Make sure that the INI backup file has restricted access rights. 2015-12-24 15:01:21 +01:00
shypike
3d78329dd3 Update translations 2015-12-24 11:31:43 +01:00
shypike
b1f99990fc If the highest SSL protocol is selected for server, set it to empty.
Should a higher protocol become available in a later release,
it will be automatically selected.
2015-12-18 18:46:54 +01:00
Safihre
2f00a878a6 Log RAR-binary and RAR-file versions 2015-12-18 17:51:47 +01:00
shypike
583c233bd2 Disable "device" field for Pushover notifications.
Not implemented.
2015-12-18 17:23:00 +01:00
shypike
3b6e9775b0 Config->Notifications: refer to 0.8.0 Help page 2015-12-18 15:29:26 +01:00
shypike
f000212b4e Fix potential crash with Windows notifications. 2015-12-18 14:00:51 +01:00
shypike
68c66de77c Handle \" constructions in filenames coming from headers. 2015-12-17 22:35:31 +01:00
shypike
bd33a729ad Fix CherryPy's header parsing bug.
Due to a bug in its header parsing, uploaded files could not contain semicolons.
CherryPy bug: 1397
2015-12-17 22:34:46 +01:00
shypike
e96597b417 Correct potential sizing error in misc.sanitize_foldername(). 2015-12-17 20:39:47 +01:00
shypike
4d9eb56d01 Update main translation file. 2015-12-17 17:12:03 +01:00
shypike
289ccba8d3 "Resume" should also produce a notification. 2015-12-17 17:10:54 +01:00
Safihre
39516d61ea Keep dropdowns open properly 2015-12-17 16:55:57 +01:00
Safihre
da9f11a7c0 Thou shalt not delete processing/unpacking jobs
Glitter allowed deleting of jobs that weren't done from history, causing
problems!
Didn't know this was not allowed.
2015-12-17 16:55:57 +01:00
Safihre
f4388d2d8a Glitter fixes
Did not show free space correctly and did not show path for downloads
still processing.
2015-12-17 16:55:57 +01:00
Safihre
4fba40b624 RSS table fix 2015-12-17 16:55:57 +01:00
Safihre
503b965bb0 New Norwegian texts 2015-12-17 16:55:56 +01:00
Safihre
4ea9eaea54 Small English updates 2015-12-17 16:55:56 +01:00
Safihre
c3b108abf2 Improve Notifications config page 2015-12-16 21:57:59 +01:00
Safihre
164114ab82 Enable Windows Notifications 2015-12-15 11:35:26 +01:00
shypike
33f45a4256 Update translations 2015-12-12 12:31:14 +01:00
Safihre
51b160da3f Sorting only worked on first page 2015-12-11 18:27:43 +01:00
Safihre
d1c1819e16 Forgot the .png 2015-12-11 13:38:04 +01:00
shypike
3adff9ea6b Update translatable text source files. 2015-12-10 16:01:18 +01:00
Safihre
3496f93cce INFO message when cache not enabled
SAB needs this cache, otherwise CPU/mem usage gets out of hand. Note: on
Windows and Mac it is turned on by default already (200M), so only for
installs from source or linux users.
2015-12-10 12:18:22 +01:00
Safihre
dcac685cee Remove leftover texts of old Wizzard 2015-12-10 12:18:18 +01:00
Safihre
a0cdf79e23 Config fixes 2015-12-10 12:18:15 +01:00
Safihre
a54ccb1f71 Use proper M/G/T/P formatting for disksizes 2015-12-10 12:18:12 +01:00
Safihre
ebeb950794 Fix multiedit bug
Would force refresh for every item when using Check All
2015-12-10 12:18:06 +01:00
Safihre
3b58aff728 Glittery things - part 3
Possible fix for retry error, generalized links, remove debug-ID
2015-12-10 12:18:00 +01:00
Safihre
8ad5ff7b8c Display passworded jobs ignored labels put by Sab
Can't rebase because already so many changes..
2015-12-07 00:49:31 +01:00
Safihre
c210636952 Decrease Glitter startup for large queues by 40%
Turns out that the <select> in the options dropdown are a hugggeeee
slowdown on initial load! Only initializing on click cuts half the speed
(especially on more than 100 items)
2015-12-07 00:23:02 +01:00
Safihre
91895d8765 Glittery things - part 2
Fix sortable, remove ugly outlines on links for Firefox, click on
search-icon focus on search-box, mobile fixes
2015-12-06 13:00:25 +01:00
Safihre
90019494ce Allow multi-edit for grabbing jobs
Requested: #404
2015-12-05 19:27:40 +01:00
Safihre
9e99d39f2c Adding RSS button to main page
User request and seemed useful to me
2015-12-05 19:27:37 +01:00
Safihre
a70addca55 Adding RSS icon through SVG
Since Bootstrap doesn't come with RSS icon..
2015-12-05 19:27:34 +01:00
Safihre
d825b40b73 Stop retrying on auth (401) errors 2015-12-05 19:27:31 +01:00
Safihre
bc3d22a06b Click on status and completed time shows details 2015-12-05 19:26:00 +01:00
Safihre
ac1d1cf24d Make RSS errors more reasonably sized 2015-12-05 19:25:58 +01:00
Safihre
05c39b2de8 Purge history items on current page
So you can use the search to remove a specific set of history items
2015-12-05 19:25:55 +01:00
Safihre
298303a239 Updating Glitter - Night
Kind of forgot about it..
2015-12-05 19:25:52 +01:00
Safihre
46d1ba7037 Drag-and-drop not on accident 2015-12-05 19:25:49 +01:00
Safihre
9d5d1d90fa Update mobile-icons
Only necessary ones
2015-12-05 19:25:47 +01:00
Safihre
58f7d563c2 Glitter CSS name update 2015-12-05 19:25:44 +01:00
Safihre
83bd8cb3a0 Improve display/editing of passworded jobs
Did not use to work in all languages!
2015-12-05 19:25:41 +01:00
Safihre
c821b583ee Select full name when clicking edit button 2015-12-05 19:25:38 +01:00
Safihre
2898d045de Highlight disabled servers 2015-12-05 19:25:35 +01:00
Safihre
f9160d286d Glittery things 2015-12-05 19:25:32 +01:00
shypike
4e20004f7b Fixes in encoding.py 2015-12-05 17:15:29 +01:00
shypike
555aadc83e Windows: convert explicit INI-path to Unicode.
On Windows, the -f parameter passes an 8bit ASCII string instead of Unicode.
2015-12-05 16:07:56 +01:00
shypike
f1029836b0 Upgrade JSON problem logging to "info" level. 2015-12-05 13:51:46 +01:00
shypike
14319ad9f5 Remove debug statement from last commit. 2015-12-05 12:09:28 +01:00
shypike
c9a4e61a3a Automatically revert to safe (but slow) JSON-encoder when encountering encoding errors.
In some situations the standard JSON encoder bails out.
In such cases, switch to safe and slow JSON encoder (from 0.7.x) for the rest of the session.
Additional logging in json.py to find out what the source of the faulty strings is.
2015-12-05 10:22:43 +01:00
shypike
d8d261132c In Config->Servers, show active servers before inactive ones. 2015-12-03 21:08:42 +01:00
shypike
a043e78a9a Do not require presence of Python's webbrowser support.
On embedded systems, the module may be missing.
Handle this gracefully.
2015-12-03 20:56:28 +01:00
shypike
4b2533d8d9 Update translatable texts. 2015-11-30 21:47:13 +01:00
Safihre
32074b9be0 Drop support for IE8 in Glitter and Config
It's almost 2016..
2015-11-30 16:48:12 +01:00
Safihre
0aba54fcf3 Change menu-icon to actual menu icon 2015-11-30 16:48:08 +01:00
Safihre
22133e4a53 Colorize server priority labels 2015-11-30 16:48:04 +01:00
Safihre
aa698d0591 Make custom pause timer more clear 2015-11-30 16:48:01 +01:00
Safihre
1e4fb79349 Increase hit targets for checkboxes and dropdowns 2015-11-30 16:47:58 +01:00
Safihre
c01e091c52 Orphaned jobs with special chars couldn't be deleted 2015-11-30 16:47:55 +01:00
Safihre
b9205d98f6 Reload Servers page on name and priority change 2015-11-30 16:47:51 +01:00
Safihre
dccf961d79 Config improvements 2015-11-30 16:47:48 +01:00
Safihre
217fe143c3 Autocomplete everywhere and for relative paths 2015-11-29 11:01:03 +01:00
shypike
69a872eac0 Update unrar for OSX to 5.30
Closes #396
2015-11-26 11:33:42 +01:00
shypike
0b6395fc1d Update unrar for Windows and OSX to 5.30
Closes #396
2015-11-25 20:31:23 +01:00
Safihre
6e5909d283 Fix enable/disable server 2015-11-25 18:35:22 +01:00
Safihre
3b48ff7bab Add folderbrowser to Categories
And make it a proper-plugin. It now handles relative paths.
2015-11-25 14:31:10 +01:00
Safihre
038a6cca6b Updating Bootstrap 2015-11-25 09:07:02 +01:00
Safihre
102eaa966b Porting FolderBrowser and AutComplete to Bootstrap
Getting rid of 2x jQuery and jQueryUI that was present in Config
2015-11-25 08:51:07 +01:00
Safihre
6bb9f3ca94 Source code formatting of Config 2015-11-25 08:51:03 +01:00
Safihre
d37cecce09 Config fixes 2015-11-25 08:50:59 +01:00
shypike
83b582d503 Correct "Movie Sorting" text. 2015-11-24 22:00:54 +01:00
shypike
53bb66ffab Correct "Enable Generic Sorting" text. 2015-11-24 21:21:55 +01:00
shypike
1b6de48ac1 Update translations 2015-11-21 12:25:40 +01:00
shypike
fe3a0cc7f7 Update text files for 0.8.0Beta3 2015-11-21 12:25:06 +01:00
Safihre
2dd26027f7 Adding help-icons to config sections 2015-11-20 20:45:29 +01:00
Safihre
7e329e8196 Small fixes 2015-11-20 16:05:01 +01:00
shypike
8f1d81cc2c Repair setting speeds in OSX top menu.
limit_speed() call no longer accepts "int" input.
Closes #392
2015-11-19 21:28:54 +01:00
Safihre
e901f3bc35 Adding selected-counter to multi-edit 2015-11-19 15:51:22 +01:00
Safihre
8d85e2887d Added folder-browser to System Folders config
And update KnockoutJS to 3.4.0 stable.
2015-11-19 13:14:00 +01:00
Safihre
fdd8775564 Error in rating reporting 2015-11-18 13:41:06 +01:00
Safihre
3f174c86a8 Re-style the speedlimit input for Plush 2015-11-18 11:35:45 +01:00
Safihre
c80a897ea0 Percentage speedlimit correct in all skins
By @shypike
2015-11-17 08:29:08 +01:00
Safihre
b913a7be09 Filelist popup correct color for Checking downloads 2015-11-16 13:45:19 +01:00
Safihre
be17f051bf Correctly display speedlimit 2015-11-16 13:45:18 +01:00
shypike
1c388faf42 Fix option to enable duplicate checking from backup folder.
Fixed error introduced by 8a166729d4
Closes issue #390
2015-11-14 13:34:21 +01:00
Safihre
3e9188c81b CSS fixes 2015-11-09 17:14:51 +01:00
Safihre
244a7a4c27 Prevent flickering in History 2015-11-09 17:14:51 +01:00
shypike
4c19fcbbfa Undo change to translatable text. 2015-11-09 17:09:16 +01:00
Jonathon Saine
01fe99dbf2 code cleanup and spelling corrections 2015-11-08 14:11:26 -06:00
shypike
90b999b8e8 Fix errors in Danish translation. 2015-11-08 16:46:36 +01:00
shypike
55ede71b4d Update translations 2015-11-08 16:40:02 +01:00
shypike
0bd6cc08dd Update translations 2015-11-06 19:27:36 +01:00
shypike
2117964ce6 Update main POT file 2015-11-06 19:26:17 +01:00
shypike
97862a941c Update text files for 0.8.0Beta2 2015-11-06 19:21:16 +01:00
Safihre
7513f230ba Small Glitter fixes 2015-11-06 16:37:35 +01:00
Safihre
6b48b1806c Adding delete all orphaned in Python
Instead of sending x times a delete request, do it internally.
2015-11-06 16:37:35 +01:00
Safihre
adb07d8c44 Add schedule option to remove completed jobs
FR #118
2015-11-06 16:37:34 +01:00
shypike
8a166729d4 Add option to enable duplicate checking from backup folder. 2015-11-06 16:36:12 +01:00
Safihre
8f054add39 Updating RSS Config pages 2015-10-31 20:01:54 +01:00
shypike
a2ccc98228 One-time conversion of "speedlimit" schedules by appending "K" to speed.
The old definition was in 1K units, while we now use KMGT notation.
This calls for a one-time conversion of scheduled speeds.
2015-10-31 19:45:20 +01:00
shypike
72c37f0b7c Disable "device" field for PushBullet.
Will be fixed once we query for devices.
2015-10-31 18:44:02 +01:00
Safihre
2ee7e638d1 Fix for clear counters and delete server 2015-10-29 19:51:45 +01:00
Safihre
5addc56d36 Limit check of IPv4 IP when not needed 2015-10-29 13:18:32 +01:00
shypike
56a89cedc1 Make sure "permissions" always result in user-writable folders and files.
Required for "incomplete" folder and for renaming output files.
2015-10-28 16:46:32 +01:00
Safihre
1a594cbabd Fix confirm on enable/disable server button 2015-10-28 15:51:07 +01:00
Safihre
badb32e959 Make Config bit more uniform
We don't use this class anymore
2015-10-28 15:51:06 +01:00
Safihre
479cab1a83 Bugfix in Config save 2015-10-28 15:51:06 +01:00
shypike
d3d5f37d49 Prevent reserved Windows device names from ending up in file names. 2015-10-28 15:45:02 +01:00
shypike
7174e3fa51 Support older PyOpenSSL versions.
Older versions miss SSLEAY_VERSION.
2015-10-28 14:18:32 +01:00
shypike
dcaccad358 Show available SSL protocols for a Usenet server.
Determine available protocols.
Log information about SSL libraries.
2015-10-27 17:07:17 +01:00
Safihre
7aa5087976 Adding Post age as extra column option 2015-10-27 14:08:11 +01:00
Safihre
4936337e84 Streamlining error/warning display 2015-10-27 14:08:08 +01:00
Safihre
e968ff5617 Fix for Orphans with special char's (Chinese) 2015-10-26 16:55:16 +01:00
Safihre
98f826a88c Stop breaking when localStorage not available 2015-10-26 16:27:27 +01:00
Safihre
95673a7d51 Better date-time formatting 2015-10-26 16:27:24 +01:00
Safihre
204bc9758b Prevent zoom on tablets when opening modal 2015-10-25 10:51:20 +01:00
Safihre
911277e1d0 Adding a hide button to the feedback window 2015-10-25 10:51:18 +01:00
shypike
e96e64320a Series renaming wasn't working properly on Windows.
Renaming based on partially shortened Windows paths didn't work.
Restore original paths of unpacked files first.
2015-10-25 01:06:44 +02:00
shypike
2257a4e6f7 Correct quoting in Chinese email templates. 2015-10-24 19:43:51 +02:00
Safihre
7012fbf4b7 Config navbar did not fit for all languages 2015-10-23 22:17:01 +02:00
Safihre
6c05066c8d Uncheck check-all on delete or page switch 2015-10-23 22:16:56 +02:00
shypike
0cb3872fb5 Yet another patch in CherryPy 2015-10-23 20:11:50 +02:00
Safihre
237b35dbdb Removing bandwith question from Wizard 2015-10-23 20:04:12 +02:00
Safihre
77262f7479 Clear searchterm in queue/history by hitting escape
Small usability bonus.
2015-10-23 20:04:12 +02:00
Safihre
8c20776860 Making modals closable by pressing escape 2015-10-23 20:04:12 +02:00
Safihre
6356ddee67 Adding confirmation if not saving changes in Config 2015-10-23 20:04:12 +02:00
Safihre
f445c37ca8 autocomplete=off for any forms with passwords
It might stop some browsers of autofilling stuff they shouldn't. However
if the user chose to save a username/password all modern browsers ignore
autocomplete=off.

https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
2015-10-23 20:04:12 +02:00
Safihre
e52f73b0e6 Updating the wizard
Make everything more user-friendly and streamlined. Port and and # of
connections are now placed under 'Show more'. Clicking SSL will change
the port to 563.
Username and option for SSL removed from the wizard, they can be enabled
in the Config.
2015-10-23 20:04:12 +02:00
Safihre
d8b6f69074 File wasn't found for new users 2015-10-23 20:04:11 +02:00
Safihre
0d964dfeef Improving showing of special chars 2015-10-23 20:04:11 +02:00
Safihre
ff14b3953c Feedback button on the side for beta/alpha versions
It shows a list of ways to contact us. Hopefully we get some more
feedback this way.
The button only shows for beta/alpha/Github versions and so I did not
add extra translations since these users know what they are getting in
to.
2015-10-23 20:04:11 +02:00
Safihre
75cedebc8d Visual fixes 2015-10-23 20:04:11 +02:00
Safihre
0b56ce29c0 Check all should only check visible items 2015-10-23 20:04:11 +02:00
shypike
453c7dd3cb PushBullet settings not handled properly in UI
Booleans coming from HTML forms need special treatment.
Closes #372
2015-10-23 15:10:53 +02:00
SanderJ
8e90325942 SSL: cleaning up 2015-10-21 20:56:55 +02:00
SanderJ
25070cc857 Print SSL system info in sabnzbd.log: try/except added 2015-10-21 20:56:55 +02:00
SanderJ
35781bfdc8 Print SSL system info in sabnzbd.log 2015-10-21 20:56:55 +02:00
shypike
758cac6336 Another patch of CherryPy.
Prevent crash when encountering a pathless URI.
2015-10-21 20:53:51 +02:00
shypike
c38cecb240 Further limit "incomplete" paths on Windows.
Limit base path to 40.
Limit job folder path to 70.

Closes #368
2015-10-16 22:39:10 +02:00
shypike
cf1d57e6e0 Override IPv6 test when Special ipv6_test_host is empty.
Assume proper working of IPv6.
Closes #367
2015-10-15 10:20:46 +02:00
shypike
396449664b Update translations 2015-10-14 22:37:47 +02:00
shypike
6fcb656292 Prevent crash when reporting overlong Windows download-folder path. 2015-10-14 21:43:18 +02:00
shypike
71d41bf0df Fix problem with duplicate checking.
Fixes commit 74e5f19252
2015-10-11 17:11:50 +02:00
shypike
b27280c752 Remove noofslots_total from History.
Variable is for queue, not history.
2015-10-10 18:02:09 +02:00
shypike
51db79d970 Update main POT file. 2015-10-10 17:35:22 +02:00
shypike
62c066e3f8 Fix error in handling ZIP files retrieved from an indexer. 2015-10-10 17:12:30 +02:00
shypike
8fcb5cf1c1 Update translations 2015-10-10 16:50:37 +02:00
shypike
ed091dd43e Server priority should ignore blocked servers. 2015-10-10 15:29:48 +02:00
shypike
5c29852033 Replace --no-api-log command line switch with the "special" option "api_logging".
More elegant code and automatically persistent.
2015-10-10 12:10:08 +02:00
Jonathon Saine
65f8fa7b5d Removed addID from api, changed reference in Plush to use addurl instead. Tested and ensured plush still worked fine. 2015-10-10 11:56:30 +02:00
shypike
74e5f19252 Series duplicate action and normal duplicate action were not independent. 2015-10-10 11:54:34 +02:00
Jonathon Saine
811e93e926 Fix dupe check logic, re-order so md5sum is used first (quickier / less prone for false positives). Since the same NZB release can actually be different depending on how the indexer obtained it (provided from user, vs indexed from usenet manually), added some debug logging. 2015-10-10 00:29:58 -05:00
shypike
4ce3c89928 Current post-processing job was shown as an orphan.
Side effect of an unneeded change in commit 6eedd99 "Redesign of retry for failed URL fetches".
2015-10-09 20:38:40 +02:00
Safihre
b6d4d7ab92 When searching, go to page 1 of results 2015-10-08 22:27:32 +02:00
Safihre
43abe40579 Added text to Plush speedlimit 2015-10-08 22:27:30 +02:00
Safihre
5857a60ceb Use localStorage smarter in Knockout 2015-10-08 22:27:29 +02:00
Safihre
c038395d17 Option to disable confirmation on removal
For Queue (queue items & warnings) and History (history-items and
orphaned jobs)
2015-10-08 22:27:27 +02:00
Safihre
655d623040 Adding more date formats 2015-10-08 22:27:25 +02:00
Safihre
1809a5a1fc Less translations 2015-10-08 22:27:23 +02:00
Safihre
43f9350491 Fix the enable button in Server-config 2015-10-08 22:27:21 +02:00
Safihre
08d4cb3204 Fixing tooltips for new Bootstrap 2015-10-08 22:27:20 +02:00
Jonathon Saine
6fb4d7ece3 More pep8 cleanup, (revert) unused variables by import / duplicate imports / misspelling / some minor renames to avoid using built-in names (list/set/id/etc). Will cleanup addID in another pull. 2015-10-08 22:04:20 +02:00
shypike
e840b8251b Queue size not influenced by filtering. Add total number of queue slots.
The "to do" size of the queue is not reduced by any search criteria.
Add template variable noofslots_total to reflect the total number of un-paused items.
2015-10-08 22:01:00 +02:00
shypike
466bbf2694 Corrections in duplicate checking.
Fix incorrect duplicate decision logic.
Remove "fetch" entry after duplicate job has been ignored.
2015-10-05 21:35:50 +02:00
shypike
3293a8b91d Sort servers in Status view too.
And correct an error in the Config->Servers sort.
2015-10-05 20:40:02 +02:00
shypike
6b547b35ae Fix access issue with folder browser.
Folder browsers should use TAPI calls instead of API calls.
Would fail when a username/password is set, while API-key disabled.
Solves #353
2015-10-05 09:40:33 +02:00
Safihre
48520c1015 Making the logo a link to reload the page 2015-10-04 20:42:39 +02:00
Safihre
147f909495 Adding optional column for extra information 2015-10-04 20:42:39 +02:00
Safihre
a97e7c86f1 Adding tabs to the Status and interface options 2015-10-04 20:42:39 +02:00
shypike
cfed5f8978 Fix issues with speed limiter. 2015-10-04 20:37:39 +02:00
shypike
37f8114d3f Accept both percentage and absolute speedlimit in Scheduler.
Also accept KMG notation for absolute limits.
2015-10-03 22:45:37 +02:00
shypike
189dca1e76 Sort servers on priority and then on display name. 2015-10-03 19:40:26 +02:00
Safihre
4f5ba027ba Resolving scrollbar issue 2015-10-03 16:27:11 +02:00
Safihre
460c51896b Updating bootstrap
However, not updating the Glyphicons because the new ones are not as
sharp as the old ones. Especially on Windows.
2015-10-03 16:14:54 +02:00
Safihre
3acfdc3e56 Adding search function to the queue 2015-10-02 14:04:06 +02:00
Safihre
f739d86112 Limit upload file types 2015-10-02 13:44:23 +02:00
Safihre
275f8d7ff8 Bugfix for long names and 10 video/audio ratings 2015-10-01 15:46:05 +02:00
Safihre
23bf17135f Adding server-priority to main server-view 2015-10-01 13:05:08 +02:00
Safihre
282b3c00c5 Removing obsolete template variables
They are really not used anymore in the interface.
2015-10-01 02:07:36 +02:00
shypike
4e5badf832 Add absolute speed limit to output of API-calls "qstatus" and "queue".
Add parameter "speedlimit_abs" to API-call "queue".
Add parameters "speedlimit" and "speedlimit_abs" to API-call "qstatus".
2015-09-30 22:20:06 +02:00
shypike
80326e3898 Remove https/ipv6 work-around for Python 2.5 on Windows.
We no longer support Python 2.5
2015-09-30 21:23:49 +02:00
Jonathon Saine
f75cb44a24 moved regex define before use (save memory when code branch isnt ran), calculate expire time once (save cpu cycles), reserved word (only some) & undefined & unused variables, depreciated has_key, more spelling and docstring cleanup 2015-09-30 21:03:21 +02:00
Safihre
da300e0676 Removing last bits of Mobile template 2015-09-30 16:52:24 +02:00
shypike
dd3ec6ab7a Merge pull request #348 from shypike/happy-eyeballs
Happyeyeballs improvements.
2015-09-30 08:42:25 +02:00
sanderjo
b883875025 Happyeyeballs improvements. 2015-09-29 21:41:53 +02:00
shypike
47c33467ee Merge pull request #346 from thezoggy/develop--pep8_pt3
More pep8 non-agressive fixes.
2015-09-28 21:46:37 +02:00
Jonathon Saine
cc0b15eb46 More pep8 non-agressive fixes. 2015-09-28 12:58:30 -05:00
shypike
31f60a5395 Fix typo in interface.py 2015-09-28 16:44:13 +02:00
shypike
ed3633c8d7 Merge pull request #343 from Safihre/develop
One-time notice of new skin
2015-09-28 16:24:53 +02:00
Safihre
036d7cd8a0 One-time notice of new skin
Only for existing users
2015-09-28 16:09:37 +02:00
shypike
86a7c0a593 Merge pull request #342 from Safihre/develop
Fixes and adding option for custom pausing
2015-09-28 13:37:54 +02:00
Safihre
75b7602e0c Adding an option for custom pause duration 2015-09-28 12:19:43 +02:00
shypike
511a96fbb4 Merge pull request #341 from thezoggy/develop--pep8_pt2
Develop  pep8 pt2
2015-09-28 10:03:13 +02:00
shypike
1d49f8380b Update skin & color table
Remove mobile and add Glitter.
2015-09-28 09:47:21 +02:00
Safihre
d8573e6bd5 Fixing Unblock server button 2015-09-28 09:26:42 +02:00
Safihre
9bf3c68702 Fixing warnings on queue > HD space 2015-09-28 08:42:02 +02:00
Jonathon Saine
40afd2e4d1 More PEP8 non-agressive whitespace cleanup. 2015-09-27 11:05:49 -05:00
Jonathon Saine
c015ac2656 Remove legacy nzbsrus logic, pep8 cleanup (non-agressive) 2015-09-27 10:57:31 -05:00
shypike
28c805ffde Update main POT file. 2015-09-25 21:36:44 +02:00
shypike
3c4b09af75 Make more error and warning strings translatable. 2015-09-25 21:35:47 +02:00
shypike
b6aff4272f Don't send a notification when reloading a pre-checked job. 2015-09-25 21:16:04 +02:00
shypike
8567fd71a2 Merge pull request #337 from thezoggy/develop--pep8
sab 0.8.x -- dev pep8
2015-09-25 20:24:09 +02:00
shypike
449111ccf8 Merge pull request #338 from Safihre/develop
Adding dark mode to Glitter
2015-09-25 20:22:37 +02:00
Safihre
b6681d4b67 Adding dark mode to Glitter 2015-09-24 18:51:07 +02:00
Jonathon Saine
565f5fd762 Some pep8 cleanup (whitespace/docstring only), focus on root dir along with scripts/tools/util. 2015-09-23 08:47:18 -05:00
shypike
bcf5343617 Merge pull request #332 from Safihre/develop
Interfaces fixes part 5
2015-09-20 19:59:20 +02:00
Safihre
026bab8249 Adding clear button to search field 2015-09-19 23:06:01 +02:00
Safihre
745c8b904e CSS improvements 2015-09-19 23:06:00 +02:00
Safihre
200b293135 Showing 'Default' instead of * 2015-09-19 23:05:58 +02:00
shypike
1ba588f530 Text files for 0.8.0Beta1 2015-09-17 19:08:15 +02:00
shypike
bcbe15e8c9 Update translations 2015-09-17 18:54:22 +02:00
shypike
04198f6606 Merge pull request #331 from sanderjo/geiranger-sab-better-test_ipv6
Geiranger commit: better test_ipv6()
2015-09-16 10:13:46 +02:00
sanderjo
26712d85bb Geiranger commit: better test_ipv6() 2015-09-15 19:18:09 +02:00
shypike
687aab7f90 Windows: prevent temp paths from ending with a period
The misc.trim_win_path() function failed to remove trailing spaces and periods.
2015-09-14 11:40:26 +02:00
shypike
c6dece737f Move sample scripts to a separate folder. 2015-09-11 21:16:04 +02:00
shypike
d3fb46433b Merge pull request #325 from Safihre/develop
Interface fixes part 4
2015-09-11 20:32:23 +02:00
Safihre
fa49a26ca6 Fixing load-balancing setting in Config 2015-09-11 18:28:38 +02:00
Safihre
b10344545b Style fixes for Config 2015-09-11 16:17:42 +02:00
shypike
f7e69b3603 Fix typo in commit 7bb3dd39d4 2015-09-11 07:15:01 +02:00
shypike
2f88a2085e Update translations 2015-09-10 21:06:49 +02:00
shypike
6737937f93 Merge pull request #322 from Safihre/develop
Interface fixes part 3
2015-09-10 21:06:00 +02:00
shypike
7bb3dd39d4 Fix first script parameter when running on Windows.
Bug in Python's path library on Windows.
os.path.normpath() does not convert long-path notation "\\?\d:\tv\bla\bla\.." to "\\?\d:\tv\bla".
Instead use os.path.abspath() in tvsort's function move_to_parent_folder().
2015-09-10 21:01:28 +02:00
Safihre
378ed873b7 CSS fixes for Glitter 2015-09-10 16:45:10 +02:00
Safihre
63fd88a04f Adding back text that should not have been removed
Oops, my fault!
2015-09-10 13:44:46 +02:00
Safihre
97343a9318 Auto-scroll to Multi-edit form
In case the queue is so long the MultiEdit is out of view, it will
scroll to it.
2015-09-10 13:44:44 +02:00
Safihre
858e19fffd Fixing amount left in title 2015-09-09 11:49:34 +02:00
Safihre
dd4fe01036 Moving sort button to top of queue 2015-09-09 11:42:57 +02:00
shypike
355ae2d60d Merge pull request #321 from Safihre/develop
Interface fixes part 2
2015-09-08 17:12:31 +02:00
Safihre
7f94f7856b Adding age on queue hover 2015-09-08 14:32:02 +02:00
Safihre
3618182483 Fixing freeze after sorting 2015-09-08 10:27:05 +02:00
Safihre
5d72e2a208 Pagination fix, human-readable queue size left 2015-09-08 10:27:01 +02:00
Safihre
7718af966d Fancy file button in retry dialog of Glitter 2015-09-08 10:26:57 +02:00
Safihre
7f1a007136 Correctly display long server-names in Config 2015-09-08 09:36:28 +02:00
shypike
986eb039a2 Fix IPv6 test.
Scope issue prevented correct result.
Solves #319
2015-09-07 23:35:09 +02:00
shypike
bde88cba7a Merge pull request #317 from Safihre/develop
Interface fixes
2015-09-07 14:29:16 +02:00
shypike
74168869cf Make the host used for testing IPv6 user configurable. 2015-09-07 13:49:41 +02:00
Safihre
302ecbe7fd Adding icon when a Special is different from default 2015-09-07 11:48:12 +02:00
Safihre
bb2bb5374a Show indicator of number of errors on top
This in case of very long queue the errors might be hidden
2015-09-07 10:33:25 +02:00
Safihre
18b5900226 Removing Info sign from history-info
Overlapped too much with the text
2015-09-07 10:33:22 +02:00
Safihre
ec1ea2e51d Update script log modal 2015-09-07 10:33:19 +02:00
Safihre
38ddef5cd9 Hide notifications options that cannot be used anyway 2015-09-07 10:33:15 +02:00
Safihre
70716e47be Adding more tooltips 2015-09-07 10:33:11 +02:00
shypike
891100343d Make error detection in urlgrabber more flexible.
Different platform have different exceptions for incorrect SSL certificates.
2015-09-07 10:03:15 +02:00
shypike
42cad7309a Make https certificate verification the default. 2015-09-07 09:26:01 +02:00
shypike
d19c65ae8f Return correct disk usage even if destination folder doesn't exist yet.
This prevents error messages in the UI.
2015-09-07 09:25:11 +02:00
shypike
ba6376f453 Update translations 2015-09-07 08:50:23 +02:00
shypike
940e1a1d69 Update main POT file. 2015-09-07 08:50:05 +02:00
shypike
9c51acdc0b Merge pull request #309 from Safihre/develop-skinny
Cleaning skin texts
2015-09-07 08:45:31 +02:00
shypike
75da736f64 Merge pull request #314 from Safihre/develop
Update Mime-type to Gzip also fonts
2015-09-06 13:21:24 +02:00
Safihre
c05459d71c Config Server Toggle now has label
For @thezoggy
2015-09-06 00:09:42 +02:00
Safihre
13b97203fc Update Mime-type to Gzip also fonts 2015-09-06 00:05:26 +02:00
Safihre
bb01be4af5 Fix for language not being saved on Back in Wizard 2015-09-05 23:25:25 +02:00
Safihre
6c9b074cd4 Adding translations to wizard page 1 2015-09-05 23:25:24 +02:00
Safihre
6c98332b78 Cleaning skin texts 2015-09-05 23:25:22 +02:00
shypike
adb95c365e Add --no-api-log to prevent a polluted log during testing.
Will not log API calls.
2015-09-05 15:29:31 +02:00
shypike
72547abe06 Merge pull request #311 from sanderjo/develop
A 404's redirect now keeps the FQDN in place
2015-09-05 10:17:15 +02:00
shypike
ed27256d44 Fix logging of call to user script.
Also fix an incorrect comment.
2015-09-05 10:11:15 +02:00
sanderjo
2c461ce2ed sabnzbd.BROWSER_URL still needed 2015-09-04 21:32:57 +02:00
sanderjo
5ed9f6f30c A 404's redirect now keeps the FQDN in place 2015-09-04 19:10:01 +02:00
Safihre
1c5b9c650f Comment update IPv6 2015-09-04 10:26:01 +02:00
shypike
62e80940a0 Merge pull request #308 from Safihre/develop
IPv6 testhost and HappyEyeballs
2015-09-03 22:47:07 +02:00
Safihre
dbac3a463d Making HappyEyeballs default 2015-09-03 17:12:09 +02:00
Safihre
2d671883e8 Changing IPv6 testhost to test-ipv6.sabnzbd.org 2015-09-03 17:11:57 +02:00
shypike
f224b265d4 Merge pull request #307 from Safihre/develop
Improve CPU usage on Firefox
2015-09-03 12:27:36 +02:00
Safihre
02b655ae50 Improve CPU usage on Firefox
Firefox uses very high CPU for anything animated.
Disables animations on progress-bar and make the History-'processing' a
block animation
Can be removed if it's performance gets better in the future..
2015-09-03 12:17:54 +02:00
shypike
1fae29f125 Merge pull request #306 from Safihre/develop
Glitter improvements.
2015-09-03 10:20:31 +02:00
Safihre
aeeb2e9421 Adding host:port text to SMTP in Config 2015-09-03 10:07:03 +02:00
Safihre
7d73799f5b Remove Json.py license 2015-09-03 09:46:09 +02:00
Safihre
c19fb43f80 Better handling of removed orphaned jobs in GUI of Glitter 2015-09-03 09:46:05 +02:00
shypike
d0409ea706 Update main POT file. 2015-09-01 21:32:41 +02:00
shypike
4314787283 Merge pull request #305 from Safihre/develop-plushfix
Plush fix for reporting
2015-09-01 08:09:14 +02:00
shypike
1d1eddabea Merge pull request #300 from Safihre/develop-newage
Removing Mobile template
2015-08-31 22:54:42 +02:00
Safihre
b4bbb27c55 Plush fix for reporting 2015-08-31 13:58:02 +02:00
shypike
ce55e0f4b2 Merge pull request #304 from Safihre/develop-plushfix
Fix for hover problems in Plush
2015-08-31 13:28:08 +02:00
Safihre
c0c2037a52 Fix for hover problems in Plush 2015-08-31 11:16:19 +02:00
shypike
76bdef4573 Merge pull request #303 from Safihre/develop
Adding translations to dashboard in Plush + bugfix
2015-08-30 22:40:27 +02:00
Safihre
7956e9f5d1 Updating Knockout 2015-08-30 11:26:57 +02:00
Safihre
693f79f09c Adding translations to Dashboard in Plush 2015-08-30 11:13:33 +02:00
Safihre
d81c389904 Bugfix for sortable in Glitter 2015-08-30 10:10:32 +02:00
shypike
6cc9e8e661 Fix crash error in logging
Fix problem introduced in commit 5f1c9cc21a
2015-08-28 14:15:56 +02:00
shypike
4d19f756cb Merge pull request #299 from Safihre/develop
Adding animations to Glitter
2015-08-28 08:53:02 +02:00
shypike
4cd99e0446 Update main POT file. 2015-08-27 22:13:34 +02:00
Safihre
13ec1cd2aa Changing dashboard text to 'Local IPv6'
Different thing!
2015-08-27 21:08:28 +02:00
Safihre
c0a8feb324 Remove empty directories of Classic/Mobile template 2015-08-27 20:41:37 +02:00
Safihre
34d4776f30 Removing Mobile template
Glitterrified!
2015-08-27 20:41:32 +02:00
Safihre
b54af908b1 Adding animations to Glitter
A little more fun!
2015-08-27 20:27:52 +02:00
shypike
13cee2dd99 Merge pull request #297 from Safihre/develop
Fix for toggle server in config
2015-08-26 22:03:57 +02:00
Safihre
afbfe809ad Fix for toggle server in config 2015-08-26 08:44:46 +02:00
shypike
a703873652 Improve logging of failed urlgrabber attempts. 2015-08-25 21:47:40 +02:00
shypike
5f1c9cc21a Log unpack passwords that are read from a file. 2015-08-25 21:24:21 +02:00
shypike
2df2bfff3e Merge pull request #296 from sanderjo/happy-eyeballs-gui
GUI for Happy Eyeballs
2015-08-25 20:47:10 +02:00
sanderjo
091756aa31 GUI for Happy Eyeballs 2015-08-25 20:10:51 +02:00
shypike
ac89838369 Improve error messages when using incorrect login date for Usenet server.
Replace cryptic server message with readable text.
2015-08-25 20:04:59 +02:00
shypike
a339ef53d3 Merge pull request #295 from Safihre/develop
Updating KnockoutJS to latest version
2015-08-25 18:42:14 +02:00
Safihre
97fd225eaf Updating KnockoutJS to latest version
Performance improvements for Firefox and Chrome.
2015-08-25 15:23:04 +02:00
shypike
77537d2dc7 Merge pull request #294 from jcfp/patch-1
README.md: fix command for bg process
2015-08-25 13:19:03 +02:00
jcfp
6ecdcedc35 README.md: fix command for bg process
re: https://forums.sabnzbd.org/viewtopic.php?f=11&t=19403
2015-08-25 12:51:47 +02:00
shypike
f3f3842545 Merge pull request #290 from Safihre/develop-unite
Removing skin-specific config pages
2015-08-25 12:03:06 +02:00
shypike
0841ebcdfc Merge pull request #288 from Safihre/develop
Adding info message for orphaned folders and updates.Fixing clear-speedlimit and storage/path in history.
2015-08-25 11:54:05 +02:00
Safihre
504097027f Adding info message for orphaned folders and updates
If more than 3 orphaned folders are found, display a message. Check this
every other day.
2015-08-24 11:45:30 +02:00
Safihre
f07897a34c Fixing clear-speedlimit and storage/path in history
Clear speedlimit icon was only clickable on Chrome. History only needed
path, not storage.
2015-08-22 20:43:58 +02:00
Safihre
f4b8524b76 Removing skin-specific config pages
All should use Uni-config.
2015-08-21 13:41:36 +02:00
shypike
6c2ce3be64 Merge pull request #284 from Safihre/develop
Adding missing options to Glitter
2015-08-18 22:13:30 +02:00
Safihre
91f4f47df4 Adding missing options to Glitter
Options that were in Plush but not yet in Glitter
2015-08-16 22:01:46 +02:00
shypike
48d83974f9 Merge pull request #281 from Safihre/develop
Adding toggle Show All/Show Failed to Glitter History. Setting CherryPy default favicon.
2015-08-16 17:15:24 +02:00
Safihre
ee39ec8139 Setting default favicon for CherryPy to SABnzbd 2015-08-16 10:11:00 +02:00
Safihre
a71bc99bc0 Adding toggle Show All/Show Failed to Glitter History. 2015-08-15 19:07:18 +02:00
shypike
e331a57303 API-call "history" now accepts one or more "category" parameters in order to filter.
api?mode=history&category=TV&category=*
This will select for category "TV" AND "Default"
2015-08-15 15:10:41 +02:00
shypike
b8889756d4 API-call "addurl" now returns a list of nzo_id's, which will be valid for the actual jobs.
The nzo_id of a "future" entry will now be re-used for the actual job.
Rename api.addid to api.addurl because API-call addid is deprecated.
2015-08-15 10:54:20 +02:00
shypike
c823de5d91 Fix selection of wrong category when the default category of an RSS stream has been removed from categories. 2015-08-14 23:42:59 +02:00
shypike
4ec8b47cf1 Improve error handling in url grabber. No retries on unresolvable errors. 2015-08-14 23:42:48 +02:00
shypike
e1c91ab001 Don't return a work_path for future jobs, because there is none. 2015-08-14 23:42:37 +02:00
shypike
6eedd99deb Redesign of retry for failed URL fetches.
Remove the clumsy embedded link in the error message.
Instead use the Retry for normal jobs.
Use the obsolete "report" field in the database to store the type of the job, "future" for failed fetches.
2015-08-14 23:42:26 +02:00
shypike
87949e25b3 Another patch for CherryPy 3.8.0
This error keeps coming back.
https://bitbucket.org/cherrypy/cherrypy/issues/1296/attributeerror-module-object-has-no
2015-08-14 21:06:01 +02:00
shypike
c0dcc4df12 Merge pull request #280 from Safihre/develop
Integrating icon font Woff as Base64 into CSS for Config and Glitter. Adding file-size to Job-details popup in Glitter.
2015-08-14 20:04:57 +02:00
Safihre
d9d27df77d Adding file-size of each file to job-popup in Glitter
Filenames get truncated in the center for longer names.
2015-08-14 15:07:40 +02:00
Safihre
72b1f31f44 Integrating icon font Woff as Base64 into CSS for Config and Glitter
This fixes any problems that Chrome has with fonts on auth/https
connections that don't have valid certificates. Both Firefox and Chrome
use Woff font's, so only for IE it will have to download 20kb extra of
the CSS while for FF/Chrome it will lower the number of requests by 1.
2015-08-14 11:28:20 +02:00
shypike
05d2f9f2f9 Fix URL for version retrieval. 2015-08-13 21:36:06 +02:00
shypike
7c9c0aa52e Improve check_version() and clean code
Remove unused functions.
Move bad_fetch() from misc to url grabber.
Move OrderedDict port from misc to its own file.
Improve check_version().
2015-08-13 21:26:14 +02:00
shypike
edf39f8e7d Bump required CherryPy to 3..8.0
Avoid CP settings that will become obsolete.
2015-08-13 19:49:57 +02:00
shypike
a7c38434d7 Patch CherryPy to avoid Unicode bugs in PyOpenSSL 0.14
On some systems this resulted in a crash.
This was patched before in the previous CherryPy in
commit d1a87c4564
2015-08-12 22:38:25 +02:00
shypike
30be2c447a Add patch file for CherryPy 3.8.0 2015-08-12 22:24:06 +02:00
shypike
da9e39367d Patch CherryPy to support 301 redirection.
Needed to support the broken Bonjour/ZeroConfig protocol that
only allows an HTTP address to set, even for a HTTPS-only server.
2015-08-12 22:24:06 +02:00
shypike
1889ecd6fb Add official CherryPy 3.8.0 release. 2015-08-12 22:24:06 +02:00
shypike
23815b6a8e Allow all CherryPy releases, starting with 3.2.2 2015-08-12 22:24:06 +02:00
shypike
3c5fe11299 Update main POT file. 2015-08-12 22:20:51 +02:00
shypike
3c442966c4 Replace own JSON module by the standard library. 2015-08-12 21:52:47 +02:00
shypike
c589b23708 Merge pull request #275 from Safihre/develop
Opt-out for global options in Glitter. RSS config page fixup. Config restart SAB fixup. Fixes for mobile/tablet.
2015-08-12 14:54:47 +02:00
Safihre
be96b84e7b Improving Glitter and Config for mobile/tablet 2015-08-12 14:30:43 +02:00
shypike
826173cf5f Merge pull request #278 from sanderjo/one-traceback-less
less traceback logging in cases like ipv6-only server on ipv4 connection
2015-08-10 20:50:37 +02:00
Safihre
c601168d07 Config restart update
Config restart now shows a splash screen. On the General-tab choosing
'Save settings' will now ask if you also want to Restart SAB as well.
2015-08-10 12:57:17 +02:00
Safihre
1cc6e323b9 RSS Config page fixup 2015-08-10 12:57:15 +02:00
Safihre
cf8ddb6e7c Making global interface settings optional in Glitter 2015-08-10 12:57:13 +02:00
SanderJ
f940d61c52 less traceback logging in cases like ipv6-only server on ipv4 connection
https://github.com/sabnzbd/sabnzbd/issues/277
2015-08-09 16:52:40 +02:00
shypike
a706820ee7 Merge pull request #270 from Safihre/develop
Saving Glitter refresh-rate and page-limits in general config. Adding a central speedhistory. Adding icons to Config.
2015-08-07 20:38:18 +02:00
shypike
755deb94d9 Update unrar to release 5.21 2015-08-06 20:42:07 +02:00
Safihre
29cbc6e10b Adding central speedhistory
Adding a central speed history within SAB, a feature many download
programs have and I think SAB could use! This way you can actually see
what happened when the browser was not open.
When there is no download-activity nothing really happens, it only calls
and updates (in case 0's need to be added) when the main.tmpl file is
called. In Glitter this is only once.
It does add consecutive numbers to a list, but this should not be a
memory hog.
2015-08-06 20:39:27 +02:00
shypike
ccf7060932 Merge pull request #271 from sanderjo/HappyEyeballs
Implement HappyEyeballs
2015-08-06 19:51:21 +02:00
sanderjo
4571ea414a Implement HappyEyeballs 2015-08-05 20:00:40 +02:00
Safihre
b1bb6d2a10 Adding icons to Config
TODO: RSS-details page
2015-08-05 10:41:19 +02:00
Safihre
20b98e95f5 Saving refresh-rate and page-limits in general config
refresh_rate and history_limit were already in the config but not used.
Added queue_limit.
This way these settings are the same no matter what device or browser
you use to connect to your SAB system.
2015-08-05 10:41:15 +02:00
shypike
bfa06e79c5 Windows: fix Unicode crash when encountering odd names in par2 file sets.
On Windows, file names coming from console output of par2.exe needs to be converted to Unicode.
2015-08-04 23:09:52 +02:00
shypike
f9ab3f193d Merge pull request #267 from Safihre/develop
Added 'Browse' to translation, graphic fixes. Replacing tabs by spaces in Glitter.
2015-08-04 20:45:53 +02:00
Safihre
6f7adb8e29 Replacing tabs by spaces in HTML/CSS of Glitter 2015-08-03 13:52:14 +02:00
Safihre
f0cc967c0c Config - Added 'Browse' to translation, graphic fixes
Both in Glitter (Add-NZB) and in Config added the word 'Browse' so that
is now also in Config multi-languages.
2015-08-02 19:22:17 +02:00
shypike
b48db17f37 Update main POT file. 2015-08-01 21:25:36 +02:00
shypike
76b9971d06 Merge pull request #266 from Safihre/develop
Customized Add-NZB in Glitter, added extra tooltips
2015-08-01 21:17:11 +02:00
Safihre
3564fc3c5c Customized Add-NZB in Glitter, added extra tooltips 2015-08-01 16:06:42 +02:00
shypike
b9bc0cf344 Decrease size of preamble in Config->Special. 2015-08-01 15:20:18 +02:00
shypike
1b4e30bcee Update main POT file. 2015-08-01 15:12:44 +02:00
shypike
c8e11549d1 Some touch-ups of Config. 2015-08-01 15:11:45 +02:00
shypike
993733cc8b Remove tab characters. 2015-08-01 15:01:11 +02:00
shypike
19ff1db3c4 Merge pull request #260 from Safihre/develop-newconfig
Redesigning the Config look.
2015-08-01 14:30:57 +02:00
Safihre
ac7607e952 Redesigning the Config 2015-08-01 14:08:08 +02:00
shypike
10d345f9c4 Enable renaming of Usenet servers.
- Renaming by showing a separate display name
- Backwards compatible: no damage to schedules and server counters
- Add multi-line field for personal server notes
2015-08-01 10:43:33 +02:00
shypike
d56c19ae1d The 301 redirection message should use the IP of the caller.
301 should not use "localhost" but the actual IP of the calling client.
Needed to support Bonjour/Zerconfig.
2015-07-31 20:53:39 +02:00
shypike
d1a631f801 Fix broken Speedlimit in Scheduler. 2015-07-30 21:09:00 +02:00
shypike
bd953c5e9f Update main POT file. 2015-07-29 19:48:14 +02:00
shypike
87dd4f1975 Fix inconsistent casing in scheduler events. 2015-07-28 22:28:01 +02:00
shypike
639114dbb5 Add English pseudo translation PO files.
Enables correction of English texts without invalidating existing translations.
These files are not maintained in the translation service, but are edited directly.
2015-07-28 19:11:53 +02:00
shypike
3a8b01e5c1 Plush main page, Queue menu: move "Retry All Failed" before Sort.
Prevents fold-out of Sort from obscuring "Retry All Failed".
2015-07-28 19:06:39 +02:00
shypike
7642d2a1e4 Fix Dutch translation. 2015-07-28 19:01:58 +02:00
shypike
68b44a7310 Drop support for Python 2.5
Also for SABHelper.py
2015-07-28 08:30:27 +02:00
shypike
17130c5208 Merge pull request #256 from Safihre/develop
Adding changing of loglevel in Glitter
2015-07-27 23:30:32 +02:00
shypike
3b0ed33598 Merge pull request #254 from thezoggy/develop--smpl_white-navigation
smpl - remove trailing | in nvaigation
2015-07-27 23:26:40 +02:00
shypike
0cb68f6f81 Merge pull request #252 from thezoggy/develop--minor
Minor fixes/spelling mistakes.
2015-07-27 23:26:19 +02:00
shypike
b2a44c66f1 Fix typo in Config->Notifications
Incorrect text type file.
2015-07-27 16:13:54 +02:00
Jonathon Saine
f2a332d3f9 Removing trailing | from navigation. 2015-07-26 03:02:34 -05:00
Jonathon Saine
8dd55b8d81 Minor fixes/spelling mistakes. 2015-07-25 21:42:53 -05:00
shypike
fe5da44602 Don't send a test notification when required data is missing. 2015-07-25 19:02:43 +02:00
Safihre
284dc10cc5 Adding changing of loglevel in Glitter 2015-07-25 17:58:16 +02:00
shypike
19d97a3c3a When auto-launching the Wizard, use the "/sabnzbd/wizard" URL.
Better compatible when configured behind another HTTP server.
2015-07-25 14:34:23 +02:00
shypike
500906e802 Update main POT file 2015-07-25 14:09:16 +02:00
shypike
7d162c2111 Add Pushbullet support. 2015-07-25 14:08:14 +02:00
shypike
f12011468d Implement Pushover support.
Users have to register their own Application key.
2015-07-24 18:04:23 +02:00
shypike
16b358bdb5 Merge pull request #248 from Safihre/develop
Updating setup wizard and Glitter upgrades
2015-07-24 11:19:53 +02:00
Safihre
2921f0825d Adding NZB-name option, minor fixes 2015-07-24 09:21:20 +02:00
Safihre
822a6103bb Delete All for Orphaned jobs in Glitter
In status-window
2015-07-23 11:06:15 +02:00
shypike
05dc4e4177 Remove potential XSS vulnerability in the Status-QueueRepair when folder names contain "<", ">" and "&".
Status did not XML-ify names.
2015-07-23 09:13:30 +02:00
shypike
496c0fd928 Remove potential XSS vulnerability in the History when folder names contain "<", ">" and "&".
Unlike build_queue, build_history did not XML-ify names.
Patch required for Plush.js, due to the way the download-report pop-up title is created.
2015-07-23 09:07:54 +02:00
Safihre
0e62433af1 Updating Wizzard
Updating Wizzard to be proper HTML and look like Glitter
2015-07-22 13:05:29 +02:00
Safihre
cc41c4881b Bugfixes to Glitter 2
Adding the right HTML-language attribute and fixing for big screens.
2015-07-22 13:05:26 +02:00
Safihre
26564b55e4 Minor bug fixes in Glitter 2015-07-22 13:05:24 +02:00
Safihre
11d1729a33 Make Glitter the default skin for new users.
Also supports config-less skins by setting the standard "Config"-skin.
2015-07-20 21:13:06 +02:00
Safihre
574f176615 Adding OZnzb to Glitter
Changed OZnzb so it will allow changing of up/down voting.
For out of retention it will only list the user's servers, not all of them.
In Glitter you can only give a audio/video score once (just like on the website).
Plush allows changing of audio/video rating and shows that change, but it is not actually changed on the website.
2015-07-19 22:08:05 +02:00
shypike
bf46ba035c Support the use of an unpatched release of CherryPy.
Use the '"redirect_url" patch only when actually present.
Only needed to support https on zeroconfig/Bonjour systems.
2015-07-19 16:57:34 +02:00
shypike
729b368b56 Remove obsolete references to indexers. 2015-07-19 16:37:15 +02:00
shypike
548f448b9d Add support for processing .nzb.bz2 files.
Support the BZIP2 format.
2015-07-18 13:00:28 +02:00
shypike
915a444a3a Get rid of non-standard indenting.
Tabs, yuk!
2015-07-18 12:37:34 +02:00
oznzb
c7ac896125 Rating functionality
Port rating functionality from 0.7.x to develop.
2015-07-15 19:49:46 +02:00
shypike
f238c8bb15 Prevent crash in zero-config/Bonjour service due toi unexpected errors. 2015-07-14 21:48:15 +02:00
shypike
d90ca686c1 Improve logging of API-calls "addlocalfile" and "addurl". 2015-07-13 21:22:50 +02:00
shypike
a7264c92d1 Fix change that disabled password recognition in the Watched folder.
Fixes side-effect of "Setting a password in Retry dialog did not work"
2015-07-13 20:58:16 +02:00
shypike
0566510b07 Prevent crash when URL grab runs into failing server. 2015-07-08 17:37:16 +02:00
shypike
41869e115c Merge pull request #240 from Safihre/develop
Fixing the favicons in all templates
2015-07-08 17:14:10 +02:00
Safihre
ac26de4578 Fixing the favicons in all templates 2015-07-06 17:56:58 +02:00
shypike
78a9c8512b Setting a password in Retry dialog did not work.
Race-condition prevented password from being added to NZO in time.
Instead set password before adding job to the queue.
2015-07-05 16:23:20 +02:00
shypike
c4618bbafb Fix skintext.py
.lower() construction used by Glitter, is not supported by translation tools.
2015-07-04 14:46:43 +02:00
shypike
3b72d5a8cf Update Dutch translation. 2015-07-04 14:45:44 +02:00
shypike
e75aad12b1 Update translations 2015-07-04 14:29:57 +02:00
shypike
a6eb72abb1 Update Dutch translation. 2015-07-04 14:29:38 +02:00
shypike
d1b49d10f1 Update text files for 0.8.0Alpha3 2015-07-04 14:06:10 +02:00
shypike
9e555cb3dd Merge pull request #236 from Safihre/develop
Updating Glitter for fixed retry in API and new icons
2015-07-04 13:03:47 +02:00
Safihre
cd2ba68f4f Fixing Favicon 16x16 in all templates 2015-07-04 12:54:08 +02:00
shypike
1994e0535e On Windows, mass-purging failed jobs from History left some files behind.
Cause: path check did not take long-path notation into account.
Solves issue #227
2015-07-04 12:39:49 +02:00
Safihre
36f2e2037f Merge remote-tracking branch 'sabnzbd/develop' into develop 2015-07-04 12:08:51 +02:00
shypike
4577390775 Update main POT file. 2015-07-04 12:01:23 +02:00
Safihre
f99e768572 Adding the icons of @MasterRoot24 to Glitter
Also changed browserconfig, should include a . in the path.
2015-07-04 11:52:30 +02:00
shypike
ec866c0daa Always show server statistics for a job, also when only one server was used. 2015-07-04 11:49:03 +02:00
shypike
5b93657e83 Remove left-over "fillserver" fields in original Plush and smpl Config->Server pages. 2015-07-04 11:30:13 +02:00
shypike
acee0a30d7 Merge pull request #228 from cdheiser/develop
Add support for restricting servers by category
2015-07-04 11:23:12 +02:00
Safihre
a8fec539ba Merge remote-tracking branch 'sabnzbd/develop' into develop 2015-07-04 11:04:05 +02:00
Safihre
47a2a44f5a Fixing retry option now it's fixed in API 2015-07-04 11:02:00 +02:00
shypike
4011dba8d5 Merge pull request #233 from sanderjo/CheckForReceptionOf-ip-address
Dashboard: if we get anything else than a plain IPv4 address, return None
2015-07-04 10:06:19 +02:00
shypike
a2c1b47a8f Fix crash when unrar is missing on Linux/Unix systems.
Solves issue #234
2015-07-04 10:02:12 +02:00
shypike
a1040a144d On Windows, failed jobs removed from History left some files behind.
Cause: path check did not take long-path notation into account.
Solves issue #230
2015-07-04 09:52:36 +02:00
cdheiser
7d790a37a0 Issue #225: Add support for restricting servers by category.
- Config support updated to save categories by server.  Any server without categories defaults to the Default category.
- Downloader now checks categories before selecting a server to use.
  - Servers with the Default category are always eligible.
  - Otherwise, only servers with a matching cagegory are eligible.
  - Servers without categories are not used (this can happen if you delete the last category for a server).
  - Properly skip servers with higher priority if they have no matching category
- Upgrades from previous versions should retain the expected behavior that all servers are eligible until configured otherwise.
2015-07-03 15:05:42 -07:00
sanderjo
501fdb9dd7 if we get anything else than a plain IPv4 address, return None 2015-07-03 23:33:15 +02:00
shypike
d689cb234f Fix the table with the pattern key for Series Sorting.
The table mixed up the Season functions for original and case-adjusted titles.
2015-07-03 23:02:36 +02:00
shypike
f6f923e060 Make sure OSX/Unix and Windows read each others INI files.
The resulting INI file is converted to the native format.
2015-07-03 22:06:52 +02:00
shypike
db5cc40b87 Remove double unicode conversion in server test error messages.
CherryPy can handle Unicode without xml_name() conversion.
2015-07-03 21:17:36 +02:00
shypike
f190d27ff4 Merge pull request #175 from MasterRoot24/icons
Update favicon, apple-touch-icon and mstiles
2015-07-03 20:40:35 +02:00
shypike
296042a491 Make the speed boxes and logo center again in Plush top bar. 2015-07-03 20:34:42 +02:00
shypike
bd3cba4dc4 One time conversion of a "fillserver" to priority 1.
Prevents all servers from getting priority 0 when upgrading to 0.8.0
Also fix explanation text.
2015-07-03 20:28:00 +02:00
shypike
823431b705 Merge pull request #226 from Safihre/develop
Adding Glitter
2015-07-02 21:35:44 +02:00
shypike
f4dcd0ef3b No longer recognize "something-s.avi" constructions as samples. 2015-07-02 21:18:47 +02:00
shypike
1f65507b39 On Windows UNC paths were not handled correctly.
Trimming UNC paths went wrong.
2015-07-02 20:59:49 +02:00
shypike
2f4cebf37a On Windows, failed jobs didn't show the "Retry" button.
Cause: path comparison didn't account for long-path notation.
(Thank you, Safihre)
2015-07-02 20:18:58 +02:00
shypike
5d2ea32217 Try to fall back to 7z if 7za is missing
Only for systems other than Windows and OSX.
2015-07-02 15:06:43 +02:00
Safihre
4c1e63f4ce Bugfixes 2015-07-01 22:17:45 +02:00
shypike
34670d0523 Merge pull request #229 from sanderjo/sab-Dashboard
Sab dashboard: Dashboard cleaning up
2015-06-30 20:23:01 +02:00
Safihre
473492cd31 Added queue sorting and more bugfixes 2015-06-28 23:55:23 +02:00
Safihre
8bc13447a7 Feature and bug update
See Forum!
2015-06-25 23:43:06 +02:00
Safihre
04089dd159 Revert "TEST"
This reverts commit 9902d11770.
2015-06-24 21:28:04 +02:00
Safihre
9902d11770 TEST 2015-06-24 21:27:38 +02:00
Safihre
0c3bc8b75d Add multi-lang 2015-06-24 21:18:10 +02:00
sanderjo
248bfbde99 Dashboard cleaning up 2015-06-23 20:23:00 +02:00
Safihre
dfd3573e99 Phone/tablet fixed, retry function, status window 2015-06-14 22:25:04 +02:00
shypike
f0bac2d1b2 Correct typo 2015-06-12 08:36:01 +02:00
Safihre
78312b00f5 Adding licensing 2015-06-11 16:13:11 +02:00
Safihre
0864fd9a6f Adding Glitter 2015-06-11 15:40:27 +02:00
shypike
6f644bf850 Update text files for 0.8.0Alpha2 2015-06-06 11:46:34 +02:00
shypike
9ed35bd259 Update French translation. 2015-06-06 11:45:51 +02:00
shypike
aba448dcad Update translations 2015-06-06 11:37:24 +02:00
shypike
9b4102da42 Send username/password as 8bit ASCII to Usenet servers to avoid Unicode bug in PyOpenSSL 0.14 2015-06-06 11:13:17 +02:00
shypike
d1a87c4564 Patch CherryPy to avoid Unicode bugs in PyOpenSSL 0.14 2015-06-06 10:30:05 +02:00
shypike
623c2706b7 Scheduling speedlimit=0 (which means disable) didn't evaluate properly. 2015-06-06 10:06:07 +02:00
shypike
b24ec3e2b7 Remove long-path notation from Windows paths before using in errors/warnings. 2015-06-04 23:22:05 +02:00
shypike
aeea78bb07 Add "action_size" parameter to file bulk operations.
To support drag-and-drop of the NZO page.
2015-06-04 23:01:34 +02:00
sanderjo
75f2d23ef2 Dashboard enhancements, among which Pystone 2015-05-29 23:59:57 +02:00
shypike
5b022d0409 Fix Config->Switches to show availability of unrar, unzip and 7zip.
Also, remove warning for missing 7zip binary.
2015-05-28 21:38:52 +02:00
shypike
e7807119ec Merge pull request #218 from sanderjo/REVfiles
Handle Rev-files in the correct way and add Dashboard.
2015-05-28 21:36:45 +02:00
sanderjo
d14d6e4ed1 Handle REV files in the correct way 2015-05-25 19:17:47 +02:00
SanderJ
797dda1e5c More stuff in the Dashboard, among which: diskspeed measuring 2015-05-21 19:48:26 +02:00
SanderJ
0d8c3420ad Creation of "Dashboard" in Plus Status tab 2015-05-19 21:01:40 +02:00
SanderJ
9dbf41d8f2 Move IP address determination into a module sabnzbd.utils.getipaddress 2015-05-19 19:42:48 +02:00
shypike
351028cb06 Remove temporary debug aid. 2015-05-19 18:40:52 +02:00
shypike
fc53885b2e Experimental server priority.
Core code changes donated by user Fmstrat.
The current implementation is bit rough as the calculation of alternative servers isn't done at the right level in the download/decoding chain.
This needs a redesign, although it works.
2015-05-16 16:41:14 +02:00
shypike
145afc44f5 Fix UI for notifications.
"Notification Center", "Growl" and "NTFOSD" should have boolean options instead of numerical.
Otherwise the user interface will not properly handle disabled options.
2015-05-14 19:13:36 +02:00
shypike
70d1c917f0 encoding.platform_encode() should only try to convert "str" types. 2015-05-14 19:11:26 +02:00
shypike
1d8a912acb New version of par2-tbb for Windows.
Supports repair for files over 2G.
2015-05-07 20:41:48 +02:00
shypike
2caf0ee1a0 Update translations 2015-05-05 20:11:19 +02:00
shypike
ff858fad48 Log the output of the pre-queue script. 2015-05-05 20:04:23 +02:00
shypike
30ee3a9840 Fix location of 7Zip by OSX binary. 2015-04-25 20:59:29 +02:00
shypike
1925097deb Point to new Wiki pages for RSS and Scheduling. 2015-04-25 20:29:22 +02:00
shypike
f5a8946d95 Update source texts. 2015-04-25 11:42:38 +02:00
shypike
ef3fb69c03 Correct language base strings.
Avoid complex formatting in translatable texts.
Remove obsolete text.
2015-04-25 11:40:49 +02:00
shypike
49d0a8bd32 Update language source files. 2015-04-25 11:14:43 +02:00
shypike
830c04fc60 Move option "script_can_fail" from Specials to Switches. 2015-04-25 11:13:34 +02:00
shypike
601db26f62 Require Python 2.6 or 2.7 2015-04-24 19:57:53 +02:00
shypike
2421bd4da6 Update translations 2015-04-24 19:31:42 +02:00
shypike
82c35d208b Update translations 2015-04-22 22:15:04 +02:00
shypike
175ed12a30 Fix translation issues. 2015-04-22 21:58:37 +02:00
shypike
9862a06f94 On Unix systems not all files were sent to the par2 tool.
As a side-effect of changes in globber() supporting Windows long paths, its behaviour changed.
The code in PAR_Verify wasn't changed accordingly.
2015-04-22 21:39:37 +02:00
shypike
587749437e After pre-check completes successfully, prevent the nzb.gz file from being deleted. 2015-04-19 18:37:08 +02:00
shypike
86f7c4b54d Make sure unpack problems result in a "failed" job status.
Incorrect rerun of failed unpacking job, masked the error status of the first one.
Don't rerun if the previous run fails.
2015-04-19 16:28:25 +02:00
shypike
687ab5d4f5 Update text files and copyright year. 2015-04-11 19:16:17 +02:00
shypike
07a16811c4 Update translations 2015-04-11 18:52:34 +02:00
shypike
d5d90765a9 Update language source file. 2015-04-03 23:59:55 +02:00
shypike
c9871c224e Improve Python version check. 2015-04-03 23:50:38 +02:00
shypike
f120265acf Make IP checking more anonymous by using unassigned addresses.
Also remove unused procedure.
2015-04-01 22:44:37 +02:00
shypike
970dbf3408 Make sure folder options always contain the right slashes for the platform. 2015-04-01 21:44:07 +02:00
shypike
c17ba7cdc3 Replace os.rename with shutil.move.
This should prevent cross-device rename errors.
2015-04-01 21:17:08 +02:00
shypike
c2329a8a9f Point several Config pages to a new Wiki page instance. 2015-04-01 20:46:11 +02:00
shypike
f92c6e1c1f Improve unrar recommendation text 2015-03-28 14:36:40 +01:00
shypike
50447f736f Correct floating point conversion 2015-03-28 11:44:08 +01:00
shypike
7ab83c0629 Log an error message when RSS feed uses bad certificate. 2015-03-26 21:12:37 +01:00
shypike
b95aa735ac Point Special-Help to a new Wiki page instance. 2015-03-26 21:09:42 +01:00
shypike
27ff8da056 Add Special to enable/disable HTTPS certificate verification.
Also: improve error messages.
2015-03-25 21:42:41 +01:00
shypike
a60bbff449 Report bad server certificates for URL-based NZB fetch
Prepare for Python's 2.7.9+ certificate verification.
Previous code did not give clear information.
2015-03-21 18:13:30 +01:00
shypike
fb97ca8cdc Correct translation errors. 2015-03-21 17:51:21 +01:00
shypike
759d601ec4 Prevent crash when the API-call "addfile" sends a file name without a proper extension. 2015-03-20 21:24:01 +01:00
shypike
48fd9d53ab Improve logging of unrar version. 2015-03-13 20:46:59 +01:00
shypike
b319ca964b Improve unrar check by recommending a minimum version.
Only for non-OSX and non-Windows.
2015-03-12 22:27:06 +01:00
shypike
20108c885e Update translations 2015-03-03 22:23:15 +01:00
shypike
3339ffc7f1 Update translation source file. 2015-02-27 21:01:57 +01:00
shypike
6840a2ffa0 Remove "do not download samples" option.
It doesn't work when samples are part of the par2 set.
2015-02-20 22:04:19 +01:00
shypike
64ca554746 Remove "fail_on_crc" option and move "overwrite_files" from Special to Switches. 2015-02-20 22:00:27 +01:00
shypike
eb761ed95b Prevent CherryPy error when trying to delete an non-existing server. 2015-02-16 20:36:12 +01:00
shypike
9cc20356af When "enable_multicore" is off, verification may fail on Linux systems.
Make sure "par2-classic" variable is always set, so that enable_multicore's value doesn't matter.
2015-02-16 13:04:18 +01:00
shypike
64bf6c5cf1 Add "password" field to the "Retry from History" function.
This way you can retry a job with a different password.
2015-02-12 21:37:16 +01:00
shypike
b4232ff589 Merge pull request #199 from sanderjo/develop
Determine and show public IPv4 address (if +Debug is on)
2015-02-09 22:22:33 +01:00
sanderjo
787a4b04f5 Determine and show publick IPv4 address (if +Debug is on) 2015-02-09 13:08:48 +01:00
shypike
7883bb6bbd Remove obsolete build files. 2015-02-04 21:11:48 +01:00
shypike
c148b990fc Default base folder for Windows is now the %USERPROFILE% folder.
Before, %USERPROFILE%\Documents was used.
The default download folders should be based on %USERPROFILE%\Downloads.
The other folders will land in %USERPROFILE%.
Also removed the obsolete option to have the INI file in the program folder. The latter now needs an explicit -f parameter.
2015-01-30 21:16:08 +01:00
shypike
236fbb9595 Update par2-tbb for Windows to version 0.4 2015-01-24 15:49:40 +01:00
shypike
ffbcc46fa4 Add 64bit only par2-sl for OSX. 2015-01-24 15:44:20 +01:00
shypike
2da41b3e51 Enable multicore choice for OSX too.
Also improve the code for par2 choice and option handling.
2015-01-24 15:11:41 +01:00
shypike
00e257fe74 Remove obsolete build support files. 2015-01-24 14:02:01 +01:00
shypike
677607d9f1 Default host is now 127.0.0.1
"localhost" gives too many problems on too many systems.
2015-01-19 20:49:55 +01:00
shypike
5731bc2ab0 Rename "local_range" to "local_ranges" to avoid breaking 0.7.x. compatibility.
Also remove default range, not needed.
2015-01-19 17:13:25 +01:00
shypike
9edb809773 Adjust Windows 8bit character mapping to work in a Unicode app. 2015-01-17 19:19:07 +01:00
shypike
f0c75504d7 Prevent crash when encountering unpack issues. 2015-01-17 18:37:58 +01:00
shypike
0f93545773 Prevent crash on systems without SSL support. 2015-01-17 18:36:41 +01:00
shypike
41ede96538 When no local range is set, allow all access. 2015-01-16 17:40:28 +01:00
shypike
7fc84ba6d0 Do not require the script folder to be writable. 2015-01-13 23:07:00 +01:00
shypike
74d3cfff20 Prevent crash when a duplicate file is detected.
Undefined function name.
2015-01-13 21:22:53 +01:00
shypike
956bd6374f Fix little problem in extension detection and fix some PyLint complaints. 2015-01-13 21:13:03 +01:00
shypike
0395dac2eb Windows long-style paths should not be damaged by trimming and cleaning. 2015-01-11 19:25:16 +01:00
shypike
03c9a3330e Make sure Windows long-style paths are not sent to par2. 2015-01-11 19:24:35 +01:00
shypike
a0536c8fed Add "Retry All" function.
Sends all failed jobs back to the queue.
2015-01-11 15:54:55 +01:00
shypike
4db46f9c62 Prevent CherryPy warning by making sure host name is in ASCII instead of Unicode. 2015-01-11 13:37:39 +01:00
shypike
3ea0bbcae5 API calls change_opts, change_script, change_cat now return "false" in case of errors.
Previously they always returned "true".
2015-01-11 13:28:59 +01:00
shypike
c1a11e26c1 Moved pystone module to sabnzbd/utils 2015-01-11 12:55:04 +01:00
sanderjo
6233ce1109 moved pystone module to sabnzbd/utils 2015-01-04 08:53:12 +01:00
sanderjo
c4feba200d Better handling if import of pystone module does not work 2015-01-02 12:25:35 +01:00
sanderjo
fef680a399 Update SABnzbd.py 2015-01-01 22:52:34 +01:00
sanderjo
76f40af514 Better handling if import of pystone module does not work 2015-01-01 22:43:22 +01:00
shypike
b7236af9e2 Log exception info when urlgrabber's URL retrieval fails. 2015-01-01 21:14:53 +01:00
shypike
8eed05d221 Correct logging of refused API calls. 2014-12-30 11:51:38 +01:00
shypike
b7294a69f1 Add "Read all RSS feeds" to system tray menus. 2014-12-22 19:54:28 +01:00
shypike
7a070fdc4a Support extra meta fields in NZB file.
What is now supported as X-DNZB-YYY header is now also accepted as meta field YYY.
'failure', 'details', 'episode', 'propername', 'year'.
2014-12-20 18:25:56 +01:00
hansvqp
678f9c7374 Add System Tray menu for Linux systems with GTK support. 2014-12-20 13:33:20 +01:00
shypike
aaa2105eaa Make notification behavior consistent with the way the UI shows the options.
Also correct the "startup" defaults for ncenter, ntfosd and growl.
2014-12-20 12:50:39 +01:00
shypike
32c15771b4 Correct error in Notification Center options. 2014-12-20 12:31:58 +01:00
shypike
5019681d81 Reduce risk of crashing on bad pystone library. 2014-12-20 11:50:26 +01:00
shypike
80bc55f8c7 Support of a list for "local_range" option. 2014-12-10 20:53:37 +01:00
shypike
2b209e8a1f Detect major OSX versions.
Affects defaults for Growl and NotificationCenter before and after MountainLion (8).
Affects top menu icon on Yosemite (10) and higher.
2014-12-08 21:41:25 +01:00
shypike
9079c05b97 Implement "send_group" and "ssl_type" per server instead of global. 2014-12-03 20:13:51 +01:00
shypike
5bed2e6b68 Enable TLS V1 for SSL server connections.
Default to value "t1" (TLS V1), except when obsolete option ssl_type was set to "v2".
2014-12-01 20:52:32 +01:00
shypike
bb6eeacaac Move some options from Specials to Switches and vv.
Also add some missing options to smpl and Plush.
2014-12-01 14:26:15 +01:00
shypike
96c72fa4c5 Show the "enable_meta" option in Config->Switches.
And remove from "Specials".
2014-12-01 12:32:27 +01:00
shypike
d9e2868a7b Remove encoding.titler()
Work-around no longer needed for Unicode.
2014-11-22 19:17:04 +01:00
shypike
e184f730e2 Remove traces of 8bit ASCII support.
Remove or replace calls to latin1().
Replace all Ta() calls with T().
2014-11-22 19:10:08 +01:00
shypike
f30059e07a Additional logging for folder renaming. 2014-11-22 13:51:54 +01:00
shypike
b0146a393a Update some license files. 2014-11-22 13:44:00 +01:00
shypike
d2e69fa005 Update unrar to 5.11 for (Snow)Leopard on Intel, but not for PPC.
There's no unrar 5.* release for PPC.
2014-11-22 13:43:28 +01:00
shypike
30f022d933 Measure and log Pystone performance, and - if possible - CPU type 2014-11-22 13:23:31 +01:00
shypike
0d6606a4a7 Let the API-call "Retry" return the new nzo_id of the job.
Also change the status of a doomed re-fetch from "Failed" to "Fetching".
2014-11-22 13:20:50 +01:00
shypike
50fe8baeef Update copyright year. 2014-11-22 13:20:31 +01:00
shypike
7e74169113 Added an issue and made some language corrections. 2014-11-22 13:18:02 +01:00
shypike
c7735a5be7 OSX Yosemite: make top-menu icon compatible with "Dark Mode". 2014-11-22 13:17:34 +01:00
shypike
88f0b6d9ac Fix problem of testing email server with existing parameters.
In existing email parameters the password consists only of asterisks.
In that case, get the password from storage.
Also improve the logging of failed authentication attempts.
2014-11-22 13:17:05 +01:00
shypike
4dc58c8229 Update unrar for OSX to 5.11 2014-11-22 13:16:30 +01:00
shypike
a139f7dc49 Support double quotes to delineate parameters in category match lists.
"a b", "c d"
is now properly handled. The double quotes needed HTML-quoting.
2014-11-22 13:13:14 +01:00
shypike
3a80fed408 Correct spelling of OSX release names. 2014-11-22 13:12:55 +01:00
shypike
5d2cb81604 When sanitizing names, preserve "." and ".." elements in paths.
"sanitize_foldername()" was too eager to remove "." characters, thus removing "." and "..".
When using a single folder, the final "." element would be replaced with "unknown".
2014-11-22 13:12:37 +01:00
shypike
d44c2265ff The after-unrar-check needs to take the "flat_unpack" option into account. 2014-11-22 13:12:15 +01:00
shypike
59a1256d5b When a comma is present in a file name, quotes are needed when passed to a user script.
The replacement list2cmdline() should handle commas.
2014-11-22 13:11:50 +01:00
shypike
f3507b5355 Update OSX DMG image.
Make MountainLion/Mavericks/Yosemite the default choice.
Separate folders for SnowLeopard and Lion.
2014-11-22 13:11:25 +01:00
shypike
6675ef85df Update OSX signing.
Lion build can only be signed on Lion.
ML/Mav build must be signed on Mav.
2014-11-22 13:10:58 +01:00
shypike
f9ef3e73fd Fix problem of a job's destination path getting damaged on Windows.
"D:\folder\map" would become "D:folder\map", giving nasty side-effects.
2014-11-22 13:10:32 +01:00
shypike
fdb64576eb Change renaming of duplicate files from file.ext-->file.ext.1 to file.ext-->file.1.ext
Works better when encountering multiple rar/par sets with identically named files.
2014-11-22 13:10:01 +01:00
shypike
064d97a190 Make OSX MountainLion build compatible with Mavericks. 2014-11-22 13:09:21 +01:00
shypike
01306fb8ac Do not remove a leading dot in a path element.
"/folder/.hidden/" must be preserved.
"/folder/hidden./" must be converted to "/folder/hidden/"
2014-11-22 13:06:31 +01:00
shypike
7eebbdeff7 Windows UNC paths, used as final destination, were damaged.
misc.sanitize_and_trim_path() did not handle UNC paths properly.
2014-11-22 13:06:11 +01:00
shypike
0413d3075a Update OSX signing method 2014-11-22 13:03:51 +01:00
shypike
0fe1637ef9 Treat RAR CRC errors like "incorrect password"
Older versions of unrar report wrong passwords as CRC errors.
Therefor, try the next password (if available) when a CRC error is reported.
2014-11-22 13:03:23 +01:00
Johannes 'fish' Ziemke
3cfa03d30f Add Dockerfile
Usage:

        docker build -t sabnzbd .
        docker run -p 127.0.0.1:8080:8080 sabnzbd
2014-11-22 12:59:01 +01:00
sanderjo
d7154c2743 Extra logging in case of Loading .../.sabnzbd/admin/Rating.sab failed
Will print the exact except error message in the error message.
2014-11-22 12:58:19 +01:00
shypike
fee13a1fb2 OSX Signing is now only possible on OSX Mavericks, so check this. 2014-11-22 12:57:50 +01:00
shypike
18f9037816 Prevent folder trimming from removing embedded passwords in filenames.
Reduce the number of calls to sanitize_foldername() and rely on NzbObject to do its work.
Also allow "oversized" incomplete folders to be sent back to the queue, by not sanitizing/trimming again.
2014-11-22 12:57:15 +01:00
shypike
663b90d664 Fix potential problem with timestamps in RSS. 2014-11-22 12:53:04 +01:00
shypike
d7463ff607 Make sure the final destination path is always sanitized and trimmed.
Titles coming from RSS and processed by Sorting escaped sanitation.
2014-11-22 12:52:43 +01:00
shypike
9442823b38 When matching SFV files with RAR-sets, do this case-insensitive. 2014-11-22 12:48:47 +01:00
shypike
6d88b84e8a Small code improvement "unwanted extensions". 2014-11-22 12:47:55 +01:00
sanderjo
0e8d41ef4d cfg.unwanted_extensions() is a list so check must be cfg.unwanted_extensions() != []
Signed-off-by: sanderjo <sander.jonkers+github@gmail.com>
2014-11-22 12:47:18 +01:00
sanderjo
d58c1e43c3 Put the last rar immediately the first rar, so that unwanted extensions will get detected earlier.
Signed-off-by: sanderjo <sander.jonkers+github@gmail.com>
2014-11-22 12:46:43 +01:00
shypike
867bb9bf8e Limit article cache to 1G to prevent a memory size bug in the _yenc module. 2014-11-22 12:46:17 +01:00
shypike
7e6e5e12b7 Upgrade unrar to version 5.11 (Windows) 2014-11-22 12:45:56 +01:00
shypike
3be0670d3d Sort order of RSS feeds incorrect due to UI using wrong time field. 2014-11-22 12:43:27 +01:00
shypike
7b1f798586 Prevent further pauses by "unwanted extension", once the user has resumed the job after the first stop.
Part of this code was accidentally included in commit 081010d50b
This is the missing part.
2014-11-22 12:42:50 +01:00
shypike
45a8ec6306 Change renaming of duplicate files from file.ext-->file.ext.1 to file.ext-->file.1.ext
Works better when encountering multiple rar/par sets with identically named files.
2014-11-22 12:42:27 +01:00
shypike
bf2c23e79a Fix for "Range" selection of queue.
Not a really good fix.
The code looks identical to the code for selecting files within an NZB (in config.js) , but it has some subtle error.
This is a fix which will work reasonably well.
Should be fixed properly later.
2014-11-22 12:38:55 +01:00
shypike
5635b20b90 Prevent crash when Windows SysTray function hits PyWin bug. 2014-11-22 12:38:09 +01:00
shypike
be7706d508 Sort queue on now visible name instead of original name. 2014-11-22 12:37:43 +01:00
shypike
d16404ab61 Remove special URL handling for nzbclub indexer, no longer needed. 2014-11-22 12:24:58 +01:00
shypike
3972e438ad Improve "unwanted extension" text. 2014-11-22 12:24:26 +01:00
shypike
c9697a3f22 Allow "nzbname" parameter with just the password (like "/password).
Works also in AddNZB dialog.
2014-11-22 12:14:25 +01:00
shypike
0d14ac7763 In debug logging mode, use Google to determine our own IP address (IPv4 and IPv6).
Helpful for diagnosing troublesome setups.
2014-11-22 12:14:01 +01:00
shypike
7b8e09613d Log more info about failure to remove item from History. 2014-11-22 12:05:10 +01:00
oopoa
5d13e8fa7d Add api for server usage statistics. 2014-11-22 12:04:23 +01:00
sanderjo
15e7cd9d6c Logs in which rar file unwanted extension 2014-11-22 11:41:13 +01:00
shypike
218bf66391 Don't pass seemingly "joinable" files to par2. No longer needed since we use a wildcard.
Can lead to problems on Windows due to a potentially huge amount of parameters.
No longer needed since we're using the wild-card parameter nowadays.
2014-11-22 11:40:31 +01:00
shypike
6d5b095b2b Fix bug that prevented multiple sets in one NZB from joining. 2014-11-22 11:39:47 +01:00
sanderjo
2c18d49efa Handle server side 5xx problems 2014-11-22 11:38:10 +01:00
Der-Jan
1488758155 Set pwd to none when empty 2014-11-22 11:37:30 +01:00
JessThrysoee
d8ca1ed4f4 Use default-path in Plush cookies.
Cookies are not port specific. When sending cookies with path=/ to
http://localhost:8090/sabnzbd/ these cookies also turn up when
requesting e.g. http://localhost/apache2 or http://localhost:8080/tomcat and so on.

To avoid polluting the global cookie space, simply do not specify a path
when setting the cookie. This will result in a cookie with the default-path,
i.e. path=/sabnzbd for http://localhost:8090/sabnzbd.
2014-11-22 11:36:51 +01:00
shypike
60b8fbfc7b Prevent false encryption messages.
Probably not encrypted when multiple files are in a RAR.
2014-11-22 11:36:00 +01:00
shypike
9a37449aa5 Prevent false positives for encryption detection.
Weird posts with double rar-ed subtitles.
2014-11-22 11:35:08 +01:00
shypike
bb992b441f Implement support for X-Failure call-back URL.
Optionally to be called when par2 verification fails, the RAR files have CRC errors or the right password isn't known.
2014-11-22 11:19:17 +01:00
shypike
99521ca931 Prevent crash in unpacking due to unset variable. 2014-11-22 10:53:18 +01:00
shypike
e51f4fc45a Merge pull request #181 from discordianfish/add-dockerfile
Add Dockerfile
2014-10-08 21:38:15 +02:00
Johannes 'fish' Ziemke
65278120e2 Add Dockerfile
Usage:

        docker build -t sabnzbd .
        docker run -p 127.0.0.1:8080:8080 sabnzbd
2014-09-24 13:46:43 +02:00
Joe Nyland
5481b6663e Update favicon, apple-touch-icon and mstiles 2014-07-31 22:39:31 +01:00
shypike
ced3301c07 Fix problem with series name extraction in TVSort.
The latin1() call is now obsolete, but would convert None to u"None".
2014-06-19 22:07:38 +02:00
shypike
e6094141a0 Update main POT file. 2014-05-24 11:59:30 +02:00
shypike
7475c02a0f When testing notifications for Growl and Prowl, use new parameters without needing to save first. 2014-05-10 20:43:45 +02:00
shypike
d58ef71a9d Prevent URLs in the queue from getting ”sanitized”. 2014-05-10 19:47:08 +02:00
shypike
134a9b1507 Fix merge error.
Merge conflict of commit ef02b5eb (X-DNZB-Failure) wasn't resolved.
2014-05-10 18:19:13 +02:00
shypike
82d1d78d9c Using priority "Force" will override the duplicate NZB check.
Will work when manually entering an NZB.
2014-05-10 18:08:43 +02:00
shypike
6b1f9c0a50 Implement support to detect unwanted extensions inside RAR archives.
unwanted_extensions = .exe, .bla
action_on_unwanted_extensions = 1
2014-05-10 18:04:15 +02:00
shypike
7cbb6d5705 Prevent pseudo error message when testing "Notification Center". 2014-05-10 17:55:44 +02:00
Jostein Kjønigsen
4026904e9c Support testing email based on values in UI instead of stored config. 2014-05-10 17:47:42 +02:00
shypike
0286f0736c Don't trim file names when renaming them (so revert to old behavior). 2014-05-10 17:32:21 +02:00
shypike
2e77dd594e Add "pause_pp" to the API. 2014-05-10 17:31:44 +02:00
shypike
c2adc2b846 Pause/abort on encryption failed when pre-check was active. 2014-05-10 17:28:55 +02:00
shypike
2c90cf9f13 Also remove colons ":" with option sanitize_safe 2014-05-10 17:28:35 +02:00
shypike
6f6d57f76d Update OSX DMG template for Mavericks. 2014-05-10 17:28:04 +02:00
shypike
262b1304f4 Support "retry-after" attribute (for NZBFinder), used for rate limiting of NZB grabs. 2014-05-10 17:24:44 +02:00
shypike
fbc2deb054 Sanitize names when renaming files and folders. 2014-05-10 16:16:10 +02:00
shypike
a37c1e9a87 Make RAR/RAR5 detection more robust. 2014-05-10 16:15:27 +02:00
shypike
630c03f99f Support double quotes in password entry boxes on job detail page. 2014-05-10 16:12:52 +02:00
shypike
6ae257d463 Prevent embedded password from getting damaged by sanitizing. 2014-05-10 16:06:38 +02:00
shypike
b19f082d5a Extend password boxes on file details page. 2014-05-10 15:57:17 +02:00
shypike
2e24d073b9 Provisional RAR5 support.
Recognize magic rar5 marker and the "incorrect password" message.
2014-05-10 15:41:55 +02:00
shypike
37f3c482f0 Add password fields to File Detail pages of "smpl" and "Classic" skins.
Also remove previous band-aid to preserve passwords after repeated scans.
Scan is now only needed when old-style API call is done (so without password field).
2014-05-10 15:41:12 +02:00
shypike
70262b516c When checking unrar, prevent creating a zombie process on some systems. 2014-05-10 15:37:00 +02:00
shypike
38a7263aee Prevent unwanted change of queue order after editing job details.
When an explicit priority is set, the category evaluation should not temporarily change the priority,
which will cause a re-sort within the priority group.
2014-05-10 15:33:13 +02:00
Ed Courtenay
5145dfd4a3 Fix trailing slash 2014-05-10 15:24:45 +02:00
shypike
b072a3be57 Add Special option ”warn_dupl_jobs” to suppress/enable warning about duplicate jobs. 2014-05-09 22:00:29 +02:00
shypike
ebda0bf267 Support UNC paths in Sort expressions (Windows). 2014-05-09 21:50:42 +02:00
shypike
861ce9b4b2 Remove race-condition in PP-queue exit that prevented shutdown. 2014-05-09 21:50:20 +02:00
shypike
ba069ae8a3 Allow "Force" priority to be set in the NZO page.
Otherwise "Force" jobs will lose their priority when other fields are changed on the NZO page.
2014-05-09 21:49:36 +02:00
shypike
d3852666a7 Make sure a manually entered decryption password has no leading spaces. 2014-05-09 21:43:25 +02:00
shypike
805e97b581 Prevent PP queue timeout construction from keeping the CPU awake.
Due to a bug in the Python libraries queue.get(timeout=3) will awake the CPU every 50 msec.
The new code will only use the timeout to detect an empty queue.
If empty, but no end-of-queue check was needed, then launch an indefinite get().
2014-05-09 21:40:35 +02:00
shypike
56d9a74a39 Add more logging about password file results. 2014-05-09 21:37:48 +02:00
shypike
b20991ac4b Add Special option "flat_unpack" to remove embedded folders in archives. 2014-05-09 21:30:22 +02:00
shypike
d685280f30 Upgrade unrar to 5.01 2014-05-09 21:27:22 +02:00
shypike
725f2cf489 Fix problem with space added to password coming from a file name.
Regression caused by redesign of password scanner.
2014-05-09 21:26:35 +02:00
shypike
676c235fe6 Don’t send 8th parameter to user script when empty.
Modify sample script to show 8th parameter.
2014-05-09 21:26:07 +02:00
shypike
ef02b5eb62 Add some basic support for X-DNZB-Failure and X-DNZB-Details headers coming from indexers.
”Failure” will send an extra URL parameter to the post processing script.
”Details” will override ”More-info” in the History.
2014-05-09 21:19:30 +02:00
shypike
204df02d5d Add provisional support for unrar 5.
The report text for encrypted files has changed in unrar 5.
Thank you, Sander!
2014-05-09 21:14:55 +02:00
shypike
dbe51f0a82 Improve scanning of passwords in file names.
Replace regexes by plain logic to allow "/" and "{{" and "}}” in passwords.
2014-05-09 21:11:29 +02:00
shypike
c535fecf7f Add the command line parameter —pidfile to set an explicit PID-file name. 2014-05-09 21:06:41 +02:00
shypike
7c174e09e7 Fix another issue with commit 3b3759e81e (NZB-meta data). 2014-05-09 21:04:11 +02:00
shypike
bfb103534e Always rename files in Sorting, regardless of casing. 2014-05-09 21:03:56 +02:00
shypike
4700477bb9 Fix issue with commit 3b3759e81e (NZB-meta data). 2014-05-09 21:03:22 +02:00
shypike
cf0019e72f Add Solaris manifest to tar.gz distribution file. 2014-05-09 21:03:04 +02:00
shypike
67a6fba3bf Add usage of NZB-meta data and X-headers for Sorting.
Meta records: "episodename", "propername" and "year".
X-headers: "x-dnzb-episodename", "x-dnzb-propername" and "x-dnzb-year".
Controlled by an option.
2014-05-09 21:02:28 +02:00
shypike
2efdf186b0 Pass extra parameter to OSX Notification Center tool to enable Mavericks support. 2014-05-09 20:58:08 +02:00
shypike
34c6795519 Show job's ETA when its priority is forced, but queue is paused. 2014-05-09 20:57:22 +02:00
shypike
81c79ce470 Another fix for false encryption reports. 2014-05-09 20:56:21 +02:00
shypike
248f4eaab0 Fix crash in API-call "queue-rename" when "value3" is empty or undefined. 2014-05-09 20:55:51 +02:00
Jim80net
606105c5a9 Adds solaris manifest 2014-05-09 20:51:18 +02:00
shypike
50c9fb3a2f For Unix systems, expand wildcards for the par2 tool to prevent problems with some builds of par2cmdline. 2014-05-09 20:50:27 +02:00
shypike
5b5a4ad87b Remove "news" section in Config skin's main page.
Was never used and caused mixed mode https/http issues.
2014-05-09 20:30:29 +02:00
shypike
7d272c6695 Add password entry box to "File Details" page (Plush only).
Also extend api call "queue_rename" with a password parameter (value3).
2014-05-09 20:02:36 +02:00
shypike
e4f8e83e23 Prevent "special" sub-folders on file servers from being scanned during unpacking. 2014-05-09 19:51:20 +02:00
shypike
6100c8109c Add special option 'sanitize_safe' to remove bad Windows chars on other platforms. 2014-05-09 19:50:47 +02:00
shypike
0c7a2f38ae Fix false positive encryption alarm for some posts, 2014-05-09 19:47:18 +02:00
manandre
9608481fa5 Add of GUID field in Queue RSS feed
The NZO id is used as unique id for the queue RSS feed to help some RSS
readers (like Thunderbird) to identify articles when the link field is
the same for all articles
2014-05-09 19:45:37 +02:00
manandre
a0040f5dd5 Add of GUID field in History RSS feed
The NZO id is used as unique id for the history RSS feed to help some RSS readers (like Thunderbird) to identify articles when the link field is the same for all articles.
2014-05-09 19:38:16 +02:00
shypike
d4c1d32acc Fix special case of unjustified encryption warning. 2014-05-09 19:37:09 +02:00
shypike
52889d77cf Missing mini-par2 sometimes prevents the other par2 files from being downloaded. 2014-05-09 19:36:38 +02:00
shypike
f0a3f373a8 Make sure even invalid RAR files are fed to unrar and handle its reporting. 2014-05-09 19:26:32 +02:00
shypike
68c1fadb7d Merge pull request #139 from startswithaj/patch-1
Change for the smpl interface.
2014-02-20 22:22:04 +01:00
Jake Mc
13a2f15c75 Change for the smpl interface.
This resets the submit button text from 'Saved' to 'Save Changes' on form changes that happen after an initial save to notify user has edited since last save and has unsaved changes.

http://www.quirksmode.org/dom/events/change.html -> form.onchange is compatible with all modern browsers.

If your interested in pulling this request I will go through and make some other tweaks to the smpl interface.
2014-02-10 23:03:58 +10:00
shypike
644971a7a2 Merge pull request #137 from sanderjo/develop
Report IPv4 and IPv6 address via logging.info, patched against develop
2014-01-31 09:57:32 -08:00
SanderJ
6ec65239a4 Report IPv4 and IPv6 address via logging.info, patched against develop 2014-01-31 17:36:52 +01:00
shypike
a21a48ae98 Merge pull request #131 from breunigs/feature/example-systemd-unit-file
add (example) systemd unit file
2014-01-11 06:13:09 -08:00
Stefan Breunig
e9a436ceda add (example) systemd unit file 2014-01-08 00:15:11 +01:00
shypike
c8f4b46656 Do safe conversion of season/episode in RSS. 2013-12-03 22:29:03 +01:00
shypike
2eed355e9c Revert "newsunpack.py: also handle output of unrar5 with password protected files"
This reverts commit 12fd63c1cf.
2013-11-11 20:24:11 +01:00
shypike
018955f4d5 Merge pull request #122 from sanderjo/patch-4
newsunpack.py: also handle output of unrar5 with password protected file...
2013-11-11 11:19:20 -08:00
sanderjo
12fd63c1cf newsunpack.py: also handle output of unrar5 with password protected files
as discussed http://forums.sabnzbd.org/viewtopic.php?f=3&t=16166&p=89054#p89054
2013-11-07 17:02:24 +01:00
shypike
d2e4a6a5cc Revert "Prevent Unicode warning from CherryPy."
This reverts commit 2d3c263ab8.
2013-09-09 17:23:07 +02:00
shypike
efaa675183 Update README.mkd with 0.8.0 info. 2013-09-07 14:48:19 +02:00
shypike
2d3c263ab8 Prevent Unicode warning from CherryPy. 2013-09-07 14:45:28 +02:00
shypike
293d43470a Remove the "Classic" skin. 2013-06-15 11:45:46 +02:00
shypike
28aac3c70f Accept "nzbname" parameter in api-call "add url" even when a ZIP file is retrieved. 2013-06-14 20:58:49 +02:00
shypike
0aa0d8ad12 Accept partial par2 file when no others are available. 2013-06-14 20:50:53 +02:00
shypike
b305bf96a9 Option to make a job fail when user script exit code is non-zero.
'script_can_fail' in Config->Special.
2013-06-02 16:13:25 +02:00
shypike
aa783ae3b5 Add "From SxxEyy" filter to RSS.
A "require" filter that sets a minimum season/episode.
2013-06-02 14:41:05 +02:00
shypike
c55a517002 When post has just one par2-set, use full wildcard so that all files are repair and par candidates. 2013-06-01 11:33:07 +02:00
shypike
39f34a8355 Fix encryption detection again. 2013-05-28 20:47:32 +02:00
shypike
91c65817e7 Restore automatic recovery from 404 errors. 2013-05-26 12:27:18 +02:00
shypike
0b75447477 Better detection of incorrect par2 parameters. 2013-05-23 22:57:09 +02:00
shypike
4a64235cb6 Prevent needless error message when creating OSX top menu. 2013-05-19 14:46:06 +02:00
shypike
13c72b41a2 Fix crash on SFV-only downloads. 2013-05-12 13:08:56 +02:00
shypike
8328a36b5d Linux: compensate for par2 renaming files to CP1252 on UTF-8 file systems.
Par2-classic on Unix systems will rename files to CP1252 when running on UTF-8 file systems.
On such systems, this renaming must be undone before further processing.
2013-05-10 11:08:41 +02:00
shypike
d03568141d Fix omitted mkdir in package.py 2013-05-09 10:11:33 +02:00
shypike
821937e64f Fix problem in encryption detection. 2013-05-07 20:54:41 +02:00
shypike
d4717aac31 Make misc.globber() function behave when it gets a non-existing path. 2013-05-07 19:30:28 +02:00
shypike
7e5ce06e12 Update language templates. 2013-05-05 12:13:44 +02:00
shypike
d8ba7577f8 List NZB age in the download report. 2013-05-04 22:27:53 +02:00
shypike
ef1db24880 Show downloaded amount per server in download report. 2013-05-04 15:23:18 +02:00
shypike
c83300eb16 Make parameter errors visible in some Config Pages.
Messages about bad parameters were not shown in the Config skin's pages.
Fix this for: General, Folders and Notifications.
2013-05-04 13:51:33 +02:00
shypike
9516d80746 Remove support for upgrading very old data on OSX.
Also clean up some missed cache_dir references.
2013-05-04 10:45:26 +02:00
shypike
486d1113df Remove all support for pre-0.6.x style queues. 2013-05-03 21:03:38 +02:00
shypike
b3d24d7f3d Avoid problems with long paths in the temporary download folder,
The par2 tool does not support paths above 259 in any way.
Take extra measures to prevent long paths from being used,
by trimming the download path.
When over sized paths are still generated, abort post-processing with a clear error message.
2013-05-03 20:41:32 +02:00
shypike
edd1002313 Add long path support for Windows.
Use "\\?\" prefix for all path-related handling in post-processing.
Use shortened paths for unpacking and user scripting.
Also support oversized paths in "incomplete" as long as the base folder is below 260.
2013-04-30 18:32:53 +02:00
shypike
99939db461 Prevent needless reevaluation of show titles for pending post-processing jobs. 2013-04-29 20:53:18 +02:00
shypike
da8d9d0a89 In paths, "~" should always be the user's home folder and not the base folder. 2013-04-28 16:21:20 +02:00
shypike
6904b2de1f Show free disk space using flexible factors instead of fixed "GB". 2013-04-28 15:55:32 +02:00
shypike
0f18771534 Allow "Default" category to be selected in Multi-ops. 2013-04-26 21:53:48 +02:00
shypike
82f76e04fe Fix issue with multiple selection in Config->Sorting.
'platform_encode' crashed on lists.
2013-04-20 16:41:51 +02:00
shypike
28c45ed4aa Allow for weird encoding of names of uploaded NZB files.
Sometimes CherryPy returns correct Unicode, sometimes UTF-8 disguised as Unicode.
2013-04-18 21:53:10 +02:00
shypike
4e69fa3f4a CherryPy Patch: allow UTF-8 encoding of headers.
Modern browsers can use non standardized UTF-8 encoding on headers,  most notably the Content-Disposition.
In Content-Disposition it is used to carry file names.
Patch CherryPy so that UTF-8 is tried before ISO-8859-1.
2013-04-18 21:51:08 +02:00
shypike
dacfe8b29e Resolve "derefer.me" links to NZB files. 2013-04-15 19:19:42 +02:00
shypike
27b65cd136 Add "Enable/Disable quota management" to Scheduler.
This allows user to set a period in which quota are ignored.
2013-04-14 12:53:35 +02:00
shypike
39ac8d9bee Touch up Bonjour support. 2013-04-14 12:37:32 +02:00
shypike
330cd0623c Ignore a number of special folders used by NAS systems when looking for orphaned jobs.
"@eaDir" and ".AppleDouble"
2013-04-13 20:26:02 +02:00
shypike
795b9f8e60 When creating a new database, set the right user_version. 2013-04-13 20:08:16 +02:00
shypike
3c7d8ab241 When repairing queue, don't try to recover non-job items in the admin/future folder. 2013-04-12 20:50:42 +02:00
shypike
46dd2137ea Add Bonjour/ZeroConfig Support.
Basic ZeroConfig support, only when SABnzbd listens to external addresses.
On all platforms, ZeroConfig/Bonjour libraries fail to implement "localhost" support properly.
Default on when support libraries are installed, special option to disable in case of trouble.
HTTP-->HTTPS redirection only enabled when ZeroConfig is active.
2013-04-12 20:05:09 +02:00
shypike
7d9afc3bbd CherryPy patch: allow setting of a HTTPS-->HTTP forwarding using "301 Moved Permanently".
Needed for later Bonjour support.
2013-04-11 22:31:05 +02:00
shypike
33e8ffd571 Fix incorrect code after removal of newzbin support. 2013-04-11 20:57:19 +02:00
shypike
1e518ef6a6 Config: fix error in Cfg->General->"External Internet access". 2013-04-11 19:53:58 +02:00
shypike
8fd993d14e Remove spaces from RSS URL-s. 2013-04-09 22:04:13 +02:00
shypike
7580b3f5ed Config and Wizard skins: fix problem with Unicode when using Chrome.
The Config skin and the Wizard were missing a proper Content-Type in <head>.
2013-04-09 21:47:54 +02:00
shypike
81bbd07c21 Make encryption detection more careful. 2013-04-09 19:35:54 +02:00
shypike
2cf2492871 Config-skin: Move clean-up list from Config->General to Config->Switches->Post-processing. 2013-04-06 19:35:51 +02:00
shypike
500b25e46f Update some UI texts. 2013-04-06 19:25:23 +02:00
shypike
56a2e492b4 Solve some fringe issues for OSX. 2013-04-06 19:10:55 +02:00
shypike
2cf0b65c83 Add refresh button to Status-Connections page. 2013-04-06 14:11:50 +02:00
shypike
3b81d84333 Errors/warnings for Notifications were not extended with parameters. 2013-04-03 23:12:58 +02:00
shypike
5128e6eef1 Fix issue where a recovered lost job would get the name "None" in the queue.
Problem happens when the orphaned job doesn't have an attribute file.
Not a normal use case, but possible as a result of a crash.
2013-04-01 19:23:09 +02:00
shypike
ba080f346b Let API calls for the queue provide more feedback.
Return True and list of affected ids
Return False (and empty list) when no ids matched.
2013-04-01 16:12:45 +02:00
shypike
bdfa862796 Only warn user about missing max line speed when an actual speed limit percentage is set. 2013-04-01 14:31:26 +02:00
shypike
d7a59acc7f Fix another merge error. 2013-03-31 23:20:51 +02:00
shypike
a24598deee Fix merge error. 2013-03-31 22:28:33 +02:00
shypike
3f4e375165 Merge pull request #85 from sabnzbd/rss_filtering
RSS filtering
2013-03-31 13:21:20 -07:00
shypike
b73c25a722 Swap title and size columns. 2013-03-31 22:18:23 +02:00
shypike
f2b3fdbd13 Add "at least" and "at most" filters to RSS.
Will only work for feeds that have a recognizable job size in their <description> field.
2013-03-31 22:18:23 +02:00
shypike
0f754c67a3 Prevent race condition when upgrading history1.db
Set "user_version" to 1 before inserting new columns.
2013-03-31 22:13:20 +02:00
shypike
9fe8f5e446 Improved duplicate detection.
The generic version is based on the md5sum of the combined article-identifiers and no longer on the NZB backup.
Episode detection is based on the  name/season/episode extraction from the job title.
There's now an option for generic detection and an option for episode detection.
All info is stored in the History database, under a new user_version number "1" because two new columns are needed.
2013-03-31 22:13:20 +02:00
shypike
c281bb4d30 Enhance security settings for external access.
User can set the range of the local network ("local_range").
Access for anything outside the local network is controlled by "inet_exposure".
The access levels are: none, nzb-only, api, full-api, full-ui
2013-03-31 18:38:10 +02:00
shypike
ecc2d6b1fd Restructure Config->Notifications and add Prowl support.
- Prowl support
- Separate settings for each notification service
2013-03-31 18:11:12 +02:00
shypike
bd27532eba Fix crash of bpsmeter when both old and new file are missing. 2013-03-31 16:53:20 +02:00
shypike
13d544cb81 Fix error introduced by scheduled priority classes.
After scheduler evaluation, only set/reset job-pause after considering the current status.
When adding new job to queue:  pause job when schedule evaluates pause, but don't undo an already set pause.
When changing priority: only pause when job is checking/downloading/queued, only resume when it was paused.
2013-03-30 11:31:20 +01:00
shypike
944568d6dc Remove all legacy code for newzbin and nzbmatrix. 2013-03-28 21:18:48 +01:00
shypike
420ff033e7 Add option to enable/disable recursive unpacking. 2013-03-26 19:38:42 +01:00
shypike
36406531ab Add Finnish translation. 2013-03-25 20:04:54 +01:00
shypike
73754e537e Improve the url grabber code.
Use the newer urllib2 that supports HTTP 1.1 properly.
Remove some obsolete code.
2013-03-22 22:26:41 +01:00
shypike
4f41db3953 When changing other job attributes than priority and category, prevent a re-sort of the queue. 2013-03-22 20:43:47 +01:00
shypike
e13b6b76ba Update the warning in README.md 2013-03-21 23:04:07 +01:00
shypike
322f9037fe Remove the attribute remapping for job admin files.
Not needed anymore because compatibility with 0.7.x is broken anyway.
2013-03-21 22:59:34 +01:00
shypike
a0f5c728da Fix issue with RSS feed names having non-plain ASCII characters. 2013-03-21 21:10:24 +01:00
shypike
c91c226071 Optimize and correct testing for string property.
Don't test for "isinstance(x, str) or isinstance(x, unicode)" but for "isinstance(x, basestring)".
Correct some places that forgot to test for unicode (so test for basestring).
2013-03-20 23:09:48 +01:00
shypike
7eff48cd00 Fix bad handling by API of Sort menu in Plush (improved).
Fix the root cause (in nzbqueue.py) instead of the symptom (in api.py).
2013-03-20 22:58:11 +01:00
shypike
40a27ae2d7 Make name sorting of the queue case-insensitive. 2013-03-20 22:46:04 +01:00
shypike
193d1125ba Fix bad handling by API of Sort menu in Plush.
Leads to (invisible) crashes in the UI, but also to warnings and failure of the sort.
2013-03-20 22:45:17 +01:00
shypike
a417b27e18 All regex expressions in newsunpack should use "raw" literal strings. 2013-03-20 21:58:14 +01:00
shypike
635ba9d98b Don't try to join a set of just one file (e.g. IMAGE.000) and reduce memory usage when joining large segments.
When there a single file called something like IMAGE.000, don't try to join it.
The joining procedure tries to read an entire segment file into memory, this may lead to a string overflow.
Use shutil.copyfileobj() with a 24 MB buffer instead.
2013-03-20 21:54:47 +01:00
shypike
7fe04d229b Use server-id instead of host:port in all downloader messages.
When user has multiple accounts on one server, the distinction wasn't visible in the messages.
2013-03-19 21:20:08 +01:00
shypike
63f2237ee1 Implement robots.txt to keep web crawlers out.
Should not really be needed, because users should password-protect any
SABnzbd instance exposed to internet.
2013-03-19 20:48:34 +01:00
shypike
d3088b504d Option to download all par2 files when repair is needed.
With QuickCheck on, all par2 files will be downloaded after QuickCheck verification fails.
With QuickCheck off, all par2 files will always be downloaded.
2013-03-19 20:22:14 +01:00
shypike
e24e374c15 CherryPy patch: no strict adherence to CRLF requirement for MIME messages. (Correction)
This would break some poorly written third-party utilities (like nzbdStatus for FireFox).
2013-03-19 19:47:01 +01:00
shypike
24fef5a838 CherryPy patch: no strict adherence to CRLF requirement for MIME messages.
This would break some poorly written third-party utilities (like nzbdStatus for FireFox).
2013-03-18 20:03:34 +01:00
shypike
ec9dd97fee Improve INI file backup handling.
When backup is not possible, do not write changes to disk.
When writing the new INI file fails, rename the backup to INI.
2013-03-17 11:45:42 +01:00
shypike
c946ab04f6 Only warn about missing unzip and 7za when their usage has been enabled. 2013-03-16 13:34:01 +01:00
shypike
f039a8f9f4 Improve scheduled pause/resume for priority groups.
Set pause/resume state based on scheduled events when adding job or changing its priority.
No change to jobs when changing schedules.
2013-03-15 21:57:56 +01:00
shypike
75cf199455 Add scheduled events for pausing and resuming low, medium and high priority job groups. 2013-03-15 21:05:48 +01:00
shypike
9c153f4b38 Improve recovery from corrupt or unwritable History database.
Create new database when the existing one is corrupt.
Report error when database is read-only, but ignore otherwise.
2013-03-15 19:58:46 +01:00
shypike
5c5bf56e7c Show URLs for primary and secondary skin in Config->General. 2013-03-14 22:08:37 +01:00
shypike
cdae0a741c Don't use an old queue when a new queue isn't present yet. 2013-03-14 22:06:59 +01:00
shypike
d00b47a32e Add warning about INI file upgrade issues. 2013-03-14 21:02:29 +01:00
shypike
2574c12a9e Allow password in AddNZB dialog box to be entered in the "nzb name" field.
NzbObject sanitized the 'nzbname' parameter before the password was extracted, which disabled password extraction.
Improve scan_password() so that a password-only "nzbname" parameter is handled correctly.
2013-03-13 19:37:18 +01:00
shypike
1fd9bf7032 Save job admin to disk when setting password or changing other attributes. 2013-03-12 20:56:51 +01:00
shypike
32ba0ad001 Plush: add "resume pp" entry to pulldown menu, when pause_pp event is scheduled.
The option allows manual resume of a scheduled paused post-processing.
2013-03-12 20:56:44 +01:00
shypike
e05b67e2ca Improve RAR detection. 2013-03-12 20:56:19 +01:00
shypike
bbfcb22796 Enable "abort if hopeless" for pre-check as well. 2013-03-12 20:56:10 +01:00
shypike
3cbc507409 More Unicode fixes.
- Show intermediate panic screen when old queue is detected
- Convert byte-counters file to Unicode
2013-03-12 19:30:01 +01:00
shypike
adcfc8dd2d Add Russian, Serbian and Simplified Chinese translations. 2013-03-11 19:36:36 +01:00
shypike
620e10a69f Convert to Unicode application.
This breaks compatibility with existing 0.7.x queues.
Polish and Romanian no longer need conversion to latin1.
2013-03-10 23:15:30 +01:00
shypike
ede33fad32 CherryPy patch: fix HTTPS file upload bug.
As described in: https://bitbucket.org/cherrypy/cherrypy/issue/1068
2013-03-10 23:00:04 +01:00
shypike
c811e090ec CherryPy patch: fix missing import of 'socket_errors_to_ignore'. 2013-03-10 14:17:39 +01:00
shypike
05c7c60c1f Add CherryPy 3.2.2 official release.
Folders 'tutorial', 'test' and 'scaffold' have been removed.
The root folder of the tar.gz has been omitted.
File VERSION.txt has been added.
2013-03-10 14:06:20 +01:00
shypike
347eaf46c3 Remove old CherryPy version. 2013-03-10 13:58:53 +01:00
shypike
e98c6e8cae Restore missing checkboxes for Multi-ops.
Introduction of searchbox (merge request #77) messed up checkboxes,
due to a debug version of $.plush.RefreshQueue() overriding the normal version.
2013-03-09 15:24:12 +01:00
shypike
9c43d20363 Replace "out of retention" text by the more likely "no longer on server". 2013-03-09 12:29:40 +01:00
shypike
357dc0437e Merge pull request #80 from jm3/tune-header-layout
Tune header layout to accomodate new search box
2013-02-13 10:21:16 -08:00
John Manoogian III
eb80a613f4 tune queue header layout to accomodate search box 2013-02-12 23:01:01 -08:00
John Manoogian III
597e03a692 make indenting style consistent 2013-02-12 21:55:49 -08:00
shypike
d351aa6ad6 Merge branch 'master' into develop 2013-02-12 18:06:37 +01:00
shypike
4989e8c156 Merge pull request #77 from jm3/searchable-queue-UI
Plush: front-end engineering for searchable NZB queue.
2013-02-11 13:32:07 -08:00
John Manoogian III
200c3d8b6a HTML+CSS+JS UI work for making queue searchable
Matches UI + behavior of history search (search updates on Enter press
and Queue Purge respects current queue search value)
2013-02-11 13:15:12 -08:00
shypike
90895116a2 Support "Search" box in queue display and Purge-queue command.
Python part.
2013-02-10 15:51:55 +01:00
shypike
a50412a327 Merge branch '0.7.x' 2013-02-07 20:30:09 +01:00
shypike
07be241112 Update text files for 0.7.11 2013-02-07 20:21:59 +01:00
shypike
fbdd264653 Update translations 2013-02-07 19:38:48 +01:00
shypike
a8bc793132 Fix regression error that could result in slow verification of NZBs with multiple rar/par sets.
The detection of obfuscated files failed, causing each par2 run to parse all files.
2013-02-07 19:27:03 +01:00
shypike
6bce423f23 Fix "Sorting" file renaming for RAR files that contain an extra folder level.
collapse_folder() should convert filename list accoerding to the renaming it does.
It's also its task to remove the _unpack_ markers from those filenames.
Rename this function to rename_and_collapse().
2013-02-04 22:47:53 +01:00
shypike
51cabf85a1 Plush: default refresh-rate now 4 sec and multi-ops bar visible. 2013-02-04 21:43:12 +01:00
shypike
38fdc2c7c8 Show warning when decoder encounters I/O-errors. 2013-02-03 12:25:33 +01:00
shypike
b91a2af9df Some badly encoded articles can be accepted as valid data.
Regression error since 0.7.9 (commit ccfbb07).
decoder.decode() no long ran into an excepton when no valid data was found.
Solved now by using the "found" flag.
2013-02-02 14:57:28 +01:00
shypike
f12317f499 Merge branch 'master' into develop 2013-01-31 23:06:29 +01:00
shypike
c300159537 Merge pull request #71 from jm3/fix-seperate-typo
Fix typo in config+comments: s/seperate/separate/g
2013-01-31 14:01:42 -08:00
shypike
e4de2d626d Merge branch '0.7.x' 2013-01-30 22:39:25 +01:00
shypike
71ee5969a8 Update text files for 0.7.10 2013-01-30 21:04:24 +01:00
shypike
1b1c772b55 Update text files for 0.7.10 2013-01-30 20:34:13 +01:00
shypike
458eb3a417 Update translations 2013-01-29 19:31:57 +01:00
shypike
98b753f015 Change access to build share, even more improved. 2013-01-28 23:31:25 +01:00
shypike
a3284e12d2 Change access to build share, improved. 2013-01-28 22:51:35 +01:00
shypike
c85120bb4b Change access to build share. 2013-01-28 21:36:12 +01:00
John Manoogian III
7f7f3dddb5 Fix typo in config+comments: s/seperate/separate/g 2013-01-26 18:48:06 -08:00
shypike
903925e06b Update main POT file. 2013-01-24 10:35:27 +01:00
shypike
03196f25e4 Accept NNTP error 400 without "too many connection" clues as a transient error.
Previously it would file a warning and lock out the server for a few minutes.
Reduce the lockout to 6 seconds.
400 should report "too many connections" but some servers use it for temporary connectivity issues.
2013-01-24 10:34:18 +01:00
ShyPike
e3f3f962b6 Handle unrar error messages better (like "path too long").
In the case of fully encrypted RAR files, SABnzbd cannot check the resulting files.
Handling unrar errors explicitly is better anyway.
2013-01-23 22:23:11 +01:00
shypike
153f92e697 "Failed" message should also appear in email notifications. 2013-01-22 23:27:21 +01:00
shypike
c1dcafe953 Display next RSS scan moment in Config->RSS 2013-01-19 21:34:31 +01:00
ShyPike
b53d97732b Reset the "today" byte counters at midnight even when idle.
Set a scheduled event at midnight for resetting the "today" byte counters.
Otherwise, when idle, the bpsmeter isn't called at all.
2013-01-17 22:24:12 +01:00
ShyPike
8f47cce9c8 Try to process obfuscated rar/par sets as good as possible.
When detecting a main par2 file without extra pars, use full wildcard for par2-run.
During par2-run, register which par2 files contain matching blocks.
Remove matching par2 files after the repair.
Skip sets of which the main par2 file has been deleted (due to having been used
in another set).
2013-01-15 22:42:59 +01:00
ShyPike
3cf42a7f94 Accept %fn (next to %fn.%ext) as end parameter in sorting strings. 2013-01-14 20:52:37 +01:00
ShyPike
ae74370cfb Add IP address of unauthenticated API-call to warning. 2013-01-14 19:23:47 +01:00
ShyPike
2aaa283991 Plush: repair and unpack icons in History were swapped.
Fixing does mean that order changes too, but that was the only way to
make the icons correspond with the hover popups.
2013-01-11 21:55:14 +01:00
ShyPike
dca7a8ccdb Plush: show speed when forced job is running in Paused mode. 2013-01-11 19:48:17 +01:00
ShyPike
2b3b5b765a Plush: show speed when forced job is running in Paused mode. 2013-01-11 19:45:31 +01:00
shypike
3172d6e987 Disable scheduled task for newzbin bookmarks. 2013-01-10 21:36:43 +01:00
ShyPike
c237ddfef4 Update text files for 0.7.9 2013-01-06 20:11:33 +01:00
ShyPike
b543dcb5ac Fix text in dropdowns being hard to see in chrome. 2013-01-06 19:33:31 +01:00
ShyPike
ccfbb07333 Take servers that only support ARTICLE into account.
When only full articles are available, the decoder needs to scan more lines
to find the start of the payload.
2013-01-06 19:33:19 +01:00
ShyPike
256ccbd6a1 Prevent crash in decoder.py 2013-01-06 19:06:15 +01:00
ShyPike
3a306ab8e0 Fix text in dropdowns being hard to see in chrome. 2013-01-06 14:34:28 +01:00
ShyPike
b9b87040dd Take servers that only support ARTICLE into account.
When only full articles are available, the decoder needs to scan more lines
to find the start of the payload.
2013-01-06 14:20:32 +01:00
ShyPike
2b8f3b0ac9 Merge branch 'master' (0.7.8) into develop 2013-01-04 19:58:10 +01:00
ShyPike
d8d507f110 Update text files for 0.7.8 2013-01-03 19:24:27 +01:00
ShyPike
7b3309649f Cancel encryption detection if meta-data if NZB contains password. 2013-01-03 18:44:31 +01:00
shypike
9a7a6652e8 Update text files for 0.7.8 2013-01-03 18:41:50 +01:00
shypike
db4891748f Update copyright year. 2013-01-03 18:40:49 +01:00
ShyPike
3dce2e8908 Support NZB 1.1 meta data; currently "category" and "password" are used.
"category" will trigger category conversion.
"password" value(s) will be used when an encrypted download is encountered.
The latter will also suppress the on-the-fly encryption detection.
2013-01-02 23:05:15 +01:00
ShyPike
c91291c315 Don't retry an empty but correct NZB retrieved from an indexer.
Also add special option "warn_empty_nzb" to control warning about empty NZBs.
2013-01-02 19:37:49 +01:00
shypike
a2a5a1f8e4 Make sure "Abort" error message ends up in download report. 2013-01-01 22:04:24 +01:00
shypike
7651f709ad API functions "addfile" and "addlocalfile" now support "nzbname" parameter for ZIP files with single NZB.
Also, prevent crash on calling "cat_convert" in those api functions (undefined).
2012-12-31 14:11:09 +01:00
shypike
a565077348 Update translations 2012-12-31 12:27:13 +01:00
shypike
6cf99e7d3a Add handling of an extra par2 error message. 2012-12-30 15:06:35 +01:00
shypike
f730a82005 Check for IPv6 connectivity should not use specific exceptions. 2012-12-30 13:16:46 +01:00
ShyPike
5449607c1d Update POT file. 2012-12-28 14:12:36 +01:00
ShyPike
c62415abfd Add "Abort" option to encryption detection.
The option pause_on_pwrar gets an extra value (2) which will
abort an encrypted job. Retrying the job will disable the check.
2012-12-28 14:10:53 +01:00
ShyPike
dcbea3057c Register removed articles and list in download report. 2012-12-28 13:23:34 +01:00
ShyPike
91642d16c8 Update POT file. 2012-12-27 22:26:33 +01:00
ShyPike
2f2773149d Fix missing Retry link for "Out of retention" jobs. 2012-12-27 22:26:05 +01:00
ShyPike
adaba03f50 Option to terminate download if too much data is missing.
Option 'fail_hopeless' Config->Switches.
On-the-fly check for possible completion after each file is processed.
Abort if it's no longer possible to download at least 99% of total data (payload + par2).
Don't do the check when retrying from History.
2012-12-27 21:56:00 +01:00
shypike
58a5e09540 Prevent web-watchdog from crashing when using Python 2.5 2012-12-27 11:28:06 +01:00
shypike
20dc906095 Support servers that don't support STAT and BODY commands.
When server sends error 500, use alternative "HEADER" and "ARTICLE" instead,
which are less efficient.
2012-12-24 20:12:01 +01:00
shypike
e2f41d3761 Add special "wait_for_dfolder", will wait for "temp download folder" at startup.
At startup, wait for the temporary download folder to come on line.
Supports situations where external drives are used, which do not mount before
SABnzbd starts up.
2012-12-23 12:11:18 +01:00
ShyPike
ab1372c7fc Prevent crash in DateSorter. 2012-12-20 18:46:45 +01:00
ShyPike
177fab2e54 Merge branch 'master' into develop 2012-12-19 22:28:26 +01:00
ShyPike
e305678cf4 In Sorting the %fn substitution sometimes fails to rename the file properly.
The Sorting code assumed that the file name used as the source for %fn
is always a base name. Sometimes it can be a full name. Deal with it.
2012-12-19 21:51:00 +01:00
ShyPike
a82df9bf2e Update text files for 0.7.7 2012-12-14 20:47:59 +01:00
ShyPike
986604f27c Update feedparser.py to from 5.1 to 5.1.3 2012-12-14 19:04:50 +01:00
shypike
59324c7453 Remove "Indexers" support page from the Wizard. 2012-12-09 13:03:03 +01:00
shypike
91613a5b37 Remove "Indexers" page from all skins. 2012-12-09 12:28:02 +01:00
shypike
5ca05fd2c0 OSX: remove association with "rar" and "zip" files. 2012-12-08 14:44:54 +01:00
shypike
4d4045cff4 Update translations 2012-12-05 21:27:04 +01:00
ShyPike
1f209a42d8 Filter unusable folders from lists generated by pathbrowser. 2012-12-03 21:13:13 +01:00
shypike
bffbb362db Update POT file. 2012-12-01 10:53:05 +01:00
shypike
435eed8818 Add 'B' to download totals on main page. 2012-12-01 10:48:27 +01:00
shypike
f86656543a Add schedule: when schedule has no days, assume daily instead of ignoring. 2012-12-01 10:06:11 +01:00
ShyPike
9c510c6dd1 When re-evaluating RSS feed, the original sort order was not preserved.
When re-using RSS entries from memory, use the original feed order and not
Python's random dictionary order.
2012-11-30 20:48:03 +01:00
ShyPike
f81ab3d1c0 Prevent crash when nzbxxx.com's category cannot be determined. 2012-11-30 18:47:38 +01:00
ShyPike
d1585c28a9 Remove all visible features for newzbin. 2012-11-29 22:07:45 +01:00
ShyPike
9c314532c0 Add optional web-watchdog to the watchdog. 2012-11-29 21:47:14 +01:00
ShyPike
853bda5d86 Add 'B' to server amounts. 2012-11-28 21:18:02 +01:00
ShyPike
d05e31f7f0 Remove placeholder for Cleanup filter in Config->General. Confusing for users. 2012-11-28 20:49:16 +01:00
ShyPike
383354871d Generic sort didn't always rename media files in multi-part jobs properly.
`rename_similar()` should be called outside of the media rename loop.
`rar_extract_core` should always return full paths.
2012-11-26 22:10:48 +01:00
ShyPike
bd54bbcf19 Generic sort didn't always rename media files in multi-part jobs properly.
`rename_similar()` should be called outside of the media rename loop.
`rar_extract_core` should always return full paths.
2012-11-26 21:39:32 +01:00
ShyPike
2086a217e0 Don't use SFV check when more par2 files can still be downloaded. 2012-11-24 22:38:04 +01:00
ShyPike
34f3574746 Update unrar for Windows to 4.20 2012-11-24 21:50:14 +01:00
ShyPike
1dfe0b957e Catch a renaming bug in par2-tbb and retry with par2-classic. 2012-11-24 21:33:58 +01:00
shypike
17d14bc3b4 OSX: update unrar to version 4.20 2012-11-24 21:33:36 +01:00
ShyPike
885032e436 Improve handling of orphaned jobs.
Re-queue of a set without a nzb.gz file would not recognize par2 sets.
Convert "None" strings in the attrib file to None.
2012-11-24 21:21:06 +01:00
ShyPike
ceee95aaf7 Orphan re-queue and delete failed when path contains non-plain ASCII characters.
Convert UTF-8 name coming from CherryPy to a platform compatible name.
2012-11-24 20:38:29 +01:00
ShyPike
aab4d933be Catch a renaming bug in par2-tbb and retry with par2-classic. 2012-11-20 23:37:28 +01:00
shypike
9b3220786e OSX: update unrar to version 4.20 2012-11-20 21:23:01 +01:00
ShyPike
490c72d934 Merge master (0.7.6) into develop. 2012-11-19 21:12:37 +01:00
ShyPike
bc6b3091eb Update text files for 0.7.6Final. 2012-11-17 14:01:38 +01:00
ShyPike
4be1a13316 Add the "User-Agent" header of each API call to logging and warnings. 2012-11-17 10:56:36 +01:00
ShyPike
a77327ee7f Support NZB re-queuing also for NZB files in sub-folders. 2012-11-15 22:01:41 +01:00
ShyPike
aa706012af Update text files for 0.7.6Beta2 2012-11-14 21:01:01 +01:00
ShyPike
f5b6203194 Make check for running SABnzbd instance more robust.
Cancel bad side-effect of removing the version check.
Under some circumstances SABnzbd can draw the unjustified conclusion
that another instance is running. Now check for a proper version pattern
in the received output.
2012-11-14 20:57:02 +01:00
ShyPike
1ced9a54e4 Fix evaluation of schedules at startup.
With the introduction of multiple-day schedules, the schedule evaluator failed.
Fixed the evaluation.
A side-effect is that Config->Scheduler will no longer show the schedules in
the order they will occur from now. Instead they will be shown in order of
occurrence from Monday to Sunday.
2012-11-14 20:23:40 +01:00
ShyPike
06c7089a77 Correct indentation in interface.py 2012-11-13 20:59:50 +01:00
ShyPike
ee1d864eea Update text files for 0.7.6Beta2 2012-11-12 21:47:19 +01:00
ShyPike
d703338935 Repair failed when mini-par2 file was in NZB but did not result in a file.
An incomplete mini-par2 file is now skipped in favor of the next available vol-par2 file.
A missing or damaged par2 file must make the next par2 file the primary par2-file
in the next repair run.
2012-11-12 21:10:27 +01:00
ShyPike
e87b24c460 Update text files for 0.7.6Beta1 2012-11-09 19:30:29 +01:00
shypike
3404ef6516 Update translations 2012-11-09 19:23:04 +01:00
shypike
181897e92b Prevent the Decoder from choking the Assembler.
Because the Decoder is CPU-bound, it has no reason to relinquish control.
This will choke the Assembler which cannot write finished and cached articles
to the designated file. The result is an increasing cache, which either grows
indefinitely or until the Decoder must flush articles.
By simply adding a sleep(0.001), the Decoder will trigger the task-scheduler
after each article, giving the Assembler a chance to do its work.
2012-11-08 23:12:15 +01:00
ShyPike
26a504e3e2 Prepare code for intro of zoned access to UI and API. 2012-11-07 21:41:04 +01:00
ShyPike
b72ed09011 Prevent IPv6 Usenet servers from being tried when they're not reachable.
Detect whether external IPv6 addresses are reachable.
If so, allow IPv6 IPs to be picked.
Add a special option 'ipv6_servers' to allow the user to forbid (0), allow (1) or force (2)
the use of IPv6. Value 2 can be used in case the detection by SABnzbd doesn't work reliable.
2012-11-07 20:07:25 +01:00
ShyPike
bb99c0d58e Fix problem with late detection of win32api absence. 2012-11-06 23:40:45 +01:00
ShyPike
4516027fdb Repair side-effect of SFV improvements.
A download without par2 files and without SFV files should not be failed.
2012-11-05 22:51:51 +01:00
ShyPike
e35f2ea3cd Prevent crash on Unix-Pythons that don't have the os.getloadavg() function.
Some Unix Pythons are defective in not providing os.getloadavg().
Add simple exception handler to cover this case.
2012-11-05 20:40:21 +01:00
ShyPike
6b79fad626 Remove version check when looking for a running instance of SABnzbd.
This will lower the chance of inadvertently launching multiple instances.
User will need to use --new to force a new instance.
2012-11-05 19:19:32 +01:00
ShyPike
ac311be430 Successfully pre-checked job lost its attributes when those were changed during check.
For successful jobs, the attributes were not saved to disk (they were for failed ones).
Solution is to save attributes independent of result.
2012-11-05 19:09:10 +01:00
shypike
4fb32bff5f Fix crash when a job is sent to postprocessing immediaterly after startup.
The Assembler wasn't running when job was sent to post processing at
the startup of the queue. The Assembler is used as a relay to send
a job to post-processing.
Solution is to start Assembler before initializing the queue.
2012-11-05 18:54:15 +01:00
ShyPike
5fda342a55 Don't try to repair/verify par sets that have "sample" in their names.
Only when sample deletion is enabled.
2012-11-03 20:34:17 +01:00
ShyPike
e23aab4710 Improve SFV handling, preventing odd side-effects in multi-set NZBs.
SFV verification per PAR-set using only the matching SFV file.
When no par2 files are found, use all available SFV files.
Remember the verification status of each set in the "verified" marker file.
Improve par-set matcher, so that there's no mix-up when one set name
is a substring of another set name.
2012-11-03 16:57:32 +01:00
ShyPike
3837d5dace Handle par-sets that have been renamed after generation of the par2 files.
Requires a wildcard to be added as a par2 parameter to make it scan all applicable files.
The rename actions need to be stored in a persistent file to prevent re-downloading in a Retry.
The status of correct sets must be remembered while fetching extra par file for failed sets.
2012-11-03 16:56:53 +01:00
shypike
f61e7cb1ed Update text files for 0.7.5 Final. 2012-11-03 16:15:22 +01:00
ShyPike
3de0c0e4ac Add missing "%dn" (original folder name) formula to Generic Sorting. 2012-11-01 21:24:51 +01:00
ShyPike
63796d3feb Improve logging for RSS readouts. 2012-11-01 19:47:48 +01:00
ShyPike
6b07529300 Update text files for 0.7.5RC1 2012-10-30 20:35:57 +01:00
ShyPike
e10676710c Support for news in Config. 2012-10-30 20:17:51 +01:00
shypike
77f67c6666 Merge pull request #59 from akuiraz/newzxxx2_fix
Fixed regex for newzbin rss filtering
2012-10-30 11:58:20 -07:00
ShyPike
bdbcdd61e1 Mask password in "Add Server" dialog. 2012-10-30 19:51:12 +01:00
ShyPike
4ab7ec754d Add periodic detection of completed but hanging jobs in the queue.
The 30 second watchdog now detects jobs without pending files.
Those jobs will be sent to the post-processor.
2012-10-30 18:47:18 +01:00
akuiraz
20f98f48bc Fixed regex for newzbin filtering by adding xxx2, now rss feeds from newzxxx2.ch will successfully download 2012-10-30 01:27:36 -04:00
shypike
84e0502e50 Prevent crash when trying to open non-existing "complete" folder from Windows System-tray icon. 2012-10-28 12:39:34 +01:00
shypike
2aa1b00dbb Prevent CherryPy crash when reading a cookie from another app which has a non-standard name. 2012-10-27 13:33:33 +02:00
ShyPike
972078a514 Fix problem with "Read" button when RSS feed name contains "&".
The feed's name wasn't properly encoded in the URL.
2012-10-24 19:34:45 +02:00
shypike
be8382d25b Add special option 'empty_postproc'.
Setting this option will run the user script on an empty download.
Normally this isn't done.
The status sent to the user script is -1, meaning "no files were downloaded".
2012-10-21 18:23:25 +02:00
shypike
8d46e88cd8 Update translations 2012-10-21 12:56:00 +02:00
shypike
6b6b1b79ad Add 'prio_sort_list' special.
This is a list of file name extensions.
Matching files will be the first to be downloaded within an NZB.

Also, if the user sets a simple space-seperated list, this will be converted to a standardized list.
2012-10-21 12:16:13 +02:00
shypike
e1fd40b34d OSX: Retina compatible menu-bar icons. 2012-10-20 19:57:11 +02:00
ShyPike
bc1f8f97a8 Prefix categories of nzbxxx.com with "XXX:". 2012-10-20 16:03:09 +02:00
shypike
b51705f458 Fix issues with accented and special characters in names of downloaded files.
name_extractor() returned Unicode instead of platform-compatible encoding.
QuickCheck assumed incorrectly that file names are not yet platform-compatible.
2012-10-20 15:11:08 +02:00
ShyPike
aaed5f4797 Adjust nzbmatrix category table. 2012-10-17 21:30:22 +02:00
ShyPike
a8eedef1d2 Prevent stuck jobs at end of pre-check. 2012-10-17 21:22:36 +02:00
shypike
9407e21e1e Prevent unusual SFV files from crashing post-processing. 2012-10-13 10:56:05 +02:00
ShyPike
ba6dcfd467 Don't show speed and ETA when download is paused during post-processing. 2012-10-08 21:21:15 +02:00
shypike
e2c1de5008 Prevent soft-crash when api-function "addfile" is called without parameters. 2012-10-06 21:57:48 +02:00
ShyPike
6737704b15 Update version to 0.8.x 2012-10-03 21:12:47 +02:00
ShyPike
481308e365 Merge branch 'master' into 'develop' at 0.7.4 release. 2012-10-03 21:04:31 +02:00
ShyPike
66f50f9f9d Merge in 0.7.3 from master branch. 2012-08-04 13:49:44 +02:00
ShyPike
1aef323e7b Set bandwidth as a percentage of the maximum bandwidth.
Both to be set by the user.
Add max bandwidth to the Wizard.
Give warning when user sets bandwidth percentage without setting a max bandwidth.
2012-07-28 17:04:32 +02:00
ShyPike
0cc7812e1f Treat 7zip archives as an NZB source (like ZIPs and RARs). 2012-07-28 12:57:39 +02:00
shypike
9957660e43 Make osx/7zip/7za executable. 2012-07-27 20:24:20 +02:00
ShyPike
f27c16ea9f Support for unpacking 7Zip files.
Same password support as for unrar.
Can be enabled and disabled.
Includes 7za 9.20 for Windows and OSX.
2012-07-27 20:15:53 +02:00
ShyPike
22a1051a19 Merge branch '0.7.x' into develop 2012-07-26 16:27:41 +02:00
ShyPike
08139bc808 Merge branch '0.7.x' into develop 2012-07-24 16:03:13 +02:00
ShyPike
77f3eb8b1c Merge branch '0.7.x' into develop 2012-07-20 19:43:35 +02:00
ShyPike
c78250fae8 Merge branch 'master' into develop 2012-07-18 18:35:10 +02:00
ShyPike
cadb4afe7c Merge from master (release 0.7.1 Final). 2012-07-06 21:29:33 +02:00
shypike
e52326f4ac Update translations 2012-06-23 12:15:54 +02:00
ShyPike
11b705fb78 Windows: the installer did not set an icon for NZB files (association). 2012-06-13 19:40:38 +02:00
Lucas Parry
172813bcd5 Make scheduler more flexible
Schedules can now be set for any aribtary group of days of the week.
2012-06-12 23:31:32 +02:00
ShyPike
dcba1877a8 Config-skin: "server" field in Config->Servers should have html5 tag "text" instead of "url". 2012-06-12 19:24:05 +02:00
ShyPike
a69120d25a Modify server test to please very critical Usenet server. 2012-06-10 20:01:00 +02:00
856 changed files with 151938 additions and 125084 deletions

43
.git-blame-ignore-revs Normal file
View File

@@ -0,0 +1,43 @@
# `git blame` master ignore list.
#
# This file contains a list of git hashes of revisions to be ignored
# by `git blame`. These revisions are considered "unimportant" in
# that they are unlikely to be what you are interested in when blaming.
# They are typically expected to be formatting-only changes.
#
# It can be used for `git blame` using `--ignore-revs-file` or by
# setting `blame.ignoreRevsFile` in the `git config`[1].
#
# Ignore these commits when reporting with blame. Calling
#
# git blame --ignore-revs-file .git-blame-ignore-revs
#
# will tell `git blame` to ignore changes made by these revisions when
# assigning blame, as if the change never happened.
#
# You can enable this as a default for your local repository by
# running
#
# git config blame.ignoreRevsFile .git-blame-ignore-revs
#
# This will probably be automatically picked by your IDE
# (VSCode+GitLens and JetBrains products are confirmed to do this).
#
# Important: if you are switching to a branch without this file,
# `git blame` will fail with an error.
#
# GitHub also excludes the commits listed below from its "Blame"
# views[2][3].
#
# [1]: https://git-scm.com/docs/git-blame#Documentation/git-blame.txt-blameignoreRevsFile
# [2]: https://github.blog/changelog/2022-03-24-ignore-commits-in-the-blame-view-beta/
# [3]: https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view
# Black changes
465a88154152fb0607a63fa24c8446bff43ec886
f06891926661986fff52d6eb4b4cb120c71972d1
9bcbcaefdfecc85aedfd8e2f8aaa1ca7f959404e
433dcab02b29f7bd3827e237434034deecc1b549
9f6a9f991222efccc87b45a701086c95629c67b6
f89114ca7e1b20bf8e645ecd0b52b707ec857aa9

31
.github/ISSUE_TEMPLATE/bug.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Bug report
description: >
Did you discover a bug in SABnzbd? Report it here!
If you are not 100% certain this is a bug please go to our forums, Reddit or Discord server first.
labels:
- Support
body:
- type: input
attributes:
label: SABnzbd version
validations:
required: true
- type: input
attributes:
label: Operating system
validations:
required: true
- type: dropdown
attributes:
label: Using Docker image
options:
- linuxserver
- hotio
- binhex
- Other
- type: textarea
attributes:
label: Description
description: Include error logs directly or link to extended logs on https://pastebin.com/
validations:
required: true

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Support forum
url: https://forums.sabnzbd.org/
about: Support questions can be asked on our forums, Reddit or Discord server.
- name: Discord
url: https://discord.sabnzbd.org
about: Support questions can be asked on our forums, Reddit or Discord server.
- name: Reddit - r/sabnzbd
url: https://www.reddit.com/r/sabnzbd
about: Support questions can be asked on our forums, Reddit or Discord server.

View File

@@ -0,0 +1,10 @@
name: Feature request
description: What new feature would you like to have added to SABnzbd?
labels:
- Support
body:
- type: textarea
attributes:
label: Description
validations:
required: true

1
.github/funding.yml vendored Normal file
View File

@@ -0,0 +1 @@
custom: ['https://sabnzbd.org/donate/']

47
.github/renovate.json vendored Normal file
View File

@@ -0,0 +1,47 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":disableDependencyDashboard"
],
"schedule": [
"before 8am on Monday"
],
"baseBranches": ["develop", "feature/uvicorn"],
"pip_requirements": {
"fileMatch": [
"requirements.txt",
"tests/requirements.txt",
"builder/requirements.txt",
"builder/release-requirements.txt"
]
},
"ignorePaths": [],
"ignoreDeps": [
"jaraco.text",
"jaraco.context",
"jaraco.collections",
"sabctools",
"paho-mqtt",
"werkzeug",
"tavern"
],
"packageRules": [
{
"matchManagers": ["github-actions"],
"matchPackageNames": ["windows", "macos"],
"enabled": false
},
{
"matchPackagePatterns": [
"*"
],
"groupName": "all dependencies",
"groupSlug": "all",
"separateMajorMinor": false,
"automerge": true
}
],
"automergeStrategy": "squash",
"platformAutomerge": true
}

256
.github/workflows/build_release.yml vendored Normal file
View File

@@ -0,0 +1,256 @@
name: Build binaries and source distribution
on: [push, pull_request]
# Setting PYTHONNODEBUGRANGES reduces binary size
env:
PYTHONNODEBUGRANGES: 1
jobs:
build_windows:
name: Build Windows binary (${{ matrix.architecture }})
strategy:
fail-fast: false
matrix:
include:
- architecture: x64
runs-on: windows-2022
- architecture: arm64
runs-on: windows-11-arm
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
architecture: ${{ matrix.architecture }}
cache: pip
cache-dependency-path: "**/requirements.txt"
- name: Install Python dependencies
# Without dependencies to make sure everything is covered in the requirements.txt
run: |
python --version
python -m pip install --upgrade pip wheel
pip install --upgrade -r requirements.txt --no-dependencies
pip install --upgrade -r builder/requirements.txt --no-dependencies
- name: Build Windows standalone binary
id: windows_binary
run: python builder/package.py binary
- name: Upload Windows standalone binary (unsigned)
uses: actions/upload-artifact@v6
id: upload-unsigned-binary
with:
path: "*-win*-bin.zip"
name: Windows standalone binary (${{ matrix.architecture }})
- name: Sign Windows standalone binary
uses: signpath/github-action-submit-signing-request@v2
if: contains(github.ref, 'refs/tags/')
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: ${{ secrets.SIGNPATH_ORG_ID }}
project-slug: "sabnzbd"
artifact-configuration-slug: "sabnzbd-binary"
signing-policy-slug: "release-signing"
github-artifact-id: ${{ steps.upload-unsigned-binary.outputs.artifact-id }}
wait-for-completion: true
output-artifact-directory: "signed"
- name: Upload Windows standalone binary (signed)
uses: actions/upload-artifact@v6
if: contains(github.ref, 'refs/tags/')
with:
name: Windows standalone binary (${{ matrix.architecture }}, signed)
path: "signed"
- name: Build Windows installer
if: matrix.architecture == 'x64'
run: python builder/package.py installer
- name: Upload Windows installer
if: matrix.architecture == 'x64'
uses: actions/upload-artifact@v6
id: upload-unsigned-installer
with:
path: "*-win-setup.exe"
name: Windows installer (${{ matrix.architecture }})
- name: Sign Windows installer
if: matrix.architecture == 'x64' && contains(github.ref, 'refs/tags/')
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: ${{ secrets.SIGNPATH_ORG_ID }}
project-slug: "sabnzbd"
artifact-configuration-slug: "sabnzbd-installer"
signing-policy-slug: "release-signing"
github-artifact-id: ${{ steps.upload-unsigned-installer.outputs.artifact-id }}
wait-for-completion: true
output-artifact-directory: "signed"
- name: Upload Windows installer (signed)
if: matrix.architecture == 'x64' && contains(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v6
with:
name: Windows installer (${{ matrix.architecture }}, signed)
path: "signed/*-win-setup.exe"
build_macos:
name: Build macOS binary
runs-on: macos-14
timeout-minutes: 15
env:
# We need the official Python, because the GA ones only support newer macOS versions
# The deployment target is picked up by the Python build tools automatically
# If updated, make sure to also set LSMinimumSystemVersion in SABnzbd.spec
PYTHON_VERSION: "3.14.2"
MACOSX_DEPLOYMENT_TARGET: "10.15"
# We need to force compile for universal2 support
CFLAGS: -arch x86_64 -arch arm64
ARCHFLAGS: -arch x86_64 -arch arm64
steps:
- uses: actions/checkout@v6
- name: Set up Python
# Only use this for the caching of pip packages!
uses: actions/setup-python@v6
with:
python-version: "3.14"
cache: pip
cache-dependency-path: "**/requirements.txt"
- name: Cache Python download
id: cache-python-download
uses: actions/cache@v5
with:
path: ~/python.pkg
key: cache-macOS-Python-${{ env.PYTHON_VERSION }}
- name: Get Python from python.org
if: steps.cache-python-download.outputs.cache-hit != 'true'
run: curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg -o ~/python.pkg
- name: Install Python
run: sudo installer -pkg ~/python.pkg -target /
- name: Install Python dependencies
# We have to manually compile some modules as they don't automatically fetch universal2 binaries
run: |
python3 --version
pip3 install --upgrade pip wheel
pip3 install --upgrade -r requirements.txt --no-binary cffi,CT3,PyYAML,charset_normalizer --no-dependencies
pip3 install --upgrade -r builder/requirements.txt --no-dependencies
- name: Import macOS codesign certificates
# Taken from https://github.com/Apple-Actions/import-codesign-certs/pull/27 (comments)
env:
CERTIFICATES_P12: ${{ secrets.CERTIFICATES_P12 }}
CERTIFICATES_P12_PASSWORD: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
MACOS_KEYCHAIN_TEMP_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_TEMP_PASSWORD }}
if: env.CERTIFICATES_P12
run: |
echo $CERTIFICATES_P12 | base64 --decode > certificate.p12
security create-keychain -p "$MACOS_KEYCHAIN_TEMP_PASSWORD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$MACOS_KEYCHAIN_TEMP_PASSWORD" build.keychain
security set-keychain-settings -lut 21600 build.keychain
security import certificate.p12 -k build.keychain -P "$CERTIFICATES_P12_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productsign -T /usr/bin/xcrun
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_KEYCHAIN_TEMP_PASSWORD" build.keychain
- name: Build source distribution
# Run this on macOS so the line endings are correct by default
run: python builder/package.py source
- name: Upload source distribution
uses: actions/upload-artifact@v6
with:
path: "*-src.tar.gz"
name: Source distribution
- name: Build macOS binary
env:
SIGNING_AUTH: ${{ secrets.SIGNING_AUTH }}
NOTARIZATION_USER: ${{ secrets.NOTARIZATION_USER }}
NOTARIZATION_PASS: ${{ secrets.NOTARIZATION_PASS }}
run: |
python3 builder/package.py app
python3 builder/make_dmg.py
- name: Upload macOS binary
uses: actions/upload-artifact@v6
with:
path: "*-macos.dmg"
name: macOS binary
build-snap:
name: Build Snap Packages (${{ matrix.linux_arch }})
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
linux_arch: x64
- os: ubuntu-24.04-arm
linux_arch: arm64
steps:
- uses: actions/checkout@v6
- name: Cache par2cmdline-turbo tarball
uses: actions/cache@v5
id: cache-par2cmdline
# Clearing the cache in case of new version requires manual clearing in GitHub!
with:
path: snap/par2cmdline.tar.gz
key: cache-par2cmdline
- name: Download par2cmdline-turbo tarball
if: steps.cache-par2cmdline.outputs.cache-hit != 'true'
run: |
PAR2_TARBALL=$(curl -sL https://api.github.com/repos/animetosho/par2cmdline-turbo/releases/latest | jq -r '.tarball_url')
curl -o snap/par2cmdline.tar.gz -L "$PAR2_TARBALL"
- uses: snapcore/action-build@v1
name: Build snap
id: snapcraft
- name: Test snap installation
run: |
sudo snap install --dangerous *.snap
sudo snap connect sabnzbd:removable-media
# Basic smoke test - check that the binary exists and can show help
timeout 10s snap run sabnzbd --help || true
sudo snap remove sabnzbd
- name: Upload snap
uses: actions/upload-artifact@v6
with:
name: Snap package (${{ matrix.linux_arch }})
path: ${{ steps.snapcraft.outputs.snap }}
- name: Publish snap
uses: snapcore/action-publish@v1
if: contains(github.ref, 'refs/tags/')
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_TOKEN }}
with:
store_login: ${{ secrets.SNAP_TOKEN }}
snap: ${{ steps.snapcraft.outputs.snap }}
release: stable
release:
name: Prepare Release
runs-on: ubuntu-latest
needs: [build_windows, build_macos]
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
cache: pip
cache-dependency-path: "builder/release-requirements.txt"
- name: Download Source distribution artifact
uses: actions/download-artifact@v7
with:
name: Source distribution
- name: Download macOS artifact
uses: actions/download-artifact@v7
with:
name: macOS binary
- name: Download Windows artifacts
uses: actions/download-artifact@v7
with:
pattern: ${{ (contains(github.ref, 'refs/tags/')) && '*signed*' || '*Windows*' }}
merge-multiple: true
- name: Prepare official release
env:
AUTOMATION_GITHUB_TOKEN: ${{ secrets.AUTOMATION_GITHUB_TOKEN }}
REDDIT_TOKEN: ${{ secrets.REDDIT_TOKEN }}
run: |
pip3 install -r builder/release-requirements.txt
python3 builder/release.py

View File

@@ -0,0 +1,63 @@
name: CI Tests
on: [push, pull_request]
jobs:
black:
name: Black Code Formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Black Code Formatter
uses: lgeiger/black-action@master
with:
args: >
SABnzbd.py
sabnzbd
scripts
tools
builder
builder/SABnzbd.spec
tests
--line-length=120
--target-version=py39
--check
--diff
test:
name: Test ${{ matrix.name }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
name: ["Linux"]
os: [ubuntu-latest]
include:
- name: macOS
os: macos-latest
python-version: "3.14"
- name: Windows
os: windows-2022
python-version: "3.14"
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/requirements.txt"
- name: Install system dependencies
if: runner.os == 'Linux'
run: sudo apt-get install unrar 7zip par2
- name: Install Python dependencies
run: |
python --version
python -m pip install --upgrade pip wheel
pip install --upgrade -r requirements.txt --no-dependencies
pip install --upgrade -r tests/requirements.txt
- name: Test SABnzbd
run: pytest -s

33
.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: "Close and lock old issues"
on:
schedule:
- cron: "30 1 * * *"
workflow_dispatch:
jobs:
stale:
name: "Close stale issues"
if: github.repository_owner == 'sabnzbd'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v10
with:
days-before-stale: 21
days-before-close: 7
stale-issue-label: "Stale"
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
exempt-issue-labels: "Feature request, Work in progress, Bug"
lock:
name: "Lock old issues"
if: github.repository_owner == 'sabnzbd'
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v6
with:
log-output: true
issue-inactive-days: 60
pr-inactive-days: 60

43
.github/workflows/translations.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Update translatable texts
on:
push:
branches:
- develop
jobs:
translations:
name: Update translatable texts
runs-on: ubuntu-latest
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.AUTOMATION_GITHUB_TOKEN }}
- name: Generate translatable texts
run: |
python3 tools/extract_pot.py
- name: Push/pull Transifex translations
if: env.TX_TOKEN
# Add --translation to the push command in order to update Transifex using local translation edits
# However, this prevents modifying existing translations in Transifex as they will be overwritten by the push!
run: |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
./tx push --source
./tx pull --all --force
- name: Compile translations to validate them
run: |
python3 tools/make_mo.py
- name: Push translatable and translated texts back to repo
uses: stefanzweifel/git-auto-commit-action@v7.1.0
if: env.TX_TOKEN
with:
commit_message: |
Update translatable texts
[skip ci]
commit_user_name: SABnzbd Automation
commit_user_email: bugs@sabnzbd.org
commit_author: SABnzbd Automation <bugs@sabnzbd.org>
file_pattern: "po/*.pot po/*.po"
push_options: --force

47
.gitignore vendored
View File

@@ -1,28 +1,53 @@
#Compiled python
*.py[co]
# Compiled python and venv
*.py[cod]
__pycache__
/venv
# Working folders for Win build
build/
dist/
locale/
srcdist/
# Snapcraft
parts/
prime/
stage/
snap/.snapcraft/
*.snap
# Generated email templates
email/*.tmpl
# Romanian ro.po is generated from ro.px, due to mapping to latin-1
ro.po
# Working folders for build
build/
dist/
locale/
srcdist/
# Build results
SABnzbd*.zip
SABnzbd*.exe
SABnzbd*.gz
SABnzbd*.dmg
SABnzbd*.pkg
SABnzbd-*/
# WingIDE project file
*.wpr
# WingIDE/PyCharm project files
*.wp[ru]
.idea
# VScode
.vscode/
# Testing folders
.cache
.xprocess
.pytest*
tests/cache
# General junk
*.keep
*.bak
*.log
# Some people use Emacs as an editor
\#*
.\#*
# Apple
.DS_Store

23
.tx/config Normal file
View File

@@ -0,0 +1,23 @@
[main]
host = https://www.transifex.com
[o:sabnzbd:p:sabnzbd-translations:r:po-main-sabnzbd-pot--develop]
file_filter = po/main/<lang>.po
minimum_perc = 0
source_file = po/main/SABnzbd.pot
source_lang = en
type = PO
[o:sabnzbd:p:sabnzbd-translations:r:po-email-sabemail-pot--develop]
file_filter = po/email/<lang>.po
minimum_perc = 0
source_file = po/email/SABemail.pot
source_lang = en
type = PO
[o:sabnzbd:p:sabnzbd-translations:r:po-nsis-sabnsis-pot--develop]
file_filter = po/nsis/<lang>.po
minimum_perc = 0
source_file = po/nsis/SABnsis.pot
source_lang = en
type = PO

View File

@@ -1,56 +0,0 @@
*******************************************
*** This is SABnzbd 0.7.4 ***
*******************************************
SABnzbd is an open-source cross-platform binary newsreader.
It simplifies the process of downloading from Usenet dramatically,
thanks to its friendly web-based user interface and advanced
built-in post-processing options that automatically verify, repair,
extract and clean up posts downloaded from Usenet.
SABnzbd also has a fully customizable user interface,
and offers a complete API for third-party applications to hook into.
There is an extensive Wiki on the use of SABnzbd.
http://wiki.sabnzbd.org/
IMPORTANT INFORMATION about release 0.7.0:
http://wiki.sabnzbd.org/introducing-0-7-0
Please also read the file "ISSUES.txt"
*******************************************
*** Upgrading from 0.6.x ***
*******************************************
Stop SABnzbd.
Install new version
Start SABnzbd.
*******************************************
*** Upgrading from 0.5.x ***
*******************************************
Stop SABnzbd.
Uninstall current version, keeping the data.
Install new version
Start SABnzbd.
The organization of the download queue is different from 0.5.x.
0.6.x will finish downloading an existing queue, but you
cannot go back to an older version without losing your queue.
Also, your sabnzbd.ini file will be upgraded, making it
incompatible with release 0.5.x
*******************************************
*** Upgrading from 0.4.x ***
*******************************************
>>>>> PLEASE DOWNLOAD YOUR CURRENT QUEUE BEFORE UPGRADING <<<<<<
When upgrading from a 0.4.x release such as 0.4.12 your old settings will be kept.
You will however be given a fresh queue and history. If you have items in your queue
from the older version of SABnzbd, you can either re-import the nzb files if you kept
an nzb backup folder, or temporarily go back to 0.4.x until your queue is complete.
The history is now stored in a better format meaning future upgrades should be backwards
compatible.

View File

@@ -1,289 +0,0 @@
-------------------------------------------------------------------------------
0.7.4Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Pre-queue script no longer got the show/season/episode information.
- Prevent crash on startup when a fully downloaded job is still in download queue.
- New RSS feed should no longer be considered new after first, but empty readout.
- Make "auth" call backward-compatible with 0.6.x releases.
- Config->Notifications: email and growl server addresses should not be marked as "url" type.
- OSX: fix top menu queue info so that it shows total queue size
-------------------------------------------------------------------------------
0.7.4RC2 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Pre-check failed to consider extra par2 files
- Fixed unjustified warning that can occur with OSX Growl 2.0
- Show memory usage on Linux systems
- Fix incorrect end-of-month quota reset
- Fix UI refresh issue when using Safari on iOS6
-------------------------------------------------------------------------------
0.7.4RC1 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Remove potential queue stalling when downloading extra par2 files
- Make Windows version less eager to use par2-classic
- Fixed DMG images
- Add missing encoding directive to Plush and Classic skins
- Prevent oversized data in API-call "history"
-------------------------------------------------------------------------------
0.7.4Beta3 by The SABnzbd-Team
-------------------------------------------------------------------------------
- All three OSX build in one DMG again
- Minor bugfixes
-------------------------------------------------------------------------------
0.7.4Beta2 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix failure to fetch more par2-files for posts with badly formatted subject lines
- After successful pre-check, preserve a job's position in the queue
- Restore SABnzbd icon for Growl
- Fix "check new releases" option in Config skin
- Separate DMG files for OSX Leopard/SL, Lion and MLion
-------------------------------------------------------------------------------
0.7.4Beta1 by The SABnzbd-Team
-------------------------------------------------------------------------------
- OSX Mountain Lion Notification Center support
- OSX Mountain Lion improved "keep awake" support
- OSX: separate builds: one for Mountain Lion and one for all others
- OSX removed 64bit code
- Scheduler: action can now run on multiple weekdays
- Scheduler: add "remove failed jobs" action
- Special option: rss_odd_titles (see Wiki)
- Support for HTTPS chain files (needed when you buy your own certificate)
- Prevent jobs from showing up in queue and history simultaneously
- Add parameter 'pp_active' to history elements in qstatus API call
- Fix some minor par2 handling bugs
- Prevent potential crash when an actively downloading job is deleted from the queue
- Special option: 'overwrite_files' (See Wiki)
- Don't try an SFV check when a retried job was already successfully verified by par2
- Enable compression of API call results
- Log failed attempts to log in to the Web UI
- A job with "forced" priority should keep that when fetching more par2 files
- Updated translations
-------------------------------------------------------------------------------
0.7.3Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Rename Special "random_server_ip" to "randomize_server_ip" so that we
can force the default to "Off". "On" kills speed on some servers.
- Ignore pseudo NZB files that start with a period in the name
- SFV failure now listed in History instead of issuing warnings
- Translation updates
- "502" errors about payments/credits will now block a server
-------------------------------------------------------------------------------
0.7.3Beta2 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Try to keep OSX Mountain Lion awake as long as downloading/postprocessing runs
- Prevent queue deadlock in case of fatally damaged par2 files
- Add RSS filter-enable checkboxes to Plush, Smpl and Classic skins
- Fix problem with saving modified paramters of an already enabled server
- Extend "check new release" option with test releases
-------------------------------------------------------------------------------
0.7.3Beta1 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Correct several errors in Sort function
- Improve organization of Config->Servers
- Support for nzbxxx.com
- Make detection of samples less aggressive
- Some minor corrections
-------------------------------------------------------------------------------
0.7.2Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix for NZB-icon issue when 0.7.0 was previously installed
- Check validity of totals9.sab file
- Fix startup problem when localhost has unexpected order of IP addresses
-------------------------------------------------------------------------------
0.7.2RC2 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Improve support for nzbsrus.com
- Don't try to show NZB age when not known yet
- Prevent systems with unresolvable hostnames from always using 0.0.0.0
-------------------------------------------------------------------------------
0.7.2RC1 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix fatal error in nzbsrus.com support
- Initial "quota left" was not set correctly when enabling quota
- Report incorrect RSS filter expressions (instead of aborting analysis)
- Improve detection of invalid articles (so that backup server will be tried)
- Windows installer: improve NZB association so that a reboot isn't needed
- Windows installer: don't remove settimngs by default when uninstalling
- Fix sorting of rar files in job so that .rar preceeds .r00
-------------------------------------------------------------------------------
0.7.1Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Disable VC90 check in Windows Installer as long as we're still on Python 2.5
- Windows: make sure \\server\share notation is never seen as a relative path
-------------------------------------------------------------------------------
0.7.1RC5 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix signing of OSX DMG
- Fix endless par2-fetch loop after retrying failed job
- Don't send "bad fetch" email when emailing is off
- Add some support for nzbrus.com's non-VIP limiting
-------------------------------------------------------------------------------
0.7.1RC4 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix failure to grab NZBs from indexers that send compressed files.
-------------------------------------------------------------------------------
0.7.1RC3 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fixed stalling par2 fetches (after first verification run)
- Fixed retry behaviour of NZB fetching from URL
and add handling of nzbsrus.com error codes
- Make sure that all malformed articles are retried on another server
- Add no_ipv6 option that suppresses listing on ::1
(to be used if your system cannot handle that)
- Prevent crash in QuickCheck when expected par2 file wasn't downloaded
- Verification/repair would not be executed properly when one more RAR files
missed their first article.
- API calls "addurl" and "addid" (newzbin) can be used interchangeably
(Fixes a problem in Qouch)
-------------------------------------------------------------------------------
0.7.1RC2 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Improved backup of sabnzbd.ini file
Will use backup when original is gone or become corrupt
- Windows: Using ::1 as single webhost address would start IE instead of default browser
-------------------------------------------------------------------------------
0.7.1RC1 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Plush skin: fix problems with pull-down menus in Mobile Safari
- On some Linux and OSX systems using localhost would still make SABnzbd
give access to other computers
- Windows: the installer did not set an icon when associating NZB files with SABnzbd
- Fix problem that the Opera browser had with Config->Servers
- Retry a few times when accessing a mounted drive to create the
final destination folder
- Reduce load caused by WinTray and OSX topmenu
-------------------------------------------------------------------------------
0.7.0Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Updated translations
-------------------------------------------------------------------------------
0.7.0RC2 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Suppress permission errors on paths containing ".AppleDouble" or ".DS_Store"
(Required for NAS systems that support Apple AFP shares)
- OSX/Windows: Set article cache to 200M when not already set.
- Pre-check: lower default minimum completion rate to 100.2%
-------------------------------------------------------------------------------
0.7.0RC1 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix for rare crash in par2 fetching
- Another /nomedia fix
- Quota reset wasn't done when quota-reset-time was passed while SABnzbd wasn't running.
- Pre-check: required ratio for NZB without par2 files should be 100%
and not the "safe" ratio
-------------------------------------------------------------------------------
0.7.0Beta8 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Disabled the .nomedia marker file feature.
Those who want to try it, use the "nomedia_marker" setting in Config->Special
It remains an experimental feature without guarantees
- Add missing info in email about failed pre-check
- Updated translations
-------------------------------------------------------------------------------
0.7.0Beta7 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix for .nomedia files not being deleted
- Fix NZB re-queueing (due to .nomedia remaining)
- Polish was missing in Windows installer and Dutch was incorrect
- When Sort renames auxillirary files, it should disregard case
- Fix crash in Wizard on some Linux systems
-------------------------------------------------------------------------------
0.7.0Beta6 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Upgrade unzip for Windows to 6.00 (supports ZIPs above 2G)
- Lower threshold for pre-check to 100.5%
- Fix removal of .nomedia file when using Sorting
- Add Polish translation (using reduced character set)
- Extension-based cleanup list now also removes extension-only files like ".sfv".
- Several small issues
-------------------------------------------------------------------------------
0.7.0Beta5 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Solved serious connection problem with some providers
- Windows Tray has the "restart" entries no under a Troubleshoot menu
- Fix newzbin entries in History's "Source" field
- During unpacking the destination folder will contain a ".nomedia" file
which will keep mediaplayers temporarily from indexing
- Pre-check jobs now require 101% completion rate (with a "special" parameter)
- Unified OSX DMG
-------------------------------------------------------------------------------
0.7.0Beta4 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Add Portuguese (Brazil) language
- Updated translations
- Some odd NZB files led to blank initial filenames in file overview
- Jobs that have 99.91%-99.99% completion rate should not be rounded to 100.0%
- Windows Tray icon now has entry to show "complete" folder
- Some minor fixes in code and Config skin
- Individual RSS filter toggle
-------------------------------------------------------------------------------
0.7.0Beta3 by The SABnzbd-Team
-------------------------------------------------------------------------------
- OSX/Linux: permissions are now also applied to the "temporary download folder"
- Fix some issues in the Config skin.
- The default for "apply max retries only on optional servers" is now 0,
thus enabling the new anti-deadlock behaviour for all servers
- Fix incompatibility with nzbsa.co.za indexer
- Log all API calls (in debug mode)
- Restore Python2.5 compatibility in growler.py
- After a language change, register again with Growl
- Clean up the api-call auth. It will now give preference to 'apikey'.
- Fix detection of retry-able history entries for case-insensitive file systems.
- API-calls "addfile" and "addlocalfile" returned an incorrect status value.
- Add support for the peculiar Usenet provider "free.xsusenet.com".
- OSX menu now uses the same formatting for speed as the skins.
- Accept multiple items in API-calls "addurl" and "addid".
The "name" and "nzbname" keywords can be repeated.
-------------------------------------------------------------------------------
0.7.0Beta2 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix behavior when using host address 0.0.0.0 on a system
that doesn't resolve localhost properly
- Add Spanish translation
-------------------------------------------------------------------------------
0.7.0Beta1 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Updated nzbmatrix categories
- "Special" option allows incomplete/partial NZB files
- Forbid "complete" being a subfolder of "incomplete"
-------------------------------------------------------------------------------
0.7.0Alpha3 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix failing join-by-par2
- Prevent API crash when deleting non-existing history item
- Prevent UI crash message when looking at NZB details page of finished job
- Config skin: fix path complettion in Config->Folders
- Config skin: fixes to support "hide behind proxy"
- Keep using unrar 4.10 for OSX Leopard and older, due to PPC support
-------------------------------------------------------------------------------
0.7.0Alpha2 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Fix disabled options in Config skin
- Remove flags from the Wizard and Config skin
- Replace real spaces in RSS-urls with %20
- Prevent double entries in History's "Source" section
- Prevent crash when OSDNotify doesn't work properly
- Small improvents in Windows installer
-------------------------------------------------------------------------------
0.7.0Alpha1 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Not tracked
-------------------------------------------------------------------------------
0.6.15Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Flag post-processing as failed when files cannot be moved/copied to destination
- Fixed another newzbin link
-------------------------------------------------------------------------------
0.6.15RC1 by The SABnzbd-Team
-------------------------------------------------------------------------------
- Change newzbin URL
- Prevent setting watched-folder speed to 0 (while having no watched-folder)
from triggering an inifinite loop.
- Move "locale" construction from Plush skin to Python code.
Some embedded Linux platforms show unstable behavior with the original construction.
- Extend OSX menu with troubleshooting options
- Add trailing slashes to internal Plush paths to support reverse proxies better.
- Ignore whitespace around regular expressions in RSS filters.
- Prevent crash on restoring URL-fetches when using --repair-all option
- Fix "Repair" button on smpl Connection page. Current path fails when using a reverse proxy
- Suppress "incompatible feed" error when doing a scheduled/automatic RSS read-out.
- Add special setting to use "pickle" library instead of cPickle.

View File

@@ -1,32 +1,37 @@
(c) Copyright 2007-2012 by "The SABnzbd-team" <team@sabnzbd.org>
(c) Copyright 2007-2025 by The SABnzbd-Team (sabnzbd.org)
The SABnzbd-team is:
The SABnzbd-Team is:
Active team:
ShyPike <shypike@sabnzbd.org>
inpheaux <inpheaux@sabnzbd.org>
zoggy <zoggy@sabnzbd.org>
Sleeping members
sw1tch <switch@sabnzbd.org>
pairofdimes <pairofdimes@sabnzbd.org>
rAf <rAf@sabnzbd.org>
Honorary member (and original author)
Gregor Kaufmann <tdian@users.sourceforge.net>
Safihre
sanderjo
jcfp
inpheaux
zoggy
Sleeping members:
ShyPike
sw1tch
pairofdimes
rAf
Honorary member (and original author):
Gregor Kaufmann
The main contributors and moderators of the translations
Danish: Rene (nordjyden6)
Dutch: ShyPike
French : rAf and Fox Ace
German: Severin Heiniger
Norwegian: Protx
The main contributors and moderators of the translations:
Danish: Rene (nordjyden6), Scott
Dutch: ShyPike, Safihre
French: rAf, Fox Ace, Fred, Morback, Jih
German: Severin Heiniger, Tim Hartmann, DonPizza, Alex
Norwegian: Protx, mjelva, TomP, John
Romanian: nicusor
Serbian: Ozzii
Swedish: Malmis
Spanish: Syquus
Portuguese (Brazil): lrrosa
Serbian: Ozzii, Krišan Darko
Swedish: Malmis, Kim Joahnsson, Patrik-liind, Chris M
Spanish: Syquus, Adolfo Jayme
Portuguese (Brazil): lrrosa, diegosps
Russian: Pavel Maryanov
Polish: Tomasz 'Zen' Napierala
Chinese: XsLiDian
Finnish: Matti Ylönen
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@@ -1,10 +1,10 @@
SABnzbd 0.7.4
SABnzbd
-------------------------------------------------------------------------------
0) LICENSE
-------------------------------------------------------------------------------
(c) Copyright 2007-2012 by "The SABnzbd-team" <team@sabnzbd.org>
(c) Copyright 2007-2025 by The SABnzbd-Team (sabnzbd.org)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -21,87 +21,61 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-------------------------------------------------------------------------------
1) INSTALL with the Win32 installer
1) INSTALL with the Windows installer
-------------------------------------------------------------------------------
Just run the downloaded EXE file and the installer will start.
It's just a simple standard installer.
After installaton, find the SABnzbd program in the Start menu and start it.
After installation, find the SABnzbd program in the Start menu and start it.
Within 5-10 seconds your web browser will start and show the user interface.
Within a few seconds your web browser will start and show the user interface.
Use the "Help" button in the web-interface to be directed to the Help Wiki.
-------------------------------------------------------------------------------
2) INSTALL pre-built Win32 binaries
2) INSTALL pre-built Windows binaries
-------------------------------------------------------------------------------
Unzip pre-built version to any folder of your liking.
Start the SABnzbd.exe program.
Within 5-10 seconds your web browser will start and show the user interface.
Within a few seconds your web browser will start and show the user interface.
Use the "Help" button in the web-interface to be directed to the Help Wiki.
-------------------------------------------------------------------------------
3) INSTALL pre-built OSX binaries
3) INSTALL pre-built macOS binaries
-------------------------------------------------------------------------------
Download the DMG file, mount and drag the SABnzbd icon to Programs.
Download the DMG file, mount and drag the SABnzbd icon to Applications.
Just like you do with so many apps.
Make sure you pick the right folder, depending on your OSX version.
-------------------------------------------------------------------------------
4) INSTALL with only sources
-------------------------------------------------------------------------------
You need to have Python installed plus some non-standard Python modules
and a few tools.
Specific guides to install from source are available for Windows and macOS:
https://sabnzbd.org/wiki/installation/install-macos
https://sabnzbd.org/wiki/installation/install-from-source-windows
Unix/Linux/OSX
Python-2.5, 2.6 or 2.7 http://www.python.org
Only Python 3.9 and above is supported.
OSX Leopard/SnowLeopard
Python 2.6 http://www.activestate.com
OSX Lion Apple Python 2.7 (included in OSX)
Windows
Python-2.7.latest http://www.activestate.com
Essential modules
cheetah-2.0.1+ http://www.cheetahtemplate.org/ (or use "pypm install cheetah")
par2cmdline >= 0.4 http://parchive.sourceforge.net/
http://chuchusoft.com/par2_tbb/index.html (multi-core)
Optional modules
unrar >= 3.90+ http://www.rarlab.com/rar_add.htm
unzip >= 5.52 http://www.info-zip.org/
yenc module >= 0.3 http://sabnzbd.sourceforge.net/yenc-0.3.tar.gz
http://sabnzbd.sourceforge.net/yenc-0.3-w32fixed.zip (Win32-only)
Optional modules Windows
pyopenssl >= 0.11 http://pypi.python.org/pypi/pyOpenSSL
(Binaries, including the OpenSSL libraries)
Optional modules Unix/Linux/OSX
pyopenssl >= 0.11 http://pypi.python.org/pypi/pyOpenSSL
openssl => v0.9.8g+ http://www.openssl.org/
Make sure the OpenSSL libraries match with PyOpenSSL
pynotify Should be part of GTK for Python support on Debian/Ubuntu
If not, you cannot use the NotifyOSD feature.
Embedded modules (only use the included version)
CherryPy-3.2 rev2138 with patches http://www.cherrypy.org
On Linux systems you need to install:
par2 unrar python3-setuptools python3-pip
On non-X86 platforms, for which PyPI does not provide all pre-compiled packages,
you also need to install these development libraries (exact names might differ per platform):
libffi-dev libssl-dev
Unpack the ZIP-file containing the SABnzbd sources to any folder of your liking.
If you want multiple languages, you need to compile the translations.
Start this from a shell terminal (or command prompt):
python tools/make_mo.py
Inside the SABnzbd source directory, install all required Python packages by running:
python3 -m pip install -r requirements.txt
If you want non-English languages, you need to compile the translations.
Start this from a shell terminal (or command prompt):
python SABnzbd.py
Within 5-10 seconds your web browser will start and show the user interface.
python3 tools/make_mo.py
To start SABnzbd, run this from a shell terminal (or command prompt):
python3 -OO SABnzbd.py
Within a few seconds your web browser will start and show the user interface.
Use the "Help" button in the web-interface to be directed to the Help Wiki.
-------------------------------------------------------------------------------
5) TROUBLESHOOTING
-------------------------------------------------------------------------------
@@ -112,11 +86,11 @@ This means that SABnzbd cannot use the default port 8080 to run its web-server o
Try to use another port, you'll need to use the a command window:
SABnzbd.exe -s localhost:7777
or
python SABnzbd.py -s localhost:7777
python3 SABnzbd.py -s localhost:7777
You may of course try other port numbers too.
For troubleshooting you can use the program SABnzbd-console.exe.
For troubleshooting on Windows you can use the program SABnzbd-console.exe.
This will show a black window where logging information will be shown. This
may help you solve problems easier.
@@ -124,9 +98,8 @@ may help you solve problems easier.
6) MORE INFORMATION
-------------------------------------------------------------------------------
Visit the WIKI site:
http://wiki.sabnzbd.org/
Visit our wiki:
https://sabnzbd.org/wiki/
-------------------------------------------------------------------------------
7) CREDITS
@@ -134,4 +107,4 @@ Visit the WIKI site:
Several parts of SABnzbd were built by other people, illustrating the
wonderful world of Free Open Source Software.
See the licences folder of the main program and of the skin folders.
See the licenses folder of the main program and of the skin folders.

View File

@@ -9,79 +9,42 @@
- When par2 or unrar hang up, never just stop SABnzbd.
Instead use your operating system's task manager to stop the par2 or unrar program.
Forcing SABnzbd to quit may damage your queues.
Windows-only:
If you keep having trouble with par2 multicore you can disable it
in Config->Switches.
This will force the use of the old and tried, but slower par2-classic program.
- A bug in Windows 7 may cause severe memory leaks when you use SABnzbd in
combination with some virus scanners and firewals.
Install this hotfix:
Description: http://support.microsoft.com/kb/979223/en-us
Download location: http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=979223&kbln=en-us
- Windows cannot handle pathnames longer than 254 characters.
Currently, SABnzbd doesn't handle this problem gracefully.
We have added the INI-only option "folder_length_max" in which you can set
a maximum folder name size.
For Windows the default is 128 and for others 256.
A quite safe value for Windows would be 64.
SABnzbd will take care of overlapping names.
See: http://wiki.sabnzbd.org/configure-special-0-7
- Some Usenet servers have intermittent login (or other) problems.
For these the server blocking method is not very favourable.
There is an INI-only option that will limit blocks to 1 minute.
no_penalties = 1
See: http://wiki.sabnzbd.org/configure-special-0-7
See: https://sabnzbd.org/wiki/configuration/3.4/special
- Some third-party utilties try to probe SABnzbd API in such a way that you will
- Some third-party utilities try to probe SABnzbd API in such a way that you will
often see warnings about unauthenticated access.
If you are sure these probes are harmless, you can suppress the warnings by
setting the option "api_warnings" to 0.
See: http://wiki.sabnzbd.org/configure-special-0-7
See: https://sabnzbd.org/wiki/configuration/3.4/special
- On OSX you may encounter downloaded files with foreign characters.
- On macOS you may encounter downloaded files with foreign characters.
The par2 repair may fail when the files were created on a Windows system.
The problem is caused by the PAR2 utility and we cannot fix this now.
This does not apply to files inside RAR files.
- On Linux when you download files they may have the wrong character encoding.
You will see this only when downloaded files contain accented characters.
You need to fix it yourself by running the convmv utility (availaible for most Linux platforms).
Possible the file system override setting 'fsys_type' might be solve things:
See: http://wiki.sabnzbd.org/configure-special-0-7
- The "Watched Folder" sometimes fails to delete the NZB files it has
processed. This happens when other software still accesses these files.
Some third-party utilities supporting SABnzbd are known to do this.
We cannot solve this problem, because the Operating System (read Windows)
prevents the removal.
- Memory usage can sometimes have high peaks. This makes using SABnzbd on very low
memory systems (eg a SAN device) a challenge.
- When SABnzbd cannot send notification emails, check your virus scanner,
firewall or security suite. It may be blocking outgoing email.
- SABnzbd is not compatible with some software firewall versions.
The Mircosoft Windows Firewall works fine, but remember to tell this
firewall that SABnzbd is allowed to talk to other computers.
- When SABnzbd cannot send nofication emails, check your virus scanner,
firewall or securiry suite. It may be blocking outgoing email.
- When you are using external drives or network shares on OSX or Linux
- When you are using external drives or network shares on macOS or Linux
make sure that the drives are mounted.
The operating system wil simply redirect your files to alternative locations.
The operating system will simply redirect your files to alternative locations.
You may have trouble finding the files when mounting the drive later.
On OSX, SABnzbd will not create new folders in /Volumes.
On macOS, SABnzbd will not create new folders in /Volumes.
The result will be a failed job that can be retried once the volume has been mounted.
- On some operating systems it looks like there is a problem with one of the standard Python libraries.
It is possible that you get errors about saving admin files and even unexplained crashes.
If so, you can enable the option for the alternative library.
It has the same functionality, but is slower.
We've had reports about this issue on non-mainstream Linux platforms.
- OpenElec
- Squeeze Linux
There is a "special" option that will allow you to select an alternative library.
use_pickle = 1
See: http://wiki.sabnzbd.org/configure-special-0-7
- If you use a mounted drive as "temporary download folder", it must be present when SABnzbd
starts up. If not, SABnzbd will use the default location.
You can make SABnzbd wait for a mount of the "temporary download folder" by setting
Config->Special->wait_for_dfolder to 1.
SABnzbd will appear to hang until the drive is mounted.

View File

@@ -1,4 +1,4 @@
(c) Copyright 2007-2012 by "The SABnzbd-team" <team@sabnzbd.org>
(c) Copyright 2007-2025 by The SABnzbd-Team (sabnzbd.org)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@@ -1,462 +0,0 @@
; -*- coding: latin-1 -*-
;
; Copyright 2008-2012 The SABnzbd-Team <team@sabnzbd.org>
;
; This program is free software; you can redistribute it and/or
; modify it under the terms of the GNU General Public License
; as published by the Free Software Foundation; either version 2
; of the License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
!addplugindir win\nsis\Plugins
!addincludedir win\nsis\Include
!include "MUI2.nsh"
!include "registerExtension.nsh"
!include "FileFunc.nsh"
!include "LogicLib.nsh"
!include "WinVer.nsh"
!include "WinSxSQuery.nsh"
;------------------------------------------------------------------
;
; Marco for removing existing and the current installation
; It share buy the installer and the uninstaller.
; Make sure it covers 0.5.x, 0.6.x and 0.7.x in one go.
;
!define RemovePrev "!insertmacro RemovePrev"
!macro RemovePrev idir
Delete "${idir}\email\email-de.tmpl"
Delete "${idir}\email\email-en.tmpl"
Delete "${idir}\email\email-nl.tmpl"
Delete "${idir}\email\email-fr.tmpl"
Delete "${idir}\email\email-sv.tmpl"
Delete "${idir}\email\email-da.tmpl"
Delete "${idir}\email\email-nb.tmpl"
Delete "${idir}\email\email-pl.tmpl"
Delete "${idir}\email\email-ro.tmpl"
Delete "${idir}\email\email-sr.tmpl"
Delete "${idir}\email\email-es.tmpl"
Delete "${idir}\email\email-pt_BR.tmpl"
Delete "${idir}\email\email-sr.tmpl"
Delete "${idir}\email\email-ru.tmpl"
Delete "${idir}\email\rss-de.tmpl"
Delete "${idir}\email\rss-en.tmpl"
Delete "${idir}\email\rss-nl.tmpl"
Delete "${idir}\email\rss-pl.tmpl"
Delete "${idir}\email\rss-fr.tmpl"
Delete "${idir}\email\rss-sv.tmpl"
Delete "${idir}\email\rss-da.tmpl"
Delete "${idir}\email\rss-nb.tmpl"
Delete "${idir}\email\rss-ro.tmpl"
Delete "${idir}\email\rss-sr.tmpl"
Delete "${idir}\email\rss-es.tmpl"
Delete "${idir}\email\rss-pt_BR.tmpl"
Delete "${idir}\email\rss-sr.tmpl"
Delete "${idir}\email\rss-ru.tmpl"
Delete "${idir}\email\badfetch-da.tmpl"
Delete "${idir}\email\badfetch-de.tmpl"
Delete "${idir}\email\badfetch-en.tmpl"
Delete "${idir}\email\badfetch-fr.tmpl"
Delete "${idir}\email\badfetch-nb.tmpl"
Delete "${idir}\email\badfetch-nl.tmpl"
Delete "${idir}\email\badfetch-pl.tmpl"
Delete "${idir}\email\badfetch-ro.tmpl"
Delete "${idir}\email\badfetch-sr.tmpl"
Delete "${idir}\email\badfetch-sv.tmpl"
Delete "${idir}\email\badfetch-sr.tmpl"
Delete "${idir}\email\badfetch-es.tmpl"
Delete "${idir}\email\badfetch-pt_BR.tmpl"
Delete "${idir}\email\badfetch-ru.tmpl"
RMDir "${idir}\email"
RMDir /r "${idir}\locale"
RMDir /r "${idir}\interfaces\Classic"
RMDir /r "${idir}\interfaces\Plush"
RMDir /r "${idir}\interfaces\smpl"
RMDir /r "${idir}\interfaces\Mobile"
RMDir /r "${idir}\interfaces\wizard"
RMDir /r "${idir}\interfaces\Config"
RMDir "${idir}\interfaces"
RMDir /r "${idir}\win\curl"
RMDir /r "${idir}\win\par2"
RMDir /r "${idir}\win\unrar"
RMDir /r "${idir}\win\unzip"
RMDir /r "${idir}\win"
RMDir /r "${idir}\licenses"
RMDir /r "${idir}\lib\"
RMDir /r "${idir}\po\email"
RMDir /r "${idir}\po\main"
RMDir /r "${idir}\po\nsis"
RMDir "${idir}\po"
RMDir /r "${idir}\icons"
Delete "${idir}\CHANGELOG.txt"
Delete "${idir}\COPYRIGHT.txt"
Delete "${idir}\email.tmpl"
Delete "${idir}\GPL2.txt"
Delete "${idir}\GPL3.txt"
Delete "${idir}\INSTALL.txt"
Delete "${idir}\ISSUES.txt"
Delete "${idir}\LICENSE.txt"
Delete "${idir}\nzbmatrix.txt"
Delete "${idir}\MSVCR71.dll"
Delete "${idir}\nzb.ico"
Delete "${idir}\sabnzbd.ico"
Delete "${idir}\PKG-INFO"
Delete "${idir}\python25.dll"
Delete "${idir}\python26.dll"
Delete "${idir}\python27.dll"
Delete "${idir}\README.txt"
Delete "${idir}\README.rtf"
Delete "${idir}\ABOUT.txt"
Delete "${idir}\IMPORTANT_MESSAGE.txt"
Delete "${idir}\SABnzbd-console.exe"
Delete "${idir}\SABnzbd.exe"
Delete "${idir}\SABnzbd.exe.log"
Delete "${idir}\SABnzbd-helper.exe"
Delete "${idir}\SABnzbd-service.exe"
Delete "${idir}\Sample-PostProc.cmd"
Delete "${idir}\Uninstall.exe"
Delete "${idir}\w9xpopen.exe"
RMDir "${idir}"
!macroend
;------------------------------------------------------------------
; Define names of the product
Name "${SAB_PRODUCT}"
OutFile "${SAB_FILE}"
InstallDir "$PROGRAMFILES\SABnzbd"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd" ""
;DirText $(MsgSelectDir)
;------------------------------------------------------------------
; Some default compiler settings (uncomment and change at will):
SetCompress auto ; (can be off or force)
SetDatablockOptimize on ; (can be off)
CRCCheck on ; (can be off)
AutoCloseWindow false ; (can be true for the window go away automatically at end)
ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
SetDateSave off ; (can be on to have files restored to their orginal date)
WindowIcon on
;------------------------------------------------------------------
; Vista/Win7 redirects $SMPROGRAMS to all users without this
RequestExecutionLevel admin
FileErrorText "If you have no admin rights, try to install into a user directory."
;------------------------------------------------------------------
;Variables
Var MUI_TEMP
Var STARTMENU_FOLDER
;------------------------------------------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;Show all languages, despite user's codepage
!define MUI_LANGDLL_ALLLANGUAGES
!define MUI_ICON "interfaces/Classic/templates/static/images/favicon.ico"
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "LICENSE.txt"
!define MUI_COMPONENTSPAGE_NODESC
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\SABnzbd"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "SABnzbd"
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\SABnzbd"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
!define MUI_FINISHPAGE_RUN_TEXT $(MsgGoWiki)
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
!define MUI_FINISHPAGE_SHOWREADME_TEXT $(MsgShowRelNote)
!define MUI_FINISHPAGE_LINK $(MsgSupportUs)
!define MUI_FINISHPAGE_LINK_LOCATION "http://www.sabnzbd.org/contribute/"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!define MUI_UNPAGE_COMPONENTSPAGE_NODESC
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
;------------------------------------------------------------------
; Set supported languages
!insertmacro MUI_LANGUAGE "English" ;first language is the default language
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "NORWEGIAN"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "PortugueseBR"
;------------------------------------------------------------------
;Reserve Files
;If you are using solid compression, files that are required before
;the actual installation should be stored first in the data block,
;because this will make your installer start faster.
!insertmacro MUI_RESERVEFILE_LANGDLL
;------------------------------------------------------------------
Function LaunchLink
ExecShell "" "http://wiki.sabnzbd.org/"
FunctionEnd
;------------------------------------------------------------------
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
;--------------------------------
;make sure that the requires MS Runtimes are installed
;
goto nodownload ; Not needed while still using Python25
runtime_loop:
push 'msvcr90.dll'
push 'Microsoft.VC90.CRT,version="9.0.21022.8",type="win32",processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b"'
call WinSxS_HasAssembly
pop $0
StrCmp $0 "1" nodownload
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(MsgNoRuntime) /SD IDOK IDOK download IDCANCEL noinstall
download:
inetc::get /BANNER $(MsgDLRuntime) \
"http://download.microsoft.com/download/1/1/1/1116b75a-9ec3-481a-a3c8-1777b5381140/vcredist_x86.exe" \
"$TEMP\vcredist_x86.exe"
Pop $0
DetailPrint "Downloaded MS runtime library"
StrCmp $0 "OK" dlok
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(MsgDLError) /SD IDCANCEL IDCANCEL exitinstall IDOK download
dlok:
ExecWait "$TEMP\vcredist_x86.exe" $1
DetailPrint "VCRESULT=$1"
DetailPrint "Tried to install MS runtime library"
delete "$TEMP\vcredist_x86.exe"
StrCmp $1 "0" nodownload
noinstall:
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(MsgDLNeed) /SD IDOK IDOK runtime_loop IDCANCEL exitinstall
Abort
nodownload:
;------------------------------------------------------------------
;make sure user terminates sabnzbd.exe or else abort
;
loop:
StrCpy $0 "SABnzbd.exe"
KillProc::FindProcesses
StrCmp $0 "0" endcheck
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(MsgCloseSab) /SD IDCANCEL IDOK loop IDCANCEL exitinstall
exitinstall:
Abort
endcheck:
FunctionEnd
;------------------------------------------------------------------
; SECTION main program
;
Section "SABnzbd" SecDummy
SetOutPath "$INSTDIR"
;------------------------------------------------------------------
; Make sure old versions are gone
IfFileExists $INSTDIR\sabnzbd.exe 0 endWarnExist
IfFileExists $INSTDIR\python27.dll 0 endWarnExist
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(MsgRemoveOld)$\n$\n$(MsgRemoveOld2)" IDOK uninst
Abort
uninst:
${RemovePrev} "$INSTDIR"
endWarnExist:
; add files / whatever that need to be installed here.
File /r "dist\*"
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "DisplayName" "SABnzbd ${SAB_VERSION}"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "DisplayVersion" '${SAB_VERSION}'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "Publisher" 'The SABnzbd Team'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "HelpLink" 'http://forums.sabnzbd.org/'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "URLInfoAbout" 'http://wiki.sabnzbd.org/'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "URLUpdateInfo" 'http://sabnzbd.org/'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "Comments" 'The automated Usenet download tool'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "DisplayIcon" '$INSTDIR\interfaces\Classic\templates\static\images\favicon.ico'
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "EstimatedSize" 29622
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "NoRepair" -1
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "NoModify" -1
; write out uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\SABnzbd.lnk" "$INSTDIR\SABnzbd.exe"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\SABnzbd - SafeMode.lnk" "$INSTDIR\SABnzbd.exe" "--server 127.0.0.1:8080 -b1 --no-login -t Plush"
WriteINIStr "$SMPROGRAMS\$STARTMENU_FOLDER\SABnzbd - Documentation.url" "InternetShortcut" "URL" "http://wiki.sabnzbd.org/"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd ; end of default section
Section /o $(MsgRunAtStart) startup
CreateShortCut "$SMPROGRAMS\Startup\SABnzbd.lnk" "$INSTDIR\SABnzbd.exe" "-b0"
SectionEnd ;
Section $(MsgIcon) desktop
CreateShortCut "$DESKTOP\SABnzbd.lnk" "$INSTDIR\SABnzbd.exe"
SectionEnd ; end of desktop icon section
Section /o $(MsgAssoc) assoc
${registerExtension} "$INSTDIR\icons\nzb.ico" "$INSTDIR\SABnzbd.exe" ".nzb" "NZB File"
${RefreshShellIcons}
SectionEnd ; end of file association section
; begin uninstall settings/section
UninstallText $(MsgUninstall)
Section "un.$(MsgDelProgram)" Uninstall
;make sure sabnzbd.exe isnt running..if so shut it down
StrCpy $0 "sabnzbd.exe"
DetailPrint "Searching for processes called '$0'"
KillProc::FindProcesses
StrCmp $1 "-1" wooops
DetailPrint "-> Found $0 processes"
StrCmp $0 "0" completed
Sleep 1500
StrCpy $0 "sabnzbd.exe"
DetailPrint "Killing all processes called '$0'"
KillProc::KillProcesses
StrCmp $1 "-1" wooops
DetailPrint "-> Killed $0 processes, failed to kill $1 processes"
Goto completed
wooops:
DetailPrint "-> Error: Something went wrong :-("
Abort
completed:
DetailPrint "Process Killed"
; add delete commands to delete whatever files/registry keys/etc you installed here.
Delete "$INSTDIR\uninstall.exe"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd"
${RemovePrev} "$INSTDIR"
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd - SafeMode.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd - Documentation.url"
RMDir "$SMPROGRAMS\$MUI_TEMP"
Delete "$SMPROGRAMS\Startup\SABnzbd.lnk"
Delete "$DESKTOP\SABnzbd.lnk"
DeleteRegKey HKEY_CURRENT_USER "Software\SABnzbd"
${unregisterExtension} ".nzb" "NZB File"
${RefreshShellIcons}
SectionEnd ; end of uninstall section
Section /o "un.$(MsgDelSettings)" DelSettings
DetailPrint "Uninstall settings $LOCALAPPDATA"
Delete "$LOCALAPPDATA\sabnzbd\sabnzbd.ini"
RMDir /r "$LOCALAPPDATA\sabnzbd"
SectionEnd
; eof
;--------------------------------
;Language strings
LangString MsgGoWiki ${LANG_ENGLISH} "Go to the SABnzbd Wiki"
LangString MsgShowRelNote ${LANG_ENGLISH} "Show Release Notes"
LangString MsgSupportUs ${LANG_ENGLISH} "Support the project, Donate!"
LangString MsgCloseSab ${LANG_ENGLISH} "Please close $\"SABnzbd.exe$\" first"
LangString MsgOldQueue ${LANG_ENGLISH} " >>>> WARNING <<<<$\r$\n$\r$\nPlease, first check the release notes or go to http://wiki.sabnzbd.org/introducing-0-7-0 !"
LangString MsgUninstall ${LANG_ENGLISH} "This will uninstall SABnzbd from your system"
LangString MsgRunAtStart ${LANG_ENGLISH} "Run at startup"
LangString MsgIcon ${LANG_ENGLISH} "Desktop Icon"
LangString MsgAssoc ${LANG_ENGLISH} "NZB File association"
LangString MsgDelProgram ${LANG_ENGLISH} "Delete Program"
LangString MsgDelSettings ${LANG_ENGLISH} "Delete Settings"
LangString MsgNoRuntime ${LANG_ENGLISH} "This system requires the Microsoft runtime library VC90 to be installed first. Do you want to do that now?"
LangString MsgDLRuntime ${LANG_ENGLISH} "Downloading Microsoft runtime installer..."
LangString MsgDLError ${LANG_ENGLISH} "Download error, retry?"
LangString MsgDLNeed ${LANG_ENGLISH} "Cannot install without runtime library, retry?"
LangString MsgRemoveOld ${LANG_ENGLISH} "You cannot overwrite an existing installation. $\n$\nClick `OK` to remove the previous version or `Cancel` to cancel this upgrade."
LangString MsgRemoveOld2 ${LANG_ENGLISH} "Your settings and data will be preserved."
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd

View File

@@ -1,10 +0,0 @@
Metadata-Version: 1.0
Name: SABnzbd
Version: 0.7.4
Summary: SABnzbd-0.7.4
Home-page: http://sabnzbd.org
Author: The SABnzbd Team
Author-email: team@sabnzbd.org
License: GNU General Public License 2 (GPL2 or later)
Description: Fully automated Usenet Binary Downloader
Platform: posix

View File

@@ -1,54 +1,77 @@
SABnzbd - The automated Usenet download tool
============================================
[![License](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[![Join our Discord](https://img.shields.io/discord/976737547558461480?color=7289DA&label=Discord&logo=Discord&logoColor=white)](https://discord.sabnzbd.org)
SABnzbd is an Open Source Binary Newsreader written in Python.
It's totally free, incredibly easy to use, and works practically everywhere.
It's totally free, easy to use, and works practically everywhere.
SABnzbd makes Usenet as simple and streamlined as possible by automating everything we can. All you have to do is add an `.nzb`. SABnzbd takes over from there, where it will be automatically downloaded, verified, repaired, extracted and filed away with zero human interaction.
SABnzbd offers an easy setup wizard and has self-analysis tools to verify your setup.
SABnzbd makes Usenet as simple and streamlined as possible by automating everything we can. All you have to do is add an .nzb. SABnzbd takes over from there, where it will be automatically downloaded, verified, repaired, extracted and filed away with zero human interaction.
If you want to know more you can head over to our website: http://sabnzbd.org.
If you want to know more you can head over to our website: https://sabnzbd.org.
## Resolving Dependencies
SABnzbd has a good deal of dependencies you'll need before you can get running. If you've previously run SABnzbd from one of the various Linux packages floating around (Ubuntu, Debian, Fedora, etc), then you likely already have all the needed dependencies. If not, here's what you're looking for:
SABnzbd has a few dependencies you'll need before you can get running. If you've previously run SABnzbd from one of the various Linux packages, then you likely already have all the needed dependencies. If not, here's what you're looking for:
- `python` (We support Python 2.5-2.7, preferably 2.6 or 2.7.)
- `python-cheetah`
- `python-configobj`
- `python-feedparser`
- `python-dbus`
- `python-openssl`
- `python-support`
- `python-yenc`
- `par2` (Multi-threaded par2 can be downloaded from [ChuChuSoft](http://chuchusoft.com/par2_tbb/download.html) )
- `unrar` (Make sure you get the "official" non-free version of unrar)
- `unzip`
- `python` (Python 3.9 and above, often called `python3`)
- Python modules listed in `requirements.txt`. Install with `python3 -m pip install -r requirements.txt -U`
- `par2` (Multi-threaded par2 installation guide can be found [here](https://sabnzbd.org/wiki/installation/multicore-par2))
- `unrar` (make sure you get the "official" non-free version of unrar)
Your package manager should supply these. If not, we've got links in our more in-depth [installation guide](https://github.com/sabnzbd/sabnzbd/blob/master/INSTALL.txt).
Optional:
- See `requirements.txt`
Your package manager should supply these. If not, we've got links in our [installation guide](https://github.com/sabnzbd/sabnzbd/blob/master/INSTALL.txt).
## Running SABnzbd from source
Once you've sorted out all the dependencies, simply run:
```
python SABnzbd.py
python3 -OO SABnzbd.py
```
Or, if you want to run in the background:
```
python -d -f /path/to/sabnzbd.ini
python3 -OO SABnzbd.py -d -f /path/to/sabnzbd.ini
```
If you want multi-language support, run:
```
python tools/make_mo.py
python3 tools/make_mo.py
```
Our many other commandline options are explained in depth [here](http://wiki.sabnzbd.org/command-line-parameters).
Our many other command line options are explained in depth [here](https://sabnzbd.org/wiki/advanced/command-line-parameters).
## About Our Repo
We're going to be attempting to follow the [gitflow model](http://nvie.com/posts/a-successful-git-branching-model/), so you can consider "master" to be whatever our present stable release build is (presently 0.6.x) and "develop" to be whatever our next build will be (presently 0.7.x). Once we transition from unstable to stable dev builds we'll create release branches, and encourage you to follow along and help us test.
The workflow we use, is a simplified form of "GitFlow".
Basically:
- `master` contains only stable releases (which have been merged to `master`) and is intended for end-users.
- `develop` is the target for integration and is **not** intended for end-users.
- `1.1.x` is a release and maintenance branch for 1.1.x (1.1.0 -> 1.1.1 -> 1.1.2) and is **not** intended for end-users.
- `feature/my_feature` is a temporary feature branch based on `develop`.
- `bugfix/my_bugfix` is an optional temporary branch for bugfix(es) based on `develop`.
Conditions:
- Merging of a stable release into `master` will be simple: the release branch is always right.
- `master` is not merged back to `develop`.
- `develop` is not re-based on `master`.
- Release branches branch from `develop` only.
- Bugfixes created specifically for a release branch are done there (because they are specific, they're not cherry-picked to `develop`).
- Bugfixes done on `develop` may be cherry-picked to a release branch.
- We will not release a 1.0.2 if a 1.1.0 has already been released.
## Privacy Policy
This program will not transfer any information to other networked systems unless
specifically requested by the user or the person installing or operating it.
## Code Signing Policy
For our Windows release, free code signing is provided by [SignPath.io](https://signpath.io), certificate by [SignPath Foundation](https://signpath.org).

View File

@@ -1,89 +1,52 @@
Release Notes - SABnzbd 0.7.4
===============================
Release Notes - SABnzbd 4.6.0 Beta 2
=========================================================
## Highlights in 0.7.4
This is the second beta release of version 4.6.
- OSX Mountain Lion: Notification Center support
- OSX Mountain Lion: improved "keep awake" support
- Scheduler: action can now run on multiple weekdays
- Fix: pre-check failed to consider extra par2 files
## New features in 4.6.0
## Features
- Support for HTTPS chain files (needed when you buy your own certificate)
- Special option: rss_odd_titles, see [Wiki](http://wiki.sabnzbd.org/configure-special-0-7/ "Wiki")
- Special option: 'overwrite_files', see [Wiki](http://wiki.sabnzbd.org/configure-special-0-7/ "Wiki")
- Show memory usage on Linux systems
- Scheduler: add "remove failed jobs" action
* Added support for NNTP Pipelining which eliminates idle waiting between
requests, significantly improving speeds on high-latency connections.
Read more here: https://sabnzbd.org/wiki/advanced/nntp-pipelining
* Dynamically increase Assembler limits on faster connections.
* Improved disk speed measurement in Status window.
* Enable `verify_xff_header` by default.
* Reduce delays between jobs during post-processing.
* If a download only has `.nzb` files inside, the new downloads
will include the name of the original download.
* Dropped support for Python 3.8.
* Windows: Added Windows ARM (portable) release.
## Bug fixes
- After successful pre-check, preserve a job's position in the queue
- Restore SABnzbd icon for Growl
- Make Windows version less eager to use par2-classic
- Prevent jobs from showing up in queue and history simultaneously
- Fix failure to fetch more par2-files for posts with badly formatted subject lines
- Fix for third-party tools requesting too much history
- New RSS feed should no longer be considered new after first, but empty readout.
- Make "auth" call backward-compatible with 0.6.x releases.
- Config->Notifications: email and growl server addresses should not be marked as "url" type.
- OSX: fix top menu queue info so that it shows total queue size
- Fixed unjustified warning that can occur with OSX Growl 2.0
- Pre-queue script no longer got the show/season/episode information.
- Prevent crash on startup when a fully downloaded job is still in download queue.
- Fix incorrect end-of-month quota reset
- Fix UI refresh issue when using Safari on iOS6 (Safari bug)
## Bug fixes since 4.5.0
## What's new in 0.7.0
* `Check before download` could get stuck or fail to reject.
* No error was shown in case NZB upload failed.
* Correct mobile layout if `Full Width` is enabled.
* Aborted Direct Unpack could result in no files being unpacked.
* Windows: Tray icon disappears after Explorer restart.
* macOS: Slow to start on some network setups.
- Download quota management
- Windows: simple system tray menu
- Multi-platform Growl support
- NotifyOSD support for Linux distros that have it
- Option to set maximum number of retries for servers (prevents deadlock)
- Pre-download check to estimate completeness (reliability is limited)
- Prevent partial downloading of par2 files that are not needed yet
- Config->Special for settings previously only available in the sabnzbd.ini file
- For Usenet servers with multiple IP addresses, pick a random one per connection
- Add pseudo-priority "Stop" that will send the job immediately to the post-processing queue
- Allow jobs still waiting for post-processing to be deleted too
- More persistent retries for unreliable indexers
- Single Configuration skin for all others skins (there is an option for the old style)
- Config->Special for settings that were previously only changeable in the sabnzbd.ini file
- Add Spanish, Portuguese (Brazil) and Polish translations
- Individual RSS filter toggle
- Unified OSX DMG
## Upgrade notices
* You can directly upgrade from version 3.0.0 and newer.
* Upgrading from older versions will require performing a `Queue repair`.
* Downgrading from version 4.2.0 or newer to 3.7.2 or older will require
performing a `Queue repair` due to changes in the internal data format.
## Known problems and solutions
* Read `ISSUES.txt` or https://sabnzbd.org/wiki/introduction/known-issues
## Code Signing Policy
Windows code signing is provided by SignPath.io using a SignPath Foundation certificate.
## About
SABnzbd is an open-source cross-platform binary newsreader.
It simplifies the process of downloading from Usenet dramatically,
thanks to its web-based user interface and advanced
built-in post-processing options that automatically verify, repair,
extract and clean up posts downloaded from Usenet.
(c) Copyright 2007-2012 by "The SABnzbd-team" \<team@sabnzbd.org\>
SABnzbd is an open-source cross-platform binary newsreader.
It simplifies the process of downloading from Usenet dramatically, thanks to its web-based
user interface and advanced built-in post-processing options that automatically verify, repair,
extract and clean up posts downloaded from Usenet.
### IMPORTANT INFORMATION about release 0.7.x
<http://wiki.sabnzbd.org/introducing-0-7-0>
### Known problems and solutions
- Read the file "ISSUES.txt"
### Upgrading from 0.6.x
- Stop SABnzbd
- Install new version
- Start SABnzbd
### Upgrading from 0.5.x
- Stop SABnzbd
- Install new version
- Start SABnzbd.
The organization of the download queue is different from 0.5.x.
0.7.x will finish downloading an existing queue, but you
cannot go back to an older version without losing your queue.
Also, your sabnzbd.ini file will be upgraded, making it
incompatible with release 0.5.x
### Upgrading from 0.4.x
Download your current queue before upgrading.
(c) Copyright 2007-2025 by The SABnzbd-Team (sabnzbd.org)

View File

@@ -1,153 +0,0 @@
#!/usr/bin/python -OO
# Copyright 2008-2012 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import sys
if sys.version_info < (2,5):
print "Sorry, requires Python 2.5 or higher."
sys.exit(1)
import os
import time
import subprocess
#------------------------------------------------------------------------------
try:
import win32api, win32file
import win32serviceutil, win32evtlogutil, win32event, win32service, pywintypes
except ImportError:
print "Sorry, requires Python module PyWin32."
sys.exit(1)
from util.mailslot import MailSlot
from util.apireg import del_connection_info, set_connection_info
#------------------------------------------------------------------------------
WIN_SERVICE = None
#------------------------------------------------------------------------------
def HandleCommandLine(allow_service=True):
""" Handle command line for a Windows Service
Prescribed name that will be called by Py2Exe.
You MUST set 'cmdline_style':'custom' in the package.py!
"""
win32serviceutil.HandleCommandLine(SABHelper)
def start_sab():
return subprocess.Popen('net start SABnzbd', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).stdout.read()
#------------------------------------------------------------------------------
def main():
mail = MailSlot()
if not mail.create(10):
return '- Cannot create Mailslot'
active = False # SABnzbd should be running
counter = 0 # Time allowed for SABnzbd to be silent
while True:
msg = mail.receive()
if msg:
if msg == 'restart':
time.sleep(1.0)
counter = 0
del_connection_info(user=False)
start_sab()
elif msg == 'stop':
active = False
del_connection_info(user=False)
elif msg == 'active':
active = True
counter = 0
elif msg.startswith('api '):
active = True
counter = 0
cmd, url = msg.split()
if url:
set_connection_info(url.strip(), user=False)
if active:
counter += 1
if counter > 120: # 120 seconds
counter = 0
start_sab()
rc = win32event.WaitForMultipleObjects((WIN_SERVICE.hWaitStop,
WIN_SERVICE.overlapped.hEvent), 0, 1000)
if rc == win32event.WAIT_OBJECT_0:
del_connection_info(user=False)
mail.disconnect()
return ''
#####################################################################
#
# Windows Service Support
#
import servicemanager
class SABHelper(win32serviceutil.ServiceFramework):
""" Win32 Service Handler """
_svc_name_ = 'SABHelper'
_svc_display_name_ = 'SABnzbd Helper'
_svc_deps_ = ["EventLog", "Tcpip"]
_svc_description_ = 'Automated downloading from Usenet. ' \
'This service helps SABnzbd to restart itself.'
def __init__(self, args):
global WIN_SERVICE
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
self.overlapped = pywintypes.OVERLAPPED()
self.overlapped.hEvent = win32event.CreateEvent(None, 0, 0, None)
WIN_SERVICE = self
def SvcDoRun(self):
msg = 'SABHelper-service'
self.Logger(servicemanager.PYS_SERVICE_STARTED, msg + ' has started')
res = main()
self.Logger(servicemanager.PYS_SERVICE_STOPPED, msg + ' has stopped' + res)
def SvcStop(self):
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
win32event.SetEvent(self.hWaitStop)
def Logger(self, state, msg):
win32evtlogutil.ReportEvent(self._svc_display_name_,
state, 0,
servicemanager.EVENTLOG_INFORMATION_TYPE,
(self._svc_name_, unicode(msg)))
def ErrLogger(self, msg, text):
win32evtlogutil.ReportEvent(self._svc_display_name_,
servicemanager.PYS_SERVICE_STOPPED, 0,
servicemanager.EVENTLOG_ERROR_TYPE,
(self._svc_name_, unicode(msg)),
unicode(text))
#####################################################################
#
# Platform specific startup code
#
if __name__ == '__main__':
win32serviceutil.HandleCommandLine(SABHelper, argv=sys.argv)

2152
SABnzbd.py
View File

File diff suppressed because it is too large Load Diff

179
builder/SABnzbd.spec Normal file
View File

@@ -0,0 +1,179 @@
# -*- mode: python -*-
import os
import sys
from PyInstaller.building.api import EXE, COLLECT, PYZ
from PyInstaller.building.build_main import Analysis
from PyInstaller.building.osx import BUNDLE
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
from builder.constants import EXTRA_FILES, EXTRA_FOLDERS, RELEASE_VERSION, RELEASE_VERSION_TUPLE
# Add extra files in the PyInstaller-spec
extra_pyinstaller_files = []
# Add hidden imports
extra_hiddenimports = ["Cheetah.DummyTransaction", "cheroot.ssl.builtin", "certifi"]
extra_hiddenimports.extend(collect_submodules("apprise"))
extra_hiddenimports.extend(collect_submodules("babelfish.converters"))
extra_hiddenimports.extend(collect_submodules("guessit.data"))
# Add platform specific stuff
if sys.platform == "darwin":
extra_hiddenimports.extend(["objc", "PyObjCTools"])
# macOS folders
EXTRA_FOLDERS += ["macos/par2/", "macos/unrar/", "macos/7zip/"]
# Add NZB-icon file
extra_pyinstaller_files.append(("builder/macos/image/nzbfile.icns", "."))
# Version information is set differently on macOS
version_info = None
else:
# Build would fail on non-Windows
from PyInstaller.utils.win32.versioninfo import (
VSVersionInfo,
FixedFileInfo,
StringFileInfo,
StringTable,
StringStruct,
VarFileInfo,
VarStruct,
)
# Windows
extra_hiddenimports.extend(["win32timezone", "winrt.windows.foundation.collections"])
EXTRA_FOLDERS += ["win/par2/", "win/unrar/", "win/7zip/"]
EXTRA_FILES += ["portable.cmd"]
# Detailed instructions are in the PyInstaller documentation
# We don't include the alpha/beta/rc in the counters
version_info = VSVersionInfo(
ffi=FixedFileInfo(
filevers=RELEASE_VERSION_TUPLE,
prodvers=RELEASE_VERSION_TUPLE,
mask=0x3F,
flags=0x0,
OS=0x40004,
fileType=0x1,
subtype=0x0,
date=(0, 0),
),
kids=[
StringFileInfo(
[
StringTable(
"040904B0",
[
StringStruct("Comments", f"SABnzbd {RELEASE_VERSION}"),
StringStruct("CompanyName", "The SABnzbd-Team"),
StringStruct("FileDescription", f"SABnzbd {RELEASE_VERSION}"),
StringStruct("FileVersion", RELEASE_VERSION),
StringStruct("LegalCopyright", "The SABnzbd-Team"),
StringStruct("ProductName", f"SABnzbd {RELEASE_VERSION}"),
StringStruct("ProductVersion", RELEASE_VERSION),
],
)
]
),
VarFileInfo([VarStruct("Translation", [1033, 1200])]),
],
)
# Process the extra-files and folders
for file_item in EXTRA_FILES:
extra_pyinstaller_files.append((file_item, "."))
for folder_item in EXTRA_FOLDERS:
extra_pyinstaller_files.append((folder_item, folder_item))
# Add babelfish data files
extra_pyinstaller_files.extend(collect_data_files("babelfish"))
extra_pyinstaller_files.extend(collect_data_files("guessit"))
extra_pyinstaller_files.extend(collect_data_files("apprise"))
extra_pyinstaller_files.extend(collect_data_files("dateutil"))
pyi_analysis = Analysis(
["SABnzbd.py"],
datas=extra_pyinstaller_files,
hiddenimports=extra_hiddenimports,
excludes=["ujson", "FixTk", "tcl", "tk", "_tkinter", "tkinter", "Tkinter", "pydoc", "pydoc_data.topics"],
module_collection_mode={"apprise.plugins": "py"},
)
pyz = PYZ(pyi_analysis.pure, pyi_analysis.zipped_data)
codesign_identity = os.environ.get("SIGNING_AUTH")
if not codesign_identity:
# PyInstaller needs specifically None, not just an empty value
codesign_identity = None
# macOS specific parameters are ignored on other platforms
exe = EXE(
pyz,
pyi_analysis.scripts,
[],
exclude_binaries=True,
name="SABnzbd",
console=False,
append_pkg=False,
icon="icons/sabnzbd.ico",
contents_directory=".",
version=version_info,
target_arch="universal2",
entitlements_file="builder/macos/entitlements.plist",
codesign_identity=codesign_identity,
)
coll = COLLECT(exe, pyi_analysis.binaries, pyi_analysis.zipfiles, pyi_analysis.datas, name="SABnzbd")
# We need to run again for the console-app
if sys.platform == "win32":
# Enable console=True for this one
console_exe = EXE(
pyz,
pyi_analysis.scripts,
[],
exclude_binaries=True,
name="SABnzbd-console",
append_pkg=False,
icon="icons/sabnzbd.ico",
contents_directory=".",
version=version_info,
)
console_coll = COLLECT(
console_exe,
pyi_analysis.binaries,
pyi_analysis.zipfiles,
pyi_analysis.datas,
name="SABnzbd-console",
)
# Build the APP on macOS
if sys.platform == "darwin":
info_plist = {
"NSUIElement": 1,
"NSPrincipalClass": "NSApplication",
"CFBundleShortVersionString": RELEASE_VERSION,
"NSHumanReadableCopyright": "The SABnzbd-Team",
"CFBundleIdentifier": "org.sabnzbd.sabnzbd",
"CFBundleDocumentTypes": [
{
"CFBundleTypeExtensions": ["nzb"],
"CFBundleTypeIconFile": "nzbfile.icns",
"CFBundleTypeMIMETypes": ["text/nzb"],
"CFBundleTypeName": "NZB File",
"CFBundleTypeRole": "Viewer",
"LSTypeIsPackage": 0,
"NSPersistentStoreTypeKey": "Binary",
}
],
"LSMinimumSystemVersion": "10.13",
"LSEnvironment": {"LANG": "en_US.UTF-8", "LC_ALL": "en_US.UTF-8"},
}
app = BUNDLE(
coll,
name="SABnzbd.app",
icon="builder/macos/image/sabnzbdplus.icns",
bundle_identifier="org.sabnzbd.sabnzbd",
info_plist=info_plist,
)

79
builder/constants.py Normal file
View File

@@ -0,0 +1,79 @@
#!/usr/bin/python3 -OO
# Copyright 2008-2025 by The SABnzbd-Team (sabnzbd.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import os
import platform
import re
# Constants
VERSION_FILE = "sabnzbd/version.py"
APPDATA_FILE = "linux/org.sabnzbd.sabnzbd.appdata.xml"
# To draft a release or not to draft a release?
ON_GITHUB_ACTIONS = os.environ.get("CI", False)
RELEASE_THIS = "refs/tags/" in os.environ.get("GITHUB_REF", "")
# Import version.py without the sabnzbd overhead
with open(VERSION_FILE) as version_file:
exec(version_file.read())
RELEASE_VERSION = __version__
# Pre-releases are longer than 6 characters (e.g. 3.1.0Beta1 vs 3.1.0, but also 3.0.11)
PRERELEASE = len(RELEASE_VERSION) > 5
# Parse the version info for Windows file properties information
version_regexed = re.search(r"(\d+)\.(\d+)\.(\d+)([a-zA-Z]*)(\d*)", RELEASE_VERSION)
RELEASE_VERSION_TUPLE = (int(version_regexed.group(1)), int(version_regexed.group(2)), int(version_regexed.group(3)), 0)
RELEASE_VERSION_BASE = f"{RELEASE_VERSION_TUPLE[0]}.{RELEASE_VERSION_TUPLE[1]}.{RELEASE_VERSION_TUPLE[2]}"
# Define release name
RELEASE_NAME = "SABnzbd-%s" % RELEASE_VERSION
RELEASE_TITLE = "SABnzbd %s" % RELEASE_VERSION
RELEASE_SRC = RELEASE_NAME + "-src.tar.gz"
RELEASE_WIN_BIN_X64 = RELEASE_NAME + "-win64-bin.zip"
RELEASE_WIN_BIN_ARM64 = RELEASE_NAME + "-win-arm64-bin.zip"
RELEASE_WIN_INSTALLER = RELEASE_NAME + "-win-setup.exe"
RELEASE_MACOS = RELEASE_NAME + "-macos.dmg"
RELEASE_README = "README.mkd"
# Detect architecture
RELEASE_WIN_BIN = RELEASE_WIN_BIN_X64
if platform.machine() == "ARM64":
RELEASE_WIN_BIN = RELEASE_WIN_BIN_ARM64
# Used in package.py and SABnzbd.spec
EXTRA_FILES = [
RELEASE_README,
"README.txt",
"INSTALL.txt",
"LICENSE.txt",
"GPL2.txt",
"GPL3.txt",
"COPYRIGHT.txt",
"ISSUES.txt",
]
EXTRA_FOLDERS = [
"scripts/",
"licenses/",
"locale/",
"email/",
"interfaces/Glitter/",
"interfaces/wizard/",
"interfaces/Config/",
"scripts/",
"icons/",
]

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>

View File

Binary file not shown.

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

Binary file not shown.

View File

Binary file not shown.

206
builder/make_dmg.py Normal file
View File

@@ -0,0 +1,206 @@
#!/usr/bin/python3 -OO
# Copyright 2008-2025 by The SABnzbd-Team (sabnzbd.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import os
from constants import RELEASE_VERSION
# We need to call dmgbuild from command-line, so here we can setup how
if __name__ == "__main__":
# Check for DMGBuild
try:
import dmgbuild
except Exception:
print("Requires dmgbuild-module, use pip install dmgbuild")
exit()
# Make sure we are in the src folder
if not os.path.exists("builder"):
raise FileNotFoundError("Run from the main SABnzbd source folder: python builder/package.py")
# Check if signing is possible
authority = os.environ.get("SIGNING_AUTH")
# Extract version info and set DMG path
# Create sub-folder to upload later
release = RELEASE_VERSION
prod = "SABnzbd-" + release
fileDmg = prod + "-macos.dmg"
# Path to app file
apppath = "dist/SABnzbd.app"
# Copy Readme
readmepath = os.path.join(apppath, "Contents/Resources/README.txt")
# Path to background and the icon
backgroundpath = "builder/macos/image/sabnzbd_new_bg.png"
iconpath = "builder/macos/image/sabnzbdplus.icns"
# Make DMG
print("Building DMG")
dmgbuild.build_dmg(
filename=fileDmg,
volume_name=prod,
settings_file="builder/make_dmg.py",
defines={"app": apppath, "readme": readmepath, "background": backgroundpath, "iconpath": iconpath},
)
# Resign APP
if authority:
print("Siging DMG")
os.system('codesign --deep -f -i "org.sabnzbd.SABnzbd" -s "%s" "%s"' % (authority, fileDmg))
print("Signed!")
else:
print("Signing skipped, missing SIGNING_AUTH.")
exit()
### START OF DMGBUILD SETTINGS
### COPIED AND MODIFIED FROM THE EXAMPLE ONLINE
application = defines.get("app", "AppName.app")
readme = defines.get("readme", "ReadMe.rtf")
appname = os.path.basename(application)
# .. Basics ....................................................................
# Volume format (see hdiutil create -help)
format = defines.get("format", "UDBZ")
# Volume size (must be large enough for your files)
size = defines.get("size", "100M")
# Files to include
files = [application, readme]
# Symlinks to create
symlinks = {"Applications": "/Applications"}
# Volume icon
#
# You can either define icon, in which case that icon file will be copied to the
# image, *or* you can define badge_icon, in which case the icon file you specify
# will be used to badge the system's Removable Disk icon
#
badge_icon = defines.get("iconpath", "")
# Where to put the icons
icon_locations = {readme: (70, 160), appname: (295, 220), "Applications": (510, 220)}
# .. Window configuration ......................................................
# Window position in ((x, y), (w, h)) format
window_rect = ((100, 100), (660, 360))
# Background
#
# This is a STRING containing any of the following:
#
# #3344ff - web-style RGB color
# #34f - web-style RGB color, short form (#34f == #3344ff)
# rgb(1,0,0) - RGB color, each value is between 0 and 1
# hsl(120,1,.5) - HSL (hue saturation lightness) color
# hwb(300,0,0) - HWB (hue whiteness blackness) color
# cmyk(0,1,0,0) - CMYK color
# goldenrod - X11/SVG named color
# builtin-arrow - A simple built-in background with a blue arrow
# /foo/bar/baz.png - The path to an image file
#
# Other color components may be expressed either in the range 0 to 1, or
# as percentages (e.g. 60% is equivalent to 0.6).
background = defines.get("background", "builtin-arrow")
show_status_bar = False
show_tab_view = False
show_toolbar = False
show_pathbar = False
show_sidebar = False
sidebar_width = 0
# Select the default view; must be one of
#
# 'icon-view'
# 'list-view'
# 'column-view'
# 'coverflow'
#
default_view = "icon-view"
# General view configuration
show_icon_preview = False
# Set these to True to force inclusion of icon/list view settings (otherwise
# we only include settings for the default view)
include_icon_view_settings = "auto"
include_list_view_settings = "auto"
# .. Icon view configuration ...................................................
arrange_by = None
grid_offset = (0, 0)
grid_spacing = 50
scroll_position = (0, 0)
label_pos = "bottom" # or 'right'
text_size = 16
icon_size = 64
# .. List view configuration ...................................................
# Column names are as follows:
#
# name
# date-modified
# date-created
# date-added
# date-last-opened
# size
# kind
# label
# version
# comments
#
list_icon_size = 16
list_text_size = 12
list_scroll_position = (0, 0)
list_sort_by = "name"
list_use_relative_dates = True
list_calculate_all_sizes = (False,)
list_columns = ("name", "date-modified", "size", "kind", "date-added")
list_column_widths = {
"name": 300,
"date-modified": 181,
"date-created": 181,
"date-added": 181,
"date-last-opened": 181,
"size": 97,
"kind": 115,
"label": 100,
"version": 75,
"comments": 300,
}
list_column_sort_directions = {
"name": "ascending",
"date-modified": "descending",
"date-created": "descending",
"date-added": "descending",
"date-last-opened": "descending",
"size": "descending",
"kind": "ascending",
"label": "ascending",
"version": "ascending",
"comments": "ascending",
}

511
builder/package.py Normal file
View File

@@ -0,0 +1,511 @@
#!/usr/bin/python3 -OO
# Copyright 2008-2025 by The SABnzbd-Team (sabnzbd.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import glob
import re
import sys
import os
import tempfile
import time
import shutil
import subprocess
import tarfile
import urllib.request
import urllib.error
import configobj
import packaging.version
from constants import (
RELEASE_VERSION,
RELEASE_VERSION_TUPLE,
VERSION_FILE,
RELEASE_README,
RELEASE_NAME,
RELEASE_WIN_BIN,
RELEASE_WIN_INSTALLER,
ON_GITHUB_ACTIONS,
RELEASE_THIS,
RELEASE_SRC,
EXTRA_FILES,
EXTRA_FOLDERS,
)
# Support functions
def safe_remove(path):
"""Remove file without errors if the file doesn't exist
Can also handle folders
"""
if os.path.exists(path):
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(path)
def delete_files_glob(glob_pattern: str, allow_no_matches: bool = False):
"""Delete one file or set of files from wild-card spec.
We expect to match at least 1 file, to force expected behavior"""
if files_to_remove := glob.glob(glob_pattern):
for path in files_to_remove:
if os.path.exists(path):
os.remove(path)
else:
if not allow_no_matches:
raise FileNotFoundError(f"No files found that match '{glob_pattern}'")
def run_external_command(command: list[str], print_output: bool = True, **kwargs):
"""Wrapper to ease the use of calling external programs"""
process = subprocess.Popen(command, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs)
output, _ = process.communicate()
ret = process.wait()
if (output and print_output) or ret != 0:
print(output)
if ret != 0:
raise RuntimeError("Command returned non-zero exit code %s!" % ret)
return output
def run_git_command(parms):
"""Run git command, raise error if it failed"""
return run_external_command(["git"] + parms)
def patch_version_file(release_name):
"""Patch in the Git commit hash, but only when this is
an unmodified checkout
"""
git_output = run_git_command(["log", "-1"])
for line in git_output.split("\n"):
if "commit " in line:
commit = line.split(" ")[1].strip()
break
else:
raise TypeError("Commit hash not found")
with open(VERSION_FILE, "r") as ver:
version_file = ver.read()
version_file = re.sub(r'__baseline__\s*=\s*"[^"]*"', '__baseline__ = "%s"' % commit, version_file)
version_file = re.sub(r'__version__\s*=\s*"[^"]*"', '__version__ = "%s"' % release_name, version_file)
with open(VERSION_FILE, "w") as ver:
ver.write(version_file)
def test_macos_min_version(binary_path: str):
# Skip check if nothing was set
if macos_min_version := os.environ.get("MACOSX_DEPLOYMENT_TARGET"):
# Skip any arm64 specific files
if "arm64" in binary_path:
print(f"Skipping arm64 binary {binary_path}")
return
# Check minimum macOS version is at least mac OS10.13
# We only check the x86_64 since for arm64 it's always macOS 11+
print(f"Checking if binary supports macOS {macos_min_version} and above: {binary_path}")
otool_output = run_external_command(
[
"otool",
"-arch",
"x86_64",
"-l",
binary_path,
],
print_output=False,
)
# Parse the output for LC_BUILD_VERSION minos
# The output is very large, so that's why we enumerate over it
req_version = packaging.version.parse(macos_min_version)
bin_version = None
lines = otool_output.split("\n")
for line_nr, line in enumerate(lines):
if "LC_VERSION_MIN_MACOSX" in line:
# Display the version in the next lines
bin_version = packaging.version.parse(lines[line_nr + 2].split()[1])
elif "minos" in line:
bin_version = packaging.version.parse(line.split()[1])
if bin_version and bin_version > req_version:
raise ValueError(f"{binary_path} requires {bin_version}, we want {req_version}")
else:
# We got the information we need
break
else:
print(lines)
raise RuntimeError(f"Could not determine minimum macOS version for {binary_path}")
else:
print(f"Skipping macOS version check, MACOSX_DEPLOYMENT_TARGET not set")
def test_sab_binary(binary_path: str):
"""Wrapper to have a simple start-up test for the binary"""
with tempfile.TemporaryDirectory() as config_dir:
sabnzbd_process = subprocess.Popen(
[binary_path, "--browser", "0", "--logging", "2", "--config", config_dir],
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
# Wait for SAB to respond
base_url = "http://127.0.0.1:8080/"
for _ in range(30):
try:
urllib.request.urlopen(base_url, timeout=1).read()
break
except Exception:
time.sleep(1)
else:
# Print console output and give some time to print
print(sabnzbd_process.stdout.read())
time.sleep(1)
raise urllib.error.URLError("Could not connect to SABnzbd")
# Open a number of API calls and pages, to see if we are really up
pages_to_test = [
"",
"wizard",
"config",
"config/server",
"config/categories",
"config/scheduling",
"config/rss",
"config/general",
"config/folders",
"config/switches",
"config/sorting",
"config/notify",
"config/special",
"api?mode=version",
]
for url in pages_to_test:
print("Testing: %s%s" % (base_url, url))
if b"500 Internal Server Error" in urllib.request.urlopen(base_url + url, timeout=1).read():
raise RuntimeError("Crash in %s" % url)
# Parse API-key so we can do a graceful shutdown
sab_config = configobj.ConfigObj(os.path.join(config_dir, "sabnzbd.ini"))
urllib.request.urlopen(base_url + "shutdown/?apikey=" + sab_config["misc"]["api_key"], timeout=10)
sabnzbd_process.wait()
# Print logs for verification
with open(os.path.join(config_dir, "logs", "sabnzbd.log"), "r") as log_file:
# Wait after printing so the output is nicely displayed in case of problems
print(log_text := log_file.read())
time.sleep(5)
# Make sure no extra errors/warnings were reported
if "ERROR" in log_text or "WARNING" in log_text:
raise RuntimeError("Warning or error reported during execution")
if __name__ == "__main__":
# Was any option supplied?
if len(sys.argv) < 2:
raise TypeError("Please specify what to do")
# Make sure we are in the src folder
if not os.path.exists("builder"):
raise FileNotFoundError("Run from the main SABnzbd source folder: python builder/package.py")
# Check if we have the needed certificates
try:
import certifi
except ImportError:
raise FileNotFoundError("Need certifi module")
# Patch release file
patch_version_file(RELEASE_VERSION)
# Rename release notes file
safe_remove("README.txt")
shutil.copyfile(RELEASE_README, "README.txt")
# Compile translations
if not os.path.exists("locale"):
run_external_command([sys.executable, "tools/make_mo.py"])
# Check again if translations exist, fail otherwise
if not os.path.exists("locale"):
raise FileNotFoundError("Failed to compile language files")
if "binary" in sys.argv:
# Must be run on Windows
if sys.platform != "win32":
raise RuntimeError("Binary should be created on Windows")
# Make sure we remove any existing build-folders
safe_remove("build")
safe_remove("dist")
# Remove any leftovers
safe_remove(RELEASE_NAME)
safe_remove(RELEASE_WIN_BIN)
# Run PyInstaller and check output
shutil.copyfile("builder/SABnzbd.spec", "SABnzbd.spec")
run_external_command([sys.executable, "-O", "-m", "PyInstaller", "SABnzbd.spec"])
shutil.copytree("dist/SABnzbd-console", "dist/SABnzbd", dirs_exist_ok=True)
safe_remove("dist/SABnzbd-console")
# Remove unwanted DLL's
shutil.rmtree("dist/SABnzbd/Pythonwin")
delete_files_glob("dist/SABnzbd/api-ms-win*.dll", allow_no_matches=True)
delete_files_glob("dist/SABnzbd/ucrtbase.dll", allow_no_matches=True)
# Test the release
test_sab_binary("dist/SABnzbd/SABnzbd.exe")
# Create the archive
run_external_command(["win/7zip/7za.exe", "a", RELEASE_WIN_BIN, "SABnzbd"], cwd="dist")
shutil.move(f"dist/{RELEASE_WIN_BIN}", RELEASE_WIN_BIN)
if "installer" in sys.argv:
# Check if we have the dist folder
if not os.path.exists("dist/SABnzbd/SABnzbd.exe"):
raise FileNotFoundError("SABnzbd executable not found, run binary creation first")
# Check if we have a signed version
if os.path.exists(f"signed/{RELEASE_WIN_BIN}"):
print("Using signed version of SABnzbd binaries")
safe_remove("dist/SABnzbd")
run_external_command(["win/7zip/7za.exe", "x", "-odist", f"signed/{RELEASE_WIN_BIN}"])
# Make sure it exists
if not os.path.exists("dist/SABnzbd/SABnzbd.exe"):
raise FileNotFoundError("SABnzbd executable not found, signed zip extraction failed")
elif RELEASE_THIS:
raise FileNotFoundError("Signed SABnzbd executable not found, required for release!")
else:
print("Using unsigned version of SABnzbd binaries")
# Compile NSIS translations
safe_remove("NSIS_Installer.nsi")
safe_remove("NSIS_Installer.nsi.tmp")
shutil.copyfile("builder/win/NSIS_Installer.nsi", "NSIS_Installer.nsi")
run_external_command([sys.executable, "tools/make_mo.py", "nsis"])
# Run NSIS to build installer
run_external_command(
[
"makensis.exe",
"/V3",
"/DSAB_VERSION=%s" % RELEASE_VERSION,
"/DSAB_VERSIONKEY=%s" % ".".join(map(str, RELEASE_VERSION_TUPLE)),
"/DSAB_FILE=%s" % RELEASE_WIN_INSTALLER,
"NSIS_Installer.nsi.tmp",
]
)
if "app" in sys.argv:
# Must be run on macOS
if sys.platform != "darwin":
raise RuntimeError("App should be created on macOS")
# Who will sign and notarize this?
authority = os.environ.get("SIGNING_AUTH")
notarization_user = os.environ.get("NOTARIZATION_USER")
notarization_pass = os.environ.get("NOTARIZATION_PASS")
# We need to sign all the included binaries before packaging them
# Otherwise the signature of the main application becomes invalid
if authority:
files_to_sign = [
"macos/par2/par2",
"macos/unrar/unrar",
"macos/unrar/arm64/unrar",
"macos/7zip/7zz",
]
for file_to_sign in files_to_sign:
# Make sure it supports the macOS versions we want first
test_macos_min_version(file_to_sign)
# Then sign in
print("Signing %s with hardened runtime" % file_to_sign)
run_external_command(
[
"codesign",
"--deep",
"--force",
"--timestamp",
"--options",
"runtime",
"--entitlements",
"builder/macos/entitlements.plist",
"-s",
authority,
file_to_sign,
],
print_output=False,
)
print("Signed %s!" % file_to_sign)
# Run PyInstaller and check output
shutil.copyfile("builder/SABnzbd.spec", "SABnzbd.spec")
run_external_command([sys.executable, "-O", "-m", "PyInstaller", "SABnzbd.spec"])
# Make sure we created a fully universal2 release when releasing or during CI
if RELEASE_THIS or ON_GITHUB_ACTIONS:
for bin_to_check in glob.glob("dist/SABnzbd.app/**/*.so", recursive=True):
print("Checking if binary is universal2: %s" % bin_to_check)
file_output = run_external_command(["file", bin_to_check], print_output=False)
# Make sure we have both arm64 and x86
if not ("x86_64" in file_output and "arm64" in file_output):
raise RuntimeError("Non-universal2 binary found!")
# Make sure it supports the macOS versions we want
test_macos_min_version(bin_to_check)
# Only continue if we can sign
if authority:
# We use PyInstaller to sign the main SABnzbd executable and the SABnzbd.app
files_already_signed = [
"dist/SABnzbd.app/Contents/MacOS/SABnzbd",
"dist/SABnzbd.app",
]
for file_to_check in files_already_signed:
print("Checking signature of %s" % file_to_check)
sign_result = run_external_command(
[
"codesign",
"-dv",
"-r-",
file_to_check,
],
print_output=False,
) + run_external_command(
[
"codesign",
"--verify",
"--deep",
file_to_check,
],
print_output=False,
)
if authority not in sign_result or "adhoc" in sign_result or "invalid" in sign_result:
raise RuntimeError("Signature of %s seems invalid!" % file_to_check)
# Always notarize, as newer macOS versions don't allow any code without it
if notarization_user and notarization_pass:
# Prepare zip to upload to notarization service
print("Creating zip to send to Apple notarization service")
# We need to use ditto, otherwise the signature gets lost!
notarization_zip = RELEASE_NAME + ".zip"
run_external_command(
["ditto", "-c", "-k", "--sequesterRsrc", "--keepParent", "dist/SABnzbd.app", notarization_zip]
)
# Upload to Apple
print("Sending zip to Apple notarization service")
upload_result = run_external_command(
[
"xcrun",
"notarytool",
"submit",
notarization_zip,
"--apple-id",
notarization_user,
"--team-id",
authority,
"--password",
notarization_pass,
"--wait",
],
)
# Check if success
if "status: accepted" not in upload_result.lower():
raise RuntimeError("Failed to notarize..")
# Staple the notarization!
print("Approved! Stapling the result to the app")
run_external_command(["xcrun", "stapler", "staple", "dist/SABnzbd.app"])
else:
print("Notarization skipped, NOTARIZATION_USER or NOTARIZATION_PASS missing.")
else:
print("Signing skipped, missing SIGNING_AUTH.")
# Test the release, as the very last step to not mess with any release code
test_sab_binary("dist/SABnzbd.app/Contents/MacOS/SABnzbd")
if "source" in sys.argv:
# Prepare Source distribution package.
# We assume the sources are freshly cloned from the repo
# Make sure all source files are Unix format
src_folder = "srcdist"
safe_remove(src_folder)
os.mkdir(src_folder)
# Remove any leftovers
safe_remove(RELEASE_SRC)
# Add extra files and folders need for source dist
EXTRA_FOLDERS.extend(["sabnzbd/", "po/", "linux/", "tools/", "tests/"])
EXTRA_FILES.extend(["SABnzbd.py", "requirements.txt"])
# Copy all folders and files to the new folder
for source_folder in EXTRA_FOLDERS:
shutil.copytree(source_folder, os.path.join(src_folder, source_folder), dirs_exist_ok=True)
# Copy all files
for source_file in EXTRA_FILES:
shutil.copyfile(source_file, os.path.join(src_folder, source_file))
# Make sure all line-endings are correct
for input_filename in glob.glob("%s/**/*.*" % src_folder, recursive=True):
base, ext = os.path.splitext(input_filename)
if ext.lower() not in (".py", ".txt", ".css", ".js", ".tmpl", ".sh", ".cmd"):
continue
print(input_filename)
with open(input_filename, "rb") as input_data:
data = input_data.read()
data = data.replace(b"\r", b"")
with open(input_filename, "wb") as output_data:
output_data.write(data)
# Create tar.gz file for source distro
with tarfile.open(RELEASE_SRC, "w:gz") as tar_output:
for root, dirs, files in os.walk(src_folder):
for _file in files:
input_path = os.path.join(root, _file)
if sys.platform == "win32":
tar_path = input_path.replace("srcdist\\", RELEASE_NAME + "/").replace("\\", "/")
else:
tar_path = input_path.replace("srcdist/", RELEASE_NAME + "/")
tarinfo = tar_output.gettarinfo(input_path, tar_path)
tarinfo.uid = 0
tarinfo.gid = 0
if _file in ("SABnzbd.py", "Sample-PostProc.sh", "make_mo.py", "msgfmt.py"):
# Force Linux/macOS scripts as executable
tarinfo.mode = 0o755
else:
tarinfo.mode = 0o644
with open(input_path, "rb") as f:
tar_output.addfile(tarinfo, f)
# Remove source folder
safe_remove(src_folder)
# Reset!
run_git_command(["reset", "--hard"])
run_git_command(["clean", "-f"])

View File

@@ -0,0 +1,2 @@
PyGithub==2.8.1
praw==7.8.1

272
builder/release.py Normal file
View File

@@ -0,0 +1,272 @@
#!/usr/bin/python3 -OO
# Copyright 2008-2025 by The SABnzbd-Team (sabnzbd.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import hashlib
import json
import os
import re
import xml.etree.ElementTree as ET
import github
import praw
from constants import (
RELEASE_VERSION,
RELEASE_VERSION_BASE,
PRERELEASE,
RELEASE_SRC,
RELEASE_WIN_BIN_X64,
RELEASE_WIN_BIN_ARM64,
RELEASE_WIN_INSTALLER,
RELEASE_MACOS,
RELEASE_README,
RELEASE_THIS,
RELEASE_TITLE,
APPDATA_FILE,
ON_GITHUB_ACTIONS,
)
# Verify we have all assets
files_to_check = (
RELEASE_SRC,
RELEASE_WIN_BIN_X64,
RELEASE_WIN_BIN_ARM64,
RELEASE_WIN_INSTALLER,
RELEASE_MACOS,
RELEASE_README,
)
for file_to_check in files_to_check:
if not os.path.exists(file_to_check):
raise RuntimeError("Not all release files are present!")
print("All release files are present")
# Verify that appdata file is updated
if not isinstance(ET.parse(APPDATA_FILE).find(f"./releases/release[@version='{RELEASE_VERSION_BASE}']"), ET.Element):
release_missing = f"Could not find {RELEASE_VERSION_BASE} in {APPDATA_FILE}"
if RELEASE_THIS:
raise RuntimeError(release_missing)
elif ON_GITHUB_ACTIONS:
print(f"::warning file={APPDATA_FILE},title=Missing release::{release_missing}")
else:
print(release_missing)
# Calculate hashes for Synology release
with open(RELEASE_SRC, "rb") as inp_file:
source_data = inp_file.read()
print("---- Synology spksrc digest hashes ---- ")
print(RELEASE_SRC, "SHA1", hashlib.sha1(source_data).hexdigest())
print(RELEASE_SRC, "SHA256", hashlib.sha256(source_data).hexdigest())
print(RELEASE_SRC, "MD5", hashlib.md5(source_data).hexdigest())
print("----")
# Check if tagged as release and check for token
gh_token = os.environ.get("AUTOMATION_GITHUB_TOKEN", "")
if RELEASE_THIS and gh_token:
gh_obj = github.Github(auth=github.Auth.Token(gh_token))
gh_repo = gh_obj.get_repo("sabnzbd/sabnzbd")
# Read the release notes
with open(RELEASE_README, "r") as readme_file:
readme_data = readme_file.read()
# We have to manually check if we already created this release
for release in gh_repo.get_releases():
if release.tag_name == RELEASE_VERSION:
gh_release = release
print("Found existing release %s" % gh_release.name)
break
else:
# Did not find it, so create the release, use the GitHub tag we got as input
print("Creating GitHub release SABnzbd %s" % RELEASE_VERSION)
gh_release = gh_repo.create_git_release(
tag=RELEASE_VERSION,
name=RELEASE_TITLE,
message=readme_data,
draft=True,
prerelease=PRERELEASE,
)
# Fetch existing assets, as overwriting is not allowed by GitHub
gh_assets = gh_release.get_assets()
# Upload the assets
for file_to_check in files_to_check:
if os.path.exists(file_to_check):
# Check if this file was previously uploaded
if gh_assets.totalCount:
for gh_asset in gh_assets:
if gh_asset.name == file_to_check:
print("Removing existing asset %s " % gh_asset.name)
gh_asset.delete_asset()
# Upload the new one
print("Uploading %s to release %s" % (file_to_check, gh_release.name))
gh_release.upload_asset(file_to_check)
# Check if we now have all files
gh_new_assets = gh_release.get_assets()
if gh_new_assets.totalCount:
all_assets = [gh_asset.name for gh_asset in gh_new_assets]
# Check if we have all files, using set-comparison
if set(files_to_check) == set(all_assets):
print("All assets present, releasing %s" % RELEASE_VERSION)
# Publish release
gh_release.update_release(
tag_name=RELEASE_VERSION,
name=RELEASE_TITLE,
message=readme_data,
draft=False,
prerelease=PRERELEASE,
)
# Update the website
gh_repo_web = gh_obj.get_repo("sabnzbd/sabnzbd.github.io")
# Check if the branch already exists, only create one if it doesn't
skip_website_update = False
try:
gh_repo_web.get_branch(RELEASE_VERSION)
print("Branch %s on sabnzbd/sabnzbd.github.io already exists, skipping update" % RELEASE_VERSION)
skip_website_update = True
except github.GithubException:
# Create a new branch to have the changes
sb = gh_repo_web.get_branch("master")
print("Creating branch %s on sabnzbd/sabnzbd.github.io" % RELEASE_VERSION)
new_branch = gh_repo_web.create_git_ref(ref="refs/heads/" + RELEASE_VERSION, sha=sb.commit.sha)
# Update the files
if not skip_website_update:
# We need bytes version to interact with GitHub
RELEASE_VERSION_BYTES = RELEASE_VERSION.encode()
# Get all the version files
latest_txt = gh_repo_web.get_contents("latest.txt")
latest_txt_items = latest_txt.decoded_content.split()
new_latest_txt_items = latest_txt_items[:2]
config_yml = gh_repo_web.get_contents("_config.yml")
if PRERELEASE:
# If it's a pre-release, we append to current version in latest.txt
new_latest_txt_items.extend([RELEASE_VERSION_BYTES, latest_txt_items[1]])
# And replace in _config.yml
new_config_yml = re.sub(
b"latest_testing: '[^']*'",
b"latest_testing: '%s'" % RELEASE_VERSION_BYTES,
config_yml.decoded_content,
)
else:
# New stable release, replace the version
new_latest_txt_items[0] = RELEASE_VERSION_BYTES
# And replace in _config.yml
new_config_yml = re.sub(
b"latest_testing: '[^']*'",
b"latest_testing: ''",
config_yml.decoded_content,
)
new_config_yml = re.sub(
b"latest_stable: '[^']*'",
b"latest_stable: '%s'" % RELEASE_VERSION_BYTES,
new_config_yml,
)
# Also update the wiki-settings, these only use x.x notation
new_config_yml = re.sub(
b"wiki_version: '[^']*'",
b"wiki_version: '%s'" % RELEASE_VERSION_BYTES[:3],
new_config_yml,
)
# Update the files
print("Updating latest.txt")
gh_repo_web.update_file(
"latest.txt",
"Release %s: latest.txt" % RELEASE_VERSION,
b"\n".join(new_latest_txt_items),
latest_txt.sha,
RELEASE_VERSION,
)
print("Updating _config.yml")
gh_repo_web.update_file(
"_config.yml",
"Release %s: _config.yml" % RELEASE_VERSION,
new_config_yml,
config_yml.sha,
RELEASE_VERSION,
)
# Create pull-request
print("Creating pull request in sabnzbd/sabnzbd.github.io for the update")
update_pr = gh_repo_web.create_pull(
title="Release %s" % RELEASE_VERSION,
base="master",
body="Automated update of release files",
head=RELEASE_VERSION,
)
# Merge pull-request
print("Merging pull request in sabnzbd/sabnzbd.github.io for the update")
update_pr.merge(merge_method="squash")
# Only with GitHub success we proceed to Reddit
if reddit_token := os.environ.get("REDDIT_TOKEN", ""):
# Token format (without whitespace):
# {
# "client_id":"XXX",
# "client_secret":"XXX",
# "user_agent":"SABnzbd release script",
# "username":"Safihre",
# "password":"XXX"
# }
credentials = json.loads(reddit_token)
reddit = praw.Reddit(**credentials)
subreddit_sabnzbd = reddit.subreddit("sabnzbd")
subreddit_usenet = reddit.subreddit("usenet")
# Read the release notes
with open(RELEASE_README, "r") as readme_file:
readme_lines = readme_file.readlines()
# Put the download link after the title
readme_lines[2] = "## https://sabnzbd.org/downloads\n\n"
# Use the header in the readme as title
title = readme_lines[0]
release_notes_text = "".join(readme_lines[2:])
print("Posting release notes to Reddit")
# Only stable releases to r/usenet
if not PRERELEASE:
# Get correct flair-id (required by r/usenet)
for flair in subreddit_usenet.flair.link_templates.user_selectable():
if flair["flair_text"] == "News":
print("Posting to r/usenet")
submission = subreddit_usenet.submit(
title, selftext=release_notes_text, flair_id=flair["flair_template_id"]
)
break
else:
raise ValueError("Could not locate flair_text for posting to r/usenet")
# Post always to r/SABnzbd
print("Posting to r/sabnzbd")
subreddit_sabnzbd.submit(title, selftext=release_notes_text)
else:
print("Missing REDDIT_TOKEN")
else:
print("To push release to GitHub, first tag the commit.")
print("Or missing the AUTOMATION_GITHUB_TOKEN, cannot push to GitHub without it.")

19
builder/requirements.txt Normal file
View File

@@ -0,0 +1,19 @@
# Basic build requirements
# Note that not all sub-dependencies are listed, but only ones we know could cause trouble
pyinstaller==6.17.0
packaging==25.0
pyinstaller-hooks-contrib==2025.10
altgraph==0.17.5
wrapt==2.0.1
setuptools==80.9.0
# For the Windows build
pefile==2024.8.26; sys_platform == 'win32'
pywin32-ctypes==0.2.3; sys_platform == 'win32'
# For the macOS build
dmgbuild==1.6.6; sys_platform == 'darwin'
mac-alias==2.2.3; sys_platform == 'darwin'
macholib==1.16.4; sys_platform == 'darwin'
ds-store==1.3.2; sys_platform == 'darwin'
PyNaCl==1.6.1; sys_platform == 'darwin'

View File

@@ -0,0 +1,442 @@
; -*- coding: utf-8 -*-
;
; Copyright 2008-2015 The SABnzbd-Team (sabnzbd.org)
;
; This program is free software; you can redistribute it and/or
; modify it under the terms of the GNU General Public License
; as published by the Free Software Foundation; either version 2
; of the License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Unicode true
!addplugindir builder\win\nsis\Plugins
!addincludedir builder\win\nsis\Include
!include "MUI2.nsh"
!include "registerExtension.nsh"
!include "FileFunc.nsh"
!include "LogicLib.nsh"
!include "WinVer.nsh"
!include "nsProcess.nsh"
!include "x64.nsh"
!include "servicelib.nsh"
!include "StdUtils.nsh"
;------------------------------------------------------------------
;
; Macro for removing existing and the current installation
; It shared by the installer and the uninstaller.
;
!define RemovePrev "!insertmacro RemovePrev"
!macro RemovePrev idir
; Remove the whole dir
; Users should not be putting stuff here!
RMDir /r "${idir}"
!macroend
!define RemovePrevShortcuts "!insertmacro RemovePrevShortcuts"
!macro RemovePrevShortcuts
; Remove shortcuts, starting with current user ones (from old installs)
SetShellVarContext current
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd - SafeMode.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd - Documentation.url"
RMDir "$SMPROGRAMS\$MUI_TEMP"
Delete "$SMPROGRAMS\Startup\SABnzbd.lnk"
Delete "$DESKTOP\SABnzbd.lnk"
SetShellVarContext all
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd - SafeMode.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd - Documentation.url"
RMDir "$SMPROGRAMS\$MUI_TEMP"
Delete "$SMPROGRAMS\Startup\SABnzbd.lnk"
Delete "$DESKTOP\SABnzbd.lnk"
!macroend
;------------------------------------------------------------------
; Define names of the product
Name "SABnzbd ${SAB_VERSION}"
VIProductVersion "${SAB_VERSIONKEY}"
VIFileVersion "${SAB_VERSIONKEY}"
VIAddVersionKey "Comments" "SABnzbd ${SAB_VERSION}"
VIAddVersionKey "CompanyName" "The SABnzbd-Team"
VIAddVersionKey "FileDescription" "SABnzbd ${SAB_VERSION}"
VIAddVersionKey "FileVersion" "${SAB_VERSION}"
VIAddVersionKey "LegalCopyright" "The SABnzbd-Team"
VIAddVersionKey "ProductName" "SABnzbd ${SAB_VERSION}"
VIAddVersionKey "ProductVersion" "${SAB_VERSION}"
OutFile "${SAB_FILE}"
InstallDir "$PROGRAMFILES\SABnzbd"
;------------------------------------------------------------------
; Some default compiler settings (uncomment and change at will):
SetCompress auto ; (can be off or force)
SetDatablockOptimize on ; (can be off)
CRCCheck on ; (can be off)
AutoCloseWindow false ; (can be true for the window go away automatically at end)
ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
SetDateSave off ; (can be on to have files restored to their original date)
WindowIcon on
SpaceTexts none
;------------------------------------------------------------------
; Vista/Win7 redirects $SMPROGRAMS to all users without this
RequestExecutionLevel admin
FileErrorText "If you have no admin rights, try to install into a user directory."
;------------------------------------------------------------------
;Variables
Var MUI_TEMP
Var STARTMENU_FOLDER
Var PREV_INST_DIR
;------------------------------------------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;Show all languages, despite user's codepage
!define MUI_LANGDLL_ALLLANGUAGES
!define MUI_ICON "dist\SABnzbd\icons\sabnzbd.ico"
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "dist\SABnzbd\LICENSE.txt"
!define MUI_COMPONENTSPAGE_NODESC
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\SABnzbd"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "SABnzbd"
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\SABnzbd"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
!define MUI_FINISHPAGE_RUN_TEXT $(MsgRunSAB)
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
!define MUI_FINISHPAGE_SHOWREADME_TEXT $(MsgShowRelNote)
!define MUI_FINISHPAGE_LINK $(MsgSupportUs)
!define MUI_FINISHPAGE_LINK_LOCATION "https://sabnzbd.org/donate"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!define MUI_UNPAGE_COMPONENTSPAGE_NODESC
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
;------------------------------------------------------------------
; Run as user-level at end of install
Function PageFinishRun
; Check if SABnzbd service is installed
!insertmacro SERVICE "installed" "SABnzbd" ""
Pop $0 ;response
${If} $0 == true
; Service is installed, start the service
!insertmacro SERVICE "start" "SABnzbd" ""
${Else}
; Service not installed, run executable as user
${StdUtils.ExecShellAsUser} $0 "$INSTDIR\SABnzbd.exe" "" ""
${EndIf}
FunctionEnd
;------------------------------------------------------------------
; Set supported languages
;
; If you edit this list you also need to edit apireg.py in SABnzbd!
;
!insertmacro MUI_LANGUAGE "English" ;first language is the default language
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "SimpChinese"
;------------------------------------------------------------------
;Reserve Files
;If you are using solid compression, files that are required before
;the actual installation should be stored first in the data block,
;because this will make your installer start faster.
!insertmacro MUI_RESERVEFILE_LANGDLL
;------------------------------------------------------------------
; SECTION main program
;
Section "SABnzbd" SecDummy
SetOutPath "$INSTDIR"
SetShellVarContext all
DetailPrint $(MsgShutting)
;------------------------------------------------------------------
; Shutdown any running service
!insertmacro SERVICE "stop" "SABnzbd" ""
;------------------------------------------------------------------
; Terminate SABnzbd.exe
loop:
${nsProcess::FindProcess} "SABnzbd.exe" $R0
StrCmp $R0 0 0 endcheck
${nsProcess::CloseProcess} "SABnzbd.exe" $R0
Sleep 500
Goto loop
endcheck:
${nsProcess::Unload}
;------------------------------------------------------------------
; Make sure old versions are gone (reg-key already read in onInt)
StrCmp $PREV_INST_DIR "" noPrevInstallRemove
${RemovePrev} "$PREV_INST_DIR"
Goto continueSetupAfterRemove
;------------------------------------------------------------------
; Add firewall rules for new installs
noPrevInstallRemove:
liteFirewallW::AddRule "$INSTDIR\SABnzbd.exe" "SABnzbd"
liteFirewallW::AddRule "$INSTDIR\SABnzbd-console.exe" "SABnzbd-console"
continueSetupAfterRemove:
; add files / whatever that need to be installed here.
File /r "dist\SABnzbd\*"
;------------------------------------------------------------------
; Add to registry
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd" "Installer Language" "$(MsgLangCode)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "DisplayName" "SABnzbd ${SAB_VERSION}"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "DisplayVersion" '${SAB_VERSION}'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "Publisher" 'The SABnzbd-Team'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "HelpLink" 'https://forums.sabnzbd.org/'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "URLInfoAbout" 'https://sabnzbd.org/wiki/'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "URLUpdateInfo" 'https://sabnzbd.org/'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "Comments" 'The automated Usenet download tool'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "DisplayIcon" '$INSTDIR\icons\sabnzbd.ico'
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "EstimatedSize" 40674
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "NoRepair" -1
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "NoModify" -1
WriteRegStr HKEY_CURRENT_USER "Software\Classes\AppUserModelId\SABnzbd" "DisplayName" "SABnzbd"
WriteRegStr HKEY_CURRENT_USER "Software\Classes\AppUserModelId\SABnzbd" "IconUri" '$INSTDIR\icons\sabnzbd16_32.ico'
; write out uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\SABnzbd.lnk" "$INSTDIR\SABnzbd.exe"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\SABnzbd - SafeMode.lnk" "$INSTDIR\SABnzbd.exe" "--server 127.0.0.1:8080 -b1 --no-login"
WriteINIStr "$SMPROGRAMS\$STARTMENU_FOLDER\SABnzbd - Documentation.url" "InternetShortcut" "URL" "https://sabnzbd.org/wiki/"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd ; end of default section
Section $(MsgIcon) desktop
CreateShortCut "$DESKTOP\SABnzbd.lnk" "$INSTDIR\SABnzbd.exe"
SectionEnd ; end of desktop icon section
Section $(MsgAssoc) assoc
${registerExtension} "$INSTDIR\icons\nzb.ico" "$INSTDIR\SABnzbd.exe" ".nzb" "NZB File"
${RefreshShellIcons}
SectionEnd ; end of file association section
Section /o $(MsgRunAtStart) startup
CreateShortCut "$SMPROGRAMS\Startup\SABnzbd.lnk" "$INSTDIR\SABnzbd.exe" "-b0"
SectionEnd ;
;------------------------------------------------------------------
Function .onInit
; We need to modify the dir here for X64
${If} ${RunningX64}
StrCpy $INSTDIR "$PROGRAMFILES64\SABnzbd"
${Else}
MessageBox MB_OK|MB_ICONSTOP $(MsgOnly64bit)
Abort
${EndIf}
; Python 3.9 no longer supports Windows 7
${If} ${AtMostWin8}
MessageBox MB_OK|MB_ICONSTOP $(MsgNoWin7)
Abort
${EndIf}
;------------------------------------------------------------------
; Change settings based on if SAB was already installed
ReadRegStr $PREV_INST_DIR HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd" ""
StrCmp $PREV_INST_DIR "" noPrevInstall
; We want to use the user's custom dir if he used one
StrCmp $PREV_INST_DIR "$PROGRAMFILES\SABnzbd" noSpecialDir
StrCmp $PREV_INST_DIR "$PROGRAMFILES64\SABnzbd" noSpecialDir
; Set what the user had before
StrCpy $INSTDIR "$PREV_INST_DIR"
noSpecialDir:
;------------------------------------------------------------------
; Check what the user has currently set for install options
SetShellVarContext current
IfFileExists "$SMPROGRAMS\Startup\SABnzbd.lnk" 0 endCheckStartupCurrent
SectionSetFlags ${startup} 1
endCheckStartupCurrent:
SetShellVarContext all
IfFileExists "$SMPROGRAMS\Startup\SABnzbd.lnk" 0 endCheckStartup
SectionSetFlags ${startup} 1
endCheckStartup:
SetShellVarContext current
IfFileExists "$DESKTOP\SABnzbd.lnk" endCheckDesktop 0
; If not present for current user, first check all user folder
SetShellVarContext all
IfFileExists "$DESKTOP\SABnzbd.lnk" endCheckDesktop 0
SectionSetFlags ${desktop} 0 ; SAB is installed but desktop-icon not, so uncheck it
endCheckDesktop:
SetShellVarContext all
Push $1
ReadRegStr $1 HKCR ".nzb" "" ; read current file association
StrCmp "$1" "NZB File" noPrevInstall 0
SectionSetFlags ${assoc} 0 ; Uncheck it when it wasn't checked before
noPrevInstall:
;--------------------------------
; Display language chooser
!insertmacro MUI_LANGDLL_DISPLAY
;------------------------------------------------------------------
; Tell users about the service change
;
!insertmacro SERVICE "installed" "SABHelper" ""
Pop $0 ;response
${If} $0 == true
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(MsgServChange) IDOK removeservices IDCANCEL exitinstall
exitinstall:
Abort
removeservices:
!insertmacro SERVICE "delete" "SABHelper" ""
!insertmacro SERVICE "delete" "SABnzbd" ""
${EndIf}
FunctionEnd
;--------------------------------
; begin uninstall settings/section
UninstallText $(MsgUninstall)
Section "un.$(MsgDelProgram)" Uninstall
;make sure sabnzbd.exe isn't running..if so shut it down
DetailPrint $(MsgShutting)
${nsProcess::KillProcess} "SABnzbd.exe" $R0
${nsProcess::Unload}
; add delete commands to delete whatever files/registry keys/etc you installed here.
Delete "$INSTDIR\uninstall.exe"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd"
DeleteRegKey HKEY_CURRENT_USER "Software\Classes\AppUserModelId\SABnzbd"
DeleteRegKey HKEY_CURRENT_USER "Software\SABnzbd"
${RemovePrev} "$INSTDIR"
${RemovePrevShortcuts}
; Remove firewall entries
liteFirewallW::RemoveRule "$INSTDIR\SABnzbd.exe" "SABnzbd"
liteFirewallW::RemoveRule "$INSTDIR\SABnzbd-console.exe" "SABnzbd-console"
${unregisterExtension} ".nzb" "NZB File"
${RefreshShellIcons}
SectionEnd ; end of uninstall section
Section /o "un.$(MsgDelSettings)" DelSettings
DetailPrint "Uninstall settings $LOCALAPPDATA"
Delete "$LOCALAPPDATA\sabnzbd\sabnzbd.ini"
RMDir /r "$LOCALAPPDATA\sabnzbd"
SectionEnd
; eof
;--------------------------------
;Language strings
LangString MsgShowRelNote ${LANG_ENGLISH} "Show Release Notes"
LangString MsgRunSAB ${LANG_ENGLISH} "Run SABnzbd"
LangString MsgSupportUs ${LANG_ENGLISH} "Support the project, Donate!"
LangString MsgServChange ${LANG_ENGLISH} "The SABnzbd Windows Service changed in SABnzbd 3.0.0. $\nYou will need to reinstall the SABnzbd service. $\n$\nClick `OK` to remove the existing services or `Cancel` to cancel this upgrade."
LangString MsgOnly64bit ${LANG_ENGLISH} "SABnzbd only supports 64-bit Windows."
LangString MsgNoWin7 ${LANG_ENGLISH} "SABnzbd only supports Windows 8.1 and above."
LangString MsgShutting ${LANG_ENGLISH} "Shutting down SABnzbd"
LangString MsgUninstall ${LANG_ENGLISH} "This will uninstall SABnzbd from your system"
LangString MsgRunAtStart ${LANG_ENGLISH} "Run at startup"
LangString MsgIcon ${LANG_ENGLISH} "Desktop Icon"
LangString MsgAssoc ${LANG_ENGLISH} "NZB File association"
LangString MsgDelProgram ${LANG_ENGLISH} "Delete Program"
LangString MsgDelSettings ${LANG_ENGLISH} "Delete Settings"
LangString MsgLangCode ${LANG_ENGLISH} "en"
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd

View File

@@ -0,0 +1,501 @@
#################################################################################
# StdUtils plug-in for NSIS
# Copyright (C) 2004-2018 LoRd_MuldeR <MuldeR2@GMX.de>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# http://www.gnu.org/licenses/lgpl-2.1.txt
#################################################################################
# DEVELOPER NOTES:
# - Please see "https://github.com/lordmulder/stdutils/" for news and updates!
# - Please see "Docs\StdUtils\StdUtils.html" for detailed function descriptions!
# - Please see "Examples\StdUtils\StdUtilsTest.nsi" for usage examples!
#################################################################################
# FUNCTION DECLARTIONS
#################################################################################
!ifndef ___STDUTILS__NSH___
!define ___STDUTILS__NSH___
!define StdUtils.Time '!insertmacro _StdU_Time' #time(), as in C standard library
!define StdUtils.GetMinutes '!insertmacro _StdU_GetMinutes' #GetSystemTimeAsFileTime(), returns the number of minutes
!define StdUtils.GetHours '!insertmacro _StdU_GetHours' #GetSystemTimeAsFileTime(), returns the number of hours
!define StdUtils.GetDays '!insertmacro _StdU_GetDays' #GetSystemTimeAsFileTime(), returns the number of days
!define StdUtils.Rand '!insertmacro _StdU_Rand' #rand(), as in C standard library
!define StdUtils.RandMax '!insertmacro _StdU_RandMax' #rand(), as in C standard library, with maximum value
!define StdUtils.RandMinMax '!insertmacro _StdU_RandMinMax' #rand(), as in C standard library, with minimum/maximum value
!define StdUtils.RandList '!insertmacro _StdU_RandList' #rand(), as in C standard library, with list support
!define StdUtils.RandBytes '!insertmacro _StdU_RandBytes' #Generates random bytes, returned as Base64-encoded string
!define StdUtils.FormatStr '!insertmacro _StdU_FormatStr' #sprintf(), as in C standard library, one '%d' placeholder
!define StdUtils.FormatStr2 '!insertmacro _StdU_FormatStr2' #sprintf(), as in C standard library, two '%d' placeholders
!define StdUtils.FormatStr3 '!insertmacro _StdU_FormatStr3' #sprintf(), as in C standard library, three '%d' placeholders
!define StdUtils.ScanStr '!insertmacro _StdU_ScanStr' #sscanf(), as in C standard library, one '%d' placeholder
!define StdUtils.ScanStr2 '!insertmacro _StdU_ScanStr2' #sscanf(), as in C standard library, two '%d' placeholders
!define StdUtils.ScanStr3 '!insertmacro _StdU_ScanStr3' #sscanf(), as in C standard library, three '%d' placeholders
!define StdUtils.TrimStr '!insertmacro _StdU_TrimStr' #Remove whitspaces from string, left and right
!define StdUtils.TrimStrLeft '!insertmacro _StdU_TrimStrLeft' #Remove whitspaces from string, left side only
!define StdUtils.TrimStrRight '!insertmacro _StdU_TrimStrRight' #Remove whitspaces from string, right side only
!define StdUtils.RevStr '!insertmacro _StdU_RevStr' #Reverse a string, e.g. "reverse me" <-> "em esrever"
!define StdUtils.ValidFileName '!insertmacro _StdU_ValidFileName' #Test whether string is a valid file name - no paths allowed
!define StdUtils.ValidPathSpec '!insertmacro _StdU_ValidPathSpec' #Test whether string is a valid full(!) path specification
!define StdUtils.ValidDomainName '!insertmacro _StdU_ValidDomain' #Test whether string is a valid host name or domain name
!define StdUtils.StrToUtf8 '!insertmacro _StdU_StrToUtf8' #Convert string from Unicode (UTF-16) or ANSI to UTF-8 bytes
!define StdUtils.StrFromUtf8 '!insertmacro _StdU_StrFromUtf8' #Convert string from UTF-8 bytes to Unicode (UTF-16) or ANSI
!define StdUtils.SHFileMove '!insertmacro _StdU_SHFileMove' #SHFileOperation(), using the FO_MOVE operation
!define StdUtils.SHFileCopy '!insertmacro _StdU_SHFileCopy' #SHFileOperation(), using the FO_COPY operation
!define StdUtils.AppendToFile '!insertmacro _StdU_AppendToFile' #Append contents of an existing file to another file
!define StdUtils.ExecShellAsUser '!insertmacro _StdU_ExecShlUser' #ShellExecute() as NON-elevated user from elevated installer
!define StdUtils.InvokeShellVerb '!insertmacro _StdU_InvkeShlVrb' #Invokes a "shell verb", e.g. for pinning items to the taskbar
!define StdUtils.ExecShellWaitEx '!insertmacro _StdU_ExecShlWaitEx' #ShellExecuteEx(), returns the handle of the new process
!define StdUtils.WaitForProcEx '!insertmacro _StdU_WaitForProcEx' #WaitForSingleObject(), e.g. to wait for a running process
!define StdUtils.GetParameter '!insertmacro _StdU_GetParameter' #Get the value of a specific command-line option
!define StdUtils.TestParameter '!insertmacro _StdU_TestParameter' #Test whether a specific command-line option has been set
!define StdUtils.ParameterCnt '!insertmacro _StdU_ParameterCnt' #Get number of command-line tokens, similar to argc in main()
!define StdUtils.ParameterStr '!insertmacro _StdU_ParameterStr' #Get the n-th command-line token, similar to argv[i] in main()
!define StdUtils.GetAllParameters '!insertmacro _StdU_GetAllParams' #Get complete command-line, but without executable name
!define StdUtils.GetRealOSVersion '!insertmacro _StdU_GetRealOSVer' #Get the *real* Windows version number, even on Windows 8.1+
!define StdUtils.GetRealOSBuildNo '!insertmacro _StdU_GetRealOSBld' #Get the *real* Windows build number, even on Windows 8.1+
!define StdUtils.GetRealOSName '!insertmacro _StdU_GetRealOSStr' #Get the *real* Windows version, as a "friendly" name
!define StdUtils.GetOSEdition '!insertmacro _StdU_GetOSEdition' #Get the Windows edition, i.e. "workstation" or "server"
!define StdUtils.GetOSReleaseId '!insertmacro _StdU_GetOSRelIdNo' #Get the Windows release identifier (on Windows 10)
!define StdUtils.GetOSReleaseName '!insertmacro _StdU_GetOSRelIdStr' #Get the Windows release (on Windows 10), as a "friendly" name
!define StdUtils.VerifyOSVersion '!insertmacro _StdU_VrfyRealOSVer' #Compare *real* operating system to an expected version number
!define StdUtils.VerifyOSBuildNo '!insertmacro _StdU_VrfyRealOSBld' #Compare *real* operating system to an expected build number
!define StdUtils.HashText '!insertmacro _StdU_HashText' #Compute hash from text string (CRC32, MD5, SHA1/2/3, BLAKE2)
!define StdUtils.HashFile '!insertmacro _StdU_HashFile' #Compute hash from file (CRC32, MD5, SHA1/2/3, BLAKE2)
!define StdUtils.NormalizePath '!insertmacro _StdU_NormalizePath' #Simplifies the path to produce a direct, well-formed path
!define StdUtils.GetParentPath '!insertmacro _StdU_GetParentPath' #Get parent path by removing the last component from the path
!define StdUtils.SplitPath '!insertmacro _StdU_SplitPath' #Split the components of the given path
!define StdUtils.GetDrivePart '!insertmacro _StdU_GetDrivePart' #Get drive component of path
!define StdUtils.GetDirectoryPart '!insertmacro _StdU_GetDirPart' #Get directory component of path
!define StdUtils.GetFileNamePart '!insertmacro _StdU_GetFNamePart' #Get file name component of path
!define StdUtils.GetExtensionPart '!insertmacro _StdU_GetExtnPart' #Get file extension component of path
!define StdUtils.TimerCreate '!insertmacro _StdU_TimerCreate' #Create a new event-timer that will be triggered periodically
!define StdUtils.TimerDestroy '!insertmacro _StdU_TimerDestroy' #Destroy a running timer created with TimerCreate()
!define StdUtils.ProtectStr '!insertmacro _StdU_PrtctStr' #Protect a given String using Windows' DPAPI
!define StdUtils.UnprotectStr '!insertmacro _StdU_UnprtctStr' #Unprotect a string that was protected via ProtectStr()
!define StdUtils.GetLibVersion '!insertmacro _StdU_GetLibVersion' #Get the current StdUtils library version (for debugging)
!define StdUtils.SetVerbose '!insertmacro _StdU_SetVerbose' #Enable or disable "verbose" mode (for debugging)
#################################################################################
# MACRO DEFINITIONS
#################################################################################
!macro _StdU_Time out
StdUtils::Time /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetMinutes out
StdUtils::GetMinutes /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetHours out
StdUtils::GetHours /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetDays out
StdUtils::GetDays /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_Rand out
StdUtils::Rand /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_RandMax out max
push ${max}
StdUtils::RandMax /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_RandMinMax out min max
push ${min}
push ${max}
StdUtils::RandMinMax /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_RandList count max
push ${max}
push ${count}
StdUtils::RandList /NOUNLOAD
!macroend
!macro _StdU_RandBytes out count
push ${count}
StdUtils::RandBytes /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_FormatStr out format val
push `${format}`
push ${val}
StdUtils::FormatStr /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_FormatStr2 out format val1 val2
push `${format}`
push ${val1}
push ${val2}
StdUtils::FormatStr2 /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_FormatStr3 out format val1 val2 val3
push `${format}`
push ${val1}
push ${val2}
push ${val3}
StdUtils::FormatStr3 /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_ScanStr out format input default
push `${format}`
push `${input}`
push ${default}
StdUtils::ScanStr /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_ScanStr2 out1 out2 format input default1 default2
push `${format}`
push `${input}`
push ${default1}
push ${default2}
StdUtils::ScanStr2 /NOUNLOAD
pop ${out1}
pop ${out2}
!macroend
!macro _StdU_ScanStr3 out1 out2 out3 format input default1 default2 default3
push `${format}`
push `${input}`
push ${default1}
push ${default2}
push ${default3}
StdUtils::ScanStr3 /NOUNLOAD
pop ${out1}
pop ${out2}
pop ${out3}
!macroend
!macro _StdU_TrimStr var
push ${var}
StdUtils::TrimStr /NOUNLOAD
pop ${var}
!macroend
!macro _StdU_TrimStrLeft var
push ${var}
StdUtils::TrimStrLeft /NOUNLOAD
pop ${var}
!macroend
!macro _StdU_TrimStrRight var
push ${var}
StdUtils::TrimStrRight /NOUNLOAD
pop ${var}
!macroend
!macro _StdU_RevStr var
push ${var}
StdUtils::RevStr /NOUNLOAD
pop ${var}
!macroend
!macro _StdU_ValidFileName out test
push `${test}`
StdUtils::ValidFileName /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_ValidPathSpec out test
push `${test}`
StdUtils::ValidPathSpec /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_ValidDomain out test
push `${test}`
StdUtils::ValidDomainName /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_StrToUtf8 out str
push `${str}`
StdUtils::StrToUtf8 /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_StrFromUtf8 out trnc str
push ${trnc}
push `${str}`
StdUtils::StrFromUtf8 /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_SHFileMove out from to hwnd
push `${from}`
push `${to}`
push ${hwnd}
StdUtils::SHFileMove /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_SHFileCopy out from to hwnd
push `${from}`
push `${to}`
push ${hwnd}
StdUtils::SHFileCopy /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_AppendToFile out from dest offset maxlen
push `${from}`
push `${dest}`
push ${offset}
push ${maxlen}
StdUtils::AppendToFile /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_ExecShlUser out file verb args
push `${file}`
push `${verb}`
push `${args}`
StdUtils::ExecShellAsUser /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_InvkeShlVrb out path file verb_id
push "${path}"
push "${file}"
push ${verb_id}
StdUtils::InvokeShellVerb /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_ExecShlWaitEx out_res out_val file verb args
push `${file}`
push `${verb}`
push `${args}`
StdUtils::ExecShellWaitEx /NOUNLOAD
pop ${out_res}
pop ${out_val}
!macroend
!macro _StdU_WaitForProcEx out handle
push `${handle}`
StdUtils::WaitForProcEx /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetParameter out name default
push `${name}`
push `${default}`
StdUtils::GetParameter /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_TestParameter out name
push `${name}`
StdUtils::TestParameter /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_ParameterCnt out
StdUtils::ParameterCnt /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_ParameterStr out index
push ${index}
StdUtils::ParameterStr /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetAllParams out truncate
push `${truncate}`
StdUtils::GetAllParameters /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetRealOSVer out_major out_minor out_spack
StdUtils::GetRealOsVersion /NOUNLOAD
pop ${out_major}
pop ${out_minor}
pop ${out_spack}
!macroend
!macro _StdU_GetRealOSBld out
StdUtils::GetRealOsBuildNo /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetRealOSStr out
StdUtils::GetRealOsName /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_VrfyRealOSVer out major minor spack
push `${major}`
push `${minor}`
push `${spack}`
StdUtils::VerifyRealOsVersion /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_VrfyRealOSBld out build
push `${build}`
StdUtils::VerifyRealOsBuildNo /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetOSEdition out
StdUtils::GetOsEdition /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetOSRelIdNo out
StdUtils::GetOsReleaseId /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetOSRelIdStr out
StdUtils::GetOsReleaseName /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_HashText out type text
push `${type}`
push `${text}`
StdUtils::HashText /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_HashFile out type file
push `${type}`
push `${file}`
StdUtils::HashFile /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_NormalizePath out path
push `${path}`
StdUtils::NormalizePath /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetParentPath out path
push `${path}`
StdUtils::GetParentPath /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_SplitPath out_drive out_dir out_fname out_ext path
push `${path}`
StdUtils::SplitPath /NOUNLOAD
pop ${out_drive}
pop ${out_dir}
pop ${out_fname}
pop ${out_ext}
!macroend
!macro _StdU_GetDrivePart out path
push `${path}`
StdUtils::GetDrivePart /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetDirPart out path
push `${path}`
StdUtils::GetDirectoryPart /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetFNamePart out path
push `${path}`
StdUtils::GetFileNamePart /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetExtnPart out path
push `${path}`
StdUtils::GetExtensionPart /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_TimerCreate out callback interval
GetFunctionAddress ${out} ${callback}
push ${out}
push ${interval}
StdUtils::TimerCreate /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_TimerDestroy out timer_id
push ${timer_id}
StdUtils::TimerDestroy /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_PrtctStr out dpsc salt text
push `${dpsc}`
push `${salt}`
push `${text}`
StdUtils::ProtectStr /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_UnprtctStr out trnc salt data
push `${trnc}`
push `${salt}`
push `${data}`
StdUtils::UnprotectStr /NOUNLOAD
pop ${out}
!macroend
!macro _StdU_GetLibVersion out_ver out_tst
StdUtils::GetLibVersion /NOUNLOAD
pop ${out_ver}
pop ${out_tst}
!macroend
!macro _StdU_SetVerbose enable
Push ${enable}
StdUtils::SetVerboseMode /NOUNLOAD
!macroend
#################################################################################
# MAGIC NUMBERS
#################################################################################
!define StdUtils.Const.ShellVerb.PinToTaskbar 0
!define StdUtils.Const.ShellVerb.UnpinFromTaskbar 1
!define StdUtils.Const.ShellVerb.PinToStart 2
!define StdUtils.Const.ShellVerb.UnpinFromStart 3
!endif # !___STDUTILS__NSH___

View File

@@ -0,0 +1,28 @@
!define nsProcess::FindProcess `!insertmacro nsProcess::FindProcess`
!macro nsProcess::FindProcess _FILE _ERR
nsProcess::_FindProcess /NOUNLOAD `${_FILE}`
Pop ${_ERR}
!macroend
!define nsProcess::KillProcess `!insertmacro nsProcess::KillProcess`
!macro nsProcess::KillProcess _FILE _ERR
nsProcess::_KillProcess /NOUNLOAD `${_FILE}`
Pop ${_ERR}
!macroend
!define nsProcess::CloseProcess `!insertmacro nsProcess::CloseProcess`
!macro nsProcess::CloseProcess _FILE _ERR
nsProcess::_CloseProcess /NOUNLOAD `${_FILE}`
Pop ${_ERR}
!macroend
!define nsProcess::Unload `!insertmacro nsProcess::Unload`
!macro nsProcess::Unload
nsProcess::_Unload
!macroend

View File

@@ -1,71 +1,53 @@
!define registerExtension "!insertmacro registerExtension"
!define unregisterExtension "!insertmacro unregisterExtension"
!define SHCNE_ASSOCCHANGED 0x8000000
!define SHCNF_IDLIST 0
; Source = http://nsis.sourceforge.net/File_Association
; Patched for SABnzbd by swi-tch
!macro registerExtension icon executable extension description
Push "${icon}" ; "full path to icon.ico"
Push "${executable}" ; "full path to my.exe"
Push "${extension}" ; ".mkv"
Push "${description}" ; "MKV File"
Call registerExtension
!macroend
; back up old value of .opt
Function registerExtension
!define Index "Line${__LINE__}"
pop $R0 ; ext name
pop $R1
pop $R2
pop $R3
push $1
push $0
DeleteRegKey HKEY_CURRENT_USER "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$R1"
ReadRegStr $1 HKCR $R1 ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "OptionsFile" "${Index}-NoBackup"
WriteRegStr HKCR $R1 "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR $R1 "" $R0
ReadRegStr $0 HKCR $R0 ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR $R0 "" $R0
WriteRegStr HKCR "$R0\shell" "" "open"
WriteRegStr HKCR "$R0\DefaultIcon" "" "$R3,0"
"${Index}-Skip:"
WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"'
WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0"
WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"'
pop $0
pop $1
!undef Index
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
FunctionEnd
!macro unregisterExtension extension description
Push "${extension}" ; ".mkv"
Push "${description}" ; "MKV File"
Call un.unregisterExtension
!macroend
Function un.unregisterExtension
pop $R1 ; description
pop $R0 ; extension
!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR $R0 ""
StrCmp $1 $R1 0 "${Index}-NoOwn" ; only do this if we own it
ReadRegStr $1 HKCR $R0 "backup_val"
StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key
DeleteRegKey HKCR $R0
Goto "${Index}-NoOwn"
"${Index}-Restore:"
WriteRegStr HKCR $R0 "" $1
DeleteRegValue HKCR $R0 "backup_val"
DeleteRegKey HKCR $R1 ;Delete key with association name settings
"${Index}-NoOwn:"
!undef Index
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
!define registerExtension "!insertmacro registerExtension"
!define unregisterExtension "!insertmacro unregisterExtension"
!define SHCNE_ASSOCCHANGED 0x8000000
!define SHCNF_IDLIST 0
; Source = http://nsis.sourceforge.net/File_Association
; Patched for SABnzbd by swi-tch
!macro registerExtension icon executable extension description
Push "${icon}" ; "full path to icon.ico"
Push "${executable}" ; "full path to my.exe"
Push "${extension}" ; ".mkv"
Push "${description}" ; "MKV File"
Call registerExtension
!macroend
; back up old value of .opt
Function registerExtension
!define Index "Line${__LINE__}"
pop $R0 ; ext name
pop $R1
pop $R2
pop $R3
push $1
push $0
DeleteRegKey HKEY_CURRENT_USER "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$R1"
WriteRegStr HKCR $R1 "" $R0
WriteRegStr HKCR $R0 "" $R0
WriteRegStr HKCR "$R0\shell" "" "open"
WriteRegStr HKCR "$R0\DefaultIcon" "" "$R3,0"
WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"'
WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0"
WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"'
pop $0
pop $1
!undef Index
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
FunctionEnd
!macro unregisterExtension extension description
Push "${extension}" ; ".mkv"
Push "${description}" ; "MKV File"
Call un.unregisterExtension
!macroend
Function un.unregisterExtension
pop $R1 ; description
pop $R0 ; extension
!define Index "Line${__LINE__}"
DeleteRegKey HKCR $R0
!undef Index
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
FunctionEnd

View File

@@ -0,0 +1,411 @@
; NSIS SERVICE LIBRARY - servicelib.nsh
; Version 1.8.1 - Jun 21th, 2013
; Questions/Comments - dselkirk@hotmail.com
;
; Description:
; Provides an interface to window services
;
; Inputs:
; action - systemlib action ie. create, delete, start, stop, pause,
; continue, installed, running, status
; name - name of service to manipulate
; param - action parameters; usage: var1=value1;var2=value2;...etc.
; (don't forget to add a ';' after the last value!)
;
; Actions:
; create - creates a new windows service
; Parameters:
; path - path to service executable
; autostart - automatically start with system ie. 1|0
; interact - interact with the desktop ie. 1|0
; depend - service dependencies
; user - user that runs the service
; password - password of the above user
; display - display name in service's console
; description - Description of service
; starttype - start type (supersedes autostart)
; servicetype - service type (supersedes interact)
;
; delete - deletes a windows service
; start - start a stopped windows service
; stop - stops a running windows service
; pause - pauses a running windows service
; continue - continues a paused windows service
; installed - is the provided service installed
; Parameters:
; action - if true then invokes the specified action
; running - is the provided service running
; Parameters:
; action - if true then invokes the specified action
; status - check the status of the provided service
;
; Usage:
; Method 1:
; Push "action"
; Push "name"
; Push "param"
; Call Service
; Pop $0 ;response
;
; Method 2:
; !insertmacro SERVICE "action" "name" "param"
;
; History:
; 1.0 - 09/15/2003 - Initial release
; 1.1 - 09/16/2003 - Changed &l to i, thx brainsucker
; 1.2 - 02/29/2004 - Fixed documentation.
; 1.3 - 01/05/2006 - Fixed interactive flag and pop order (Kichik)
; 1.4 - 12/07/2006 - Added display and depend, fixed datatypes (Vitoco)
; 1.5 - 06/25/2008 - Added description of service.(DeSafe.com/liuqixing#gmail.com)
; 1.5.1 - 06/12/2009 - Added use of __UNINSTALL__
; 1.6 - 08/02/2010 - Fixed description implementation (Anders)
; 1.7 - 04/11/2010 - Added get running service process id (Nico)
; 1.8 - 24/03/2011 - Added starttype and servicetype (Sergius)
; 1.8.1 - 21/06/2013 - Added dynamic ASCII & Unicode support (Zinthose)
!ifndef SERVICELIB
!define SERVICELIB
!define SC_MANAGER_ALL_ACCESS 0x3F
!define SC_STATUS_PROCESS_INFO 0x0
!define SERVICE_ALL_ACCESS 0xF01FF
!define SERVICE_CONTROL_STOP 1
!define SERVICE_CONTROL_PAUSE 2
!define SERVICE_CONTROL_CONTINUE 3
!define SERVICE_STOPPED 0x1
!define SERVICE_START_PENDING 0x2
!define SERVICE_STOP_PENDING 0x3
!define SERVICE_RUNNING 0x4
!define SERVICE_CONTINUE_PENDING 0x5
!define SERVICE_PAUSE_PENDING 0x6
!define SERVICE_PAUSED 0x7
!define SERVICE_KERNEL_DRIVER 0x00000001
!define SERVICE_FILE_SYSTEM_DRIVER 0x00000002
!define SERVICE_WIN32_OWN_PROCESS 0x00000010
!define SERVICE_WIN32_SHARE_PROCESS 0x00000020
!define SERVICE_INTERACTIVE_PROCESS 0x00000100
!define SERVICE_BOOT_START 0x00000000
!define SERVICE_SYSTEM_START 0x00000001
!define SERVICE_AUTO_START 0x00000002
!define SERVICE_DEMAND_START 0x00000003
!define SERVICE_DISABLED 0x00000004
## Added by Zinthose for Native Unicode Support
!ifdef NSIS_UNICODE
!define APITAG "W"
!else
!define APITAG "A"
!endif
!macro SERVICE ACTION NAME PARAM
Push '${ACTION}'
Push '${NAME}'
Push '${PARAM}'
!ifdef __UNINSTALL__
Call un.Service
!else
Call Service
!endif
!macroend
!macro FUNC_GETPARAM
Push $0
Push $1
Push $2
Push $3
Push $4
Push $5
Push $6
Push $7
Exch 8
Pop $1 ;name
Exch 8
Pop $2 ;source
StrCpy $0 ""
StrLen $7 $2
StrCpy $3 0
lbl_loop:
IntCmp $3 $7 0 0 lbl_done
StrLen $4 "$1="
StrCpy $5 $2 $4 $3
StrCmp $5 "$1=" 0 lbl_next
IntOp $5 $3 + $4
StrCpy $3 $5
lbl_loop2:
IntCmp $3 $7 0 0 lbl_done
StrCpy $6 $2 1 $3
StrCmp $6 ";" 0 lbl_next2
IntOp $6 $3 - $5
StrCpy $0 $2 $6 $5
Goto lbl_done
lbl_next2:
IntOp $3 $3 + 1
Goto lbl_loop2
lbl_next:
IntOp $3 $3 + 1
Goto lbl_loop
lbl_done:
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Exch 2
Pop $6
Pop $7
Exch $0
!macroend
!macro CALL_GETPARAM VAR NAME DEFAULT LABEL
Push $1
Push ${NAME}
Call ${UN}GETPARAM
Pop $6
StrCpy ${VAR} "${DEFAULT}"
StrCmp $6 "" "${LABEL}" 0
StrCpy ${VAR} $6
!macroend
!macro FUNC_SERVICE UN
Push $0
Push $1
Push $2
Push $3
Push $4
Push $5
Push $6
Push $7
Exch 8
Pop $1 ;param
Exch 8
Pop $2 ;name
Exch 8
Pop $3 ;action
;$0 return
;$4 OpenSCManager
;$5 OpenService
StrCpy $0 "false"
System::Call 'advapi32::OpenSCManager${APITAG}(n, n, i ${SC_MANAGER_ALL_ACCESS}) i.r4'
IntCmp $4 0 lbl_done
StrCmp $3 "create" lbl_create
System::Call 'advapi32::OpenService${APITAG}(i r4, t r2, i ${SERVICE_ALL_ACCESS}) i.r5'
IntCmp $5 0 lbl_done
lbl_select:
StrCmp $3 "delete" lbl_delete
StrCmp $3 "start" lbl_start
StrCmp $3 "stop" lbl_stop
StrCmp $3 "pause" lbl_pause
StrCmp $3 "continue" lbl_continue
StrCmp $3 "installed" lbl_installed
StrCmp $3 "running" lbl_running
StrCmp $3 "status" lbl_status
StrCmp $3 "processid" lbl_processid
Goto lbl_done
; create service
lbl_create:
Push $R1 ;depend
Push $R2 ;user
Push $R3 ;password
Push $R4 ;servicetype/interact
Push $R5 ;starttype/autostart
Push $R6 ;path
Push $R7 ;display
Push $R8 ;description
!insertmacro CALL_GETPARAM $R1 "depend" "n" "lbl_depend"
StrCpy $R1 't "$R1"'
lbl_depend:
StrCmp $R1 "n" 0 lbl_machine ;old name of depend param
!insertmacro CALL_GETPARAM $R1 "machine" "n" "lbl_machine"
StrCpy $R1 't "$R1"'
lbl_machine:
!insertmacro CALL_GETPARAM $R2 "user" "n" "lbl_user"
StrCpy $R2 't "$R2"'
lbl_user:
!insertmacro CALL_GETPARAM $R3 "password" "n" "lbl_password"
StrCpy $R3 't "$R3"'
lbl_password:
!insertmacro CALL_GETPARAM $R4 "interact" "${SERVICE_WIN32_OWN_PROCESS}" "lbl_interact"
StrCpy $6 ${SERVICE_WIN32_OWN_PROCESS}
IntCmp $R4 0 +2
IntOp $6 $6 | ${SERVICE_INTERACTIVE_PROCESS}
StrCpy $R4 $6
lbl_interact:
!insertmacro CALL_GETPARAM $R4 "servicetype" "$R4" "lbl_servicetype"
lbl_servicetype:
!insertmacro CALL_GETPARAM $R5 "autostart" "${SERVICE_DEMAND_START}" "lbl_autostart"
StrCpy $6 ${SERVICE_DEMAND_START}
IntCmp $R5 0 +2
StrCpy $6 ${SERVICE_AUTO_START}
StrCpy $R5 $6
lbl_autostart:
!insertmacro CALL_GETPARAM $R5 "starttype" "$R5" "lbl_starttype"
lbl_starttype:
!insertmacro CALL_GETPARAM $R6 "path" "n" "lbl_path"
lbl_path:
!insertmacro CALL_GETPARAM $R7 "display" "$2" "lbl_display"
lbl_display:
!insertmacro CALL_GETPARAM $R8 "description" "$2" "lbl_description"
lbl_description:
System::Call 'advapi32::CreateService${APITAG}(i r4, t r2, t R7, i ${SERVICE_ALL_ACCESS}, \
i R4, i R5, i 0, t R6, n, n, $R1, $R2, $R3) i.r6'
; write description of service (SERVICE_CONFIG_DESCRIPTION)
System::Call 'advapi32::ChangeServiceConfig2${APITAG}(ir6,i1,*t "$R8")i.R7'
strcmp $R7 "error" 0 lbl_descriptioncomplete
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\$2" "Description" $R8
lbl_descriptioncomplete:
Pop $R8
Pop $R7
Pop $R6
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Pop $R1
StrCmp $6 0 lbl_done lbl_good
; delete service
lbl_delete:
System::Call 'advapi32::DeleteService(i r5) i.r6'
StrCmp $6 0 lbl_done lbl_good
; start service
lbl_start:
System::Call 'advapi32::StartService${APITAG}(i r5, i 0, i 0) i.r6'
StrCmp $6 0 lbl_done lbl_good
; stop service
lbl_stop:
Push $R1
System::Call '*(i,i,i,i,i,i,i) i.R1'
System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_STOP}, i $R1) i'
System::Free $R1
Pop $R1
StrCmp $6 0 lbl_done lbl_good
; pause service
lbl_pause:
Push $R1
System::Call '*(i,i,i,i,i,i,i) i.R1'
System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_PAUSE}, i $R1) i'
System::Free $R1
Pop $R1
StrCmp $6 0 lbl_done lbl_good
; continue service
lbl_continue:
Push $R1
System::Call '*(i,i,i,i,i,i,i) i.R1'
System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_CONTINUE}, i $R1) i'
System::Free $R1
Pop $R1
StrCmp $6 0 lbl_done lbl_good
; is installed
lbl_installed:
!insertmacro CALL_GETPARAM $7 "action" "" "lbl_good"
StrCpy $3 $7
Goto lbl_select
; is service running
lbl_running:
Push $R1
System::Call '*(i,i,i,i,i,i,i) i.R1'
System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i'
System::Call '*$R1(i, i.r6)'
System::Free $R1
Pop $R1
IntFmt $6 "0x%X" $6
StrCmp $6 ${SERVICE_RUNNING} 0 lbl_done
!insertmacro CALL_GETPARAM $7 "action" "" "lbl_good"
StrCpy $3 $7
Goto lbl_select
lbl_status:
Push $R1
System::Call '*(i,i,i,i,i,i,i) i.R1'
System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i'
System::Call '*$R1(i, i .r6)'
System::Free $R1
Pop $R1
IntFmt $6 "0x%X" $6
StrCpy $0 "running"
IntCmp $6 ${SERVICE_RUNNING} lbl_done
StrCpy $0 "stopped"
IntCmp $6 ${SERVICE_STOPPED} lbl_done
StrCpy $0 "start_pending"
IntCmp $6 ${SERVICE_START_PENDING} lbl_done
StrCpy $0 "stop_pending"
IntCmp $6 ${SERVICE_STOP_PENDING} lbl_done
StrCpy $0 "running"
IntCmp $6 ${SERVICE_RUNNING} lbl_done
StrCpy $0 "continue_pending"
IntCmp $6 ${SERVICE_CONTINUE_PENDING} lbl_done
StrCpy $0 "pause_pending"
IntCmp $6 ${SERVICE_PAUSE_PENDING} lbl_done
StrCpy $0 "paused"
IntCmp $6 ${SERVICE_PAUSED} lbl_done
StrCpy $0 "unknown"
Goto lbl_done
lbl_processid:
Push $R1
Push $R2
System::Call '*(i,i,i,i,i,i,i,i,i) i.R1'
System::Call '*(i 0) i.R2'
System::Call "advapi32::QueryServiceStatusEx(i r5, i ${SC_STATUS_PROCESS_INFO}, i $R1, i 36, i $R2) i"
System::Call "*$R1(i,i,i,i,i,i,i, i .r0)"
System::Free $R2
System::Free $R1
Pop $R2
Pop $R1
Goto lbl_done
lbl_good:
StrCpy $0 "true"
lbl_done:
IntCmp $5 0 +2
System::Call 'advapi32::CloseServiceHandle(i r5) n'
IntCmp $4 0 +2
System::Call 'advapi32::CloseServiceHandle(i r4) n'
Pop $4
Pop $3
Pop $2
Pop $1
Exch 3
Pop $5
Pop $7
Pop $6
Exch $0
!macroend
Function Service
!insertmacro FUNC_SERVICE ""
FunctionEnd
Function GetParam
!insertmacro FUNC_GETPARAM
FunctionEnd
!undef APITAG
!endif

View File

Binary file not shown.

View File

Binary file not shown.

View File

Binary file not shown.

View File

@@ -1,25 +0,0 @@
Copyright (c) 2004-2007, CherryPy Team (team@cherrypy.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the CherryPy Team nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1 +0,0 @@
This CherryPy Rev 2138 patched with Rev 2272.

View File

@@ -1,561 +0,0 @@
"""CherryPy is a pythonic, object-oriented HTTP framework.
CherryPy consists of not one, but four separate API layers.
The APPLICATION LAYER is the simplest. CherryPy applications are written as
a tree of classes and methods, where each branch in the tree corresponds to
a branch in the URL path. Each method is a 'page handler', which receives
GET and POST params as keyword arguments, and returns or yields the (HTML)
body of the response. The special method name 'index' is used for paths
that end in a slash, and the special method name 'default' is used to
handle multiple paths via a single handler. This layer also includes:
* the 'exposed' attribute (and cherrypy.expose)
* cherrypy.quickstart()
* _cp_config attributes
* cherrypy.tools (including cherrypy.session)
* cherrypy.url()
The ENVIRONMENT LAYER is used by developers at all levels. It provides
information about the current request and response, plus the application
and server environment, via a (default) set of top-level objects:
* cherrypy.request
* cherrypy.response
* cherrypy.engine
* cherrypy.server
* cherrypy.tree
* cherrypy.config
* cherrypy.thread_data
* cherrypy.log
* cherrypy.HTTPError, NotFound, and HTTPRedirect
* cherrypy.lib
The EXTENSION LAYER allows advanced users to construct and share their own
plugins. It consists of:
* Hook API
* Tool API
* Toolbox API
* Dispatch API
* Config Namespace API
Finally, there is the CORE LAYER, which uses the core API's to construct
the default components which are available at higher layers. You can think
of the default components as the 'reference implementation' for CherryPy.
Megaframeworks (and advanced users) may replace the default components
with customized or extended components. The core API's are:
* Application API
* Engine API
* Request API
* Server API
* WSGI API
These API's are described in the CherryPy specification:
http://www.cherrypy.org/wiki/CherryPySpec
"""
__version__ = "3.2.0"
from urlparse import urljoin as _urljoin
class _AttributeDocstrings(type):
"""Metaclass for declaring docstrings for class attributes."""
# The full docstring for this type is down in the __init__ method so
# that it doesn't show up in help() for every consumer class.
def __init__(cls, name, bases, dct):
'''Metaclass for declaring docstrings for class attributes.
Base Python doesn't provide any syntax for setting docstrings on
'data attributes' (non-callables). This metaclass allows class
definitions to follow the declaration of a data attribute with
a docstring for that attribute; the attribute docstring will be
popped from the class dict and folded into the class docstring.
The naming convention for attribute docstrings is:
<attrname> + "__doc".
For example:
class Thing(object):
"""A thing and its properties."""
__metaclass__ = cherrypy._AttributeDocstrings
height = 50
height__doc = """The height of the Thing in inches."""
In which case, help(Thing) starts like this:
>>> help(mod.Thing)
Help on class Thing in module pkg.mod:
class Thing(__builtin__.object)
| A thing and its properties.
|
| height [= 50]:
| The height of the Thing in inches.
|
The benefits of this approach over hand-edited class docstrings:
1. Places the docstring nearer to the attribute declaration.
2. Makes attribute docs more uniform ("name (default): doc").
3. Reduces mismatches of attribute _names_ between
the declaration and the documentation.
4. Reduces mismatches of attribute default _values_ between
the declaration and the documentation.
The benefits of a metaclass approach over other approaches:
1. Simpler ("less magic") than interface-based solutions.
2. __metaclass__ can be specified at the module global level
for classic classes.
For various formatting reasons, you should write multiline docs
with a leading newline and not a trailing one:
response__doc = """
The response object for the current thread. In the main thread,
and any threads which are not HTTP requests, this is None."""
The type of the attribute is intentionally not included, because
that's not How Python Works. Quack.
'''
newdoc = [cls.__doc__ or ""]
dctnames = dct.keys()
dctnames.sort()
for name in dctnames:
if name.endswith("__doc"):
# Remove the magic doc attribute.
if hasattr(cls, name):
delattr(cls, name)
# Make a uniformly-indented docstring from it.
val = '\n'.join([' ' + line.strip()
for line in dct[name].split('\n')])
# Get the default value.
attrname = name[:-5]
try:
attrval = getattr(cls, attrname)
except AttributeError:
attrval = "missing"
# Add the complete attribute docstring to our list.
newdoc.append("%s [= %r]:\n%s" % (attrname, attrval, val))
# Add our list of new docstrings to the class docstring.
cls.__doc__ = "\n\n".join(newdoc)
from cherrypy._cperror import HTTPError, HTTPRedirect, InternalRedirect
from cherrypy._cperror import NotFound, CherryPyException, TimeoutError
from cherrypy import _cpdispatch as dispatch
from cherrypy import _cptools
tools = _cptools.default_toolbox
Tool = _cptools.Tool
from cherrypy import _cprequest
from cherrypy.lib import http as _http
from cherrypy import _cptree
tree = _cptree.Tree()
from cherrypy._cptree import Application
from cherrypy import _cpwsgi as wsgi
from cherrypy import process
try:
from cherrypy.process import win32
engine = win32.Win32Bus()
engine.console_control_handler = win32.ConsoleCtrlHandler(engine)
del win32
except ImportError:
engine = process.bus
# Timeout monitor
class _TimeoutMonitor(process.plugins.Monitor):
def __init__(self, bus):
self.servings = []
process.plugins.Monitor.__init__(self, bus, self.run)
def acquire(self):
self.servings.append((serving.request, serving.response))
def release(self):
try:
self.servings.remove((serving.request, serving.response))
except ValueError:
pass
def run(self):
"""Check timeout on all responses. (Internal)"""
for req, resp in self.servings:
resp.check_timeout()
engine.timeout_monitor = _TimeoutMonitor(engine)
engine.timeout_monitor.subscribe()
engine.autoreload = process.plugins.Autoreloader(engine)
engine.autoreload.subscribe()
engine.thread_manager = process.plugins.ThreadManager(engine)
engine.thread_manager.subscribe()
engine.signal_handler = process.plugins.SignalHandler(engine)
from cherrypy import _cpserver
server = _cpserver.Server()
server.subscribe()
def quickstart(root=None, script_name="", config=None):
"""Mount the given root, start the builtin server (and engine), then block.
root: an instance of a "controller class" (a collection of page handler
methods) which represents the root of the application.
script_name: a string containing the "mount point" of the application.
This should start with a slash, and be the path portion of the URL
at which to mount the given root. For example, if root.index() will
handle requests to "http://www.example.com:8080/dept/app1/", then
the script_name argument would be "/dept/app1".
It MUST NOT end in a slash. If the script_name refers to the root
of the URI, it MUST be an empty string (not "/").
config: a file or dict containing application config. If this contains
a [global] section, those entries will be used in the global
(site-wide) config.
"""
if config:
_global_conf_alias.update(config)
if root is not None:
tree.mount(root, script_name, config)
if hasattr(engine, "signal_handler"):
engine.signal_handler.subscribe()
if hasattr(engine, "console_control_handler"):
engine.console_control_handler.subscribe()
engine.start()
engine.block()
try:
from threading import local as _local
except ImportError:
from cherrypy._cpthreadinglocal import local as _local
class _Serving(_local):
"""An interface for registering request and response objects.
Rather than have a separate "thread local" object for the request and
the response, this class works as a single threadlocal container for
both objects (and any others which developers wish to define). In this
way, we can easily dump those objects when we stop/start a new HTTP
conversation, yet still refer to them as module-level globals in a
thread-safe way.
"""
__metaclass__ = _AttributeDocstrings
request = _cprequest.Request(_http.Host("127.0.0.1", 80),
_http.Host("127.0.0.1", 1111))
request__doc = """
The request object for the current thread. In the main thread,
and any threads which are not receiving HTTP requests, this is None."""
response = _cprequest.Response()
response__doc = """
The response object for the current thread. In the main thread,
and any threads which are not receiving HTTP requests, this is None."""
def load(self, request, response):
self.request = request
self.response = response
def clear(self):
"""Remove all attributes of self."""
self.__dict__.clear()
serving = _Serving()
class _ThreadLocalProxy(object):
__slots__ = ['__attrname__', '__dict__']
def __init__(self, attrname):
self.__attrname__ = attrname
def __getattr__(self, name):
child = getattr(serving, self.__attrname__)
return getattr(child, name)
def __setattr__(self, name, value):
if name in ("__attrname__", ):
object.__setattr__(self, name, value)
else:
child = getattr(serving, self.__attrname__)
setattr(child, name, value)
def __delattr__(self, name):
child = getattr(serving, self.__attrname__)
delattr(child, name)
def _get_dict(self):
child = getattr(serving, self.__attrname__)
d = child.__class__.__dict__.copy()
d.update(child.__dict__)
return d
__dict__ = property(_get_dict)
def __getitem__(self, key):
child = getattr(serving, self.__attrname__)
return child[key]
def __setitem__(self, key, value):
child = getattr(serving, self.__attrname__)
child[key] = value
def __delitem__(self, key):
child = getattr(serving, self.__attrname__)
del child[key]
def __contains__(self, key):
child = getattr(serving, self.__attrname__)
return key in child
def __len__(self):
child = getattr(serving, self.__attrname__)
return len(child)
def __nonzero__(self):
child = getattr(serving, self.__attrname__)
return bool(child)
# Create request and response object (the same objects will be used
# throughout the entire life of the webserver, but will redirect
# to the "serving" object)
request = _ThreadLocalProxy('request')
response = _ThreadLocalProxy('response')
# Create thread_data object as a thread-specific all-purpose storage
class _ThreadData(_local):
"""A container for thread-specific data."""
thread_data = _ThreadData()
# Monkeypatch pydoc to allow help() to go through the threadlocal proxy.
# Jan 2007: no Googleable examples of anyone else replacing pydoc.resolve.
# The only other way would be to change what is returned from type(request)
# and that's not possible in pure Python (you'd have to fake ob_type).
def _cherrypy_pydoc_resolve(thing, forceload=0):
"""Given an object or a path to an object, get the object and its name."""
if isinstance(thing, _ThreadLocalProxy):
thing = getattr(serving, thing.__attrname__)
return _pydoc._builtin_resolve(thing, forceload)
try:
import pydoc as _pydoc
_pydoc._builtin_resolve = _pydoc.resolve
_pydoc.resolve = _cherrypy_pydoc_resolve
except ImportError:
pass
from cherrypy import _cplogging
class _GlobalLogManager(_cplogging.LogManager):
def __call__(self, *args, **kwargs):
try:
log = request.app.log
except AttributeError:
log = self
return log.error(*args, **kwargs)
def access(self):
try:
return request.app.log.access()
except AttributeError:
return _cplogging.LogManager.access(self)
log = _GlobalLogManager()
# Set a default screen handler on the global log.
log.screen = True
log.error_file = ''
# Using an access file makes CP about 10% slower. Leave off by default.
log.access_file = ''
def _buslog(msg, level):
log.error(msg, 'ENGINE', severity=level)
engine.subscribe('log', _buslog)
# Helper functions for CP apps #
def expose(func=None, alias=None):
"""Expose the function, optionally providing an alias or set of aliases."""
def expose_(func):
func.exposed = True
if alias is not None:
if isinstance(alias, basestring):
parents[alias.replace(".", "_")] = func
else:
for a in alias:
parents[a.replace(".", "_")] = func
return func
import sys, types
if isinstance(func, (types.FunctionType, types.MethodType)):
if alias is None:
# @expose
func.exposed = True
return func
else:
# func = expose(func, alias)
parents = sys._getframe(1).f_locals
return expose_(func)
elif func is None:
if alias is None:
# @expose()
parents = sys._getframe(1).f_locals
return expose_
else:
# @expose(alias="alias") or
# @expose(alias=["alias1", "alias2"])
parents = sys._getframe(1).f_locals
return expose_
else:
# @expose("alias") or
# @expose(["alias1", "alias2"])
parents = sys._getframe(1).f_locals
alias = func
return expose_
def url(path="", qs="", script_name=None, base=None, relative=None):
"""Create an absolute URL for the given path.
If 'path' starts with a slash ('/'), this will return
(base + script_name + path + qs).
If it does not start with a slash, this returns
(base + script_name [+ request.path_info] + path + qs).
If script_name is None, cherrypy.request will be used
to find a script_name, if available.
If base is None, cherrypy.request.base will be used (if available).
Note that you can use cherrypy.tools.proxy to change this.
Finally, note that this function can be used to obtain an absolute URL
for the current request path (minus the querystring) by passing no args.
If you call url(qs=cherrypy.request.query_string), you should get the
original browser URL (assuming no internal redirections).
If relative is None or not provided, request.app.relative_urls will
be used (if available, else False). If False, the output will be an
absolute URL (including the scheme, host, vhost, and script_name).
If True, the output will instead be a URL that is relative to the
current request path, perhaps including '..' atoms. If relative is
the string 'server', the output will instead be a URL that is
relative to the server root; i.e., it will start with a slash.
"""
if qs:
qs = '?' + qs
if request.app:
if not path.startswith("/"):
# Append/remove trailing slash from path_info as needed
# (this is to support mistyped URL's without redirecting;
# if you want to redirect, use tools.trailing_slash).
pi = request.path_info
if request.is_index is True:
if not pi.endswith('/'):
pi = pi + '/'
elif request.is_index is False:
if pi.endswith('/') and pi != '/':
pi = pi[:-1]
if path == "":
path = pi
else:
path = _urljoin(pi, path)
if script_name is None:
script_name = request.script_name
if base is None:
base = request.base
newurl = base + script_name + path + qs
else:
# No request.app (we're being called outside a request).
# We'll have to guess the base from server.* attributes.
# This will produce very different results from the above
# if you're using vhosts or tools.proxy.
if base is None:
base = server.base()
path = (script_name or "") + path
newurl = base + path + qs
if './' in newurl:
# Normalize the URL by removing ./ and ../
atoms = []
for atom in newurl.split('/'):
if atom == '.':
pass
elif atom == '..':
atoms.pop()
else:
atoms.append(atom)
newurl = '/'.join(atoms)
# At this point, we should have a fully-qualified absolute URL.
if relative is None:
relative = getattr(request.app, "relative_urls", False)
# See http://www.ietf.org/rfc/rfc2396.txt
if relative == 'server':
# "A relative reference beginning with a single slash character is
# termed an absolute-path reference, as defined by <abs_path>..."
# This is also sometimes called "server-relative".
newurl = '/' + '/'.join(newurl.split('/', 3)[3:])
elif relative:
# "A relative reference that does not begin with a scheme name
# or a slash character is termed a relative-path reference."
old = url().split('/')[:-1]
new = newurl.split('/')
while old and new:
a, b = old[0], new[0]
if a != b:
break
old.pop(0)
new.pop(0)
new = (['..'] * len(old)) + new
newurl = '/'.join(new)
return newurl
# import _cpconfig last so it can reference other top-level objects
from cherrypy import _cpconfig
# Use _global_conf_alias so quickstart can use 'config' as an arg
# without shadowing cherrypy.config.
config = _global_conf_alias = _cpconfig.Config()
from cherrypy import _cpchecker
checker = _cpchecker.Checker()
engine.subscribe('start', checker)

View File

@@ -1,79 +0,0 @@
import cgi
import cherrypy
class FieldStorage(cgi.FieldStorage):
def __init__(self, *args, **kwds):
try:
cgi.FieldStorage.__init__(self, *args, **kwds)
except ValueError, ex:
if str(ex) == 'Maximum content length exceeded':
raise cherrypy.HTTPError(status=413)
else:
raise ex
def read_lines_to_eof(self):
"""Internal: read lines until EOF."""
while 1:
line = self.fp.readline(1<<16)
if not line:
self.done = -1
break
self.__write(line)
def read_lines_to_outerboundary(self):
"""Internal: read lines until outerboundary."""
next = "--" + self.outerboundary
last = next + "--"
delim = ""
last_line_lfend = True
while 1:
line = self.fp.readline(1<<16)
if not line:
self.done = -1
break
if line[:2] == "--" and last_line_lfend:
strippedline = line.strip()
if strippedline == next:
break
if strippedline == last:
self.done = 1
break
odelim = delim
if line[-2:] == "\r\n":
delim = "\r\n"
line = line[:-2]
last_line_lfend = True
elif line[-1] == "\n":
delim = "\n"
line = line[:-1]
last_line_lfend = True
else:
delim = ""
last_line_lfend = False
self.__write(odelim + line)
def skip_lines(self):
"""Internal: skip lines until outer boundary if defined."""
if not self.outerboundary or self.done:
return
next = "--" + self.outerboundary
last = next + "--"
last_line_lfend = True
while 1:
line = self.fp.readline(1<<16)
if not line:
self.done = -1
break
if line[:2] == "--" and last_line_lfend:
strippedline = line.strip()
if strippedline == next:
break
if strippedline == last:
self.done = 1
break
if line.endswith('\n'):
last_line_lfend = True
else:
last_line_lfend = False

View File

@@ -1,285 +0,0 @@
import os
import warnings
import cherrypy
class Checker(object):
"""A checker for CherryPy sites and their mounted applications.
on: set this to False to turn off the checker completely.
When this object is called at engine startup, it executes each
of its own methods whose names start with "check_". If you wish
to disable selected checks, simply add a line in your global
config which sets the appropriate method to False:
[global]
checker.check_skipped_app_config = False
You may also dynamically add or replace check_* methods in this way.
"""
on = True
def __init__(self):
self._populate_known_types()
def __call__(self):
"""Run all check_* methods."""
if self.on:
oldformatwarning = warnings.formatwarning
warnings.formatwarning = self.formatwarning
try:
for name in dir(self):
if name.startswith("check_"):
method = getattr(self, name)
if method and callable(method):
method()
finally:
warnings.formatwarning = oldformatwarning
def formatwarning(self, message, category, filename, lineno, line=None):
"""Function to format a warning."""
return "CherryPy Checker:\n%s\n\n" % message
# This value should be set inside _cpconfig.
global_config_contained_paths = False
def check_app_config_entries_dont_start_with_script_name(self):
for sn, app in cherrypy.tree.apps.iteritems():
if not isinstance(app, cherrypy.Application):
continue
if not app.config:
continue
if sn == '':
continue
sn_atoms = sn.strip("/").split("/")
for key in app.config.keys():
key_atoms = key.strip("/").split("/")
if key_atoms[:len(sn_atoms)] == sn_atoms:
warnings.warn(
"The application mounted at %r has config " \
"entries that start with its script name: %r" % (sn, key))
def check_skipped_app_config(self):
for sn, app in cherrypy.tree.apps.iteritems():
if not isinstance(app, cherrypy.Application):
continue
if not app.config:
msg = "The Application mounted at %r has an empty config." % sn
if self.global_config_contained_paths:
msg += (" It looks like the config you passed to "
"cherrypy.config.update() contains application-"
"specific sections. You must explicitly pass "
"application config via "
"cherrypy.tree.mount(..., config=app_config)")
warnings.warn(msg)
return
def check_static_paths(self):
# Use the dummy Request object in the main thread.
request = cherrypy.request
for sn, app in cherrypy.tree.apps.iteritems():
if not isinstance(app, cherrypy.Application):
continue
request.app = app
for section in app.config:
# get_resource will populate request.config
request.get_resource(section + "/dummy.html")
conf = request.config.get
if conf("tools.staticdir.on", False):
msg = ""
root = conf("tools.staticdir.root")
dir = conf("tools.staticdir.dir")
if dir is None:
msg = "tools.staticdir.dir is not set."
else:
fulldir = ""
if os.path.isabs(dir):
fulldir = dir
if root:
msg = ("dir is an absolute path, even "
"though a root is provided.")
testdir = os.path.join(root, dir[1:])
if os.path.exists(testdir):
msg += ("\nIf you meant to serve the "
"filesystem folder at %r, remove "
"the leading slash from dir." % testdir)
else:
if not root:
msg = "dir is a relative path and no root provided."
else:
fulldir = os.path.join(root, dir)
if not os.path.isabs(fulldir):
msg = "%r is not an absolute path." % fulldir
if fulldir and not os.path.exists(fulldir):
if msg:
msg += "\n"
msg += ("%r (root + dir) is not an existing "
"filesystem path." % fulldir)
if msg:
warnings.warn("%s\nsection: [%s]\nroot: %r\ndir: %r"
% (msg, section, root, dir))
# -------------------------- Compatibility -------------------------- #
obsolete = {
'server.default_content_type': 'tools.response_headers.headers',
'log_access_file': 'log.access_file',
'log_config_options': None,
'log_file': 'log.error_file',
'log_file_not_found': None,
'log_request_headers': 'tools.log_headers.on',
'log_to_screen': 'log.screen',
'show_tracebacks': 'request.show_tracebacks',
'throw_errors': 'request.throw_errors',
'profiler.on': ('cherrypy.tree.mount(profiler.make_app('
'cherrypy.Application(Root())))'),
}
deprecated = {}
def _compat(self, config):
"""Process config and warn on each obsolete or deprecated entry."""
for section, conf in config.iteritems():
if isinstance(conf, dict):
for k, v in conf.iteritems():
if k in self.obsolete:
warnings.warn("%r is obsolete. Use %r instead.\n"
"section: [%s]" %
(k, self.obsolete[k], section))
elif k in self.deprecated:
warnings.warn("%r is deprecated. Use %r instead.\n"
"section: [%s]" %
(k, self.deprecated[k], section))
else:
if section in self.obsolete:
warnings.warn("%r is obsolete. Use %r instead."
% (section, self.obsolete[section]))
elif section in self.deprecated:
warnings.warn("%r is deprecated. Use %r instead."
% (section, self.deprecated[section]))
def check_compatibility(self):
"""Process config and warn on each obsolete or deprecated entry."""
self._compat(cherrypy.config)
for sn, app in cherrypy.tree.apps.iteritems():
if not isinstance(app, cherrypy.Application):
continue
self._compat(app.config)
# ------------------------ Known Namespaces ------------------------ #
extra_config_namespaces = []
def _known_ns(self, app):
ns = ["wsgi"]
ns.extend(app.toolboxes.keys())
ns.extend(app.namespaces.keys())
ns.extend(app.request_class.namespaces.keys())
ns.extend(cherrypy.config.namespaces.keys())
ns += self.extra_config_namespaces
for section, conf in app.config.iteritems():
is_path_section = section.startswith("/")
if is_path_section and isinstance(conf, dict):
for k, v in conf.iteritems():
atoms = k.split(".")
if len(atoms) > 1:
if atoms[0] not in ns:
# Spit out a special warning if a known
# namespace is preceded by "cherrypy."
if (atoms[0] == "cherrypy" and atoms[1] in ns):
msg = ("The config entry %r is invalid; "
"try %r instead.\nsection: [%s]"
% (k, ".".join(atoms[1:]), section))
else:
msg = ("The config entry %r is invalid, because "
"the %r config namespace is unknown.\n"
"section: [%s]" % (k, atoms[0], section))
warnings.warn(msg)
elif atoms[0] == "tools":
if atoms[1] not in dir(cherrypy.tools):
msg = ("The config entry %r may be invalid, "
"because the %r tool was not found.\n"
"section: [%s]" % (k, atoms[1], section))
warnings.warn(msg)
def check_config_namespaces(self):
"""Process config and warn on each unknown config namespace."""
for sn, app in cherrypy.tree.apps.iteritems():
if not isinstance(app, cherrypy.Application):
continue
self._known_ns(app)
# -------------------------- Config Types -------------------------- #
known_config_types = {}
def _populate_known_types(self):
import __builtin__
builtins = [x for x in vars(__builtin__).values()
if type(x) is type(str)]
def traverse(obj, namespace):
for name in dir(obj):
vtype = type(getattr(obj, name, None))
if vtype in builtins:
self.known_config_types[namespace + "." + name] = vtype
traverse(cherrypy.request, "request")
traverse(cherrypy.response, "response")
traverse(cherrypy.server, "server")
traverse(cherrypy.engine, "engine")
traverse(cherrypy.log, "log")
def _known_types(self, config):
msg = ("The config entry %r in section %r is of type %r, "
"which does not match the expected type %r.")
for section, conf in config.iteritems():
if isinstance(conf, dict):
for k, v in conf.iteritems():
if v is not None:
expected_type = self.known_config_types.get(k, None)
vtype = type(v)
if expected_type and vtype != expected_type:
warnings.warn(msg % (k, section, vtype.__name__,
expected_type.__name__))
else:
k, v = section, conf
if v is not None:
expected_type = self.known_config_types.get(k, None)
vtype = type(v)
if expected_type and vtype != expected_type:
warnings.warn(msg % (k, section, vtype.__name__,
expected_type.__name__))
def check_config_types(self):
"""Assert that config values are of the same type as default values."""
self._known_types(cherrypy.config)
for sn, app in cherrypy.tree.apps.iteritems():
if not isinstance(app, cherrypy.Application):
continue
self._known_types(app.config)
# -------------------- Specific config warnings -------------------- #
def check_localhost(self):
"""Warn if any socket_host is 'localhost'. See #711."""
for k, v in cherrypy.config.iteritems():
if k == 'server.socket_host' and v == 'localhost':
warnings.warn("The use of 'localhost' as a socket host can "
"cause problems on newer systems, since 'localhost' can "
"map to either an IPv4 or an IPv6 address. You should "
"use '127.0.0.1' or '[::1]' instead.")

View File

@@ -1,415 +0,0 @@
"""Configuration system for CherryPy.
Configuration in CherryPy is implemented via dictionaries. Keys are strings
which name the mapped value, which may be of any type.
Architecture
------------
CherryPy Requests are part of an Application, which runs in a global context,
and configuration data may apply to any of those three scopes:
Global: configuration entries which apply everywhere are stored in
cherrypy.config.
Application: entries which apply to each mounted application are stored
on the Application object itself, as 'app.config'. This is a two-level
dict where each key is a path, or "relative URL" (for example, "/" or
"/path/to/my/page"), and each value is a config dict. Usually, this
data is provided in the call to tree.mount(root(), config=conf),
although you may also use app.merge(conf).
Request: each Request object possesses a single 'Request.config' dict.
Early in the request process, this dict is populated by merging global
config entries, Application entries (whose path equals or is a parent
of Request.path_info), and any config acquired while looking up the
page handler (see next).
Declaration
-----------
Configuration data may be supplied as a Python dictionary, as a filename,
or as an open file object. When you supply a filename or file, CherryPy
uses Python's builtin ConfigParser; you declare Application config by
writing each path as a section header:
[/path/to/my/page]
request.stream = True
To declare global configuration entries, place them in a [global] section.
You may also declare config entries directly on the classes and methods
(page handlers) that make up your CherryPy application via the '_cp_config'
attribute. For example:
class Demo:
_cp_config = {'tools.gzip.on': True}
def index(self):
return "Hello world"
index.exposed = True
index._cp_config = {'request.show_tracebacks': False}
Note, however, that this behavior is only guaranteed for the default
dispatcher. Other dispatchers may have different restrictions on where
you can attach _cp_config attributes.
Namespaces
----------
Configuration keys are separated into namespaces by the first "." in the key.
Current namespaces:
engine: Controls the 'application engine', including autoreload.
These can only be declared in the global config.
tree: Grafts cherrypy.Application objects onto cherrypy.tree.
These can only be declared in the global config.
hooks: Declares additional request-processing functions.
log: Configures the logging for each application.
These can only be declared in the global or / config.
request: Adds attributes to each Request.
response: Adds attributes to each Response.
server: Controls the default HTTP server via cherrypy.server.
These can only be declared in the global config.
tools: Runs and configures additional request-processing packages.
wsgi: Adds WSGI middleware to an Application's "pipeline".
These can only be declared in the app's root config ("/").
checker: Controls the 'checker', which looks for common errors in
app state (including config) when the engine starts.
Global config only.
The only key that does not exist in a namespace is the "environment" entry.
This special entry 'imports' other config entries from a template stored in
cherrypy._cpconfig.environments[environment]. It only applies to the global
config, and only when you use cherrypy.config.update.
You can define your own namespaces to be called at the Global, Application,
or Request level, by adding a named handler to cherrypy.config.namespaces,
app.namespaces, or app.request_class.namespaces. The name can
be any string, and the handler must be either a callable or a (Python 2.5
style) context manager.
"""
import ConfigParser
try:
set
except NameError:
from sets import Set as set
import sys
import cherrypy
environments = {
"staging": {
'engine.autoreload_on': False,
'checker.on': False,
'tools.log_headers.on': False,
'request.show_tracebacks': False,
'request.show_mismatched_params': False,
},
"production": {
'engine.autoreload_on': False,
'checker.on': False,
'tools.log_headers.on': False,
'request.show_tracebacks': False,
'request.show_mismatched_params': False,
'log.screen': False,
},
"embedded": {
# For use with CherryPy embedded in another deployment stack.
'engine.autoreload_on': False,
'checker.on': False,
'tools.log_headers.on': False,
'request.show_tracebacks': False,
'request.show_mismatched_params': False,
'log.screen': False,
'engine.SIGHUP': None,
'engine.SIGTERM': None,
},
"test_suite": {
'engine.autoreload_on': False,
'checker.on': False,
'tools.log_headers.on': False,
'request.show_tracebacks': True,
'request.show_mismatched_params': True,
'log.screen': False,
},
}
def as_dict(config):
"""Return a dict from 'config' whether it is a dict, file, or filename."""
if isinstance(config, basestring):
config = _Parser().dict_from_file(config)
elif hasattr(config, 'read'):
config = _Parser().dict_from_file(config)
return config
def merge(base, other):
"""Merge one app config (from a dict, file, or filename) into another.
If the given config is a filename, it will be appended to
the list of files to monitor for "autoreload" changes.
"""
if isinstance(other, basestring):
cherrypy.engine.autoreload.files.add(other)
# Load other into base
for section, value_map in as_dict(other).iteritems():
base.setdefault(section, {}).update(value_map)
class NamespaceSet(dict):
"""A dict of config namespace names and handlers.
Each config entry should begin with a namespace name; the corresponding
namespace handler will be called once for each config entry in that
namespace, and will be passed two arguments: the config key (with the
namespace removed) and the config value.
Namespace handlers may be any Python callable; they may also be
Python 2.5-style 'context managers', in which case their __enter__
method should return a callable to be used as the handler.
See cherrypy.tools (the Toolbox class) for an example.
"""
def __call__(self, config):
"""Iterate through config and pass it to each namespace handler.
'config' should be a flat dict, where keys use dots to separate
namespaces, and values are arbitrary.
The first name in each config key is used to look up the corresponding
namespace handler. For example, a config entry of {'tools.gzip.on': v}
will call the 'tools' namespace handler with the args: ('gzip.on', v)
"""
# Separate the given config into namespaces
ns_confs = {}
for k in config:
if "." in k:
ns, name = k.split(".", 1)
bucket = ns_confs.setdefault(ns, {})
bucket[name] = config[k]
# I chose __enter__ and __exit__ so someday this could be
# rewritten using Python 2.5's 'with' statement:
# for ns, handler in self.iteritems():
# with handler as callable:
# for k, v in ns_confs.get(ns, {}).iteritems():
# callable(k, v)
for ns, handler in self.iteritems():
exit = getattr(handler, "__exit__", None)
if exit:
callable = handler.__enter__()
no_exc = True
try:
try:
for k, v in ns_confs.get(ns, {}).iteritems():
callable(k, v)
except:
# The exceptional case is handled here
no_exc = False
if exit is None:
raise
if not exit(*sys.exc_info()):
raise
# The exception is swallowed if exit() returns true
finally:
# The normal and non-local-goto cases are handled here
if no_exc and exit:
exit(None, None, None)
else:
for k, v in ns_confs.get(ns, {}).iteritems():
handler(k, v)
def __repr__(self):
return "%s.%s(%s)" % (self.__module__, self.__class__.__name__,
dict.__repr__(self))
def __copy__(self):
newobj = self.__class__()
newobj.update(self)
return newobj
copy = __copy__
class Config(dict):
"""The 'global' configuration data for the entire CherryPy process."""
defaults = {
'tools.log_tracebacks.on': True,
'tools.log_headers.on': True,
'tools.trailing_slash.on': True,
}
namespaces = NamespaceSet(
**{"log": lambda k, v: setattr(cherrypy.log, k, v),
"checker": lambda k, v: setattr(cherrypy.checker, k, v),
})
def __init__(self):
self.reset()
def reset(self):
"""Reset self to default values."""
self.clear()
dict.update(self, self.defaults)
def update(self, config):
"""Update self from a dict, file or filename."""
if isinstance(config, basestring):
# Filename
cherrypy.engine.autoreload.files.add(config)
config = _Parser().dict_from_file(config)
elif hasattr(config, 'read'):
# Open file object
config = _Parser().dict_from_file(config)
else:
config = config.copy()
if isinstance(config.get("global", None), dict):
if len(config) > 1:
cherrypy.checker.global_config_contained_paths = True
config = config["global"]
which_env = config.get('environment')
if which_env:
env = environments[which_env]
for k in env:
if k not in config:
config[k] = env[k]
if 'tools.staticdir.dir' in config:
config['tools.staticdir.section'] = "global"
dict.update(self, config)
self.namespaces(config)
def __setitem__(self, k, v):
dict.__setitem__(self, k, v)
self.namespaces({k: v})
def _server_namespace_handler(k, v):
"""Config handler for the "server" namespace."""
atoms = k.split(".", 1)
if len(atoms) > 1:
# Special-case config keys of the form 'server.servername.socket_port'
# to configure additional HTTP servers.
if not hasattr(cherrypy, "servers"):
cherrypy.servers = {}
servername, k = atoms
if servername not in cherrypy.servers:
from cherrypy import _cpserver
cherrypy.servers[servername] = _cpserver.Server()
# On by default, but 'on = False' can unsubscribe it (see below).
cherrypy.servers[servername].subscribe()
if k == 'on':
if v:
cherrypy.servers[servername].subscribe()
else:
cherrypy.servers[servername].unsubscribe()
else:
setattr(cherrypy.servers[servername], k, v)
else:
setattr(cherrypy.server, k, v)
Config.namespaces["server"] = _server_namespace_handler
def _engine_namespace_handler(k, v):
"""Backward compatibility handler for the "engine" namespace."""
engine = cherrypy.engine
if k == 'autoreload_on':
if v:
engine.autoreload.subscribe()
else:
engine.autoreload.unsubscribe()
elif k == 'autoreload_frequency':
engine.autoreload.frequency = v
elif k == 'autoreload_match':
engine.autoreload.match = v
elif k == 'reload_files':
engine.autoreload.files = set(v)
elif k == 'deadlock_poll_freq':
engine.timeout_monitor.frequency = v
elif k == 'SIGHUP':
engine.listeners['SIGHUP'] = set([v])
elif k == 'SIGTERM':
engine.listeners['SIGTERM'] = set([v])
elif "." in k:
plugin, attrname = k.split(".", 1)
plugin = getattr(engine, plugin)
if attrname == 'on':
if v and callable(getattr(plugin, 'subscribe', None)):
plugin.subscribe()
return
elif (not v) and callable(getattr(plugin, 'unsubscribe', None)):
plugin.unsubscribe()
return
setattr(plugin, attrname, v)
else:
setattr(engine, k, v)
Config.namespaces["engine"] = _engine_namespace_handler
def _tree_namespace_handler(k, v):
"""Namespace handler for the 'tree' config namespace."""
cherrypy.tree.graft(v, v.script_name)
cherrypy.engine.log("Mounted: %s on %s" % (v, v.script_name or "/"))
Config.namespaces["tree"] = _tree_namespace_handler
class _Parser(ConfigParser.ConfigParser):
"""Sub-class of ConfigParser that keeps the case of options and that raises
an exception if the file cannot be read.
"""
def optionxform(self, optionstr):
return optionstr
def read(self, filenames):
if isinstance(filenames, basestring):
filenames = [filenames]
for filename in filenames:
# try:
# fp = open(filename)
# except IOError:
# continue
fp = open(filename)
try:
self._read(fp, filename)
finally:
fp.close()
def as_dict(self, raw=False, vars=None):
"""Convert an INI file to a dictionary"""
# Load INI file into a dict
from cherrypy.lib import unrepr
result = {}
for section in self.sections():
if section not in result:
result[section] = {}
for option in self.options(section):
value = self.get(section, option, raw, vars)
try:
value = unrepr(value)
except Exception, x:
msg = ("Config error in section: %r, option: %r, "
"value: %r. Config values must be valid Python." %
(section, option, value))
raise ValueError(msg, x.__class__.__name__, x.args)
result[section][option] = value
return result
def dict_from_file(self, file):
if hasattr(file, 'read'):
self.readfp(file)
else:
self.read(file)
return self.as_dict()
del ConfigParser

View File

@@ -1,561 +0,0 @@
"""CherryPy dispatchers.
A 'dispatcher' is the object which looks up the 'page handler' callable
and collects config for the current request based on the path_info, other
request attributes, and the application architecture. The core calls the
dispatcher as early as possible, passing it a 'path_info' argument.
The default dispatcher discovers the page handler by matching path_info
to a hierarchical arrangement of objects, starting at request.app.root.
"""
import cherrypy
class PageHandler(object):
"""Callable which sets response.body."""
def __init__(self, callable, *args, **kwargs):
self.callable = callable
self.args = args
self.kwargs = kwargs
def __call__(self):
try:
return self.callable(*self.args, **self.kwargs)
except TypeError, x:
try:
test_callable_spec(self.callable, self.args, self.kwargs)
except cherrypy.HTTPError, error:
raise error
except:
raise x
raise
def test_callable_spec(callable, callable_args, callable_kwargs):
"""
Inspect callable and test to see if the given args are suitable for it.
When an error occurs during the handler's invoking stage there are 2
erroneous cases:
1. Too many parameters passed to a function which doesn't define
one of *args or **kwargs.
2. Too little parameters are passed to the function.
There are 3 sources of parameters to a cherrypy handler.
1. query string parameters are passed as keyword parameters to the handler.
2. body parameters are also passed as keyword parameters.
3. when partial matching occurs, the final path atoms are passed as
positional args.
Both the query string and path atoms are part of the URI. If they are
incorrect, then a 404 Not Found should be raised. Conversely the body
parameters are part of the request; if they are invalid a 400 Bad Request.
"""
show_mismatched_params = getattr(cherrypy.request, 'show_mismatched_params', False)
try:
(args, varargs, varkw, defaults) = inspect.getargspec(callable)
except TypeError:
if isinstance(callable, object) and hasattr(callable, '__call__'):
(args, varargs, varkw, defaults) = inspect.getargspec(callable.__call__)
else:
# If it wasn't one of our own types, re-raise
# the original error
raise
if args and args[0] == 'self':
args = args[1:]
arg_usage = dict([(arg, 0,) for arg in args])
vararg_usage = 0
varkw_usage = 0
extra_kwargs = set()
for i, value in enumerate(callable_args):
try:
arg_usage[args[i]] += 1
except IndexError:
vararg_usage += 1
for key in callable_kwargs.keys():
try:
arg_usage[key] += 1
except KeyError:
varkw_usage += 1
extra_kwargs.add(key)
for i, val in enumerate(defaults or []):
# Defaults take effect only when the arg hasn't been used yet.
if arg_usage[args[i]] == 0:
arg_usage[args[i]] += 1
missing_args = []
multiple_args = []
for key, usage in arg_usage.iteritems():
if usage == 0:
missing_args.append(key)
elif usage > 1:
multiple_args.append(key)
if missing_args:
# In the case where the method allows body arguments
# there are 3 potential errors:
# 1. not enough query string parameters -> 404
# 2. not enough body parameters -> 400
# 3. not enough path parts (partial matches) -> 404
#
# We can't actually tell which case it is,
# so I'm raising a 404 because that covers 2/3 of the
# possibilities
#
# In the case where the method does not allow body
# arguments it's definitely a 404.
message = None
if show_mismatched_params:
message="Missing parameters: %s" % ",".join(missing_args)
raise cherrypy.HTTPError(404, message=message)
# the extra positional arguments come from the path - 404 Not Found
if not varargs and vararg_usage > 0:
raise cherrypy.HTTPError(404)
body_params = cherrypy.request.body_params or {}
body_params = set(body_params.keys())
qs_params = set(callable_kwargs.keys()) - body_params
if multiple_args:
if qs_params.intersection(set(multiple_args)):
# If any of the multiple parameters came from the query string then
# it's a 404 Not Found
error = 404
else:
# Otherwise it's a 400 Bad Request
error = 400
message = None
if show_mismatched_params:
message="Multiple values for parameters: "\
"%s" % ",".join(multiple_args)
raise cherrypy.HTTPError(error, message=message)
if not varkw and varkw_usage > 0:
# If there were extra query string parameters, it's a 404 Not Found
extra_qs_params = set(qs_params).intersection(extra_kwargs)
if extra_qs_params:
message = None
if show_mismatched_params:
message="Unexpected query string "\
"parameters: %s" % ", ".join(extra_qs_params)
raise cherrypy.HTTPError(404, message=message)
# If there were any extra body parameters, it's a 400 Not Found
extra_body_params = set(body_params).intersection(extra_kwargs)
if extra_body_params:
message = None
if show_mismatched_params:
message="Unexpected body parameters: "\
"%s" % ", ".join(extra_body_params)
raise cherrypy.HTTPError(400, message=message)
try:
import inspect
except ImportError:
test_callable_spec = lambda callable, args, kwargs: None
class LateParamPageHandler(PageHandler):
"""When passing cherrypy.request.params to the page handler, we do not
want to capture that dict too early; we want to give tools like the
decoding tool a chance to modify the params dict in-between the lookup
of the handler and the actual calling of the handler. This subclass
takes that into account, and allows request.params to be 'bound late'
(it's more complicated than that, but that's the effect).
"""
def _get_kwargs(self):
kwargs = cherrypy.request.params.copy()
if self._kwargs:
kwargs.update(self._kwargs)
return kwargs
def _set_kwargs(self, kwargs):
self._kwargs = kwargs
kwargs = property(_get_kwargs, _set_kwargs,
doc='page handler kwargs (with '
'cherrypy.request.params copied in)')
class Dispatcher(object):
"""CherryPy Dispatcher which walks a tree of objects to find a handler.
The tree is rooted at cherrypy.request.app.root, and each hierarchical
component in the path_info argument is matched to a corresponding nested
attribute of the root object. Matching handlers must have an 'exposed'
attribute which evaluates to True. The special method name "index"
matches a URI which ends in a slash ("/"). The special method name
"default" may match a portion of the path_info (but only when no longer
substring of the path_info matches some other object).
This is the default, built-in dispatcher for CherryPy.
"""
__metaclass__ = cherrypy._AttributeDocstrings
dispatch_method_name = '_cp_dispatch'
dispatch_method_name__doc = """
The name of the dispatch method that nodes may optionally implement
to provide their own dynamic dispatch algorithm.
"""
def __init__(self, dispatch_method_name = None):
if dispatch_method_name:
self.dispatch_method_name = dispatch_method_name
def __call__(self, path_info):
"""Set handler and config for the current request."""
request = cherrypy.request
func, vpath = self.find_handler(path_info)
if func:
# Decode any leftover %2F in the virtual_path atoms.
vpath = [x.replace("%2F", "/") for x in vpath]
request.handler = LateParamPageHandler(func, *vpath)
else:
request.handler = cherrypy.NotFound()
def find_handler(self, path):
"""Return the appropriate page handler, plus any virtual path.
This will return two objects. The first will be a callable,
which can be used to generate page output. Any parameters from
the query string or request body will be sent to that callable
as keyword arguments.
The callable is found by traversing the application's tree,
starting from cherrypy.request.app.root, and matching path
components to successive objects in the tree. For example, the
URL "/path/to/handler" might return root.path.to.handler.
The second object returned will be a list of names which are
'virtual path' components: parts of the URL which are dynamic,
and were not used when looking up the handler.
These virtual path components are passed to the handler as
positional arguments.
"""
request = cherrypy.request
app = request.app
root = app.root
dispatch_name = self.dispatch_method_name
# Get config for the root object/path.
curpath = ""
nodeconf = {}
if hasattr(root, "_cp_config"):
nodeconf.update(root._cp_config)
if "/" in app.config:
nodeconf.update(app.config["/"])
object_trail = [['root', root, nodeconf, curpath]]
node = root
names = [x for x in path.strip('/').split('/') if x] + ['index']
iternames = names[:]
while iternames:
name = iternames[0]
# map to legal Python identifiers (replace '.' with '_')
objname = name.replace('.', '_')
nodeconf = {}
subnode = getattr(node, objname, None)
if subnode is None:
dispatch = getattr(node, dispatch_name, None)
if dispatch and callable(dispatch) and not \
getattr(dispatch, 'exposed', False):
subnode = dispatch(vpath=iternames)
name = iternames.pop(0)
node = subnode
if node is not None:
# Get _cp_config attached to this node.
if hasattr(node, "_cp_config"):
nodeconf.update(node._cp_config)
# Mix in values from app.config for this path.
curpath = "/".join((curpath, name))
if curpath in app.config:
nodeconf.update(app.config[curpath])
object_trail.append([name, node, nodeconf, curpath])
def set_conf():
"""Collapse all object_trail config into cherrypy.request.config."""
base = cherrypy.config.copy()
# Note that we merge the config from each node
# even if that node was None.
for name, obj, conf, curpath in object_trail:
base.update(conf)
if 'tools.staticdir.dir' in conf:
base['tools.staticdir.section'] = curpath
return base
# Try successive objects (reverse order)
num_candidates = len(object_trail) - 1
for i in xrange(num_candidates, -1, -1):
name, candidate, nodeconf, curpath = object_trail[i]
if candidate is None:
continue
# Try a "default" method on the current leaf.
if hasattr(candidate, "default"):
defhandler = candidate.default
if getattr(defhandler, 'exposed', False):
# Insert any extra _cp_config from the default handler.
conf = getattr(defhandler, "_cp_config", {})
object_trail.insert(i+1, ["default", defhandler, conf, curpath])
request.config = set_conf()
# See http://www.cherrypy.org/ticket/613
request.is_index = path.endswith("/")
return defhandler, names[i:-1]
# Uncomment the next line to restrict positional params to "default".
# if i < num_candidates - 2: continue
# Try the current leaf.
if getattr(candidate, 'exposed', False):
request.config = set_conf()
if i == num_candidates:
# We found the extra ".index". Mark request so tools
# can redirect if path_info has no trailing slash.
request.is_index = True
else:
# We're not at an 'index' handler. Mark request so tools
# can redirect if path_info has NO trailing slash.
# Note that this also includes handlers which take
# positional parameters (virtual paths).
request.is_index = False
return candidate, names[i:-1]
# We didn't find anything
request.config = set_conf()
return None, []
class MethodDispatcher(Dispatcher):
"""Additional dispatch based on cherrypy.request.method.upper().
Methods named GET, POST, etc will be called on an exposed class.
The method names must be all caps; the appropriate Allow header
will be output showing all capitalized method names as allowable
HTTP verbs.
Note that the containing class must be exposed, not the methods.
"""
def __call__(self, path_info):
"""Set handler and config for the current request."""
request = cherrypy.request
resource, vpath = self.find_handler(path_info)
if resource:
# Set Allow header
avail = [m for m in dir(resource) if m.isupper()]
if "GET" in avail and "HEAD" not in avail:
avail.append("HEAD")
avail.sort()
cherrypy.response.headers['Allow'] = ", ".join(avail)
# Find the subhandler
meth = request.method.upper()
func = getattr(resource, meth, None)
if func is None and meth == "HEAD":
func = getattr(resource, "GET", None)
if func:
# Decode any leftover %2F in the virtual_path atoms.
vpath = [x.replace("%2F", "/") for x in vpath]
request.handler = LateParamPageHandler(func, *vpath)
else:
request.handler = cherrypy.HTTPError(405)
else:
request.handler = cherrypy.NotFound()
class RoutesDispatcher(object):
"""A Routes based dispatcher for CherryPy."""
def __init__(self, full_result=False):
"""
Routes dispatcher
Set full_result to True if you wish the controller
and the action to be passed on to the page handler
parameters. By default they won't be.
"""
import routes
self.full_result = full_result
self.controllers = {}
self.mapper = routes.Mapper()
self.mapper.controller_scan = self.controllers.keys
def connect(self, name, route, controller, **kwargs):
self.controllers[name] = controller
self.mapper.connect(name, route, controller=name, **kwargs)
def redirect(self, url):
raise cherrypy.HTTPRedirect(url)
def __call__(self, path_info):
"""Set handler and config for the current request."""
func = self.find_handler(path_info)
if func:
cherrypy.request.handler = LateParamPageHandler(func)
else:
cherrypy.request.handler = cherrypy.NotFound()
def find_handler(self, path_info):
"""Find the right page handler, and set request.config."""
import routes
request = cherrypy.request
config = routes.request_config()
config.mapper = self.mapper
if hasattr(cherrypy.request, 'wsgi_environ'):
config.environ = cherrypy.request.wsgi_environ
config.host = request.headers.get('Host', None)
config.protocol = request.scheme
config.redirect = self.redirect
result = self.mapper.match(path_info)
config.mapper_dict = result
params = {}
if result:
params = result.copy()
if not self.full_result:
params.pop('controller', None)
params.pop('action', None)
request.params.update(params)
# Get config for the root object/path.
request.config = base = cherrypy.config.copy()
curpath = ""
def merge(nodeconf):
if 'tools.staticdir.dir' in nodeconf:
nodeconf['tools.staticdir.section'] = curpath or "/"
base.update(nodeconf)
app = request.app
root = app.root
if hasattr(root, "_cp_config"):
merge(root._cp_config)
if "/" in app.config:
merge(app.config["/"])
# Mix in values from app.config.
atoms = [x for x in path_info.split("/") if x]
if atoms:
last = atoms.pop()
else:
last = None
for atom in atoms:
curpath = "/".join((curpath, atom))
if curpath in app.config:
merge(app.config[curpath])
handler = None
if result:
controller = result.get('controller', None)
controller = self.controllers.get(controller)
if controller:
# Get config from the controller.
if hasattr(controller, "_cp_config"):
merge(controller._cp_config)
action = result.get('action', None)
if action is not None:
handler = getattr(controller, action, None)
# Get config from the handler
if hasattr(handler, "_cp_config"):
merge(handler._cp_config)
# Do the last path atom here so it can
# override the controller's _cp_config.
if last:
curpath = "/".join((curpath, last))
if curpath in app.config:
merge(app.config[curpath])
return handler
def XMLRPCDispatcher(next_dispatcher=Dispatcher()):
from cherrypy.lib import xmlrpc
def xmlrpc_dispatch(path_info):
path_info = xmlrpc.patched_path(path_info)
return next_dispatcher(path_info)
return xmlrpc_dispatch
def VirtualHost(next_dispatcher=Dispatcher(), use_x_forwarded_host=True, **domains):
"""Select a different handler based on the Host header.
This can be useful when running multiple sites within one CP server.
It allows several domains to point to different parts of a single
website structure. For example:
http://www.domain.example -> root
http://www.domain2.example -> root/domain2/
http://www.domain2.example:443 -> root/secure
can be accomplished via the following config:
[/]
request.dispatch = cherrypy.dispatch.VirtualHost(
**{'www.domain2.example': '/domain2',
'www.domain2.example:443': '/secure',
})
next_dispatcher: the next dispatcher object in the dispatch chain.
The VirtualHost dispatcher adds a prefix to the URL and calls
another dispatcher. Defaults to cherrypy.dispatch.Dispatcher().
use_x_forwarded_host: if True (the default), any "X-Forwarded-Host"
request header will be used instead of the "Host" header. This
is commonly added by HTTP servers (such as Apache) when proxying.
**domains: a dict of {host header value: virtual prefix} pairs.
The incoming "Host" request header is looked up in this dict,
and, if a match is found, the corresponding "virtual prefix"
value will be prepended to the URL path before calling the
next dispatcher. Note that you often need separate entries
for "example.com" and "www.example.com". In addition, "Host"
headers may contain the port number.
"""
from cherrypy.lib import http
def vhost_dispatch(path_info):
header = cherrypy.request.headers.get
domain = header('Host', '')
if use_x_forwarded_host:
domain = header("X-Forwarded-Host", domain)
prefix = domains.get(domain, "")
if prefix:
path_info = http.urljoin(prefix, path_info)
result = next_dispatcher(path_info)
# Touch up staticdir config. See http://www.cherrypy.org/ticket/614.
section = cherrypy.request.config.get('tools.staticdir.section')
if section:
section = section[len(prefix):]
cherrypy.request.config['tools.staticdir.section'] = section
return result
return vhost_dispatch

View File

@@ -1,392 +0,0 @@
"""Error classes for CherryPy."""
from cgi import escape as _escape
from sys import exc_info as _exc_info
from traceback import format_exception as _format_exception
from urlparse import urljoin as _urljoin
from cherrypy.lib import http as _http
class CherryPyException(Exception):
pass
class TimeoutError(CherryPyException):
"""Exception raised when Response.timed_out is detected."""
pass
class InternalRedirect(CherryPyException):
"""Exception raised to switch to the handler for a different URL.
Any request.params must be supplied in a query string.
"""
def __init__(self, path):
import cherrypy
request = cherrypy.request
self.query_string = ""
if "?" in path:
# Separate any params included in the path
path, self.query_string = path.split("?", 1)
# Note that urljoin will "do the right thing" whether url is:
# 1. a URL relative to root (e.g. "/dummy")
# 2. a URL relative to the current path
# Note that any query string will be discarded.
path = _urljoin(request.path_info, path)
# Set a 'path' member attribute so that code which traps this
# error can have access to it.
self.path = path
CherryPyException.__init__(self, path, self.query_string)
class HTTPRedirect(CherryPyException):
"""Exception raised when the request should be redirected.
The new URL must be passed as the first argument to the Exception,
e.g., HTTPRedirect(newUrl). Multiple URLs are allowed. If a URL is
absolute, it will be used as-is. If it is relative, it is assumed
to be relative to the current cherrypy.request.path_info.
"""
def __init__(self, urls, status=None):
import cherrypy
request = cherrypy.request
if isinstance(urls, basestring):
urls = [urls]
abs_urls = []
for url in urls:
# Note that urljoin will "do the right thing" whether url is:
# 1. a complete URL with host (e.g. "http://www.example.com/test")
# 2. a URL relative to root (e.g. "/dummy")
# 3. a URL relative to the current path
# Note that any query string in cherrypy.request is discarded.
url = _urljoin(cherrypy.url(), url)
abs_urls.append(url)
self.urls = abs_urls
# RFC 2616 indicates a 301 response code fits our goal; however,
# browser support for 301 is quite messy. Do 302/303 instead. See
# http://www.alanflavell.org.uk/www/post-redirect.html
if status is None:
if request.protocol >= (1, 1):
status = 303
else:
status = 302
else:
status = int(status)
if status < 300 or status > 399:
raise ValueError("status must be between 300 and 399.")
self.status = status
CherryPyException.__init__(self, abs_urls, status)
def set_response(self):
"""Modify cherrypy.response status, headers, and body to represent self.
CherryPy uses this internally, but you can also use it to create an
HTTPRedirect object and set its output without *raising* the exception.
"""
import cherrypy
response = cherrypy.response
response.status = status = self.status
if status in (300, 301, 302, 303, 307):
response.headers['Content-Type'] = "text/html"
# "The ... URI SHOULD be given by the Location field
# in the response."
response.headers['Location'] = self.urls[0]
# "Unless the request method was HEAD, the entity of the response
# SHOULD contain a short hypertext note with a hyperlink to the
# new URI(s)."
msg = {300: "This resource can be found at <a href='%s'>%s</a>.",
301: "This resource has permanently moved to <a href='%s'>%s</a>.",
302: "This resource resides temporarily at <a href='%s'>%s</a>.",
303: "This resource can be found at <a href='%s'>%s</a>.",
307: "This resource has moved temporarily to <a href='%s'>%s</a>.",
}[status]
response.body = "<br />\n".join([msg % (u, u) for u in self.urls])
# Previous code may have set C-L, so we have to reset it
# (allow finalize to set it).
response.headers.pop('Content-Length', None)
elif status == 304:
# Not Modified.
# "The response MUST include the following header fields:
# Date, unless its omission is required by section 14.18.1"
# The "Date" header should have been set in Response.__init__
# "...the response SHOULD NOT include other entity-headers."
for key in ('Allow', 'Content-Encoding', 'Content-Language',
'Content-Length', 'Content-Location', 'Content-MD5',
'Content-Range', 'Content-Type', 'Expires',
'Last-Modified'):
if key in response.headers:
del response.headers[key]
# "The 304 response MUST NOT contain a message-body."
response.body = None
# Previous code may have set C-L, so we have to reset it.
response.headers.pop('Content-Length', None)
elif status == 305:
# Use Proxy.
# self.urls[0] should be the URI of the proxy.
response.headers['Location'] = self.urls[0]
response.body = None
# Previous code may have set C-L, so we have to reset it.
response.headers.pop('Content-Length', None)
else:
raise ValueError("The %s status code is unknown." % status)
def __call__(self):
"""Use this exception as a request.handler (raise self)."""
raise self
def clean_headers(status):
"""Remove any headers which should not apply to an error response."""
import cherrypy
response = cherrypy.response
# Remove headers which applied to the original content,
# but do not apply to the error page.
respheaders = response.headers
for key in ["Accept-Ranges", "Age", "ETag", "Location", "Retry-After",
"Vary", "Content-Encoding", "Content-Length", "Expires",
"Content-Location", "Content-MD5", "Last-Modified"]:
if respheaders.has_key(key):
del respheaders[key]
if status != 416:
# A server sending a response with status code 416 (Requested
# range not satisfiable) SHOULD include a Content-Range field
# with a byte-range-resp-spec of "*". The instance-length
# specifies the current length of the selected resource.
# A response with status code 206 (Partial Content) MUST NOT
# include a Content-Range field with a byte-range- resp-spec of "*".
if respheaders.has_key("Content-Range"):
del respheaders["Content-Range"]
class HTTPError(CherryPyException):
""" Exception used to return an HTTP error code (4xx-5xx) to the client.
This exception will automatically set the response status and body.
A custom message (a long description to display in the browser)
can be provided in place of the default.
"""
def __init__(self, status=500, message=None):
self.status = status
try:
self.code, self.reason, defaultmsg = _http.valid_status(status)
except ValueError, x:
raise cherrypy.HTTPError(500, x.args[0])
if self.code < 400 or self.code > 599:
raise ValueError("status must be between 400 and 599.")
# See http://www.python.org/dev/peps/pep-0352/
# self.message = message
self._message = message or defaultmsg
CherryPyException.__init__(self, status, message)
def set_response(self):
"""Modify cherrypy.response status, headers, and body to represent self.
CherryPy uses this internally, but you can also use it to create an
HTTPError object and set its output without *raising* the exception.
"""
import cherrypy
response = cherrypy.response
clean_headers(self.code)
# In all cases, finalize will be called after this method,
# so don't bother cleaning up response values here.
response.status = self.status
tb = None
if cherrypy.request.show_tracebacks:
tb = format_exc()
response.headers['Content-Type'] = "text/html"
content = self.get_error_page(self.status, traceback=tb,
message=self._message)
response.body = content
response.headers['Content-Length'] = len(content)
_be_ie_unfriendly(self.code)
def get_error_page(self, *args, **kwargs):
return get_error_page(*args, **kwargs)
def __call__(self):
"""Use this exception as a request.handler (raise self)."""
raise self
class NotFound(HTTPError):
"""Exception raised when a URL could not be mapped to any handler (404)."""
def __init__(self, path=None):
if path is None:
import cherrypy
path = cherrypy.request.script_name + cherrypy.request.path_info
self.args = (path,)
HTTPError.__init__(self, 404, "The path %r was not found." % path)
_HTTPErrorTemplate = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<title>%(status)s</title>
<style type="text/css">
#powered_by {
margin-top: 20px;
border-top: 2px solid black;
font-style: italic;
}
#traceback {
color: red;
}
</style>
</head>
<body>
<h2>%(status)s</h2>
<p>%(message)s</p>
<pre id="traceback">%(traceback)s</pre>
<div id="powered_by">
<span>Powered by <a href="http://www.cherrypy.org">CherryPy %(version)s</a></span>
</div>
</body>
</html>
'''
def get_error_page(status, **kwargs):
"""Return an HTML page, containing a pretty error response.
status should be an int or a str.
kwargs will be interpolated into the page template.
"""
import cherrypy
try:
code, reason, message = _http.valid_status(status)
except ValueError, x:
raise cherrypy.HTTPError(500, x.args[0])
# We can't use setdefault here, because some
# callers send None for kwarg values.
if kwargs.get('status') is None:
kwargs['status'] = "%s %s" % (code, reason)
if kwargs.get('message') is None:
kwargs['message'] = message
if kwargs.get('traceback') is None:
kwargs['traceback'] = ''
if kwargs.get('version') is None:
kwargs['version'] = cherrypy.__version__
for k, v in kwargs.iteritems():
if v is None:
kwargs[k] = ""
else:
kwargs[k] = _escape(kwargs[k])
# Use a custom template or callable for the error page?
pages = cherrypy.request.error_page
error_page = pages.get(code) or pages.get('default')
if error_page:
try:
if callable(error_page):
return error_page(**kwargs)
else:
return file(error_page, 'rb').read() % kwargs
except:
e = _format_exception(*_exc_info())[-1]
m = kwargs['message']
if m:
m += "<br />"
m += "In addition, the custom error page failed:\n<br />%s" % e
kwargs['message'] = m
return _HTTPErrorTemplate % kwargs
_ie_friendly_error_sizes = {
400: 512, 403: 256, 404: 512, 405: 256,
406: 512, 408: 512, 409: 512, 410: 256,
500: 512, 501: 512, 505: 512,
}
def _be_ie_unfriendly(status):
import cherrypy
response = cherrypy.response
# For some statuses, Internet Explorer 5+ shows "friendly error
# messages" instead of our response.body if the body is smaller
# than a given size. Fix this by returning a body over that size
# (by adding whitespace).
# See http://support.microsoft.com/kb/q218155/
s = _ie_friendly_error_sizes.get(status, 0)
if s:
s += 1
# Since we are issuing an HTTP error status, we assume that
# the entity is short, and we should just collapse it.
content = response.collapse_body()
l = len(content)
if l and l < s:
# IN ADDITION: the response must be written to IE
# in one chunk or it will still get replaced! Bah.
content = content + (" " * (s - l))
response.body = content
response.headers['Content-Length'] = len(content)
def format_exc(exc=None):
"""Return exc (or sys.exc_info if None), formatted."""
if exc is None:
exc = _exc_info()
if exc == (None, None, None):
return ""
import traceback
return "".join(traceback.format_exception(*exc))
def bare_error(extrabody=None):
"""Produce status, headers, body for a critical error.
Returns a triple without calling any other questionable functions,
so it should be as error-free as possible. Call it from an HTTP server
if you get errors outside of the request.
If extrabody is None, a friendly but rather unhelpful error message
is set in the body. If extrabody is a string, it will be appended
as-is to the body.
"""
# The whole point of this function is to be a last line-of-defense
# in handling errors. That is, it must not raise any errors itself;
# it cannot be allowed to fail. Therefore, don't add to it!
# In particular, don't call any other CP functions.
body = "Unrecoverable error in the server."
if extrabody is not None:
body += "\n" + extrabody
return ("500 Internal Server Error",
[('Content-Type', 'text/plain'),
('Content-Length', str(len(body)))],
[body])

View File

@@ -1,245 +0,0 @@
"""CherryPy logging."""
import datetime
import logging
# Silence the no-handlers "warning" (stderr write!) in stdlib logging
logging.Logger.manager.emittedNoHandlerWarning = 1
logfmt = logging.Formatter("%(message)s")
import os
import rfc822
import sys
import cherrypy
from cherrypy import _cperror
class LogManager(object):
appid = None
error_log = None
access_log = None
access_log_format = \
'%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
def __init__(self, appid=None, logger_root="cherrypy"):
self.logger_root = logger_root
self.appid = appid
if appid is None:
self.error_log = logging.getLogger("%s.error" % logger_root)
self.access_log = logging.getLogger("%s.access" % logger_root)
else:
self.error_log = logging.getLogger("%s.error.%s" % (logger_root, appid))
self.access_log = logging.getLogger("%s.access.%s" % (logger_root, appid))
self.error_log.setLevel(logging.DEBUG)
self.access_log.setLevel(logging.INFO)
cherrypy.engine.subscribe('graceful', self.reopen_files)
def reopen_files(self):
"""Close and reopen all file handlers."""
for log in (self.error_log, self.access_log):
for h in log.handlers:
if isinstance(h, logging.FileHandler):
h.acquire()
h.stream.close()
h.stream = open(h.baseFilename, h.mode)
h.release()
def error(self, msg='', context='', severity=logging.INFO, traceback=False):
"""Write to the error log.
This is not just for errors! Applications may call this at any time
to log application-specific information.
"""
if traceback:
msg += _cperror.format_exc()
self.error_log.log(severity, ' '.join((self.time(), context, msg)))
def __call__(self, *args, **kwargs):
"""Write to the error log.
This is not just for errors! Applications may call this at any time
to log application-specific information.
"""
return self.error(*args, **kwargs)
def access(self):
"""Write to the access log (in Apache/NCSA Combined Log format).
Like Apache started doing in 2.0.46, non-printable and other special
characters in %r (and we expand that to all parts) are escaped using
\\xhh sequences, where hh stands for the hexadecimal representation
of the raw byte. Exceptions from this rule are " and \\, which are
escaped by prepending a backslash, and all whitespace characters,
which are written in their C-style notation (\\n, \\t, etc).
"""
request = cherrypy.request
remote = request.remote
response = cherrypy.response
outheaders = response.headers
inheaders = request.headers
atoms = {'h': remote.name or remote.ip,
'l': '-',
'u': getattr(request, "login", None) or "-",
't': self.time(),
'r': request.request_line,
's': response.status.split(" ", 1)[0],
'b': outheaders.get('Content-Length', '') or "-",
'f': inheaders.get('Referer', ''),
'a': inheaders.get('User-Agent', ''),
}
for k, v in atoms.items():
if isinstance(v, unicode):
v = v.encode('utf8')
elif not isinstance(v, str):
v = str(v)
# Fortunately, repr(str) escapes unprintable chars, \n, \t, etc
# and backslash for us. All we have to do is strip the quotes.
v = repr(v)[1:-1]
# Escape double-quote.
atoms[k] = v.replace('"', '\\"')
try:
self.access_log.log(logging.INFO, self.access_log_format % atoms)
except:
self(traceback=True)
def time(self):
"""Return now() in Apache Common Log Format (no timezone)."""
now = datetime.datetime.now()
month = rfc822._monthnames[now.month - 1].capitalize()
return ('[%02d/%s/%04d:%02d:%02d:%02d]' %
(now.day, month, now.year, now.hour, now.minute, now.second))
def _get_builtin_handler(self, log, key):
for h in log.handlers:
if getattr(h, "_cpbuiltin", None) == key:
return h
# ------------------------- Screen handlers ------------------------- #
def _set_screen_handler(self, log, enable, stream=None):
h = self._get_builtin_handler(log, "screen")
if enable:
if not h:
if stream is None:
stream=sys.stderr
h = logging.StreamHandler(stream)
h.setFormatter(logfmt)
h._cpbuiltin = "screen"
log.addHandler(h)
elif h:
log.handlers.remove(h)
def _get_screen(self):
h = self._get_builtin_handler
has_h = h(self.error_log, "screen") or h(self.access_log, "screen")
return bool(has_h)
def _set_screen(self, newvalue):
self._set_screen_handler(self.error_log, newvalue, stream=sys.stderr)
self._set_screen_handler(self.access_log, newvalue, stream=sys.stdout)
screen = property(_get_screen, _set_screen,
doc="If True, error and access will print to stderr.")
# -------------------------- File handlers -------------------------- #
def _add_builtin_file_handler(self, log, fname):
h = logging.FileHandler(fname)
h.setFormatter(logfmt)
h._cpbuiltin = "file"
log.addHandler(h)
def _set_file_handler(self, log, filename):
h = self._get_builtin_handler(log, "file")
if filename:
if h:
if h.baseFilename != os.path.abspath(filename):
h.close()
log.handlers.remove(h)
self._add_builtin_file_handler(log, filename)
else:
self._add_builtin_file_handler(log, filename)
else:
if h:
h.close()
log.handlers.remove(h)
def _get_error_file(self):
h = self._get_builtin_handler(self.error_log, "file")
if h:
return h.baseFilename
return ''
def _set_error_file(self, newvalue):
self._set_file_handler(self.error_log, newvalue)
error_file = property(_get_error_file, _set_error_file,
doc="The filename for self.error_log.")
def _get_access_file(self):
h = self._get_builtin_handler(self.access_log, "file")
if h:
return h.baseFilename
return ''
def _set_access_file(self, newvalue):
self._set_file_handler(self.access_log, newvalue)
access_file = property(_get_access_file, _set_access_file,
doc="The filename for self.access_log.")
# ------------------------- WSGI handlers ------------------------- #
def _set_wsgi_handler(self, log, enable):
h = self._get_builtin_handler(log, "wsgi")
if enable:
if not h:
h = WSGIErrorHandler()
h.setFormatter(logfmt)
h._cpbuiltin = "wsgi"
log.addHandler(h)
elif h:
log.handlers.remove(h)
def _get_wsgi(self):
return bool(self._get_builtin_handler(self.error_log, "wsgi"))
def _set_wsgi(self, newvalue):
self._set_wsgi_handler(self.error_log, newvalue)
wsgi = property(_get_wsgi, _set_wsgi,
doc="If True, error messages will be sent to wsgi.errors.")
class WSGIErrorHandler(logging.Handler):
"A handler class which writes logging records to environ['wsgi.errors']."
def flush(self):
"""Flushes the stream."""
try:
stream = cherrypy.request.wsgi_environ.get('wsgi.errors')
except (AttributeError, KeyError):
pass
else:
stream.flush()
def emit(self, record):
"""Emit a record."""
try:
stream = cherrypy.request.wsgi_environ.get('wsgi.errors')
except (AttributeError, KeyError):
pass
else:
try:
msg = self.format(record)
fs = "%s\n"
import types
if not hasattr(types, "UnicodeType"): #if no unicode support...
stream.write(fs % msg)
else:
try:
stream.write(fs % msg)
except UnicodeError:
stream.write(fs % msg.encode("UTF-8"))
self.flush()
except:
self.handleError(record)

View File

@@ -1,330 +0,0 @@
"""Native adapter for serving CherryPy via mod_python
Basic usage:
##########################################
# Application in a module called myapp.py
##########################################
import cherrypy
class Root:
@cherrypy.expose
def index(self):
return 'Hi there, Ho there, Hey there'
# We will use this method from the mod_python configuration
# as the entry point to our application
def setup_server():
cherrypy.tree.mount(Root())
cherrypy.config.update({'environment': 'production',
'log.screen': False,
'show_tracebacks': False})
##########################################
# mod_python settings for apache2
# This should reside in your httpd.conf
# or a file that will be loaded at
# apache startup
##########################################
# Start
DocumentRoot "/"
Listen 8080
LoadModule python_module /usr/lib/apache2/modules/mod_python.so
<Location "/">
PythonPath "sys.path+['/path/to/my/application']"
SetHandler python-program
PythonHandler cherrypy._cpmodpy::handler
PythonOption cherrypy.setup myapp::setup_server
PythonDebug On
</Location>
# End
The actual path to your mod_python.so is dependent on your
environment. In this case we suppose a global mod_python
installation on a Linux distribution such as Ubuntu.
We do set the PythonPath configuration setting so that
your application can be found by from the user running
the apache2 instance. Of course if your application
resides in the global site-package this won't be needed.
Then restart apache2 and access http://127.0.0.1:8080
"""
import logging
import StringIO
import cherrypy
from cherrypy._cperror import format_exc, bare_error
from cherrypy.lib import http
# ------------------------------ Request-handling
def setup(req):
from mod_python import apache
# Run any setup function defined by a "PythonOption cherrypy.setup" directive.
options = req.get_options()
if 'cherrypy.setup' in options:
atoms = options['cherrypy.setup'].split('::', 1)
if len(atoms) == 1:
mod = __import__(atoms[0], globals(), locals())
else:
modname, fname = atoms
mod = __import__(modname, globals(), locals(), [fname])
func = getattr(mod, fname)
func()
cherrypy.config.update({'log.screen': False,
"tools.ignore_headers.on": True,
"tools.ignore_headers.headers": ['Range'],
})
engine = cherrypy.engine
if hasattr(engine, "signal_handler"):
engine.signal_handler.unsubscribe()
if hasattr(engine, "console_control_handler"):
engine.console_control_handler.unsubscribe()
engine.autoreload.unsubscribe()
cherrypy.server.unsubscribe()
def _log(msg, level):
newlevel = apache.APLOG_ERR
if logging.DEBUG >= level:
newlevel = apache.APLOG_DEBUG
elif logging.INFO >= level:
newlevel = apache.APLOG_INFO
elif logging.WARNING >= level:
newlevel = apache.APLOG_WARNING
# On Windows, req.server is required or the msg will vanish. See
# http://www.modpython.org/pipermail/mod_python/2003-October/014291.html.
# Also, "When server is not specified...LogLevel does not apply..."
apache.log_error(msg, newlevel, req.server)
engine.subscribe('log', _log)
engine.start()
def cherrypy_cleanup(data):
engine.exit()
try:
# apache.register_cleanup wasn't available until 3.1.4.
apache.register_cleanup(cherrypy_cleanup)
except AttributeError:
req.server.register_cleanup(req, cherrypy_cleanup)
class _ReadOnlyRequest:
expose = ('read', 'readline', 'readlines')
def __init__(self, req):
for method in self.expose:
self.__dict__[method] = getattr(req, method)
recursive = False
_isSetUp = False
def handler(req):
from mod_python import apache
try:
global _isSetUp
if not _isSetUp:
setup(req)
_isSetUp = True
# Obtain a Request object from CherryPy
local = req.connection.local_addr
local = http.Host(local[0], local[1], req.connection.local_host or "")
remote = req.connection.remote_addr
remote = http.Host(remote[0], remote[1], req.connection.remote_host or "")
scheme = req.parsed_uri[0] or 'http'
req.get_basic_auth_pw()
try:
# apache.mpm_query only became available in mod_python 3.1
q = apache.mpm_query
threaded = q(apache.AP_MPMQ_IS_THREADED)
forked = q(apache.AP_MPMQ_IS_FORKED)
except AttributeError:
bad_value = ("You must provide a PythonOption '%s', "
"either 'on' or 'off', when running a version "
"of mod_python < 3.1")
threaded = options.get('multithread', '').lower()
if threaded == 'on':
threaded = True
elif threaded == 'off':
threaded = False
else:
raise ValueError(bad_value % "multithread")
forked = options.get('multiprocess', '').lower()
if forked == 'on':
forked = True
elif forked == 'off':
forked = False
else:
raise ValueError(bad_value % "multiprocess")
sn = cherrypy.tree.script_name(req.uri or "/")
if sn is None:
send_response(req, '404 Not Found', [], '')
else:
app = cherrypy.tree.apps[sn]
method = req.method
path = req.uri
qs = req.args or ""
reqproto = req.protocol
headers = req.headers_in.items()
rfile = _ReadOnlyRequest(req)
prev = None
try:
redirections = []
while True:
request, response = app.get_serving(local, remote, scheme,
"HTTP/1.1")
request.login = req.user
request.multithread = bool(threaded)
request.multiprocess = bool(forked)
request.app = app
request.prev = prev
# Run the CherryPy Request object and obtain the response
try:
request.run(method, path, qs, reqproto, headers, rfile)
break
except cherrypy.InternalRedirect, ir:
app.release_serving()
prev = request
if not recursive:
if ir.path in redirections:
raise RuntimeError("InternalRedirector visited the "
"same URL twice: %r" % ir.path)
else:
# Add the *previous* path_info + qs to redirections.
if qs:
qs = "?" + qs
redirections.append(sn + path + qs)
# Munge environment and try again.
method = "GET"
path = ir.path
qs = ir.query_string
rfile = StringIO.StringIO()
send_response(req, response.status, response.header_list,
response.body, response.stream)
finally:
app.release_serving()
except:
tb = format_exc()
cherrypy.log(tb, 'MOD_PYTHON', severity=logging.ERROR)
s, h, b = bare_error()
send_response(req, s, h, b)
return apache.OK
def send_response(req, status, headers, body, stream=False):
# Set response status
req.status = int(status[:3])
# Set response headers
req.content_type = "text/plain"
for header, value in headers:
if header.lower() == 'content-type':
req.content_type = value
continue
req.headers_out.add(header, value)
if stream:
# Flush now so the status and headers are sent immediately.
req.flush()
# Set response body
if isinstance(body, basestring):
req.write(body)
else:
for seg in body:
req.write(seg)
# --------------- Startup tools for CherryPy + mod_python --------------- #
import os
import re
def read_process(cmd, args=""):
pipein, pipeout = os.popen4("%s %s" % (cmd, args))
try:
firstline = pipeout.readline()
if (re.search(r"(not recognized|No such file|not found)", firstline,
re.IGNORECASE)):
raise IOError('%s must be on your system path.' % cmd)
output = firstline + pipeout.read()
finally:
pipeout.close()
return output
class ModPythonServer(object):
template = """
# Apache2 server configuration file for running CherryPy with mod_python.
DocumentRoot "/"
Listen %(port)s
LoadModule python_module modules/mod_python.so
<Location %(loc)s>
SetHandler python-program
PythonHandler %(handler)s
PythonDebug On
%(opts)s
</Location>
"""
def __init__(self, loc="/", port=80, opts=None, apache_path="apache",
handler="cherrypy._cpmodpy::handler"):
self.loc = loc
self.port = port
self.opts = opts
self.apache_path = apache_path
self.handler = handler
def start(self):
opts = "".join([" PythonOption %s %s\n" % (k, v)
for k, v in self.opts])
conf_data = self.template % {"port": self.port,
"loc": self.loc,
"opts": opts,
"handler": self.handler,
}
mpconf = os.path.join(os.path.dirname(__file__), "cpmodpy.conf")
f = open(mpconf, 'wb')
try:
f.write(conf_data)
finally:
f.close()
response = read_process(self.apache_path, "-k start -f %s" % mpconf)
self.ready = True
return response
def stop(self):
os.popen("apache -k stop")
self.ready = False

View File

@@ -1,912 +0,0 @@
import Cookie
import os
import sys
import time
import types
import cherrypy
from cherrypy import _cpcgifs, _cpconfig
from cherrypy._cperror import format_exc, bare_error
from cherrypy.lib import http, file_generator
class Hook(object):
"""A callback and its metadata: failsafe, priority, and kwargs."""
__metaclass__ = cherrypy._AttributeDocstrings
callback = None
callback__doc = """
The bare callable that this Hook object is wrapping, which will
be called when the Hook is called."""
failsafe = False
failsafe__doc = """
If True, the callback is guaranteed to run even if other callbacks
from the same call point raise exceptions."""
priority = 50
priority__doc = """
Defines the order of execution for a list of Hooks. Priority numbers
should be limited to the closed interval [0, 100], but values outside
this range are acceptable, as are fractional values."""
kwargs = {}
kwargs__doc = """
A set of keyword arguments that will be passed to the
callable on each call."""
def __init__(self, callback, failsafe=None, priority=None, **kwargs):
self.callback = callback
if failsafe is None:
failsafe = getattr(callback, "failsafe", False)
self.failsafe = failsafe
if priority is None:
priority = getattr(callback, "priority", 50)
self.priority = priority
self.kwargs = kwargs
def __cmp__(self, other):
return cmp(self.priority, other.priority)
def __call__(self):
"""Run self.callback(**self.kwargs)."""
return self.callback(**self.kwargs)
def __repr__(self):
cls = self.__class__
return ("%s.%s(callback=%r, failsafe=%r, priority=%r, %s)"
% (cls.__module__, cls.__name__, self.callback,
self.failsafe, self.priority,
", ".join(['%s=%r' % (k, v)
for k, v in self.kwargs.iteritems()])))
class HookMap(dict):
"""A map of call points to lists of callbacks (Hook objects)."""
def __new__(cls, points=None):
d = dict.__new__(cls)
for p in points or []:
d[p] = []
return d
def __init__(self, *a, **kw):
pass
def attach(self, point, callback, failsafe=None, priority=None, **kwargs):
"""Append a new Hook made from the supplied arguments."""
self[point].append(Hook(callback, failsafe, priority, **kwargs))
def run(self, point):
"""Execute all registered Hooks (callbacks) for the given point."""
exc = None
hooks = self[point]
hooks.sort()
for hook in hooks:
# Some hooks are guaranteed to run even if others at
# the same hookpoint fail. We will still log the failure,
# but proceed on to the next hook. The only way
# to stop all processing from one of these hooks is
# to raise SystemExit and stop the whole server.
if exc is None or hook.failsafe:
try:
hook()
except (KeyboardInterrupt, SystemExit):
raise
except (cherrypy.HTTPError, cherrypy.HTTPRedirect,
cherrypy.InternalRedirect):
exc = sys.exc_info()[1]
except:
exc = sys.exc_info()[1]
cherrypy.log(traceback=True, severity=40)
if exc:
raise
def __copy__(self):
newmap = self.__class__()
# We can't just use 'update' because we want copies of the
# mutable values (each is a list) as well.
for k, v in self.iteritems():
newmap[k] = v[:]
return newmap
copy = __copy__
def __repr__(self):
cls = self.__class__
return "%s.%s(points=%r)" % (cls.__module__, cls.__name__, self.keys())
# Config namespace handlers
def hooks_namespace(k, v):
"""Attach bare hooks declared in config."""
# Use split again to allow multiple hooks for a single
# hookpoint per path (e.g. "hooks.before_handler.1").
# Little-known fact you only get from reading source ;)
hookpoint = k.split(".", 1)[0]
if isinstance(v, basestring):
v = cherrypy.lib.attributes(v)
if not isinstance(v, Hook):
v = Hook(v)
cherrypy.request.hooks[hookpoint].append(v)
def request_namespace(k, v):
"""Attach request attributes declared in config."""
setattr(cherrypy.request, k, v)
def response_namespace(k, v):
"""Attach response attributes declared in config."""
setattr(cherrypy.response, k, v)
def error_page_namespace(k, v):
"""Attach error pages declared in config."""
if k != 'default':
k = int(k)
cherrypy.request.error_page[k] = v
hookpoints = ['on_start_resource', 'before_request_body',
'before_handler', 'before_finalize',
'on_end_resource', 'on_end_request',
'before_error_response', 'after_error_response']
class Request(object):
"""An HTTP request.
This object represents the metadata of an HTTP request message;
that is, it contains attributes which describe the environment
in which the request URL, headers, and body were sent (if you
want tools to interpret the headers and body, those are elsewhere,
mostly in Tools). This 'metadata' consists of socket data,
transport characteristics, and the Request-Line. This object
also contains data regarding the configuration in effect for
the given URL, and the execution plan for generating a response.
"""
__metaclass__ = cherrypy._AttributeDocstrings
prev = None
prev__doc = """
The previous Request object (if any). This should be None
unless we are processing an InternalRedirect."""
# Conversation/connection attributes
local = http.Host("127.0.0.1", 80)
local__doc = \
"An http.Host(ip, port, hostname) object for the server socket."
remote = http.Host("127.0.0.1", 1111)
remote__doc = \
"An http.Host(ip, port, hostname) object for the client socket."
scheme = "http"
scheme__doc = """
The protocol used between client and server. In most cases,
this will be either 'http' or 'https'."""
server_protocol = "HTTP/1.1"
server_protocol__doc = """
The HTTP version for which the HTTP server is at least
conditionally compliant."""
base = ""
base__doc = """The (scheme://host) portion of the requested URL.
In some cases (e.g. when proxying via mod_rewrite), this may contain
path segments which cherrypy.url uses when constructing url's, but
which otherwise are ignored by CherryPy. Regardless, this value
MUST NOT end in a slash."""
# Request-Line attributes
request_line = ""
request_line__doc = """
The complete Request-Line received from the client. This is a
single string consisting of the request method, URI, and protocol
version (joined by spaces). Any final CRLF is removed."""
method = "GET"
method__doc = """
Indicates the HTTP method to be performed on the resource identified
by the Request-URI. Common methods include GET, HEAD, POST, PUT, and
DELETE. CherryPy allows any extension method; however, various HTTP
servers and gateways may restrict the set of allowable methods.
CherryPy applications SHOULD restrict the set (on a per-URI basis)."""
query_string = ""
query_string__doc = """
The query component of the Request-URI, a string of information to be
interpreted by the resource. The query portion of a URI follows the
path component, and is separated by a '?'. For example, the URI
'http://www.cherrypy.org/wiki?a=3&b=4' has the query component,
'a=3&b=4'."""
protocol = (1, 1)
protocol__doc = """The HTTP protocol version corresponding to the set
of features which should be allowed in the response. If BOTH
the client's request message AND the server's level of HTTP
compliance is HTTP/1.1, this attribute will be the tuple (1, 1).
If either is 1.0, this attribute will be the tuple (1, 0).
Lower HTTP protocol versions are not explicitly supported."""
params = {}
params__doc = """
A dict which combines query string (GET) and request entity (POST)
variables. This is populated in two stages: GET params are added
before the 'on_start_resource' hook, and POST params are added
between the 'before_request_body' and 'before_handler' hooks."""
# Message attributes
header_list = []
header_list__doc = """
A list of the HTTP request headers as (name, value) tuples.
In general, you should use request.headers (a dict) instead."""
headers = http.HeaderMap()
headers__doc = """
A dict-like object containing the request headers. Keys are header
names (in Title-Case format); however, you may get and set them in
a case-insensitive manner. That is, headers['Content-Type'] and
headers['content-type'] refer to the same value. Values are header
values (decoded according to RFC 2047 if necessary). See also:
http.HeaderMap, http.HeaderElement."""
cookie = Cookie.SimpleCookie()
cookie__doc = """See help(Cookie)."""
rfile = None
rfile__doc = """
If the request included an entity (body), it will be available
as a stream in this attribute. However, the rfile will normally
be read for you between the 'before_request_body' hook and the
'before_handler' hook, and the resulting string is placed into
either request.params or the request.body attribute.
You may disable the automatic consumption of the rfile by setting
request.process_request_body to False, either in config for the desired
path, or in an 'on_start_resource' or 'before_request_body' hook.
WARNING: In almost every case, you should not attempt to read from the
rfile stream after CherryPy's automatic mechanism has read it. If you
turn off the automatic parsing of rfile, you should read exactly the
number of bytes specified in request.headers['Content-Length'].
Ignoring either of these warnings may result in a hung request thread
or in corruption of the next (pipelined) request.
"""
process_request_body = True
process_request_body__doc = """
If True, the rfile (if any) is automatically read and parsed,
and the result placed into request.params or request.body."""
methods_with_bodies = ("POST", "PUT")
methods_with_bodies__doc = """
A sequence of HTTP methods for which CherryPy will automatically
attempt to read a body from the rfile."""
body = None
body__doc = """
If the request Content-Type is 'application/x-www-form-urlencoded'
or multipart, this will be None. Otherwise, this will contain the
request entity body as a string; this value is set between the
'before_request_body' and 'before_handler' hooks (assuming that
process_request_body is True)."""
body_params = None
body_params__doc = """
If the request Content-Type is 'application/x-www-form-urlencoded' or
multipart, this will be a dict of the params pulled from the entity
body; that is, it will be the portion of request.params that come
from the message body (sometimes called "POST params", although they
can be sent with various HTTP method verbs). This value is set between
the 'before_request_body' and 'before_handler' hooks (assuming that
process_request_body is True)."""
# Dispatch attributes
dispatch = cherrypy.dispatch.Dispatcher()
dispatch__doc = """
The object which looks up the 'page handler' callable and collects
config for the current request based on the path_info, other
request attributes, and the application architecture. The core
calls the dispatcher as early as possible, passing it a 'path_info'
argument.
The default dispatcher discovers the page handler by matching path_info
to a hierarchical arrangement of objects, starting at request.app.root.
See help(cherrypy.dispatch) for more information."""
script_name = ""
script_name__doc = """
The 'mount point' of the application which is handling this request.
This attribute MUST NOT end in a slash. If the script_name refers to
the root of the URI, it MUST be an empty string (not "/").
"""
path_info = "/"
path_info__doc = """
The 'relative path' portion of the Request-URI. This is relative
to the script_name ('mount point') of the application which is
handling this request."""
login = None
login__doc = """
When authentication is used during the request processing this is
set to 'False' if it failed and to the 'username' value if it succeeded.
The default 'None' implies that no authentication happened."""
# Note that cherrypy.url uses "if request.app:" to determine whether
# the call is during a real HTTP request or not. So leave this None.
app = None
app__doc = \
"""The cherrypy.Application object which is handling this request."""
handler = None
handler__doc = """
The function, method, or other callable which CherryPy will call to
produce the response. The discovery of the handler and the arguments
it will receive are determined by the request.dispatch object.
By default, the handler is discovered by walking a tree of objects
starting at request.app.root, and is then passed all HTTP params
(from the query string and POST body) as keyword arguments."""
toolmaps = {}
toolmaps__doc = """
A nested dict of all Toolboxes and Tools in effect for this request,
of the form: {Toolbox.namespace: {Tool.name: config dict}}."""
config = None
config__doc = """
A flat dict of all configuration entries which apply to the
current request. These entries are collected from global config,
application config (based on request.path_info), and from handler
config (exactly how is governed by the request.dispatch object in
effect for this request; by default, handler config can be attached
anywhere in the tree between request.app.root and the final handler,
and inherits downward)."""
is_index = None
is_index__doc = """
This will be True if the current request is mapped to an 'index'
resource handler (also, a 'default' handler if path_info ends with
a slash). The value may be used to automatically redirect the
user-agent to a 'more canonical' URL which either adds or removes
the trailing slash. See cherrypy.tools.trailing_slash."""
hooks = HookMap(hookpoints)
hooks__doc = """
A HookMap (dict-like object) of the form: {hookpoint: [hook, ...]}.
Each key is a str naming the hook point, and each value is a list
of hooks which will be called at that hook point during this request.
The list of hooks is generally populated as early as possible (mostly
from Tools specified in config), but may be extended at any time.
See also: _cprequest.Hook, _cprequest.HookMap, and cherrypy.tools."""
error_response = cherrypy.HTTPError(500).set_response
error_response__doc = """
The no-arg callable which will handle unexpected, untrapped errors
during request processing. This is not used for expected exceptions
(like NotFound, HTTPError, or HTTPRedirect) which are raised in
response to expected conditions (those should be customized either
via request.error_page or by overriding HTTPError.set_response).
By default, error_response uses HTTPError(500) to return a generic
error response to the user-agent."""
error_page = {}
error_page__doc = """
A dict of {error code: response filename or callable} pairs.
The error code must be an int representing a given HTTP error code,
or the string 'default', which will be used if no matching entry
is found for a given numeric code.
If a filename is provided, the file should contain a Python string-
formatting template, and can expect by default to receive format
values with the mapping keys %(status)s, %(message)s, %(traceback)s,
and %(version)s. The set of format mappings can be extended by
overriding HTTPError.set_response.
If a callable is provided, it will be called by default with keyword
arguments 'status', 'message', 'traceback', and 'version', as for a
string-formatting template. The callable must return a string which
will be set to response.body. It may also override headers or perform
any other processing.
If no entry is given for an error code, and no 'default' entry exists,
a default template will be used.
"""
show_tracebacks = True
show_tracebacks__doc = """
If True, unexpected errors encountered during request processing will
include a traceback in the response body."""
show_mismatched_params = True
show_mismatched_params__doc = """
If True, mismatched parameters encountered during PageHandler invocation
processing will be included in the response body."""
throws = (KeyboardInterrupt, SystemExit, cherrypy.InternalRedirect)
throws__doc = \
"""The sequence of exceptions which Request.run does not trap."""
throw_errors = False
throw_errors__doc = """
If True, Request.run will not trap any errors (except HTTPRedirect and
HTTPError, which are more properly called 'exceptions', not errors)."""
closed = False
closed__doc = """
True once the close method has been called, False otherwise."""
stage = None
stage__doc = """
A string containing the stage reached in the request-handling process.
This is useful when debugging a live server with hung requests."""
namespaces = _cpconfig.NamespaceSet(
**{"hooks": hooks_namespace,
"request": request_namespace,
"response": response_namespace,
"error_page": error_page_namespace,
"tools": cherrypy.tools,
})
def __init__(self, local_host, remote_host, scheme="http",
server_protocol="HTTP/1.1"):
"""Populate a new Request object.
local_host should be an http.Host object with the server info.
remote_host should be an http.Host object with the client info.
scheme should be a string, either "http" or "https".
"""
self.local = local_host
self.remote = remote_host
self.scheme = scheme
self.server_protocol = server_protocol
self.closed = False
# Put a *copy* of the class error_page into self.
self.error_page = self.error_page.copy()
# Put a *copy* of the class namespaces into self.
self.namespaces = self.namespaces.copy()
self.stage = None
def close(self):
"""Run cleanup code. (Core)"""
if not self.closed:
self.closed = True
self.stage = 'on_end_request'
self.hooks.run('on_end_request')
self.stage = 'close'
def run(self, method, path, query_string, req_protocol, headers, rfile):
"""Process the Request. (Core)
method, path, query_string, and req_protocol should be pulled directly
from the Request-Line (e.g. "GET /path?key=val HTTP/1.0").
path should be %XX-unquoted, but query_string should not be.
headers should be a list of (name, value) tuples.
rfile should be a file-like object containing the HTTP request entity.
When run() is done, the returned object should have 3 attributes:
status, e.g. "200 OK"
header_list, a list of (name, value) tuples
body, an iterable yielding strings
Consumer code (HTTP servers) should then access these response
attributes to build the outbound stream.
"""
self.stage = 'run'
try:
self.error_response = cherrypy.HTTPError(500).set_response
self.method = method
path = path or "/"
self.query_string = query_string or ''
# Compare request and server HTTP protocol versions, in case our
# server does not support the requested protocol. Limit our output
# to min(req, server). We want the following output:
# request server actual written supported response
# protocol protocol response protocol feature set
# a 1.0 1.0 1.0 1.0
# b 1.0 1.1 1.1 1.0
# c 1.1 1.0 1.0 1.0
# d 1.1 1.1 1.1 1.1
# Notice that, in (b), the response will be "HTTP/1.1" even though
# the client only understands 1.0. RFC 2616 10.5.6 says we should
# only return 505 if the _major_ version is different.
rp = int(req_protocol[5]), int(req_protocol[7])
sp = int(self.server_protocol[5]), int(self.server_protocol[7])
self.protocol = min(rp, sp)
# Rebuild first line of the request (e.g. "GET /path HTTP/1.0").
url = path
if query_string:
url += '?' + query_string
self.request_line = '%s %s %s' % (method, url, req_protocol)
self.header_list = list(headers)
self.rfile = rfile
self.headers = http.HeaderMap()
self.cookie = Cookie.SimpleCookie()
self.handler = None
# path_info should be the path from the
# app root (script_name) to the handler.
self.script_name = self.app.script_name
self.path_info = pi = path[len(self.script_name):]
self.stage = 'respond'
self.respond(pi)
except self.throws:
raise
except:
if self.throw_errors:
raise
else:
# Failure in setup, error handler or finalize. Bypass them.
# Can't use handle_error because we may not have hooks yet.
cherrypy.log(traceback=True, severity=40)
if self.show_tracebacks:
body = format_exc()
else:
body = ""
r = bare_error(body)
response = cherrypy.response
response.status, response.header_list, response.body = r
if self.method == "HEAD":
# HEAD requests MUST NOT return a message-body in the response.
cherrypy.response.body = []
try:
cherrypy.log.access()
except:
cherrypy.log.error(traceback=True)
if cherrypy.response.timed_out:
raise cherrypy.TimeoutError()
return cherrypy.response
def respond(self, path_info):
"""Generate a response for the resource at self.path_info. (Core)"""
try:
try:
try:
if self.app is None:
raise cherrypy.NotFound()
# Get the 'Host' header, so we can HTTPRedirect properly.
self.stage = 'process_headers'
self.process_headers()
# Make a copy of the class hooks
self.hooks = self.__class__.hooks.copy()
self.toolmaps = {}
self.stage = 'get_resource'
self.get_resource(path_info)
self.namespaces(self.config)
self.stage = 'on_start_resource'
self.hooks.run('on_start_resource')
if self.process_request_body:
if self.method not in self.methods_with_bodies:
self.process_request_body = False
self.stage = 'before_request_body'
self.hooks.run('before_request_body')
if self.process_request_body:
self.process_body()
self.stage = 'before_handler'
self.hooks.run('before_handler')
if self.handler:
self.stage = 'handler'
cherrypy.response.body = self.handler()
self.stage = 'before_finalize'
self.hooks.run('before_finalize')
cherrypy.response.finalize()
except (cherrypy.HTTPRedirect, cherrypy.HTTPError), inst:
inst.set_response()
self.stage = 'before_finalize (HTTPError)'
self.hooks.run('before_finalize')
cherrypy.response.finalize()
finally:
self.stage = 'on_end_resource'
self.hooks.run('on_end_resource')
except self.throws:
raise
except:
if self.throw_errors:
raise
self.handle_error()
def process_headers(self):
"""Parse HTTP header data into Python structures. (Core)"""
self.params = http.parse_query_string(self.query_string)
# Process the headers into self.headers
headers = self.headers
for name, value in self.header_list:
# Call title() now (and use dict.__method__(headers))
# so title doesn't have to be called twice.
name = name.title()
value = value.strip()
# Warning: if there is more than one header entry for cookies (AFAIK,
# only Konqueror does that), only the last one will remain in headers
# (but they will be correctly stored in request.cookie).
if "=?" in value:
dict.__setitem__(headers, name, http.decode_TEXT(value))
else:
dict.__setitem__(headers, name, value)
# Handle cookies differently because on Konqueror, multiple
# cookies come on different lines with the same key
if name == 'Cookie':
self.cookie.load(value)
if not dict.__contains__(headers, 'Host'):
# All Internet-based HTTP/1.1 servers MUST respond with a 400
# (Bad Request) status code to any HTTP/1.1 request message
# which lacks a Host header field.
if self.protocol >= (1, 1):
msg = "HTTP/1.1 requires a 'Host' request header."
raise cherrypy.HTTPError(400, msg)
host = dict.get(headers, 'Host')
if not host:
host = self.local.name or self.local.ip
self.base = "%s://%s" % (self.scheme, host)
def get_resource(self, path):
"""Call a dispatcher (which sets self.handler and .config). (Core)"""
dispatch = self.dispatch
# First, see if there is a custom dispatch at this URI. Custom
# dispatchers can only be specified in app.config, not in _cp_config
# (since custom dispatchers may not even have an app.root).
trail = path or "/"
while trail:
nodeconf = self.app.config.get(trail, {})
d = nodeconf.get("request.dispatch")
if d:
dispatch = d
break
lastslash = trail.rfind("/")
if lastslash == -1:
break
elif lastslash == 0 and trail != "/":
trail = "/"
else:
trail = trail[:lastslash]
# dispatch() should set self.handler and self.config
dispatch(path)
def process_body(self):
"""Convert request.rfile into request.params (or request.body). (Core)"""
if not self.headers.get("Content-Length", ""):
# No Content-Length header supplied (or it's 0).
# If we went ahead and called cgi.FieldStorage, it would hang,
# since it cannot determine when to stop reading from the socket.
# See http://www.cherrypy.org/ticket/493.
# See also http://www.cherrypy.org/ticket/650.
# Note also that we expect any HTTP server to have decoded
# any message-body that had a transfer-coding, and we expect
# the HTTP server to have supplied a Content-Length header
# which is valid for the decoded entity-body.
raise cherrypy.HTTPError(411)
# If the headers are missing "Content-Type" then add one
# with an empty value. This ensures that FieldStorage
# won't parse the request body for params if the client
# didn't provide a "Content-Type" header.
if 'Content-Type' not in self.headers:
h = http.HeaderMap(self.headers.items())
h['Content-Type'] = ''
else:
h = self.headers
try:
forms = _cpcgifs.FieldStorage(fp=self.rfile,
headers=h,
# FieldStorage only recognizes POST.
environ={'REQUEST_METHOD': "POST"},
keep_blank_values=1)
except Exception, e:
if e.__class__.__name__ == 'MaxSizeExceeded':
# Post data is too big
raise cherrypy.HTTPError(413)
else:
raise
# Note that, if headers['Content-Type'] is multipart/*,
# then forms.file will not exist; instead, each form[key]
# item will be its own file object, and will be handled
# by params_from_CGI_form.
if forms.file:
# request body was a content-type other than multipart.
self.body = forms.file
else:
self.body_params = p = http.params_from_CGI_form(forms)
self.params.update(p)
def handle_error(self):
"""Handle the last unanticipated exception. (Core)"""
try:
self.hooks.run("before_error_response")
if self.error_response:
self.error_response()
self.hooks.run("after_error_response")
cherrypy.response.finalize()
except cherrypy.HTTPRedirect, inst:
inst.set_response()
cherrypy.response.finalize()
class Body(object):
"""The body of the HTTP response (the response entity)."""
def __get__(self, obj, objclass=None):
if obj is None:
# When calling on the class instead of an instance...
return self
else:
return obj._body
def __set__(self, obj, value):
# Convert the given value to an iterable object.
if isinstance(value, basestring):
# strings get wrapped in a list because iterating over a single
# item list is much faster than iterating over every character
# in a long string.
if value:
value = [value]
else:
# [''] doesn't evaluate to False, so replace it with [].
value = []
elif isinstance(value, types.FileType):
value = file_generator(value)
elif value is None:
value = []
obj._body = value
class Response(object):
"""An HTTP Response, including status, headers, and body.
Application developers should use Response.headers (a dict) to
set or modify HTTP response headers. When the response is finalized,
Response.headers is transformed into Response.header_list as
(key, value) tuples.
"""
__metaclass__ = cherrypy._AttributeDocstrings
# Class attributes for dev-time introspection.
status = ""
status__doc = """The HTTP Status-Code and Reason-Phrase."""
header_list = []
header_list__doc = """
A list of the HTTP response headers as (name, value) tuples.
In general, you should use response.headers (a dict) instead."""
headers = http.HeaderMap()
headers__doc = """
A dict-like object containing the response headers. Keys are header
names (in Title-Case format); however, you may get and set them in
a case-insensitive manner. That is, headers['Content-Type'] and
headers['content-type'] refer to the same value. Values are header
values (decoded according to RFC 2047 if necessary). See also:
http.HeaderMap, http.HeaderElement."""
cookie = Cookie.SimpleCookie()
cookie__doc = """See help(Cookie)."""
body = Body()
body__doc = """The body (entity) of the HTTP response."""
time = None
time__doc = """The value of time.time() when created. Use in HTTP dates."""
timeout = 300
timeout__doc = """Seconds after which the response will be aborted."""
timed_out = False
timed_out__doc = """
Flag to indicate the response should be aborted, because it has
exceeded its timeout."""
stream = False
stream__doc = """If False, buffer the response body."""
def __init__(self):
self.status = None
self.header_list = None
self._body = []
self.time = time.time()
self.headers = http.HeaderMap()
# Since we know all our keys are titled strings, we can
# bypass HeaderMap.update and get a big speed boost.
dict.update(self.headers, {
"Content-Type": 'text/html',
"Server": "CherryPy/" + cherrypy.__version__,
"Date": http.HTTPDate(self.time),
})
self.cookie = Cookie.SimpleCookie()
def collapse_body(self):
"""Collapse self.body to a single string; replace it and return it."""
newbody = ''.join([chunk for chunk in self.body])
self.body = newbody
return newbody
def finalize(self):
"""Transform headers (and cookies) into self.header_list. (Core)"""
try:
code, reason, _ = http.valid_status(self.status)
except ValueError, x:
raise cherrypy.HTTPError(500, x.args[0])
self.status = "%s %s" % (code, reason)
headers = self.headers
if self.stream:
# The upshot: wsgiserver will chunk the response if
# you pop Content-Length (or set it explicitly to None).
# Note that lib.static sets C-L to the file's st_size.
if dict.get(headers, 'Content-Length') is None:
dict.pop(headers, 'Content-Length', None)
elif code < 200 or code in (204, 205, 304):
# "All 1xx (informational), 204 (no content),
# and 304 (not modified) responses MUST NOT
# include a message-body."
dict.pop(headers, 'Content-Length', None)
self.body = ""
else:
# Responses which are not streamed should have a Content-Length,
# but allow user code to set Content-Length if desired.
if dict.get(headers, 'Content-Length') is None:
content = self.collapse_body()
dict.__setitem__(headers, 'Content-Length', len(content))
# Transform our header dict into a list of tuples.
self.header_list = h = headers.output(cherrypy.request.protocol)
cookie = self.cookie.output()
if cookie:
for line in cookie.split("\n"):
if line.endswith("\r"):
# Python 2.4 emits cookies joined by LF but 2.5+ by CRLF.
line = line[:-1]
name, value = line.split(": ", 1)
h.append((name, value))
def check_timeout(self):
"""If now > self.time + self.timeout, set self.timed_out.
This purposefully sets a flag, rather than raising an error,
so that a monitor thread can interrupt the Response thread.
"""
if time.time() > self.time + self.timeout:
self.timed_out = True

View File

@@ -1,143 +0,0 @@
"""Manage HTTP servers with CherryPy."""
import warnings
import cherrypy
from cherrypy.lib import attributes
# We import * because we want to export check_port
# et al as attributes of this module.
from cherrypy.process.servers import *
class Server(ServerAdapter):
"""An adapter for an HTTP server.
You can set attributes (like socket_host and socket_port)
on *this* object (which is probably cherrypy.server), and call
quickstart. For example:
cherrypy.server.socket_port = 80
cherrypy.quickstart()
"""
socket_port = 8080
_socket_host = '127.0.0.1'
def _get_socket_host(self):
return self._socket_host
def _set_socket_host(self, value):
if value == '':
raise ValueError("The empty string ('') is not an allowed value. "
"Use '0.0.0.0' instead to listen on all active "
"interfaces (INADDR_ANY).")
self._socket_host = value
socket_host = property(_get_socket_host, _set_socket_host,
doc="""The hostname or IP address on which to listen for connections.
Host values may be any IPv4 or IPv6 address, or any valid hostname.
The string 'localhost' is a synonym for '127.0.0.1' (or '::1', if
your hosts file prefers IPv6). The string '0.0.0.0' is a special
IPv4 entry meaning "any active interface" (INADDR_ANY), and '::'
is the similar IN6ADDR_ANY for IPv6. The empty string or None are
not allowed.""")
socket_file = None
socket_queue_size = 5
socket_timeout = 10
shutdown_timeout = 5
protocol_version = 'HTTP/1.1'
reverse_dns = False
thread_pool = 10
thread_pool_max = -1
max_request_header_size = 500 * 1024
max_request_body_size = 100 * 1024 * 1024
instance = None
ssl_context = None
ssl_certificate = None
ssl_certificate_chain = None
ssl_private_key = None
nodelay = True
def __init__(self):
self.bus = cherrypy.engine
self.httpserver = None
self.interrupt = None
self.running = False
def quickstart(self, server=None):
"""This does nothing now and will be removed in 3.2."""
warnings.warn('quickstart does nothing now and will be removed in '
'3.2. Call cherrypy.engine.start() instead.',
DeprecationWarning)
def httpserver_from_self(self, httpserver=None):
"""Return a (httpserver, bind_addr) pair based on self attributes."""
if httpserver is None:
httpserver = self.instance
if httpserver is None:
from cherrypy import _cpwsgi_server
httpserver = _cpwsgi_server.CPWSGIServer(self)
if isinstance(httpserver, basestring):
# Is anyone using this? Can I add an arg?
httpserver = attributes(httpserver)(self)
return httpserver, self.bind_addr
def start(self):
"""Start the HTTP server."""
if not self.httpserver:
self.httpserver, self.bind_addr = self.httpserver_from_self()
ServerAdapter.start(self)
start.priority = 75
def _get_bind_addr(self):
if self.socket_file:
return self.socket_file
if self.socket_host is None and self.socket_port is None:
return None
return (self.socket_host, self.socket_port)
def _set_bind_addr(self, value):
if value is None:
self.socket_file = None
self.socket_host = None
self.socket_port = None
elif isinstance(value, basestring):
self.socket_file = value
self.socket_host = None
self.socket_port = None
else:
try:
self.socket_host, self.socket_port = value
self.socket_file = None
except ValueError:
raise ValueError("bind_addr must be a (host, port) tuple "
"(for TCP sockets) or a string (for Unix "
"domain sockets), not %r" % value)
bind_addr = property(_get_bind_addr, _set_bind_addr)
def base(self):
"""Return the base (scheme://host[:port] or sock file) for this server."""
if self.socket_file:
return self.socket_file
host = self.socket_host
if host in ('0.0.0.0', '::'):
# 0.0.0.0 is INADDR_ANY and :: is IN6ADDR_ANY.
# Look up the host name, which should be the
# safest thing to spit out in a URL.
import socket
host = socket.gethostname()
port = self.socket_port
if self.ssl_certificate:
scheme = "https"
if port != 443:
host += ":%s" % port
else:
scheme = "http"
if port != 80:
host += ":%s" % port
return "%s://%s" % (scheme, host)

View File

@@ -1,239 +0,0 @@
# This is a backport of Python-2.4's threading.local() implementation
"""Thread-local objects
(Note that this module provides a Python version of thread
threading.local class. Depending on the version of Python you're
using, there may be a faster one available. You should always import
the local class from threading.)
Thread-local objects support the management of thread-local data.
If you have data that you want to be local to a thread, simply create
a thread-local object and use its attributes:
>>> mydata = local()
>>> mydata.number = 42
>>> mydata.number
42
You can also access the local-object's dictionary:
>>> mydata.__dict__
{'number': 42}
>>> mydata.__dict__.setdefault('widgets', [])
[]
>>> mydata.widgets
[]
What's important about thread-local objects is that their data are
local to a thread. If we access the data in a different thread:
>>> log = []
>>> def f():
... items = mydata.__dict__.items()
... items.sort()
... log.append(items)
... mydata.number = 11
... log.append(mydata.number)
>>> import threading
>>> thread = threading.Thread(target=f)
>>> thread.start()
>>> thread.join()
>>> log
[[], 11]
we get different data. Furthermore, changes made in the other thread
don't affect data seen in this thread:
>>> mydata.number
42
Of course, values you get from a local object, including a __dict__
attribute, are for whatever thread was current at the time the
attribute was read. For that reason, you generally don't want to save
these values across threads, as they apply only to the thread they
came from.
You can create custom local objects by subclassing the local class:
>>> class MyLocal(local):
... number = 2
... initialized = False
... def __init__(self, **kw):
... if self.initialized:
... raise SystemError('__init__ called too many times')
... self.initialized = True
... self.__dict__.update(kw)
... def squared(self):
... return self.number ** 2
This can be useful to support default values, methods and
initialization. Note that if you define an __init__ method, it will be
called each time the local object is used in a separate thread. This
is necessary to initialize each thread's dictionary.
Now if we create a local object:
>>> mydata = MyLocal(color='red')
Now we have a default number:
>>> mydata.number
2
an initial color:
>>> mydata.color
'red'
>>> del mydata.color
And a method that operates on the data:
>>> mydata.squared()
4
As before, we can access the data in a separate thread:
>>> log = []
>>> thread = threading.Thread(target=f)
>>> thread.start()
>>> thread.join()
>>> log
[[('color', 'red'), ('initialized', True)], 11]
without affecting this thread's data:
>>> mydata.number
2
>>> mydata.color
Traceback (most recent call last):
...
AttributeError: 'MyLocal' object has no attribute 'color'
Note that subclasses can define slots, but they are not thread
local. They are shared across threads:
>>> class MyLocal(local):
... __slots__ = 'number'
>>> mydata = MyLocal()
>>> mydata.number = 42
>>> mydata.color = 'red'
So, the separate thread:
>>> thread = threading.Thread(target=f)
>>> thread.start()
>>> thread.join()
affects what we see:
>>> mydata.number
11
>>> del mydata
"""
# Threading import is at end
class _localbase(object):
__slots__ = '_local__key', '_local__args', '_local__lock'
def __new__(cls, *args, **kw):
self = object.__new__(cls)
key = 'thread.local.' + str(id(self))
object.__setattr__(self, '_local__key', key)
object.__setattr__(self, '_local__args', (args, kw))
object.__setattr__(self, '_local__lock', RLock())
if args or kw and (cls.__init__ is object.__init__):
raise TypeError("Initialization arguments are not supported")
# We need to create the thread dict in anticipation of
# __init__ being called, to make sure we don't call it
# again ourselves.
dict = object.__getattribute__(self, '__dict__')
currentThread().__dict__[key] = dict
return self
def _patch(self):
key = object.__getattribute__(self, '_local__key')
d = currentThread().__dict__.get(key)
if d is None:
d = {}
currentThread().__dict__[key] = d
object.__setattr__(self, '__dict__', d)
# we have a new instance dict, so call out __init__ if we have
# one
cls = type(self)
if cls.__init__ is not object.__init__:
args, kw = object.__getattribute__(self, '_local__args')
cls.__init__(self, *args, **kw)
else:
object.__setattr__(self, '__dict__', d)
class local(_localbase):
def __getattribute__(self, name):
lock = object.__getattribute__(self, '_local__lock')
lock.acquire()
try:
_patch(self)
return object.__getattribute__(self, name)
finally:
lock.release()
def __setattr__(self, name, value):
lock = object.__getattribute__(self, '_local__lock')
lock.acquire()
try:
_patch(self)
return object.__setattr__(self, name, value)
finally:
lock.release()
def __delattr__(self, name):
lock = object.__getattribute__(self, '_local__lock')
lock.acquire()
try:
_patch(self)
return object.__delattr__(self, name)
finally:
lock.release()
def __del__():
threading_enumerate = enumerate
__getattribute__ = object.__getattribute__
def __del__(self):
key = __getattribute__(self, '_local__key')
try:
threads = list(threading_enumerate())
except:
# if enumerate fails, as it seems to do during
# shutdown, we'll skip cleanup under the assumption
# that there is nothing to clean up
return
for thread in threads:
try:
__dict__ = thread.__dict__
except AttributeError:
# Thread is dying, rest in peace
continue
if key in __dict__:
try:
del __dict__[key]
except KeyError:
pass # didn't have anything in this thread
return __del__
__del__ = __del__()
from threading import currentThread, enumerate, RLock

View File

@@ -1,492 +0,0 @@
"""CherryPy tools. A "tool" is any helper, adapted to CP.
Tools are usually designed to be used in a variety of ways (although some
may only offer one if they choose):
Library calls:
All tools are callables that can be used wherever needed.
The arguments are straightforward and should be detailed within the
docstring.
Function decorators:
All tools, when called, may be used as decorators which configure
individual CherryPy page handlers (methods on the CherryPy tree).
That is, "@tools.anytool()" should "turn on" the tool via the
decorated function's _cp_config attribute.
CherryPy config:
If a tool exposes a "_setup" callable, it will be called
once per Request (if the feature is "turned on" via config).
Tools may be implemented as any object with a namespace. The builtins
are generally either modules or instances of the tools.Tool class.
"""
import cherrypy
def _getargs(func):
"""Return the names of all static arguments to the given function."""
# Use this instead of importing inspect for less mem overhead.
import types
if isinstance(func, types.MethodType):
func = func.im_func
co = func.func_code
return co.co_varnames[:co.co_argcount]
class Tool(object):
"""A registered function for use with CherryPy request-processing hooks.
help(tool.callable) should give you more information about this Tool.
"""
namespace = "tools"
def __init__(self, point, callable, name=None, priority=50):
self._point = point
self.callable = callable
self._name = name
self._priority = priority
self.__doc__ = self.callable.__doc__
self._setargs()
def _setargs(self):
"""Copy func parameter names to obj attributes."""
try:
for arg in _getargs(self.callable):
setattr(self, arg, None)
except (TypeError, AttributeError):
if hasattr(self.callable, "__call__"):
for arg in _getargs(self.callable.__call__):
setattr(self, arg, None)
# IronPython 1.0 raises NotImplementedError because
# inspect.getargspec tries to access Python bytecode
# in co_code attribute.
except NotImplementedError:
pass
# IronPython 1B1 may raise IndexError in some cases,
# but if we trap it here it doesn't prevent CP from working.
except IndexError:
pass
def _merged_args(self, d=None):
"""Return a dict of configuration entries for this Tool."""
if d:
conf = d.copy()
else:
conf = {}
tm = cherrypy.request.toolmaps[self.namespace]
if self._name in tm:
conf.update(tm[self._name])
if "on" in conf:
del conf["on"]
return conf
def __call__(self, *args, **kwargs):
"""Compile-time decorator (turn on the tool in config).
For example:
@tools.proxy()
def whats_my_base(self):
return cherrypy.request.base
whats_my_base.exposed = True
"""
if args:
raise TypeError("The %r Tool does not accept positional "
"arguments; you must use keyword arguments."
% self._name)
def tool_decorator(f):
if not hasattr(f, "_cp_config"):
f._cp_config = {}
subspace = self.namespace + "." + self._name + "."
f._cp_config[subspace + "on"] = True
for k, v in kwargs.iteritems():
f._cp_config[subspace + k] = v
return f
return tool_decorator
def _setup(self):
"""Hook this tool into cherrypy.request.
The standard CherryPy request object will automatically call this
method when the tool is "turned on" in config.
"""
conf = self._merged_args()
p = conf.pop("priority", None)
if p is None:
p = getattr(self.callable, "priority", self._priority)
cherrypy.request.hooks.attach(self._point, self.callable,
priority=p, **conf)
class HandlerTool(Tool):
"""Tool which is called 'before main', that may skip normal handlers.
If the tool successfully handles the request (by setting response.body),
if should return True. This will cause CherryPy to skip any 'normal' page
handler. If the tool did not handle the request, it should return False
to tell CherryPy to continue on and call the normal page handler. If the
tool is declared AS a page handler (see the 'handler' method), returning
False will raise NotFound.
"""
def __init__(self, callable, name=None):
Tool.__init__(self, 'before_handler', callable, name)
def handler(self, *args, **kwargs):
"""Use this tool as a CherryPy page handler.
For example:
class Root:
nav = tools.staticdir.handler(section="/nav", dir="nav",
root=absDir)
"""
def handle_func(*a, **kw):
handled = self.callable(*args, **self._merged_args(kwargs))
if not handled:
raise cherrypy.NotFound()
return cherrypy.response.body
handle_func.exposed = True
return handle_func
def _wrapper(self, **kwargs):
if self.callable(**kwargs):
cherrypy.request.handler = None
def _setup(self):
"""Hook this tool into cherrypy.request.
The standard CherryPy request object will automatically call this
method when the tool is "turned on" in config.
"""
conf = self._merged_args()
p = conf.pop("priority", None)
if p is None:
p = getattr(self.callable, "priority", self._priority)
cherrypy.request.hooks.attach(self._point, self._wrapper,
priority=p, **conf)
class HandlerWrapperTool(Tool):
"""Tool which wraps request.handler in a provided wrapper function.
The 'newhandler' arg must be a handler wrapper function that takes a
'next_handler' argument, plus *args and **kwargs. Like all page handler
functions, it must return an iterable for use as cherrypy.response.body.
For example, to allow your 'inner' page handlers to return dicts
which then get interpolated into a template:
def interpolator(next_handler, *args, **kwargs):
filename = cherrypy.request.config.get('template')
cherrypy.response.template = env.get_template(filename)
response_dict = next_handler(*args, **kwargs)
return cherrypy.response.template.render(**response_dict)
cherrypy.tools.jinja = HandlerWrapperTool(interpolator)
"""
def __init__(self, newhandler, point='before_handler', name=None, priority=50):
self.newhandler = newhandler
self._point = point
self._name = name
self._priority = priority
def callable(self):
innerfunc = cherrypy.request.handler
def wrap(*args, **kwargs):
return self.newhandler(innerfunc, *args, **kwargs)
cherrypy.request.handler = wrap
class ErrorTool(Tool):
"""Tool which is used to replace the default request.error_response."""
def __init__(self, callable, name=None):
Tool.__init__(self, None, callable, name)
def _wrapper(self):
self.callable(**self._merged_args())
def _setup(self):
"""Hook this tool into cherrypy.request.
The standard CherryPy request object will automatically call this
method when the tool is "turned on" in config.
"""
cherrypy.request.error_response = self._wrapper
# Builtin tools #
from cherrypy.lib import cptools, encoding, auth, static, tidy
from cherrypy.lib import sessions as _sessions, xmlrpc as _xmlrpc
from cherrypy.lib import caching as _caching, wsgiapp as _wsgiapp
class SessionTool(Tool):
"""Session Tool for CherryPy.
sessions.locking:
When 'implicit' (the default), the session will be locked for you,
just before running the page handler.
When 'early', the session will be locked before reading the request
body. This is off by default for safety reasons; for example,
a large upload would block the session, denying an AJAX
progress meter (see http://www.cherrypy.org/ticket/630).
When 'explicit' (or any other value), you need to call
cherrypy.session.acquire_lock() yourself before using
session data.
"""
def __init__(self):
# _sessions.init must be bound after headers are read
Tool.__init__(self, 'before_request_body', _sessions.init)
def _lock_session(self):
cherrypy.serving.session.acquire_lock()
def _setup(self):
"""Hook this tool into cherrypy.request.
The standard CherryPy request object will automatically call this
method when the tool is "turned on" in config.
"""
hooks = cherrypy.request.hooks
conf = self._merged_args()
p = conf.pop("priority", None)
if p is None:
p = getattr(self.callable, "priority", self._priority)
hooks.attach(self._point, self.callable, priority=p, **conf)
locking = conf.pop('locking', 'implicit')
if locking == 'implicit':
hooks.attach('before_handler', self._lock_session)
elif locking == 'early':
# Lock before the request body (but after _sessions.init runs!)
hooks.attach('before_request_body', self._lock_session,
priority=60)
else:
# Don't lock
pass
hooks.attach('before_finalize', _sessions.save)
hooks.attach('on_end_request', _sessions.close)
def regenerate(self):
"""Drop the current session and make a new one (with a new id)."""
sess = cherrypy.serving.session
sess.regenerate()
# Grab cookie-relevant tool args
conf = dict([(k, v) for k, v in self._merged_args().iteritems()
if k in ('path', 'path_header', 'name', 'timeout',
'domain', 'secure')])
_sessions.set_response_cookie(**conf)
class XMLRPCController(object):
"""A Controller (page handler collection) for XML-RPC.
To use it, have your controllers subclass this base class (it will
turn on the tool for you).
You can also supply the following optional config entries:
tools.xmlrpc.encoding: 'utf-8'
tools.xmlrpc.allow_none: 0
XML-RPC is a rather discontinuous layer over HTTP; dispatching to the
appropriate handler must first be performed according to the URL, and
then a second dispatch step must take place according to the RPC method
specified in the request body. It also allows a superfluous "/RPC2"
prefix in the URL, supplies its own handler args in the body, and
requires a 200 OK "Fault" response instead of 404 when the desired
method is not found.
Therefore, XML-RPC cannot be implemented for CherryPy via a Tool alone.
This Controller acts as the dispatch target for the first half (based
on the URL); it then reads the RPC method from the request body and
does its own second dispatch step based on that method. It also reads
body params, and returns a Fault on error.
The XMLRPCDispatcher strips any /RPC2 prefix; if you aren't using /RPC2
in your URL's, you can safely skip turning on the XMLRPCDispatcher.
Otherwise, you need to use declare it in config:
request.dispatch: cherrypy.dispatch.XMLRPCDispatcher()
"""
# Note we're hard-coding this into the 'tools' namespace. We could do
# a huge amount of work to make it relocatable, but the only reason why
# would be if someone actually disabled the default_toolbox. Meh.
_cp_config = {'tools.xmlrpc.on': True}
def default(self, *vpath, **params):
rpcparams, rpcmethod = _xmlrpc.process_body()
subhandler = self
for attr in str(rpcmethod).split('.'):
subhandler = getattr(subhandler, attr, None)
if subhandler and getattr(subhandler, "exposed", False):
body = subhandler(*(vpath + rpcparams), **params)
else:
# http://www.cherrypy.org/ticket/533
# if a method is not found, an xmlrpclib.Fault should be returned
# raising an exception here will do that; see
# cherrypy.lib.xmlrpc.on_error
raise Exception, 'method "%s" is not supported' % attr
conf = cherrypy.request.toolmaps['tools'].get("xmlrpc", {})
_xmlrpc.respond(body,
conf.get('encoding', 'utf-8'),
conf.get('allow_none', 0))
return cherrypy.response.body
default.exposed = True
class WSGIAppTool(HandlerTool):
"""A tool for running any WSGI middleware/application within CP.
Here are the parameters:
wsgi_app - any wsgi application callable
env_update - a dictionary with arbitrary keys and values to be
merged with the WSGI environ dictionary.
Example:
class Whatever:
_cp_config = {'tools.wsgiapp.on': True,
'tools.wsgiapp.app': some_app,
'tools.wsgiapp.env': app_environ,
}
"""
def _setup(self):
# Keep request body intact so the wsgi app can have its way with it.
cherrypy.request.process_request_body = False
HandlerTool._setup(self)
class SessionAuthTool(HandlerTool):
def _setargs(self):
for name in dir(cptools.SessionAuth):
if not name.startswith("__"):
setattr(self, name, None)
class CachingTool(Tool):
"""Caching Tool for CherryPy."""
def _wrapper(self, invalid_methods=("POST", "PUT", "DELETE"), **kwargs):
request = cherrypy.request
if not hasattr(cherrypy, "_cache"):
# Make a process-wide Cache object.
cherrypy._cache = kwargs.pop("cache_class", _caching.MemoryCache)()
# Take all remaining kwargs and set them on the Cache object.
for k, v in kwargs.iteritems():
setattr(cherrypy._cache, k, v)
if _caching.get(invalid_methods=invalid_methods):
request.handler = None
else:
if request.cacheable:
# Note the devious technique here of adding hooks on the fly
request.hooks.attach('before_finalize', _caching.tee_output,
priority = 90)
_wrapper.priority = 20
def _setup(self):
"""Hook caching into cherrypy.request."""
conf = self._merged_args()
p = conf.pop("priority", None)
cherrypy.request.hooks.attach('before_handler', self._wrapper,
priority=p, **conf)
class Toolbox(object):
"""A collection of Tools.
This object also functions as a config namespace handler for itself.
Custom toolboxes should be added to each Application's toolboxes dict.
"""
def __init__(self, namespace):
self.namespace = namespace
def __setattr__(self, name, value):
# If the Tool._name is None, supply it from the attribute name.
if isinstance(value, Tool):
if value._name is None:
value._name = name
value.namespace = self.namespace
object.__setattr__(self, name, value)
def __enter__(self):
"""Populate request.toolmaps from tools specified in config."""
cherrypy.request.toolmaps[self.namespace] = map = {}
def populate(k, v):
toolname, arg = k.split(".", 1)
bucket = map.setdefault(toolname, {})
bucket[arg] = v
return populate
def __exit__(self, exc_type, exc_val, exc_tb):
"""Run tool._setup() for each tool in our toolmap."""
map = cherrypy.request.toolmaps.get(self.namespace)
if map:
for name, settings in map.items():
if settings.get("on", False):
tool = getattr(self, name)
tool._setup()
default_toolbox = _d = Toolbox("tools")
_d.session_auth = SessionAuthTool(cptools.session_auth)
_d.proxy = Tool('before_request_body', cptools.proxy, priority=30)
_d.response_headers = Tool('on_start_resource', cptools.response_headers)
_d.log_tracebacks = Tool('before_error_response', cptools.log_traceback)
_d.log_headers = Tool('before_error_response', cptools.log_request_headers)
_d.log_hooks = Tool('on_end_request', cptools.log_hooks, priority=100)
_d.err_redirect = ErrorTool(cptools.redirect)
_d.etags = Tool('before_finalize', cptools.validate_etags, priority=75)
_d.decode = Tool('before_handler', encoding.decode)
# the order of encoding, gzip, caching is important
_d.encode = Tool('before_finalize', encoding.encode, priority=70)
_d.gzip = Tool('before_finalize', encoding.gzip, priority=80)
_d.staticdir = HandlerTool(static.staticdir)
_d.staticfile = HandlerTool(static.staticfile)
_d.sessions = SessionTool()
_d.xmlrpc = ErrorTool(_xmlrpc.on_error)
_d.wsgiapp = WSGIAppTool(_wsgiapp.run)
_d.caching = CachingTool('before_handler', _caching.get, 'caching')
_d.expires = Tool('before_finalize', _caching.expires)
_d.tidy = Tool('before_finalize', tidy.tidy)
_d.nsgmls = Tool('before_finalize', tidy.nsgmls)
_d.ignore_headers = Tool('before_request_body', cptools.ignore_headers)
_d.referer = Tool('before_request_body', cptools.referer)
_d.basic_auth = Tool('on_start_resource', auth.basic_auth)
_d.digest_auth = Tool('on_start_resource', auth.digest_auth)
_d.trailing_slash = Tool('before_handler', cptools.trailing_slash, priority=60)
_d.flatten = Tool('before_finalize', cptools.flatten)
_d.accept = Tool('on_start_resource', cptools.accept)
_d.redirect = Tool('on_start_resource', cptools.redirect)
del _d, cptools, encoding, auth, static, tidy

View File

@@ -1,248 +0,0 @@
"""CherryPy Application and Tree objects."""
import os
import cherrypy
from cherrypy import _cpconfig, _cplogging, _cprequest, _cpwsgi, tools
from cherrypy.lib import http as _http
class Application(object):
"""A CherryPy Application.
Servers and gateways should not instantiate Request objects directly.
Instead, they should ask an Application object for a request object.
An instance of this class may also be used as a WSGI callable
(WSGI application object) for itself.
"""
__metaclass__ = cherrypy._AttributeDocstrings
root = None
root__doc = """
The top-most container of page handlers for this app. Handlers should
be arranged in a hierarchy of attributes, matching the expected URI
hierarchy; the default dispatcher then searches this hierarchy for a
matching handler. When using a dispatcher other than the default,
this value may be None."""
config = {}
config__doc = """
A dict of {path: pathconf} pairs, where 'pathconf' is itself a dict
of {key: value} pairs."""
namespaces = _cpconfig.NamespaceSet()
toolboxes = {'tools': cherrypy.tools}
log = None
log__doc = """A LogManager instance. See _cplogging."""
wsgiapp = None
wsgiapp__doc = """A CPWSGIApp instance. See _cpwsgi."""
request_class = _cprequest.Request
response_class = _cprequest.Response
relative_urls = False
def __init__(self, root, script_name="", config=None):
self.log = _cplogging.LogManager(id(self), cherrypy.log.logger_root)
self.root = root
self.script_name = script_name
self.wsgiapp = _cpwsgi.CPWSGIApp(self)
self.namespaces = self.namespaces.copy()
self.namespaces["log"] = lambda k, v: setattr(self.log, k, v)
self.namespaces["wsgi"] = self.wsgiapp.namespace_handler
self.config = self.__class__.config.copy()
if config:
self.merge(config)
def __repr__(self):
return "%s.%s(%r, %r)" % (self.__module__, self.__class__.__name__,
self.root, self.script_name)
script_name__doc = """
The URI "mount point" for this app. A mount point is that portion of
the URI which is constant for all URIs that are serviced by this
application; it does not include scheme, host, or proxy ("virtual host")
portions of the URI.
For example, if script_name is "/my/cool/app", then the URL
"http://www.example.com/my/cool/app/page1" might be handled by a
"page1" method on the root object.
The value of script_name MUST NOT end in a slash. If the script_name
refers to the root of the URI, it MUST be an empty string (not "/").
If script_name is explicitly set to None, then the script_name will be
provided for each call from request.wsgi_environ['SCRIPT_NAME'].
"""
def _get_script_name(self):
if self._script_name is None:
# None signals that the script name should be pulled from WSGI environ.
return cherrypy.request.wsgi_environ['SCRIPT_NAME'].rstrip("/")
return self._script_name
def _set_script_name(self, value):
if value:
value = value.rstrip("/")
self._script_name = value
script_name = property(fget=_get_script_name, fset=_set_script_name,
doc=script_name__doc)
def merge(self, config):
"""Merge the given config into self.config."""
_cpconfig.merge(self.config, config)
# Handle namespaces specified in config.
self.namespaces(self.config.get("/", {}))
def get_serving(self, local, remote, scheme, sproto):
"""Create and return a Request and Response object."""
req = self.request_class(local, remote, scheme, sproto)
req.app = self
for name, toolbox in self.toolboxes.iteritems():
req.namespaces[name] = toolbox
resp = self.response_class()
cherrypy.serving.load(req, resp)
cherrypy.engine.timeout_monitor.acquire()
cherrypy.engine.publish('acquire_thread')
return req, resp
def release_serving(self):
"""Release the current serving (request and response)."""
req = cherrypy.serving.request
cherrypy.engine.timeout_monitor.release()
try:
req.close()
except:
cherrypy.log(traceback=True, severity=40)
cherrypy.serving.clear()
def __call__(self, environ, start_response):
return self.wsgiapp(environ, start_response)
class Tree(object):
"""A registry of CherryPy applications, mounted at diverse points.
An instance of this class may also be used as a WSGI callable
(WSGI application object), in which case it dispatches to all
mounted apps.
"""
apps = {}
apps__doc = """
A dict of the form {script name: application}, where "script name"
is a string declaring the URI mount point (no trailing slash), and
"application" is an instance of cherrypy.Application (or an arbitrary
WSGI callable if you happen to be using a WSGI server)."""
def __init__(self):
self.apps = {}
def mount(self, root, script_name="", config=None):
"""Mount a new app from a root object, script_name, and config.
root: an instance of a "controller class" (a collection of page
handler methods) which represents the root of the application.
This may also be an Application instance, or None if using
a dispatcher other than the default.
script_name: a string containing the "mount point" of the application.
This should start with a slash, and be the path portion of the
URL at which to mount the given root. For example, if root.index()
will handle requests to "http://www.example.com:8080/dept/app1/",
then the script_name argument would be "/dept/app1".
It MUST NOT end in a slash. If the script_name refers to the
root of the URI, it MUST be an empty string (not "/").
config: a file or dict containing application config.
"""
if script_name is None:
raise TypeError(
"The 'script_name' argument may not be None. Application "
"objects may, however, possess a script_name of None (in "
"order to inpect the WSGI environ for SCRIPT_NAME upon each "
"request). You cannot mount such Applications on this Tree; "
"you must pass them to a WSGI server interface directly.")
# Next line both 1) strips trailing slash and 2) maps "/" -> "".
script_name = script_name.rstrip("/")
if isinstance(root, Application):
app = root
if script_name != "" and script_name != app.script_name:
raise ValueError, "Cannot specify a different script name and pass an Application instance to cherrypy.mount"
script_name = app.script_name
else:
app = Application(root, script_name)
# If mounted at "", add favicon.ico
if (script_name == "" and root is not None
and not hasattr(root, "favicon_ico")):
favicon = os.path.join(os.getcwd(), os.path.dirname(__file__),
"favicon.ico")
root.favicon_ico = tools.staticfile.handler(favicon)
if config:
app.merge(config)
self.apps[script_name] = app
return app
def graft(self, wsgi_callable, script_name=""):
"""Mount a wsgi callable at the given script_name."""
# Next line both 1) strips trailing slash and 2) maps "/" -> "".
script_name = script_name.rstrip("/")
self.apps[script_name] = wsgi_callable
def script_name(self, path=None):
"""The script_name of the app at the given path, or None.
If path is None, cherrypy.request is used.
"""
if path is None:
try:
path = _http.urljoin(cherrypy.request.script_name,
cherrypy.request.path_info)
except AttributeError:
return None
while True:
if path in self.apps:
return path
if path == "":
return None
# Move one node up the tree and try again.
path = path[:path.rfind("/")]
def __call__(self, environ, start_response):
# If you're calling this, then you're probably setting SCRIPT_NAME
# to '' (some WSGI servers always set SCRIPT_NAME to '').
# Try to look up the app using the full path.
path = _http.urljoin(environ.get('SCRIPT_NAME', ''),
environ.get('PATH_INFO', ''))
sn = self.script_name(path or "/")
if sn is None:
start_response('404 Not Found', [])
return []
app = self.apps[sn]
# Correct the SCRIPT_NAME and PATH_INFO environ entries.
environ = environ.copy()
environ['SCRIPT_NAME'] = sn
environ['PATH_INFO'] = path[len(sn.rstrip("/")):]
return app(environ, start_response)

View File

@@ -1,330 +0,0 @@
"""WSGI interface (see PEP 333)."""
import StringIO as _StringIO
import sys as _sys
import cherrypy as _cherrypy
from cherrypy import _cperror
from cherrypy.lib import http as _http
class VirtualHost(object):
"""Select a different WSGI application based on the Host header.
This can be useful when running multiple sites within one CP server.
It allows several domains to point to different applications. For example:
root = Root()
RootApp = cherrypy.Application(root)
Domain2App = cherrypy.Application(root)
SecureApp = cherrypy.Application(Secure())
vhost = cherrypy._cpwsgi.VirtualHost(RootApp,
domains={'www.domain2.example': Domain2App,
'www.domain2.example:443': SecureApp,
})
cherrypy.tree.graft(vhost)
default: required. The default WSGI application.
use_x_forwarded_host: if True (the default), any "X-Forwarded-Host"
request header will be used instead of the "Host" header. This
is commonly added by HTTP servers (such as Apache) when proxying.
domains: a dict of {host header value: application} pairs.
The incoming "Host" request header is looked up in this dict,
and, if a match is found, the corresponding WSGI application
will be called instead of the default. Note that you often need
separate entries for "example.com" and "www.example.com".
In addition, "Host" headers may contain the port number.
"""
def __init__(self, default, domains=None, use_x_forwarded_host=True):
self.default = default
self.domains = domains or {}
self.use_x_forwarded_host = use_x_forwarded_host
def __call__(self, environ, start_response):
domain = environ.get('HTTP_HOST', '')
if self.use_x_forwarded_host:
domain = environ.get("HTTP_X_FORWARDED_HOST", domain)
nextapp = self.domains.get(domain)
if nextapp is None:
nextapp = self.default
return nextapp(environ, start_response)
# WSGI-to-CP Adapter #
class AppResponse(object):
throws = (KeyboardInterrupt, SystemExit)
request = None
def __init__(self, environ, start_response, cpapp, recursive=False):
self.redirections = []
self.recursive = recursive
self.environ = environ
self.start_response = start_response
self.cpapp = cpapp
self.setapp()
def setapp(self):
try:
self.request = self.get_request()
s, h, b = self.get_response()
self.iter_response = iter(b)
self.write = self.start_response(s, h)
except self.throws:
self.close()
raise
except _cherrypy.InternalRedirect, ir:
self.environ['cherrypy.previous_request'] = _cherrypy.serving.request
self.close()
self.iredirect(ir.path, ir.query_string)
return
except:
if getattr(self.request, "throw_errors", False):
self.close()
raise
tb = _cperror.format_exc()
_cherrypy.log(tb, severity=40)
if not getattr(self.request, "show_tracebacks", True):
tb = ""
s, h, b = _cperror.bare_error(tb)
self.iter_response = iter(b)
try:
self.start_response(s, h, _sys.exc_info())
except:
# "The application must not trap any exceptions raised by
# start_response, if it called start_response with exc_info.
# Instead, it should allow such exceptions to propagate
# back to the server or gateway."
# But we still log and call close() to clean up ourselves.
_cherrypy.log(traceback=True, severity=40)
self.close()
raise
def iredirect(self, path, query_string):
"""Doctor self.environ and perform an internal redirect.
When cherrypy.InternalRedirect is raised, this method is called.
It rewrites the WSGI environ using the new path and query_string,
and calls a new CherryPy Request object. Because the wsgi.input
stream may have already been consumed by the next application,
the redirected call will always be of HTTP method "GET"; therefore,
any params must be passed in the query_string argument, which is
formed from InternalRedirect.query_string when using that exception.
If you need something more complicated, make and raise your own
exception and write your own AppResponse subclass to trap it. ;)
It would be a bad idea to redirect after you've already yielded
response content, although an enterprising soul could choose
to abuse this.
"""
env = self.environ
if not self.recursive:
sn = env.get('SCRIPT_NAME', '')
qs = query_string
if qs:
qs = "?" + qs
if sn + path + qs in self.redirections:
raise RuntimeError("InternalRedirector visited the "
"same URL twice: %r + %r + %r" %
(sn, path, qs))
else:
# Add the *previous* path_info + qs to redirections.
p = env.get('PATH_INFO', '')
qs = env.get('QUERY_STRING', '')
if qs:
qs = "?" + qs
self.redirections.append(sn + p + qs)
# Munge environment and try again.
env['REQUEST_METHOD'] = "GET"
env['PATH_INFO'] = path
env['QUERY_STRING'] = query_string
env['wsgi.input'] = _StringIO.StringIO()
env['CONTENT_LENGTH'] = "0"
self.setapp()
def __iter__(self):
return self
def next(self):
try:
chunk = self.iter_response.next()
# WSGI requires all data to be of type "str". This coercion should
# not take any time at all if chunk is already of type "str".
# If it's unicode, it could be a big performance hit (x ~500).
if not isinstance(chunk, str):
chunk = chunk.encode("ISO-8859-1")
return chunk
except self.throws:
self.close()
raise
except _cherrypy.InternalRedirect, ir:
self.environ['cherrypy.previous_request'] = _cherrypy.serving.request
self.close()
self.iredirect(ir.path, ir.query_string)
except StopIteration:
raise
except:
if getattr(self.request, "throw_errors", False):
self.close()
raise
tb = _cperror.format_exc()
_cherrypy.log(tb, severity=40)
if not getattr(self.request, "show_tracebacks", True):
tb = ""
s, h, b = _cperror.bare_error(tb)
# Empty our iterable (so future calls raise StopIteration)
self.iter_response = iter([])
try:
self.start_response(s, h, _sys.exc_info())
except:
# "The application must not trap any exceptions raised by
# start_response, if it called start_response with exc_info.
# Instead, it should allow such exceptions to propagate
# back to the server or gateway."
# But we still log and call close() to clean up ourselves.
_cherrypy.log(traceback=True, severity=40)
self.close()
raise
return "".join(b)
def close(self):
"""Close and de-reference the current request and response. (Core)"""
self.cpapp.release_serving()
def get_response(self):
"""Run self.request and return its response."""
meth = self.environ['REQUEST_METHOD']
path = _http.urljoin(self.environ.get('SCRIPT_NAME', ''),
self.environ.get('PATH_INFO', ''))
qs = self.environ.get('QUERY_STRING', '')
rproto = self.environ.get('SERVER_PROTOCOL')
headers = self.translate_headers(self.environ)
rfile = self.environ['wsgi.input']
response = self.request.run(meth, path, qs, rproto, headers, rfile)
return response.status, response.header_list, response.body
def get_request(self):
"""Create a Request object using environ."""
env = self.environ.get
local = _http.Host('', int(env('SERVER_PORT', 80)),
env('SERVER_NAME', ''))
remote = _http.Host(env('REMOTE_ADDR', ''),
int(env('REMOTE_PORT', -1)),
env('REMOTE_HOST', ''))
scheme = env('wsgi.url_scheme')
sproto = env('ACTUAL_SERVER_PROTOCOL', "HTTP/1.1")
request, resp = self.cpapp.get_serving(local, remote, scheme, sproto)
# LOGON_USER is served by IIS, and is the name of the
# user after having been mapped to a local account.
# Both IIS and Apache set REMOTE_USER, when possible.
request.login = env('LOGON_USER') or env('REMOTE_USER') or None
request.multithread = self.environ['wsgi.multithread']
request.multiprocess = self.environ['wsgi.multiprocess']
request.wsgi_environ = self.environ
request.prev = env('cherrypy.previous_request', None)
return request
headerNames = {'HTTP_CGI_AUTHORIZATION': 'Authorization',
'CONTENT_LENGTH': 'Content-Length',
'CONTENT_TYPE': 'Content-Type',
'REMOTE_HOST': 'Remote-Host',
'REMOTE_ADDR': 'Remote-Addr',
}
def translate_headers(self, environ):
"""Translate CGI-environ header names to HTTP header names."""
for cgiName in environ:
# We assume all incoming header keys are uppercase already.
if cgiName in self.headerNames:
yield self.headerNames[cgiName], environ[cgiName]
elif cgiName[:5] == "HTTP_":
# Hackish attempt at recovering original header names.
translatedHeader = cgiName[5:].replace("_", "-")
yield translatedHeader, environ[cgiName]
class CPWSGIApp(object):
"""A WSGI application object for a CherryPy Application.
pipeline: a list of (name, wsgiapp) pairs. Each 'wsgiapp' MUST be a
constructor that takes an initial, positional 'nextapp' argument,
plus optional keyword arguments, and returns a WSGI application
(that takes environ and start_response arguments). The 'name' can
be any you choose, and will correspond to keys in self.config.
head: rather than nest all apps in the pipeline on each call, it's only
done the first time, and the result is memoized into self.head. Set
this to None again if you change self.pipeline after calling self.
config: a dict whose keys match names listed in the pipeline. Each
value is a further dict which will be passed to the corresponding
named WSGI callable (from the pipeline) as keyword arguments.
"""
pipeline = []
head = None
config = {}
response_class = AppResponse
def __init__(self, cpapp, pipeline=None):
self.cpapp = cpapp
self.pipeline = self.pipeline[:]
if pipeline:
self.pipeline.extend(pipeline)
self.config = self.config.copy()
def tail(self, environ, start_response):
"""WSGI application callable for the actual CherryPy application.
You probably shouldn't call this; call self.__call__ instead,
so that any WSGI middleware in self.pipeline can run first.
"""
return self.response_class(environ, start_response, self.cpapp)
def __call__(self, environ, start_response):
head = self.head
if head is None:
# Create and nest the WSGI apps in our pipeline (in reverse order).
# Then memoize the result in self.head.
head = self.tail
for name, callable in self.pipeline[::-1]:
conf = self.config.get(name, {})
head = callable(head, **conf)
self.head = head
return head(environ, start_response)
def namespace_handler(self, k, v):
"""Config handler for the 'wsgi' namespace."""
if k == "pipeline":
# Note this allows multiple 'wsgi.pipeline' config entries
# (but each entry will be processed in a 'random' order).
# It should also allow developers to set default middleware
# in code (passed to self.__init__) that deployers can add to
# (but not remove) via config.
self.pipeline.extend(v)
elif k == "response_class":
self.response_class = v
else:
name, arg = k.split(".", 1)
bucket = self.config.setdefault(name, {})
bucket[arg] = v

View File

@@ -1,68 +0,0 @@
"""WSGI server interface (see PEP 333). This adds some CP-specific bits to
the framework-agnostic wsgiserver package.
"""
import cherrypy
from cherrypy import wsgiserver
class CPHTTPRequest(wsgiserver.HTTPRequest):
def __init__(self, sendall, environ, wsgi_app):
s = cherrypy.server
self.max_request_header_size = s.max_request_header_size or 0
self.max_request_body_size = s.max_request_body_size or 0
wsgiserver.HTTPRequest.__init__(self, sendall, environ, wsgi_app)
class CPHTTPConnection(wsgiserver.HTTPConnection):
RequestHandlerClass = CPHTTPRequest
class CPWSGIServer(wsgiserver.CherryPyWSGIServer):
"""Wrapper for wsgiserver.CherryPyWSGIServer.
wsgiserver has been designed to not reference CherryPy in any way,
so that it can be used in other frameworks and applications. Therefore,
we wrap it here, so we can set our own mount points from cherrypy.tree
and apply some attributes from config -> cherrypy.server -> wsgiserver.
"""
ConnectionClass = CPHTTPConnection
def __init__(self, server_adapter=cherrypy.server):
self.server_adapter = server_adapter
# We have to make custom subclasses of wsgiserver internals here
# so that our server.* attributes get applied to every request.
class _CPHTTPRequest(wsgiserver.HTTPRequest):
def __init__(self, sendall, environ, wsgi_app):
s = server_adapter
self.max_request_header_size = s.max_request_header_size or 0
self.max_request_body_size = s.max_request_body_size or 0
wsgiserver.HTTPRequest.__init__(self, sendall, environ, wsgi_app)
class _CPHTTPConnection(wsgiserver.HTTPConnection):
RequestHandlerClass = _CPHTTPRequest
self.ConnectionClass = _CPHTTPConnection
server_name = (self.server_adapter.socket_host or
self.server_adapter.socket_file or
None)
s = wsgiserver.CherryPyWSGIServer
s.__init__(self, server_adapter.bind_addr, cherrypy.tree,
self.server_adapter.thread_pool,
server_name,
max = self.server_adapter.thread_pool_max,
request_queue_size = self.server_adapter.socket_queue_size,
timeout = self.server_adapter.socket_timeout,
shutdown_timeout = self.server_adapter.shutdown_timeout,
)
self.protocol = self.server_adapter.protocol_version
self.nodelay = self.server_adapter.nodelay
self.ssl_context = self.server_adapter.ssl_context
self.ssl_certificate = self.server_adapter.ssl_certificate
self.ssl_certificate_chain = self.server_adapter.ssl_certificate_chain
self.ssl_private_key = self.server_adapter.ssl_private_key

View File

@@ -1,92 +0,0 @@
#! /usr/bin/env python
"""The CherryPy daemon."""
import sys
import cherrypy
from cherrypy.process import plugins, servers
def start(configfiles=None, daemonize=False, environment=None,
fastcgi=False, scgi=False, pidfile=None, imports=None):
"""Subscribe all engine plugins and start the engine."""
sys.path = [''] + sys.path
for i in imports or []:
exec "import %s" % i
for c in configfiles or []:
cherrypy.config.update(c)
engine = cherrypy.engine
if environment is not None:
cherrypy.config.update({'environment': environment})
# Only daemonize if asked to.
if daemonize:
# Don't print anything to stdout/sterr.
cherrypy.config.update({'log.screen': False})
plugins.Daemonizer(engine).subscribe()
if pidfile:
plugins.PIDFile(engine, pidfile).subscribe()
if hasattr(engine, "signal_handler"):
engine.signal_handler.subscribe()
if hasattr(engine, "console_control_handler"):
engine.console_control_handler.subscribe()
if fastcgi and scgi:
# fastcgi and scgi aren't allowed together.
cherrypy.log.error("fastcgi and scgi aren't allowed together.", 'ENGINE')
sys.exit(1)
elif fastcgi or scgi:
# Turn off autoreload when using fastcgi or scgi.
cherrypy.config.update({'engine.autoreload_on': False})
# Turn off the default HTTP server (which is subscribed by default).
cherrypy.server.unsubscribe()
addr = cherrypy.server.bind_addr
if fastcgi:
f = servers.FlupFCGIServer(application=cherrypy.tree,
bindAddress=addr)
else:
f = servers.FlupSCGIServer(application=cherrypy.tree,
bindAddress=addr)
s = servers.ServerAdapter(engine, httpserver=f, bind_addr=addr)
s.subscribe()
# Always start the engine; this will start all other services
try:
engine.start()
except:
# Assume the error has been logged already via bus.log.
sys.exit(1)
else:
engine.block()
if __name__ == '__main__':
from optparse import OptionParser
p = OptionParser()
p.add_option('-c', '--config', action="append", dest='config',
help="specify config file(s)")
p.add_option('-d', action="store_true", dest='daemonize',
help="run the server as a daemon")
p.add_option('-e', '--environment', dest='environment', default=None,
help="apply the given config environment")
p.add_option('-f', action="store_true", dest='fastcgi',
help="start a fastcgi server instead of the default HTTP server")
p.add_option('-s', action="store_true", dest='scgi',
help="start a scgi server instead of the default HTTP server")
p.add_option('-i', '--import', action="append", dest='imports',
help="specify modules to import")
p.add_option('-p', '--pidfile', dest='pidfile', default=None,
help="store the process id in the given file")
options, args = p.parse_args()
start(options.config, options.daemonize,
options.environment, options.fastcgi, options.scgi, options.pidfile,
options.imports)

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,168 +0,0 @@
"""CherryPy Library"""
import sys as _sys
def modules(modulePath):
"""Load a module and retrieve a reference to that module."""
try:
mod = _sys.modules[modulePath]
if mod is None:
raise KeyError()
except KeyError:
# The last [''] is important.
mod = __import__(modulePath, globals(), locals(), [''])
return mod
def attributes(full_attribute_name):
"""Load a module and retrieve an attribute of that module."""
# Parse out the path, module, and attribute
last_dot = full_attribute_name.rfind(u".")
attr_name = full_attribute_name[last_dot + 1:]
mod_path = full_attribute_name[:last_dot]
mod = modules(mod_path)
# Let an AttributeError propagate outward.
try:
attr = getattr(mod, attr_name)
except AttributeError:
raise AttributeError("'%s' object has no attribute '%s'"
% (mod_path, attr_name))
# Return a reference to the attribute.
return attr
# public domain "unrepr" implementation, found on the web and then improved.
class _Builder:
def build(self, o):
m = getattr(self, 'build_' + o.__class__.__name__, None)
if m is None:
raise TypeError("unrepr does not recognize %s" %
repr(o.__class__.__name__))
return m(o)
def build_Subscript(self, o):
expr, flags, subs = o.getChildren()
expr = self.build(expr)
subs = self.build(subs)
return expr[subs]
def build_CallFunc(self, o):
children = map(self.build, o.getChildren())
callee = children.pop(0)
kwargs = children.pop() or {}
starargs = children.pop() or ()
args = tuple(children) + tuple(starargs)
return callee(*args, **kwargs)
def build_List(self, o):
return map(self.build, o.getChildren())
def build_Const(self, o):
return o.value
def build_Dict(self, o):
d = {}
i = iter(map(self.build, o.getChildren()))
for el in i:
d[el] = i.next()
return d
def build_Tuple(self, o):
return tuple(self.build_List(o))
def build_Name(self, o):
if o.name == 'None':
return None
if o.name == 'True':
return True
if o.name == 'False':
return False
# See if the Name is a package or module. If it is, import it.
try:
return modules(o.name)
except ImportError:
pass
# See if the Name is in __builtin__.
try:
import __builtin__
return getattr(__builtin__, o.name)
except AttributeError:
pass
raise TypeError("unrepr could not resolve the name %s" % repr(o.name))
def build_Add(self, o):
left, right = map(self.build, o.getChildren())
return left + right
def build_Getattr(self, o):
parent = self.build(o.expr)
return getattr(parent, o.attrname)
def build_NoneType(self, o):
return None
def build_UnarySub(self, o):
return -self.build(o.getChildren()[0])
def build_UnaryAdd(self, o):
return self.build(o.getChildren()[0])
def unrepr(s):
"""Return a Python object compiled from a string."""
if not s:
return s
try:
import compiler
except ImportError:
# Fallback to eval when compiler package is not available,
# e.g. IronPython 1.0.
return eval(s)
p = compiler.parse("__tempvalue__ = " + s)
obj = p.getChildren()[1].getChildren()[0].getChildren()[1]
return _Builder().build(obj)
class file_generator(object):
"""Yield the given input (a file object) in chunks (default 64k). (Core)"""
def __init__(self, input, chunkSize=65536):
self.input = input
self.chunkSize = chunkSize
def __iter__(self):
return self
def next(self):
chunk = self.input.read(self.chunkSize)
if chunk:
return chunk
else:
self.input.close()
raise StopIteration()
def file_generator_limited(fileobj, count, chunk_size=65536):
"""Yield the given file object in chunks, stopping after `count`
bytes has been emitted. Default chunk size is 64kB. (Core)
"""
remaining = count
while remaining > 0:
chunk = fileobj.read(min(chunk_size, remaining))
chunklen = len(chunk)
if chunklen == 0:
return
remaining -= chunklen
yield chunk

View File

@@ -1,79 +0,0 @@
import logging
import cherrypy
from cherrypy.lib import httpauth
def check_auth(users, encrypt=None, realm=None):
"""If an authorization header contains credentials, return True, else False."""
if 'authorization' in cherrypy.request.headers:
# make sure the provided credentials are correctly set
ah = httpauth.parseAuthorization(cherrypy.request.headers['authorization'])
if ah is None:
raise cherrypy.HTTPError(400, 'Bad Request')
if not encrypt:
encrypt = httpauth.DIGEST_AUTH_ENCODERS[httpauth.MD5]
if callable(users):
try:
# backward compatibility
users = users() # expect it to return a dictionary
if not isinstance(users, dict):
raise ValueError, "Authentication users must be a dictionary"
# fetch the user password
password = users.get(ah["username"], None)
except TypeError:
# returns a password (encrypted or clear text)
password = users(ah["username"])
else:
if not isinstance(users, dict):
raise ValueError, "Authentication users must be a dictionary"
# fetch the user password
password = users.get(ah["username"], None)
# validate the authorization by re-computing it here
# and compare it with what the user-agent provided
if httpauth.checkResponse(ah, password, method=cherrypy.request.method,
encrypt=encrypt, realm=realm):
cherrypy.request.login = ah["username"]
return True
if ah.get('username') or ah.get('password'):
logging.info('Attempt to login with wrong credentials from %s',
cherrypy.request.headers['Remote-Addr'])
cherrypy.request.login = False
return False
def basic_auth(realm, users, encrypt=None):
"""If auth fails, raise 401 with a basic authentication header.
realm: a string containing the authentication realm.
users: a dict of the form: {username: password} or a callable returning a dict.
encrypt: callable used to encrypt the password returned from the user-agent.
if None it defaults to a md5 encryption.
"""
if check_auth(users, encrypt):
return
# inform the user-agent this path is protected
cherrypy.response.headers['www-authenticate'] = httpauth.basicAuth(realm)
raise cherrypy.HTTPError(401, "You are not authorized to access that resource")
def digest_auth(realm, users):
"""If auth fails, raise 401 with a digest authentication header.
realm: a string containing the authentication realm.
users: a dict of the form: {username: password} or a callable returning a dict.
"""
if check_auth(users, realm=realm):
return
# inform the user-agent this path is protected
cherrypy.response.headers['www-authenticate'] = httpauth.digestAuth(realm)
raise cherrypy.HTTPError(401, "You are not authorized to access that resource")

View File

@@ -1,245 +0,0 @@
import datetime
import threading
import time
import cherrypy
from cherrypy.lib import cptools, http
class MemoryCache:
maxobjects = 1000
maxobj_size = 100000
maxsize = 10000000
delay = 600
def __init__(self):
self.clear()
t = threading.Thread(target=self.expire_cache, name='expire_cache')
self.expiration_thread = t
if hasattr(threading.Thread, "daemon"):
# Python 2.6+
t.daemon = True
else:
t.setDaemon(True)
t.start()
def clear(self):
"""Reset the cache to its initial, empty state."""
self.cache = {}
self.expirations = {}
self.tot_puts = 0
self.tot_gets = 0
self.tot_hist = 0
self.tot_expires = 0
self.tot_non_modified = 0
self.cursize = 0
def key(self):
return cherrypy.url(qs=cherrypy.request.query_string)
def expire_cache(self):
# expire_cache runs in a separate thread which the servers are
# not aware of. It's possible that "time" will be set to None
# arbitrarily, so we check "while time" to avoid exceptions.
# See tickets #99 and #180 for more information.
while time:
now = time.time()
for expiration_time, objects in self.expirations.items():
if expiration_time <= now:
for obj_size, obj_key in objects:
try:
del self.cache[obj_key]
self.tot_expires += 1
self.cursize -= obj_size
except KeyError:
# the key may have been deleted elsewhere
pass
del self.expirations[expiration_time]
time.sleep(0.1)
def get(self):
"""Return the object if in the cache, else None."""
self.tot_gets += 1
cache_item = self.cache.get(self.key(), None)
if cache_item:
self.tot_hist += 1
return cache_item
else:
return None
def put(self, obj):
if len(self.cache) < self.maxobjects:
# Size check no longer includes header length
obj_size = len(obj[2])
total_size = self.cursize + obj_size
# checks if there's space for the object
if (obj_size < self.maxobj_size and total_size < self.maxsize):
# add to the expirations list and cache
expiration_time = cherrypy.response.time + self.delay
obj_key = self.key()
bucket = self.expirations.setdefault(expiration_time, [])
bucket.append((obj_size, obj_key))
self.cache[obj_key] = obj
self.tot_puts += 1
self.cursize = total_size
def delete(self):
self.cache.pop(self.key(), None)
def get(invalid_methods=("POST", "PUT", "DELETE"), **kwargs):
"""Try to obtain cached output. If fresh enough, raise HTTPError(304).
If POST, PUT, or DELETE:
* invalidates (deletes) any cached response for this resource
* sets request.cached = False
* sets request.cacheable = False
else if a cached copy exists:
* sets request.cached = True
* sets request.cacheable = False
* sets response.headers to the cached values
* checks the cached Last-Modified response header against the
current If-(Un)Modified-Since request headers; raises 304
if necessary.
* sets response.status and response.body to the cached values
* returns True
otherwise:
* sets request.cached = False
* sets request.cacheable = True
* returns False
"""
request = cherrypy.request
# POST, PUT, DELETE should invalidate (delete) the cached copy.
# See http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.10.
if request.method in invalid_methods:
cherrypy._cache.delete()
request.cached = False
request.cacheable = False
return False
cache_data = cherrypy._cache.get()
request.cached = c = bool(cache_data)
request.cacheable = not c
if c:
response = cherrypy.response
s, h, b, create_time, original_req_headers = cache_data
# Check 'Vary' selecting headers. If any headers mentioned in "Vary"
# differ between the cached and current request, bail out and
# let the rest of CP handle the request. This should properly
# mimic the behavior of isolated caches as RFC 2616 assumes:
# "If the selecting request header fields for the cached entry
# do not match the selecting request header fields of the new
# request, then the cache MUST NOT use a cached entry to satisfy
# the request unless it first relays the new request to the origin
# server in a conditional request and the server responds with
# 304 (Not Modified), including an entity tag or Content-Location
# that indicates the entity to be used.
# TODO: can we store multiple variants based on Vary'd headers?
for header_element in h.elements('Vary'):
key = header_element.value
if original_req_headers[key] != request.headers.get(key, 'missing'):
request.cached = False
request.cacheable = True
return False
# Copy the response headers. See http://www.cherrypy.org/ticket/721.
response.headers = rh = http.HeaderMap()
for k in h:
dict.__setitem__(rh, k, dict.__getitem__(h, k))
# Add the required Age header
response.headers["Age"] = str(int(response.time - create_time))
try:
# Note that validate_since depends on a Last-Modified header;
# this was put into the cached copy, and should have been
# resurrected just above (response.headers = cache_data[1]).
cptools.validate_since()
except cherrypy.HTTPRedirect, x:
if x.status == 304:
cherrypy._cache.tot_non_modified += 1
raise
# serve it & get out from the request
response.status = s
response.body = b
return c
def tee_output():
def tee(body):
"""Tee response.body into a list."""
output = []
for chunk in body:
output.append(chunk)
yield chunk
# Might as well do this here; why cache if the body isn't consumed?
if response.headers.get('Pragma', None) != 'no-cache':
# save the cache data
body = ''.join(output)
vary = [he.value for he in
cherrypy.response.headers.elements('Vary')]
if vary:
sel_headers = dict([(k, v) for k, v
in cherrypy.request.headers.iteritems()
if k in vary])
else:
sel_headers = {}
cherrypy._cache.put((response.status, response.headers or {},
body, response.time, sel_headers))
response = cherrypy.response
response.body = tee(response.body)
def expires(secs=0, force=False):
"""Tool for influencing cache mechanisms using the 'Expires' header.
'secs' must be either an int or a datetime.timedelta, and indicates the
number of seconds between response.time and when the response should
expire. The 'Expires' header will be set to (response.time + secs).
If 'secs' is zero, the 'Expires' header is set one year in the past, and
the following "cache prevention" headers are also set:
'Pragma': 'no-cache'
'Cache-Control': 'no-cache, must-revalidate'
If 'force' is False (the default), the following headers are checked:
'Etag', 'Last-Modified', 'Age', 'Expires'. If any are already present,
none of the above response headers are set.
"""
response = cherrypy.response
headers = response.headers
cacheable = False
if not force:
# some header names that indicate that the response can be cached
for indicator in ('Etag', 'Last-Modified', 'Age', 'Expires'):
if indicator in headers:
cacheable = True
break
if not cacheable:
if isinstance(secs, datetime.timedelta):
secs = (86400 * secs.days) + secs.seconds
if secs == 0:
if force or "Pragma" not in headers:
headers["Pragma"] = "no-cache"
if cherrypy.request.protocol >= (1, 1):
if force or "Cache-Control" not in headers:
headers["Cache-Control"] = "no-cache, must-revalidate"
# Set an explicit Expires date in the past.
expiry = http.HTTPDate(1169942400.0)
else:
expiry = http.HTTPDate(response.time + secs)
if force or "Expires" not in headers:
headers["Expires"] = expiry

View File

@@ -1,361 +0,0 @@
"""Code-coverage tools for CherryPy.
To use this module, or the coverage tools in the test suite,
you need to download 'coverage.py', either Gareth Rees' original
implementation:
http://www.garethrees.org/2001/12/04/python-coverage/
or Ned Batchelder's enhanced version:
http://www.nedbatchelder.com/code/modules/coverage.html
To turn on coverage tracing, use the following code:
cherrypy.engine.subscribe('start', covercp.start)
cherrypy.engine.subscribe('start_thread', covercp.start)
Run your code, then use the covercp.serve() function to browse the
results in a web browser. If you run this module from the command line,
it will call serve() for you.
"""
import re
import sys
import cgi
import urllib
import os, os.path
localFile = os.path.join(os.path.dirname(__file__), "coverage.cache")
try:
import cStringIO as StringIO
except ImportError:
import StringIO
try:
from coverage import the_coverage as coverage
def start(threadid=None):
coverage.start()
except ImportError:
# Setting coverage to None will raise errors
# that need to be trapped downstream.
coverage = None
import warnings
warnings.warn("No code coverage will be performed; coverage.py could not be imported.")
def start(threadid=None):
pass
start.priority = 20
# Guess initial depth to hide FIXME this doesn't work for non-cherrypy stuff
import cherrypy
initial_base = os.path.dirname(cherrypy.__file__)
TEMPLATE_MENU = """<html>
<head>
<title>CherryPy Coverage Menu</title>
<style>
body {font: 9pt Arial, serif;}
#tree {
font-size: 8pt;
font-family: Andale Mono, monospace;
white-space: pre;
}
#tree a:active, a:focus {
background-color: black;
padding: 1px;
color: white;
border: 0px solid #9999FF;
-moz-outline-style: none;
}
.fail { color: red;}
.pass { color: #888;}
#pct { text-align: right;}
h3 {
font-size: small;
font-weight: bold;
font-style: italic;
margin-top: 5px;
}
input { border: 1px solid #ccc; padding: 2px; }
.directory {
color: #933;
font-style: italic;
font-weight: bold;
font-size: 10pt;
}
.file {
color: #400;
}
a { text-decoration: none; }
#crumbs {
color: white;
font-size: 8pt;
font-family: Andale Mono, monospace;
width: 100%;
background-color: black;
}
#crumbs a {
color: #f88;
}
#options {
line-height: 2.3em;
border: 1px solid black;
background-color: #eee;
padding: 4px;
}
#exclude {
width: 100%;
margin-bottom: 3px;
border: 1px solid #999;
}
#submit {
background-color: black;
color: white;
border: 0;
margin-bottom: -9px;
}
</style>
</head>
<body>
<h2>CherryPy Coverage</h2>"""
TEMPLATE_FORM = """
<div id="options">
<form action='menu' method=GET>
<input type='hidden' name='base' value='%(base)s' />
Show percentages <input type='checkbox' %(showpct)s name='showpct' value='checked' /><br />
Hide files over <input type='text' id='pct' name='pct' value='%(pct)s' size='3' />%%<br />
Exclude files matching<br />
<input type='text' id='exclude' name='exclude' value='%(exclude)s' size='20' />
<br />
<input type='submit' value='Change view' id="submit"/>
</form>
</div>"""
TEMPLATE_FRAMESET = """<html>
<head><title>CherryPy coverage data</title></head>
<frameset cols='250, 1*'>
<frame src='menu?base=%s' />
<frame name='main' src='' />
</frameset>
</html>
""" % initial_base.lower()
TEMPLATE_COVERAGE = """<html>
<head>
<title>Coverage for %(name)s</title>
<style>
h2 { margin-bottom: .25em; }
p { margin: .25em; }
.covered { color: #000; background-color: #fff; }
.notcovered { color: #fee; background-color: #500; }
.excluded { color: #00f; background-color: #fff; }
table .covered, table .notcovered, table .excluded
{ font-family: Andale Mono, monospace;
font-size: 10pt; white-space: pre; }
.lineno { background-color: #eee;}
.notcovered .lineno { background-color: #000;}
table { border-collapse: collapse;
</style>
</head>
<body>
<h2>%(name)s</h2>
<p>%(fullpath)s</p>
<p>Coverage: %(pc)s%%</p>"""
TEMPLATE_LOC_COVERED = """<tr class="covered">
<td class="lineno">%s&nbsp;</td>
<td>%s</td>
</tr>\n"""
TEMPLATE_LOC_NOT_COVERED = """<tr class="notcovered">
<td class="lineno">%s&nbsp;</td>
<td>%s</td>
</tr>\n"""
TEMPLATE_LOC_EXCLUDED = """<tr class="excluded">
<td class="lineno">%s&nbsp;</td>
<td>%s</td>
</tr>\n"""
TEMPLATE_ITEM = "%s%s<a class='file' href='report?name=%s' target='main'>%s</a>\n"
def _percent(statements, missing):
s = len(statements)
e = s - len(missing)
if s > 0:
return int(round(100.0 * e / s))
return 0
def _show_branch(root, base, path, pct=0, showpct=False, exclude=""):
# Show the directory name and any of our children
dirs = [k for k, v in root.iteritems() if v]
dirs.sort()
for name in dirs:
newpath = os.path.join(path, name)
if newpath.lower().startswith(base):
relpath = newpath[len(base):]
yield "| " * relpath.count(os.sep)
yield "<a class='directory' href='menu?base=%s&exclude=%s'>%s</a>\n" % \
(newpath, urllib.quote_plus(exclude), name)
for chunk in _show_branch(root[name], base, newpath, pct, showpct, exclude):
yield chunk
# Now list the files
if path.lower().startswith(base):
relpath = path[len(base):]
files = [k for k, v in root.iteritems() if not v]
files.sort()
for name in files:
newpath = os.path.join(path, name)
pc_str = ""
if showpct:
try:
_, statements, _, missing, _ = coverage.analysis2(newpath)
except:
# Yes, we really want to pass on all errors.
pass
else:
pc = _percent(statements, missing)
pc_str = ("%3d%% " % pc).replace(' ','&nbsp;')
if pc < float(pct) or pc == -1:
pc_str = "<span class='fail'>%s</span>" % pc_str
else:
pc_str = "<span class='pass'>%s</span>" % pc_str
yield TEMPLATE_ITEM % ("| " * (relpath.count(os.sep) + 1),
pc_str, newpath, name)
def _skip_file(path, exclude):
if exclude:
return bool(re.search(exclude, path))
def _graft(path, tree):
d = tree
p = path
atoms = []
while True:
p, tail = os.path.split(p)
if not tail:
break
atoms.append(tail)
atoms.append(p)
if p != "/":
atoms.append("/")
atoms.reverse()
for node in atoms:
if node:
d = d.setdefault(node, {})
def get_tree(base, exclude):
"""Return covered module names as a nested dict."""
tree = {}
coverage.get_ready()
runs = coverage.cexecuted.keys()
if runs:
for path in runs:
if not _skip_file(path, exclude) and not os.path.isdir(path):
_graft(path, tree)
return tree
class CoverStats(object):
def index(self):
return TEMPLATE_FRAMESET
index.exposed = True
def menu(self, base="/", pct="50", showpct="",
exclude=r'python\d\.\d|test|tut\d|tutorial'):
# The coverage module uses all-lower-case names.
base = base.lower().rstrip(os.sep)
yield TEMPLATE_MENU
yield TEMPLATE_FORM % locals()
# Start by showing links for parent paths
yield "<div id='crumbs'>"
path = ""
atoms = base.split(os.sep)
atoms.pop()
for atom in atoms:
path += atom + os.sep
yield ("<a href='menu?base=%s&exclude=%s'>%s</a> %s"
% (path, urllib.quote_plus(exclude), atom, os.sep))
yield "</div>"
yield "<div id='tree'>"
# Then display the tree
tree = get_tree(base, exclude)
if not tree:
yield "<p>No modules covered.</p>"
else:
for chunk in _show_branch(tree, base, "/", pct,
showpct=='checked', exclude):
yield chunk
yield "</div>"
yield "</body></html>"
menu.exposed = True
def annotated_file(self, filename, statements, excluded, missing):
source = open(filename, 'r')
buffer = []
for lineno, line in enumerate(source.readlines()):
lineno += 1
line = line.strip("\n\r")
empty_the_buffer = True
if lineno in excluded:
template = TEMPLATE_LOC_EXCLUDED
elif lineno in missing:
template = TEMPLATE_LOC_NOT_COVERED
elif lineno in statements:
template = TEMPLATE_LOC_COVERED
else:
empty_the_buffer = False
buffer.append((lineno, line))
if empty_the_buffer:
for lno, pastline in buffer:
yield template % (lno, cgi.escape(pastline))
buffer = []
yield template % (lineno, cgi.escape(line))
def report(self, name):
coverage.get_ready()
filename, statements, excluded, missing, _ = coverage.analysis2(name)
pc = _percent(statements, missing)
yield TEMPLATE_COVERAGE % dict(name=os.path.basename(name),
fullpath=name,
pc=pc)
yield '<table>\n'
for line in self.annotated_file(filename, statements, excluded,
missing):
yield line
yield '</table>'
yield '</body>'
yield '</html>'
report.exposed = True
def serve(path=localFile, port=8080):
if coverage is None:
raise ImportError("The coverage module could not be imported.")
coverage.cache_default = path
import cherrypy
cherrypy.config.update({'server.socket_port': port,
'server.thread_pool': 10,
'environment': "production",
})
cherrypy.quickstart(CoverStats())
if __name__ == "__main__":
serve(*tuple(sys.argv[1:]))

View File

@@ -1,433 +0,0 @@
"""Functions for builtin CherryPy tools."""
import logging
try:
# Python 2.5+
from hashlib import md5
except ImportError:
from md5 import new as md5
import re
import cherrypy
from cherrypy.lib import http as _http
# Conditional HTTP request support #
def validate_etags(autotags=False):
"""Validate the current ETag against If-Match, If-None-Match headers.
If autotags is True, an ETag response-header value will be provided
from an MD5 hash of the response body (unless some other code has
already provided an ETag header). If False (the default), the ETag
will not be automatic.
WARNING: the autotags feature is not designed for URL's which allow
methods other than GET. For example, if a POST to the same URL returns
no content, the automatic ETag will be incorrect, breaking a fundamental
use for entity tags in a possibly destructive fashion. Likewise, if you
raise 304 Not Modified, the response body will be empty, the ETag hash
will be incorrect, and your application will break.
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24
"""
response = cherrypy.response
# Guard against being run twice.
if hasattr(response, "ETag"):
return
status, reason, msg = _http.valid_status(response.status)
etag = response.headers.get('ETag')
# Automatic ETag generation. See warning in docstring.
if (not etag) and autotags:
if status == 200:
etag = response.collapse_body()
etag = '"%s"' % md5(etag).hexdigest()
response.headers['ETag'] = etag
response.ETag = etag
# "If the request would, without the If-Match header field, result in
# anything other than a 2xx or 412 status, then the If-Match header
# MUST be ignored."
if status >= 200 and status <= 299:
request = cherrypy.request
conditions = request.headers.elements('If-Match') or []
conditions = [str(x) for x in conditions]
if conditions and not (conditions == ["*"] or etag in conditions):
raise cherrypy.HTTPError(412, "If-Match failed: ETag %r did "
"not match %r" % (etag, conditions))
conditions = request.headers.elements('If-None-Match') or []
conditions = [str(x) for x in conditions]
if conditions == ["*"] or etag in conditions:
if request.method in ("GET", "HEAD"):
raise cherrypy.HTTPRedirect([], 304)
else:
raise cherrypy.HTTPError(412, "If-None-Match failed: ETag %r "
"matched %r" % (etag, conditions))
def validate_since():
"""Validate the current Last-Modified against If-Modified-Since headers.
If no code has set the Last-Modified response header, then no validation
will be performed.
"""
response = cherrypy.response
lastmod = response.headers.get('Last-Modified')
if lastmod:
status, reason, msg = _http.valid_status(response.status)
request = cherrypy.request
since = request.headers.get('If-Unmodified-Since')
if since and since != lastmod:
if (status >= 200 and status <= 299) or status == 412:
raise cherrypy.HTTPError(412)
since = request.headers.get('If-Modified-Since')
if since and since == lastmod:
if (status >= 200 and status <= 299) or status == 304:
if request.method in ("GET", "HEAD"):
raise cherrypy.HTTPRedirect([], 304)
else:
raise cherrypy.HTTPError(412)
# Tool code #
def proxy(base=None, local='X-Forwarded-Host', remote='X-Forwarded-For',
scheme='X-Forwarded-Proto'):
"""Change the base URL (scheme://host[:port][/path]).
For running a CP server behind Apache, lighttpd, or other HTTP server.
If you want the new request.base to include path info (not just the host),
you must explicitly set base to the full base path, and ALSO set 'local'
to '', so that the X-Forwarded-Host request header (which never includes
path info) does not override it. Regardless, the value for 'base' MUST
NOT end in a slash.
cherrypy.request.remote.ip (the IP address of the client) will be
rewritten if the header specified by the 'remote' arg is valid.
By default, 'remote' is set to 'X-Forwarded-For'. If you do not
want to rewrite remote.ip, set the 'remote' arg to an empty string.
"""
request = cherrypy.request
if scheme:
s = request.headers.get(scheme, None)
if s == 'on' and 'ssl' in scheme.lower():
# This handles e.g. webfaction's 'X-Forwarded-Ssl: on' header
scheme = 'https'
else:
# This is for lighttpd/pound/Mongrel's 'X-Forwarded-Proto: https'
scheme = s
if not scheme:
scheme = request.base[:request.base.find("://")]
if local:
base = request.headers.get(local, base)
if not base:
port = cherrypy.request.local.port
if port == 80:
base = '127.0.0.1'
else:
base = '127.0.0.1:%s' % port
if base.find("://") == -1:
# add http:// or https:// if needed
base = scheme + "://" + base
request.base = base
if remote:
xff = request.headers.get(remote)
if xff:
if remote == 'X-Forwarded-For':
# See http://bob.pythonmac.org/archives/2005/09/23/apache-x-forwarded-for-caveat/
xff = xff.split(',')[-1].strip()
request.remote.ip = xff
def ignore_headers(headers=('Range',)):
"""Delete request headers whose field names are included in 'headers'.
This is a useful tool for working behind certain HTTP servers;
for example, Apache duplicates the work that CP does for 'Range'
headers, and will doubly-truncate the response.
"""
request = cherrypy.request
for name in headers:
if name in request.headers:
del request.headers[name]
def response_headers(headers=None):
"""Set headers on the response."""
for name, value in (headers or []):
cherrypy.response.headers[name] = value
response_headers.failsafe = True
def referer(pattern, accept=True, accept_missing=False, error=403,
message='Forbidden Referer header.'):
"""Raise HTTPError if Referer header does/does not match the given pattern.
pattern: a regular expression pattern to test against the Referer.
accept: if True, the Referer must match the pattern; if False,
the Referer must NOT match the pattern.
accept_missing: if True, permit requests with no Referer header.
error: the HTTP error code to return to the client on failure.
message: a string to include in the response body on failure.
"""
try:
match = bool(re.match(pattern, cherrypy.request.headers['Referer']))
if accept == match:
return
except KeyError:
if accept_missing:
return
raise cherrypy.HTTPError(error, message)
class SessionAuth(object):
"""Assert that the user is logged in."""
session_key = "username"
def check_username_and_password(self, username, password):
pass
def anonymous(self):
"""Provide a temporary user name for anonymous users."""
pass
def on_login(self, username):
pass
def on_logout(self, username):
pass
def on_check(self, username):
pass
def login_screen(self, from_page='..', username='', error_msg='', **kwargs):
return """<html><body>
Message: %(error_msg)s
<form method="post" action="do_login">
Login: <input type="text" name="username" value="%(username)s" size="10" /><br />
Password: <input type="password" name="password" size="10" /><br />
<input type="hidden" name="from_page" value="%(from_page)s" /><br />
<input type="submit" />
</form>
</body></html>""" % {'from_page': from_page, 'username': username,
'error_msg': error_msg}
def do_login(self, username, password, from_page='..', **kwargs):
"""Login. May raise redirect, or return True if request handled."""
error_msg = self.check_username_and_password(username, password)
if error_msg:
body = self.login_screen(from_page, username, error_msg)
cherrypy.response.body = body
if cherrypy.response.headers.has_key("Content-Length"):
# Delete Content-Length header so finalize() recalcs it.
del cherrypy.response.headers["Content-Length"]
return True
else:
cherrypy.session[self.session_key] = cherrypy.request.login = username
self.on_login(username)
raise cherrypy.HTTPRedirect(from_page or "/")
def do_logout(self, from_page='..', **kwargs):
"""Logout. May raise redirect, or return True if request handled."""
sess = cherrypy.session
username = sess.get(self.session_key)
sess[self.session_key] = None
if username:
cherrypy.request.login = None
self.on_logout(username)
raise cherrypy.HTTPRedirect(from_page)
def do_check(self):
"""Assert username. May raise redirect, or return True if request handled."""
sess = cherrypy.session
request = cherrypy.request
username = sess.get(self.session_key)
if not username:
sess[self.session_key] = username = self.anonymous()
if not username:
cherrypy.response.body = self.login_screen(cherrypy.url(qs=request.query_string))
if cherrypy.response.headers.has_key("Content-Length"):
# Delete Content-Length header so finalize() recalcs it.
del cherrypy.response.headers["Content-Length"]
return True
cherrypy.request.login = username
self.on_check(username)
def run(self):
request = cherrypy.request
path = request.path_info
if path.endswith('login_screen'):
return self.login_screen(**request.params)
elif path.endswith('do_login'):
return self.do_login(**request.params)
elif path.endswith('do_logout'):
return self.do_logout(**request.params)
else:
return self.do_check()
def session_auth(**kwargs):
sa = SessionAuth()
for k, v in kwargs.iteritems():
setattr(sa, k, v)
return sa.run()
session_auth.__doc__ = """Session authentication hook.
Any attribute of the SessionAuth class may be overridden via a keyword arg
to this function:
""" + "\n".join(["%s: %s" % (k, type(getattr(SessionAuth, k)).__name__)
for k in dir(SessionAuth) if not k.startswith("__")])
def log_traceback(severity=logging.DEBUG):
"""Write the last error's traceback to the cherrypy error log."""
cherrypy.log("", "HTTP", severity=severity, traceback=True)
def log_request_headers():
"""Write request headers to the cherrypy error log."""
h = [" %s: %s" % (k, v) for k, v in cherrypy.request.header_list]
cherrypy.log('\nRequest Headers:\n' + '\n'.join(h), "HTTP")
def log_hooks():
"""Write request.hooks to the cherrypy error log."""
msg = []
# Sort by the standard points if possible.
from cherrypy import _cprequest
points = _cprequest.hookpoints
for k in cherrypy.request.hooks.keys():
if k not in points:
points.append(k)
for k in points:
msg.append(" %s:" % k)
v = cherrypy.request.hooks.get(k, [])
v.sort()
for h in v:
msg.append(" %r" % h)
cherrypy.log('\nRequest Hooks for ' + cherrypy.url() +
':\n' + '\n'.join(msg), "HTTP")
def redirect(url='', internal=True):
"""Raise InternalRedirect or HTTPRedirect to the given url."""
if internal:
raise cherrypy.InternalRedirect(url)
else:
raise cherrypy.HTTPRedirect(url)
def trailing_slash(missing=True, extra=False):
"""Redirect if path_info has (missing|extra) trailing slash."""
request = cherrypy.request
pi = request.path_info
if request.is_index is True:
if missing:
if not pi.endswith('/'):
new_url = cherrypy.url(pi + '/', request.query_string)
raise cherrypy.HTTPRedirect(new_url)
elif request.is_index is False:
if extra:
# If pi == '/', don't redirect to ''!
if pi.endswith('/') and pi != '/':
new_url = cherrypy.url(pi[:-1], request.query_string)
raise cherrypy.HTTPRedirect(new_url)
def flatten():
"""Wrap response.body in a generator that recursively iterates over body.
This allows cherrypy.response.body to consist of 'nested generators';
that is, a set of generators that yield generators.
"""
import types
def flattener(input):
for x in input:
if not isinstance(x, types.GeneratorType):
yield x
else:
for y in flattener(x):
yield y
response = cherrypy.response
response.body = flattener(response.body)
def accept(media=None):
"""Return the client's preferred media-type (from the given Content-Types).
If 'media' is None (the default), no test will be performed.
If 'media' is provided, it should be the Content-Type value (as a string)
or values (as a list or tuple of strings) which the current request
can emit. The client's acceptable media ranges (as declared in the
Accept request header) will be matched in order to these Content-Type
values; the first such string is returned. That is, the return value
will always be one of the strings provided in the 'media' arg (or None
if 'media' is None).
If no match is found, then HTTPError 406 (Not Acceptable) is raised.
Note that most web browsers send */* as a (low-quality) acceptable
media range, which should match any Content-Type. In addition, "...if
no Accept header field is present, then it is assumed that the client
accepts all media types."
Matching types are checked in order of client preference first,
and then in the order of the given 'media' values.
Note that this function does not honor accept-params (other than "q").
"""
if not media:
return
if isinstance(media, basestring):
media = [media]
# Parse the Accept request header, and try to match one
# of the requested media-ranges (in order of preference).
ranges = cherrypy.request.headers.elements('Accept')
if not ranges:
# Any media type is acceptable.
return media[0]
else:
# Note that 'ranges' is sorted in order of preference
for element in ranges:
if element.qvalue > 0:
if element.value == "*/*":
# Matches any type or subtype
return media[0]
elif element.value.endswith("/*"):
# Matches any subtype
mtype = element.value[:-1] # Keep the slash
for m in media:
if m.startswith(mtype):
return m
else:
# Matches exact value
if element.value in media:
return element.value
# No suitable media-range found.
ah = cherrypy.request.headers.get('Accept')
if ah is None:
msg = "Your client did not send an Accept header."
else:
msg = "Your client sent this Accept header: %s." % ah
msg += (" But this resource only emits these media types: %s." %
", ".join(media))
raise cherrypy.HTTPError(406, msg)

View File

@@ -1,265 +0,0 @@
import struct
import time
import cherrypy
def decode(encoding=None, default_encoding='utf-8'):
"""Decode cherrypy.request.params from str to unicode objects."""
if not encoding:
ct = cherrypy.request.headers.elements("Content-Type")
if ct:
ct = ct[0]
encoding = ct.params.get("charset", None)
if (not encoding) and ct.value.lower().startswith("text/"):
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7.1
# When no explicit charset parameter is provided by the
# sender, media subtypes of the "text" type are defined
# to have a default charset value of "ISO-8859-1" when
# received via HTTP.
encoding = "ISO-8859-1"
if not encoding:
encoding = default_encoding
try:
decode_params(encoding)
except UnicodeDecodeError:
# IE and Firefox don't supply a charset when submitting form
# params with a CT of application/x-www-form-urlencoded.
# So after all our guessing, it could *still* be wrong.
# Start over with ISO-8859-1, since that seems to be preferred.
decode_params("ISO-8859-1")
def decode_params(encoding):
decoded_params = {}
for key, value in cherrypy.request.params.items():
if not hasattr(value, 'file'):
# Skip the value if it is an uploaded file
if isinstance(value, list):
# value is a list: decode each element
value = [v.decode(encoding) for v in value]
elif isinstance(value, str):
# value is a regular string: decode it
value = value.decode(encoding)
decoded_params[key] = value
# Decode all or nothing, so we can try again on error.
cherrypy.request.params = decoded_params
# Encoding
def encode(encoding=None, errors='strict', text_only=True, add_charset=True):
# Guard against running twice
if getattr(cherrypy.request, "_encoding_attempted", False):
return
cherrypy.request._encoding_attempted = True
ct = cherrypy.response.headers.elements("Content-Type")
if ct:
ct = ct[0]
if (not text_only) or ct.value.lower().startswith("text/"):
# Set "charset=..." param on response Content-Type header
ct.params['charset'] = find_acceptable_charset(encoding, errors=errors)
if add_charset:
cherrypy.response.headers["Content-Type"] = str(ct)
def encode_stream(encoding, errors='strict'):
"""Encode a streaming response body.
Use a generator wrapper, and just pray it works as the stream is
being written out.
"""
def encoder(body):
for chunk in body:
if isinstance(chunk, unicode):
chunk = chunk.encode(encoding, errors)
yield chunk
cherrypy.response.body = encoder(cherrypy.response.body)
return True
def encode_string(encoding, errors='strict'):
"""Encode a buffered response body."""
try:
body = []
for chunk in cherrypy.response.body:
if isinstance(chunk, unicode):
chunk = chunk.encode(encoding, errors)
body.append(chunk)
cherrypy.response.body = body
except (LookupError, UnicodeError):
return False
else:
return True
def find_acceptable_charset(encoding=None, default_encoding='utf-8', errors='strict'):
response = cherrypy.response
if cherrypy.response.stream:
encoder = encode_stream
else:
response.collapse_body()
encoder = encode_string
if response.headers.has_key("Content-Length"):
# Delete Content-Length header so finalize() recalcs it.
# Encoded strings may be of different lengths from their
# unicode equivalents, and even from each other. For example:
# >>> t = u"\u7007\u3040"
# >>> len(t)
# 2
# >>> len(t.encode("UTF-8"))
# 6
# >>> len(t.encode("utf7"))
# 8
del response.headers["Content-Length"]
# Parse the Accept-Charset request header, and try to provide one
# of the requested charsets (in order of user preference).
encs = cherrypy.request.headers.elements('Accept-Charset')
charsets = [enc.value.lower() for enc in encs]
attempted_charsets = []
if encoding is not None:
# If specified, force this encoding to be used, or fail.
encoding = encoding.lower()
if (not charsets) or "*" in charsets or encoding in charsets:
if encoder(encoding, errors):
return encoding
else:
if not encs:
# Any character-set is acceptable.
if encoder(default_encoding, errors):
return default_encoding
else:
raise cherrypy.HTTPError(500, failmsg % default_encoding)
else:
if "*" not in charsets:
# If no "*" is present in an Accept-Charset field, then all
# character sets not explicitly mentioned get a quality
# value of 0, except for ISO-8859-1, which gets a quality
# value of 1 if not explicitly mentioned.
iso = 'iso-8859-1'
if iso not in charsets:
attempted_charsets.append(iso)
if encoder(iso, errors):
return iso
for element in encs:
if element.qvalue > 0:
if element.value == "*":
# Matches any charset. Try our default.
if default_encoding not in attempted_charsets:
attempted_charsets.append(default_encoding)
if encoder(default_encoding, errors):
return default_encoding
else:
encoding = element.value
if encoding not in attempted_charsets:
attempted_charsets.append(encoding)
if encoder(encoding, errors):
return encoding
# No suitable encoding found.
ac = cherrypy.request.headers.get('Accept-Charset')
if ac is None:
msg = "Your client did not send an Accept-Charset header."
else:
msg = "Your client sent this Accept-Charset header: %s." % ac
msg += " We tried these charsets: %s." % ", ".join(attempted_charsets)
raise cherrypy.HTTPError(406, msg)
# GZIP
def compress(body, compress_level):
"""Compress 'body' at the given compress_level."""
import zlib
yield '\037\213' # magic header
yield '\010' # compression method
yield '\0'
yield struct.pack("<L", long(time.time()))
yield '\002'
yield '\377'
crc = zlib.crc32("")
size = 0
zobj = zlib.compressobj(compress_level,
zlib.DEFLATED, -zlib.MAX_WBITS,
zlib.DEF_MEM_LEVEL, 0)
for line in body:
size += len(line)
crc = zlib.crc32(line, crc)
yield zobj.compress(line)
yield zobj.flush()
yield struct.pack("<l", crc)
yield struct.pack("<L", size & 0xFFFFFFFFL)
def decompress(body):
import gzip, StringIO
zbuf = StringIO.StringIO()
zbuf.write(body)
zbuf.seek(0)
zfile = gzip.GzipFile(mode='rb', fileobj=zbuf)
data = zfile.read()
zfile.close()
return data
def gzip(compress_level=9, mime_types=['text/html', 'text/plain']):
"""Try to gzip the response body if Content-Type in mime_types.
cherrypy.response.headers['Content-Type'] must be set to one of the
values in the mime_types arg before calling this function.
No compression is performed if any of the following hold:
* The client sends no Accept-Encoding request header
* No 'gzip' or 'x-gzip' is present in the Accept-Encoding header
* No 'gzip' or 'x-gzip' with a qvalue > 0 is present
* The 'identity' value is given with a qvalue > 0.
"""
response = cherrypy.response
if not response.body:
# Response body is empty (might be a 304 for instance)
return
# If returning cached content (which should already have been gzipped),
# don't re-zip.
if getattr(cherrypy.request, "cached", False):
return
acceptable = cherrypy.request.headers.elements('Accept-Encoding')
if not acceptable:
# If no Accept-Encoding field is present in a request,
# the server MAY assume that the client will accept any
# content coding. In this case, if "identity" is one of
# the available content-codings, then the server SHOULD use
# the "identity" content-coding, unless it has additional
# information that a different content-coding is meaningful
# to the client.
return
ct = response.headers.get('Content-Type', '').split(';')[0]
for coding in acceptable:
if coding.value == 'identity' and coding.qvalue != 0:
return
if coding.value in ('gzip', 'x-gzip'):
if coding.qvalue == 0:
return
if ct in mime_types:
# Return a generator that compresses the page
varies = response.headers.get("Vary", "")
varies = [x.strip() for x in varies.split(",") if x.strip()]
if "Accept-Encoding" not in varies:
varies.append("Accept-Encoding")
response.headers['Vary'] = ", ".join(varies)
response.headers['Content-Encoding'] = 'gzip'
response.body = compress(response.body, compress_level)
if response.headers.has_key("Content-Length"):
# Delete Content-Length header so finalize() recalcs it.
del response.headers["Content-Length"]
return
cherrypy.HTTPError(406, "identity, gzip").set_response()

View File

@@ -1,410 +0,0 @@
"""HTTP library functions."""
# This module contains functions for building an HTTP application
# framework: any one, not just one whose name starts with "Ch". ;) If you
# reference any modules from some popular framework inside *this* module,
# FuManChu will personally hang you up by your thumbs and submit you
# to a public caning.
from BaseHTTPServer import BaseHTTPRequestHandler
response_codes = BaseHTTPRequestHandler.responses.copy()
# From http://www.cherrypy.org/ticket/361
response_codes[500] = ('Internal Server Error',
'The server encountered an unexpected condition '
'which prevented it from fulfilling the request.')
response_codes[503] = ('Service Unavailable',
'The server is currently unable to handle the '
'request due to a temporary overloading or '
'maintenance of the server.')
import cgi
import re
from rfc822 import formatdate as HTTPDate
def urljoin(*atoms):
"""Return the given path *atoms, joined into a single URL.
This will correctly join a SCRIPT_NAME and PATH_INFO into the
original URL, even if either atom is blank.
"""
url = "/".join([x for x in atoms if x])
while "//" in url:
url = url.replace("//", "/")
# Special-case the final url of "", and return "/" instead.
return url or "/"
def protocol_from_http(protocol_str):
"""Return a protocol tuple from the given 'HTTP/x.y' string."""
return int(protocol_str[5]), int(protocol_str[7])
def get_ranges(headervalue, content_length):
"""Return a list of (start, stop) indices from a Range header, or None.
Each (start, stop) tuple will be composed of two ints, which are suitable
for use in a slicing operation. That is, the header "Range: bytes=3-6",
if applied against a Python string, is requesting resource[3:7]. This
function will return the list [(3, 7)].
If this function returns an empty list, you should return HTTP 416.
"""
if not headervalue:
return None
result = []
bytesunit, byteranges = headervalue.split("=", 1)
for brange in byteranges.split(","):
start, stop = [x.strip() for x in brange.split("-", 1)]
if start:
if not stop:
stop = content_length - 1
start, stop = map(int, (start, stop))
if start >= content_length:
# From rfc 2616 sec 14.16:
# "If the server receives a request (other than one
# including an If-Range request-header field) with an
# unsatisfiable Range request-header field (that is,
# all of whose byte-range-spec values have a first-byte-pos
# value greater than the current length of the selected
# resource), it SHOULD return a response code of 416
# (Requested range not satisfiable)."
continue
if stop < start:
# From rfc 2616 sec 14.16:
# "If the server ignores a byte-range-spec because it
# is syntactically invalid, the server SHOULD treat
# the request as if the invalid Range header field
# did not exist. (Normally, this means return a 200
# response containing the full entity)."
return None
result.append((start, stop + 1))
else:
if not stop:
# See rfc quote above.
return None
# Negative subscript (last N bytes)
result.append((content_length - int(stop), content_length))
return result
class HeaderElement(object):
"""An element (with parameters) from an HTTP header's element list."""
def __init__(self, value, params=None):
self.value = value
if params is None:
params = {}
self.params = params
def __unicode__(self):
p = [";%s=%s" % (k, v) for k, v in self.params.iteritems()]
return u"%s%s" % (self.value, "".join(p))
def __str__(self):
return str(self.__unicode__())
def parse(elementstr):
"""Transform 'token;key=val' to ('token', {'key': 'val'})."""
# Split the element into a value and parameters. The 'value' may
# be of the form, "token=token", but we don't split that here.
atoms = [x.strip() for x in elementstr.split(";") if x.strip()]
initial_value = atoms.pop(0).strip()
params = {}
for atom in atoms:
atom = [x.strip() for x in atom.split("=", 1) if x.strip()]
key = atom.pop(0)
if atom:
val = atom[0]
else:
val = ""
params[key] = val
return initial_value, params
parse = staticmethod(parse)
def from_str(cls, elementstr):
"""Construct an instance from a string of the form 'token;key=val'."""
ival, params = cls.parse(elementstr)
return cls(ival, params)
from_str = classmethod(from_str)
q_separator = re.compile(r'; *q *=')
class AcceptElement(HeaderElement):
"""An element (with parameters) from an Accept* header's element list.
AcceptElement objects are comparable; the more-preferred object will be
"less than" the less-preferred object. They are also therefore sortable;
if you sort a list of AcceptElement objects, they will be listed in
priority order; the most preferred value will be first. Yes, it should
have been the other way around, but it's too late to fix now.
"""
def from_str(cls, elementstr):
qvalue = None
# The first "q" parameter (if any) separates the initial
# media-range parameter(s) (if any) from the accept-params.
atoms = q_separator.split(elementstr, 1)
media_range = atoms.pop(0).strip()
if atoms:
# The qvalue for an Accept header can have extensions. The other
# headers cannot, but it's easier to parse them as if they did.
qvalue = HeaderElement.from_str(atoms[0].strip())
media_type, params = cls.parse(media_range)
if qvalue is not None:
params["q"] = qvalue
return cls(media_type, params)
from_str = classmethod(from_str)
def qvalue(self):
val = self.params.get("q", "1")
if isinstance(val, HeaderElement):
val = val.value
return float(val)
qvalue = property(qvalue, doc="The qvalue, or priority, of this value.")
def __cmp__(self, other):
diff = cmp(other.qvalue, self.qvalue)
if diff == 0:
diff = cmp(str(other), str(self))
return diff
def header_elements(fieldname, fieldvalue):
"""Return a HeaderElement list from a comma-separated header str."""
if not fieldvalue:
return None
headername = fieldname.lower()
result = []
for element in fieldvalue.split(","):
if headername.startswith("accept") or headername == 'te':
hv = AcceptElement.from_str(element)
else:
hv = HeaderElement.from_str(element)
result.append(hv)
result.sort()
return result
def decode_TEXT(value):
"""Decode RFC-2047 TEXT (e.g. "=?utf-8?q?f=C3=BCr?=" -> u"f\xfcr")."""
from email.Header import decode_header
atoms = decode_header(value)
decodedvalue = ""
for atom, charset in atoms:
if charset is not None:
atom = atom.decode(charset)
decodedvalue += atom
return decodedvalue
def valid_status(status):
"""Return legal HTTP status Code, Reason-phrase and Message.
The status arg must be an int, or a str that begins with an int.
If status is an int, or a str and no reason-phrase is supplied,
a default reason-phrase will be provided.
"""
if not status:
status = 200
status = str(status)
parts = status.split(" ", 1)
if len(parts) == 1:
# No reason supplied.
code, = parts
reason = None
else:
code, reason = parts
reason = reason.strip()
try:
code = int(code)
except ValueError:
raise ValueError("Illegal response status from server "
"(%s is non-numeric)." % repr(code))
if code < 100 or code > 599:
raise ValueError("Illegal response status from server "
"(%s is out of range)." % repr(code))
if code not in response_codes:
# code is unknown but not illegal
default_reason, message = "", ""
else:
default_reason, message = response_codes[code]
if reason is None:
reason = default_reason
return code, reason, message
image_map_pattern = re.compile(r"[0-9]+,[0-9]+")
def parse_query_string(query_string, keep_blank_values=True):
"""Build a params dictionary from a query_string.
Duplicate key/value pairs in the provided query_string will be
returned as {'key': [val1, val2, ...]}. Single key/values will
be returned as strings: {'key': 'value'}.
"""
if image_map_pattern.match(query_string):
# Server-side image map. Map the coords to 'x' and 'y'
# (like CGI::Request does).
pm = query_string.split(",")
pm = {'x': int(pm[0]), 'y': int(pm[1])}
else:
pm = cgi.parse_qs(query_string, keep_blank_values)
for key, val in pm.items():
if len(val) == 1:
pm[key] = val[0]
return pm
def params_from_CGI_form(form):
params = {}
for key in form.keys():
value_list = form[key]
if key is None:
# multipart/* message parts that have no Content-Disposition
# have a .name of None, but Python kwarg keys must be strings.
# See http://www.cherrypy.org/ticket/890.
key = 'parts'
if isinstance(value_list, list):
params[key] = []
for item in value_list:
if item.filename is not None:
value = item # It's a file upload
else:
value = item.value # It's a regular field
params[key].append(value)
else:
if value_list.filename is not None:
value = value_list # It's a file upload
else:
value = value_list.value # It's a regular field
params[key] = value
return params
class CaseInsensitiveDict(dict):
"""A case-insensitive dict subclass.
Each key is changed on entry to str(key).title().
"""
def __getitem__(self, key):
return dict.__getitem__(self, str(key).title())
def __setitem__(self, key, value):
dict.__setitem__(self, str(key).title(), value)
def __delitem__(self, key):
dict.__delitem__(self, str(key).title())
def __contains__(self, key):
return dict.__contains__(self, str(key).title())
def get(self, key, default=None):
return dict.get(self, str(key).title(), default)
def has_key(self, key):
return dict.has_key(self, str(key).title())
def update(self, E):
for k in E.keys():
self[str(k).title()] = E[k]
def fromkeys(cls, seq, value=None):
newdict = cls()
for k in seq:
newdict[str(k).title()] = value
return newdict
fromkeys = classmethod(fromkeys)
def setdefault(self, key, x=None):
key = str(key).title()
try:
return self[key]
except KeyError:
self[key] = x
return x
def pop(self, key, default):
return dict.pop(self, str(key).title(), default)
class HeaderMap(CaseInsensitiveDict):
"""A dict subclass for HTTP request and response headers.
Each key is changed on entry to str(key).title(). This allows headers
to be case-insensitive and avoid duplicates.
Values are header values (decoded according to RFC 2047 if necessary).
"""
def elements(self, key):
"""Return a list of HeaderElements for the given header (or None)."""
key = str(key).title()
h = self.get(key)
if h is None:
return []
return header_elements(key, h)
def output(self, protocol=(1, 1)):
"""Transform self into a list of (name, value) tuples."""
header_list = []
for key, v in self.iteritems():
if isinstance(v, unicode):
# HTTP/1.0 says, "Words of *TEXT may contain octets
# from character sets other than US-ASCII." and
# "Recipients of header field TEXT containing octets
# outside the US-ASCII character set may assume that
# they represent ISO-8859-1 characters."
try:
v = v.encode("iso-8859-1")
except UnicodeEncodeError:
if protocol >= (1, 1):
# Encode RFC-2047 TEXT
# (e.g. u"\u8200" -> "=?utf-8?b?6IiA?=").
from email.Header import Header
v = Header(v, 'utf-8').encode()
else:
raise
else:
# This coercion should not take any time at all
# if value is already of type "str".
v = str(v)
header_list.append((key, v))
return header_list
class Host(object):
"""An internet address.
name should be the client's host name. If not available (because no DNS
lookup is performed), the IP address should be used instead.
"""
ip = "0.0.0.0"
port = 80
name = "unknown.tld"
def __init__(self, ip, port, name=None):
self.ip = ip
self.port = port
if name is None:
name = ip
self.name = name
def __repr__(self):
return "http.Host(%r, %r, %r)" % (self.ip, self.port, self.name)

View File

@@ -1,361 +0,0 @@
"""
httpauth modules defines functions to implement HTTP Digest Authentication (RFC 2617).
This has full compliance with 'Digest' and 'Basic' authentication methods. In
'Digest' it supports both MD5 and MD5-sess algorithms.
Usage:
First use 'doAuth' to request the client authentication for a
certain resource. You should send an httplib.UNAUTHORIZED response to the
client so he knows he has to authenticate itself.
Then use 'parseAuthorization' to retrieve the 'auth_map' used in
'checkResponse'.
To use 'checkResponse' you must have already verified the password associated
with the 'username' key in 'auth_map' dict. Then you use the 'checkResponse'
function to verify if the password matches the one sent by the client.
SUPPORTED_ALGORITHM - list of supported 'Digest' algorithms
SUPPORTED_QOP - list of supported 'Digest' 'qop'.
"""
__version__ = 1, 0, 1
__author__ = "Tiago Cogumbreiro <cogumbreiro@users.sf.net>"
__credits__ = """
Peter van Kampen for its recipe which implement most of Digest authentication:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/302378
"""
__license__ = """
Copyright (c) 2005, Tiago Cogumbreiro <cogumbreiro@users.sf.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Sylvain Hellegouarch nor the names of his contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
__all__ = ("digestAuth", "basicAuth", "doAuth", "checkResponse",
"parseAuthorization", "SUPPORTED_ALGORITHM", "md5SessionKey",
"calculateNonce", "SUPPORTED_QOP")
################################################################################
try:
# Python 2.5+
from hashlib import md5
except ImportError:
from md5 import new as md5
import time
import base64
import urllib2
MD5 = "MD5"
MD5_SESS = "MD5-sess"
AUTH = "auth"
AUTH_INT = "auth-int"
SUPPORTED_ALGORITHM = (MD5, MD5_SESS)
SUPPORTED_QOP = (AUTH, AUTH_INT)
################################################################################
# doAuth
#
DIGEST_AUTH_ENCODERS = {
MD5: lambda val: md5(val).hexdigest(),
MD5_SESS: lambda val: md5(val).hexdigest(),
# SHA: lambda val: sha.new (val).hexdigest (),
}
def calculateNonce (realm, algorithm = MD5):
"""This is an auxaliary function that calculates 'nonce' value. It is used
to handle sessions."""
global SUPPORTED_ALGORITHM, DIGEST_AUTH_ENCODERS
assert algorithm in SUPPORTED_ALGORITHM
try:
encoder = DIGEST_AUTH_ENCODERS[algorithm]
except KeyError:
raise NotImplementedError ("The chosen algorithm (%s) does not have "\
"an implementation yet" % algorithm)
return encoder ("%d:%s" % (time.time(), realm))
def digestAuth (realm, algorithm = MD5, nonce = None, qop = AUTH):
"""Challenges the client for a Digest authentication."""
global SUPPORTED_ALGORITHM, DIGEST_AUTH_ENCODERS, SUPPORTED_QOP
assert algorithm in SUPPORTED_ALGORITHM
assert qop in SUPPORTED_QOP
if nonce is None:
nonce = calculateNonce (realm, algorithm)
return 'Digest realm="%s", nonce="%s", algorithm="%s", qop="%s"' % (
realm, nonce, algorithm, qop
)
def basicAuth (realm):
"""Challengenes the client for a Basic authentication."""
assert '"' not in realm, "Realms cannot contain the \" (quote) character."
return 'Basic realm="%s"' % realm
def doAuth (realm):
"""'doAuth' function returns the challenge string b giving priority over
Digest and fallback to Basic authentication when the browser doesn't
support the first one.
This should be set in the HTTP header under the key 'WWW-Authenticate'."""
return digestAuth (realm) + " " + basicAuth (realm)
################################################################################
# Parse authorization parameters
#
def _parseDigestAuthorization (auth_params):
# Convert the auth params to a dict
items = urllib2.parse_http_list (auth_params)
params = urllib2.parse_keqv_list (items)
# Now validate the params
# Check for required parameters
required = ["username", "realm", "nonce", "uri", "response"]
for k in required:
if not params.has_key(k):
return None
# If qop is sent then cnonce and nc MUST be present
if params.has_key("qop") and not (params.has_key("cnonce") \
and params.has_key("nc")):
return None
# If qop is not sent, neither cnonce nor nc can be present
if (params.has_key("cnonce") or params.has_key("nc")) and \
not params.has_key("qop"):
return None
return params
def _parseBasicAuthorization (auth_params):
username, password = base64.decodestring (auth_params).split (":", 1)
return {"username": username, "password": password}
AUTH_SCHEMES = {
"basic": _parseBasicAuthorization,
"digest": _parseDigestAuthorization,
}
def parseAuthorization (credentials):
"""parseAuthorization will convert the value of the 'Authorization' key in
the HTTP header to a map itself. If the parsing fails 'None' is returned.
"""
global AUTH_SCHEMES
auth_scheme, auth_params = credentials.split(" ", 1)
auth_scheme = auth_scheme.lower ()
parser = AUTH_SCHEMES[auth_scheme]
params = parser (auth_params)
if params is None:
return
assert "auth_scheme" not in params
params["auth_scheme"] = auth_scheme
return params
################################################################################
# Check provided response for a valid password
#
def md5SessionKey (params, password):
"""
If the "algorithm" directive's value is "MD5-sess", then A1
[the session key] is calculated only once - on the first request by the
client following receipt of a WWW-Authenticate challenge from the server.
This creates a 'session key' for the authentication of subsequent
requests and responses which is different for each "authentication
session", thus limiting the amount of material hashed with any one
key.
Because the server need only use the hash of the user
credentials in order to create the A1 value, this construction could
be used in conjunction with a third party authentication service so
that the web server would not need the actual password value. The
specification of such a protocol is beyond the scope of this
specification.
"""
keys = ("username", "realm", "nonce", "cnonce")
params_copy = {}
for key in keys:
params_copy[key] = params[key]
params_copy["algorithm"] = MD5_SESS
return _A1 (params_copy, password)
def _A1(params, password):
algorithm = params.get ("algorithm", MD5)
H = DIGEST_AUTH_ENCODERS[algorithm]
if algorithm == MD5:
# If the "algorithm" directive's value is "MD5" or is
# unspecified, then A1 is:
# A1 = unq(username-value) ":" unq(realm-value) ":" passwd
return "%s:%s:%s" % (params["username"], params["realm"], password)
elif algorithm == MD5_SESS:
# This is A1 if qop is set
# A1 = H( unq(username-value) ":" unq(realm-value) ":" passwd )
# ":" unq(nonce-value) ":" unq(cnonce-value)
h_a1 = H ("%s:%s:%s" % (params["username"], params["realm"], password))
return "%s:%s:%s" % (h_a1, params["nonce"], params["cnonce"])
def _A2(params, method, kwargs):
# If the "qop" directive's value is "auth" or is unspecified, then A2 is:
# A2 = Method ":" digest-uri-value
qop = params.get ("qop", "auth")
if qop == "auth":
return method + ":" + params["uri"]
elif qop == "auth-int":
# If the "qop" value is "auth-int", then A2 is:
# A2 = Method ":" digest-uri-value ":" H(entity-body)
entity_body = kwargs.get ("entity_body", "")
H = kwargs["H"]
return "%s:%s:%s" % (
method,
params["uri"],
H(entity_body)
)
else:
raise NotImplementedError ("The 'qop' method is unknown: %s" % qop)
def _computeDigestResponse(auth_map, password, method = "GET", A1 = None,**kwargs):
"""
Generates a response respecting the algorithm defined in RFC 2617
"""
params = auth_map
algorithm = params.get ("algorithm", MD5)
H = DIGEST_AUTH_ENCODERS[algorithm]
KD = lambda secret, data: H(secret + ":" + data)
qop = params.get ("qop", None)
H_A2 = H(_A2(params, method, kwargs))
if algorithm == MD5_SESS and A1 is not None:
H_A1 = H(A1)
else:
H_A1 = H(_A1(params, password))
if qop in ("auth", "auth-int"):
# If the "qop" value is "auth" or "auth-int":
# request-digest = <"> < KD ( H(A1), unq(nonce-value)
# ":" nc-value
# ":" unq(cnonce-value)
# ":" unq(qop-value)
# ":" H(A2)
# ) <">
request = "%s:%s:%s:%s:%s" % (
params["nonce"],
params["nc"],
params["cnonce"],
params["qop"],
H_A2,
)
elif qop is None:
# If the "qop" directive is not present (this construction is
# for compatibility with RFC 2069):
# request-digest =
# <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <">
request = "%s:%s" % (params["nonce"], H_A2)
return KD(H_A1, request)
def _checkDigestResponse(auth_map, password, method = "GET", A1 = None, **kwargs):
"""This function is used to verify the response given by the client when
he tries to authenticate.
Optional arguments:
entity_body - when 'qop' is set to 'auth-int' you MUST provide the
raw data you are going to send to the client (usually the
HTML page.
request_uri - the uri from the request line compared with the 'uri'
directive of the authorization map. They must represent
the same resource (unused at this time).
"""
if auth_map['realm'] != kwargs.get('realm', None):
return False
response = _computeDigestResponse(auth_map, password, method, A1,**kwargs)
return response == auth_map["response"]
def _checkBasicResponse (auth_map, password, method='GET', encrypt=None, **kwargs):
# Note that the Basic response doesn't provide the realm value so we cannot
# test it
try:
return encrypt(auth_map["password"], auth_map["username"]) == password
except TypeError:
return encrypt(auth_map["password"]) == password
AUTH_RESPONSES = {
"basic": _checkBasicResponse,
"digest": _checkDigestResponse,
}
def checkResponse (auth_map, password, method = "GET", encrypt=None, **kwargs):
"""'checkResponse' compares the auth_map with the password and optionally
other arguments that each implementation might need.
If the response is of type 'Basic' then the function has the following
signature:
checkBasicResponse (auth_map, password) -> bool
If the response is of type 'Digest' then the function has the following
signature:
checkDigestResponse (auth_map, password, method = 'GET', A1 = None) -> bool
The 'A1' argument is only used in MD5_SESS algorithm based responses.
Check md5SessionKey() for more info.
"""
global AUTH_RESPONSES
checker = AUTH_RESPONSES[auth_map["auth_scheme"]]
return checker (auth_map, password, method=method, encrypt=encrypt, **kwargs)

View File

@@ -1,198 +0,0 @@
"""Profiler tools for CherryPy.
CherryPy users
==============
You can profile any of your pages as follows:
from cherrypy.lib import profiler
class Root:
p = profile.Profiler("/path/to/profile/dir")
def index(self):
self.p.run(self._index)
index.exposed = True
def _index(self):
return "Hello, world!"
cherrypy.tree.mount(Root())
You can also turn on profiling for all requests
using the make_app function as WSGI middleware.
CherryPy developers
===================
This module can be used whenever you make changes to CherryPy,
to get a quick sanity-check on overall CP performance. Use the
"--profile" flag when running the test suite. Then, use the serve()
function to browse the results in a web browser. If you run this
module from the command line, it will call serve() for you.
"""
# Make profiler output more readable by adding __init__ modules' parents.
def new_func_strip_path(func_name):
filename, line, name = func_name
if filename.endswith("__init__.py"):
return os.path.basename(filename[:-12]) + filename[-12:], line, name
return os.path.basename(filename), line, name
try:
import profile
import pstats
pstats.func_strip_path = new_func_strip_path
except ImportError:
profile = None
pstats = None
import warnings
msg = ("Your installation of Python does not have a profile module. "
"If you're on Debian, try `sudo apt-get install python-profiler`. "
"See http://www.cherrypy.org/wiki/ProfilingOnDebian for details.")
warnings.warn(msg)
import os, os.path
import sys
try:
import cStringIO as StringIO
except ImportError:
import StringIO
_count = 0
class Profiler(object):
def __init__(self, path=None):
if not path:
path = os.path.join(os.path.dirname(__file__), "profile")
self.path = path
if not os.path.exists(path):
os.makedirs(path)
def run(self, func, *args, **params):
"""Dump profile data into self.path."""
global _count
c = _count = _count + 1
path = os.path.join(self.path, "cp_%04d.prof" % c)
prof = profile.Profile()
result = prof.runcall(func, *args, **params)
prof.dump_stats(path)
return result
def statfiles(self):
"""statfiles() -> list of available profiles."""
return [f for f in os.listdir(self.path)
if f.startswith("cp_") and f.endswith(".prof")]
def stats(self, filename, sortby='cumulative'):
"""stats(index) -> output of print_stats() for the given profile."""
sio = StringIO.StringIO()
if sys.version_info >= (2, 5):
s = pstats.Stats(os.path.join(self.path, filename), stream=sio)
s.strip_dirs()
s.sort_stats(sortby)
s.print_stats()
else:
# pstats.Stats before Python 2.5 didn't take a 'stream' arg,
# but just printed to stdout. So re-route stdout.
s = pstats.Stats(os.path.join(self.path, filename))
s.strip_dirs()
s.sort_stats(sortby)
oldout = sys.stdout
try:
sys.stdout = sio
s.print_stats()
finally:
sys.stdout = oldout
response = sio.getvalue()
sio.close()
return response
def index(self):
return """<html>
<head><title>CherryPy profile data</title></head>
<frameset cols='200, 1*'>
<frame src='menu' />
<frame name='main' src='' />
</frameset>
</html>
"""
index.exposed = True
def menu(self):
yield "<h2>Profiling runs</h2>"
yield "<p>Click on one of the runs below to see profiling data.</p>"
runs = self.statfiles()
runs.sort()
for i in runs:
yield "<a href='report?filename=%s' target='main'>%s</a><br />" % (i, i)
menu.exposed = True
def report(self, filename):
import cherrypy
cherrypy.response.headers['Content-Type'] = 'text/plain'
return self.stats(filename)
report.exposed = True
class ProfileAggregator(Profiler):
def __init__(self, path=None):
Profiler.__init__(self, path)
global _count
self.count = _count = _count + 1
self.profiler = profile.Profile()
def run(self, func, *args):
path = os.path.join(self.path, "cp_%04d.prof" % self.count)
result = self.profiler.runcall(func, *args)
self.profiler.dump_stats(path)
return result
class make_app:
def __init__(self, nextapp, path=None, aggregate=False):
"""Make a WSGI middleware app which wraps 'nextapp' with profiling.
nextapp: the WSGI application to wrap, usually an instance of
cherrypy.Application.
path: where to dump the profiling output.
aggregate: if True, profile data for all HTTP requests will go in
a single file. If False (the default), each HTTP request will
dump its profile data into a separate file.
"""
self.nextapp = nextapp
self.aggregate = aggregate
if aggregate:
self.profiler = ProfileAggregator(path)
else:
self.profiler = Profiler(path)
def __call__(self, environ, start_response):
def gather():
result = []
for line in self.nextapp(environ, start_response):
result.append(line)
return result
return self.profiler.run(gather)
def serve(path=None, port=8080):
import cherrypy
cherrypy.config.update({'server.socket_port': int(port),
'server.thread_pool': 10,
'environment': "production",
})
cherrypy.quickstart(Profiler(path))
if __name__ == "__main__":
serve(*tuple(sys.argv[1:]))

View File

@@ -1,128 +0,0 @@
import cherrypy
class MultipartWrapper(object):
"""Wraps a file-like object, returning '' when Content-Length is reached.
The cgi module's logic for reading multipart MIME messages doesn't
allow the parts to know when the Content-Length for the entire message
has been reached, and doesn't allow for multipart-MIME messages that
omit the trailing CRLF (Flash 8's FileReference.upload(url), for example,
does this). The read_lines_to_outerboundary function gets stuck in a loop
until the socket times out.
This rfile wrapper simply monitors the incoming stream. When a read is
attempted past the Content-Length, it returns an empty string rather
than timing out (of course, if the last read *overlaps* the C-L, you'll
get the last bit of data up to C-L, and then the next read will return
an empty string).
"""
def __init__(self, rfile, clen):
self.rfile = rfile
self.clen = clen
self.bytes_read = 0
def read(self, size = None):
if self.clen:
# Return '' if we've read all the data.
if self.bytes_read >= self.clen:
return ''
# Reduce 'size' if it's over our limit.
new_bytes_read = self.bytes_read + size
if new_bytes_read > self.clen:
size = self.clen - self.bytes_read
data = self.rfile.read(size)
self.bytes_read += len(data)
return data
def readline(self, size = None):
if size is not None:
if self.clen:
# Return '' if we've read all the data.
if self.bytes_read >= self.clen:
return ''
# Reduce 'size' if it's over our limit.
new_bytes_read = self.bytes_read + size
if new_bytes_read > self.clen:
size = self.clen - self.bytes_read
data = self.rfile.readline(size)
self.bytes_read += len(data)
return data
# User didn't specify a size ...
# We read the line in chunks to make sure it's not a 100MB line !
res = []
size = 256
while True:
if self.clen:
# Return if we've read all the data.
if self.bytes_read >= self.clen:
return ''.join(res)
# Reduce 'size' if it's over our limit.
new_bytes_read = self.bytes_read + size
if new_bytes_read > self.clen:
size = self.clen - self.bytes_read
data = self.rfile.readline(size)
self.bytes_read += len(data)
res.append(data)
# See http://www.cherrypy.org/ticket/421
if len(data) < size or data[-1:] == "\n":
return ''.join(res)
def readlines(self, sizehint = 0):
# Shamelessly stolen from StringIO
total = 0
lines = []
line = self.readline()
while line:
lines.append(line)
total += len(line)
if 0 < sizehint <= total:
break
line = self.readline()
return lines
def close(self):
self.rfile.close()
def __iter__(self):
return self.rfile
def next(self):
if self.clen:
# Return '' if we've read all the data.
if self.bytes_read >= self.clen:
return ''
data = self.rfile.next()
self.bytes_read += len(data)
return data
def safe_multipart(flash_only=False):
"""Wrap request.rfile in a reader that won't crash on no trailing CRLF."""
h = cherrypy.request.headers
if not h.get('Content-Type','').startswith('multipart/'):
return
if flash_only and not 'Shockwave Flash' in h.get('User-Agent', ''):
return
clen = h.get('Content-Length', '0')
try:
clen = int(clen)
except ValueError:
return
cherrypy.request.rfile = MultipartWrapper(cherrypy.request.rfile, clen)
def init():
"""Create a Tool for safe_multipart and add it to cherrypy.tools."""
cherrypy.tools.safe_multipart = cherrypy.Tool('before_request_body',
safe_multipart)

View File

@@ -1,705 +0,0 @@
"""Session implementation for CherryPy.
We use cherrypy.request to store some convenient variables as
well as data about the session for the current request. Instead of
polluting cherrypy.request we use a Session object bound to
cherrypy.session to store these variables.
"""
import datetime
import os
try:
import cPickle as pickle
except ImportError:
import pickle
import random
try:
# Python 2.5+
from hashlib import sha1 as sha
except ImportError:
from sha import new as sha
import time
import threading
import types
from warnings import warn
import cherrypy
from cherrypy.lib import http
missing = object()
class Session(object):
"""A CherryPy dict-like Session object (one per request)."""
__metaclass__ = cherrypy._AttributeDocstrings
_id = None
id_observers = None
id_observers__doc = "A list of callbacks to which to pass new id's."
id__doc = "The current session ID."
def _get_id(self):
return self._id
def _set_id(self, value):
self._id = value
for o in self.id_observers:
o(value)
id = property(_get_id, _set_id, doc=id__doc)
timeout = 60
timeout__doc = "Number of minutes after which to delete session data."
locked = False
locked__doc = """
If True, this session instance has exclusive read/write access
to session data."""
loaded = False
loaded__doc = """
If True, data has been retrieved from storage. This should happen
automatically on the first attempt to access session data."""
clean_thread = None
clean_thread__doc = "Class-level Monitor which calls self.clean_up."
clean_freq = 5
clean_freq__doc = "The poll rate for expired session cleanup in minutes."
def __init__(self, id=None, **kwargs):
self.id_observers = []
self._data = {}
for k, v in kwargs.iteritems():
setattr(self, k, v)
if id is None:
self.regenerate()
else:
self.id = id
if not self._exists():
# Expired or malicious session. Make a new one.
# See http://www.cherrypy.org/ticket/709.
self.id = None
self.regenerate()
def regenerate(self):
"""Replace the current session (with a new id)."""
if self.id is not None:
self.delete()
old_session_was_locked = self.locked
if old_session_was_locked:
self.release_lock()
self.id = None
while self.id is None:
self.id = self.generate_id()
# Assert that the generated id is not already stored.
if self._exists():
self.id = None
if old_session_was_locked:
self.acquire_lock()
def clean_up(self):
"""Clean up expired sessions."""
pass
try:
os.urandom(20)
except (AttributeError, NotImplementedError):
# os.urandom not available until Python 2.4. Fall back to random.random.
def generate_id(self):
"""Return a new session id."""
return sha('%s' % random.random()).hexdigest()
else:
def generate_id(self):
"""Return a new session id."""
return os.urandom(20).encode('hex')
def save(self):
"""Save session data."""
try:
# If session data has never been loaded then it's never been
# accessed: no need to save it
if self.loaded:
t = datetime.timedelta(seconds = self.timeout * 60)
expiration_time = datetime.datetime.now() + t
self._save(expiration_time)
finally:
if self.locked:
# Always release the lock if the user didn't release it
self.release_lock()
def load(self):
"""Copy stored session data into this session instance."""
data = self._load()
# data is either None or a tuple (session_data, expiration_time)
if data is None or data[1] < datetime.datetime.now():
# Expired session: flush session data
self._data = {}
else:
self._data = data[0]
self.loaded = True
# Stick the clean_thread in the class, not the instance.
# The instances are created and destroyed per-request.
cls = self.__class__
if self.clean_freq and not cls.clean_thread:
# clean_up is in instancemethod and not a classmethod,
# so that tool config can be accessed inside the method.
t = cherrypy.process.plugins.Monitor(
cherrypy.engine, self.clean_up, self.clean_freq * 60)
t.subscribe()
cls.clean_thread = t
t.start()
def delete(self):
"""Delete stored session data."""
self._delete()
def __getitem__(self, key):
if not self.loaded: self.load()
return self._data[key]
def __setitem__(self, key, value):
if not self.loaded: self.load()
self._data[key] = value
def __delitem__(self, key):
if not self.loaded: self.load()
del self._data[key]
def pop(self, key, default=missing):
"""Remove the specified key and return the corresponding value.
If key is not found, default is returned if given,
otherwise KeyError is raised.
"""
if not self.loaded: self.load()
if default is missing:
return self._data.pop(key)
else:
return self._data.pop(key, default)
def __contains__(self, key):
if not self.loaded: self.load()
return key in self._data
def has_key(self, key):
"""D.has_key(k) -> True if D has a key k, else False."""
if not self.loaded: self.load()
return self._data.has_key(key)
def get(self, key, default=None):
"""D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None."""
if not self.loaded: self.load()
return self._data.get(key, default)
def update(self, d):
"""D.update(E) -> None. Update D from E: for k in E: D[k] = E[k]."""
if not self.loaded: self.load()
self._data.update(d)
def setdefault(self, key, default=None):
"""D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D."""
if not self.loaded: self.load()
return self._data.setdefault(key, default)
def clear(self):
"""D.clear() -> None. Remove all items from D."""
if not self.loaded: self.load()
self._data.clear()
def keys(self):
"""D.keys() -> list of D's keys."""
if not self.loaded: self.load()
return self._data.keys()
def items(self):
"""D.items() -> list of D's (key, value) pairs, as 2-tuples."""
if not self.loaded: self.load()
return self._data.items()
def values(self):
"""D.values() -> list of D's values."""
if not self.loaded: self.load()
return self._data.values()
class RamSession(Session):
# Class-level objects. Don't rebind these!
cache = {}
locks = {}
def clean_up(self):
"""Clean up expired sessions."""
now = datetime.datetime.now()
for id, (data, expiration_time) in self.cache.items():
if expiration_time < now:
try:
del self.cache[id]
except KeyError:
pass
try:
del self.locks[id]
except KeyError:
pass
def _exists(self):
return self.id in self.cache
def _load(self):
return self.cache.get(self.id)
def _save(self, expiration_time):
self.cache[self.id] = (self._data, expiration_time)
def _delete(self):
del self.cache[self.id]
def acquire_lock(self):
"""Acquire an exclusive lock on the currently-loaded session data."""
self.locked = True
self.locks.setdefault(self.id, threading.RLock()).acquire()
def release_lock(self):
"""Release the lock on the currently-loaded session data."""
self.locks[self.id].release()
self.locked = False
def __len__(self):
"""Return the number of active sessions."""
return len(self.cache)
class FileSession(Session):
"""Implementation of the File backend for sessions
storage_path: the folder where session data will be saved. Each session
will be saved as pickle.dump(data, expiration_time) in its own file;
the filename will be self.SESSION_PREFIX + self.id.
"""
SESSION_PREFIX = 'session-'
LOCK_SUFFIX = '.lock'
pickle_protocol = pickle.HIGHEST_PROTOCOL
def __init__(self, id=None, **kwargs):
# The 'storage_path' arg is required for file-based sessions.
kwargs['storage_path'] = os.path.abspath(kwargs['storage_path'])
Session.__init__(self, id=id, **kwargs)
def setup(cls, **kwargs):
"""Set up the storage system for file-based sessions.
This should only be called once per process; this will be done
automatically when using sessions.init (as the built-in Tool does).
"""
# The 'storage_path' arg is required for file-based sessions.
kwargs['storage_path'] = os.path.abspath(kwargs['storage_path'])
for k, v in kwargs.iteritems():
setattr(cls, k, v)
# Warn if any lock files exist at startup.
lockfiles = [fname for fname in os.listdir(cls.storage_path)
if (fname.startswith(cls.SESSION_PREFIX)
and fname.endswith(cls.LOCK_SUFFIX))]
if lockfiles:
plural = ('', 's')[len(lockfiles) > 1]
warn("%s session lockfile%s found at startup. If you are "
"only running one process, then you may need to "
"manually delete the lockfiles found at %r."
% (len(lockfiles), plural, cls.storage_path))
setup = classmethod(setup)
def _get_file_path(self):
f = os.path.join(self.storage_path, self.SESSION_PREFIX + self.id)
if not os.path.abspath(f).startswith(self.storage_path):
raise cherrypy.HTTPError(400, "Invalid session id in cookie.")
return f
def _exists(self):
path = self._get_file_path()
return os.path.exists(path)
def _load(self, path=None):
if path is None:
path = self._get_file_path()
try:
f = open(path, "rb")
try:
return pickle.load(f)
finally:
f.close()
except (IOError, EOFError):
return None
def _save(self, expiration_time):
f = open(self._get_file_path(), "wb")
try:
pickle.dump((self._data, expiration_time), f, self.pickle_protocol)
finally:
f.close()
def _delete(self):
try:
os.unlink(self._get_file_path())
except OSError:
pass
def acquire_lock(self, path=None):
"""Acquire an exclusive lock on the currently-loaded session data."""
if path is None:
path = self._get_file_path()
path += self.LOCK_SUFFIX
while True:
try:
lockfd = os.open(path, os.O_CREAT|os.O_WRONLY|os.O_EXCL)
except OSError:
time.sleep(0.1)
else:
os.close(lockfd)
break
self.locked = True
def release_lock(self, path=None):
"""Release the lock on the currently-loaded session data."""
if path is None:
path = self._get_file_path()
os.unlink(path + self.LOCK_SUFFIX)
self.locked = False
def clean_up(self):
"""Clean up expired sessions."""
now = datetime.datetime.now()
# Iterate over all session files in self.storage_path
for fname in os.listdir(self.storage_path):
if (fname.startswith(self.SESSION_PREFIX)
and not fname.endswith(self.LOCK_SUFFIX)):
# We have a session file: lock and load it and check
# if it's expired. If it fails, nevermind.
path = os.path.join(self.storage_path, fname)
self.acquire_lock(path)
try:
contents = self._load(path)
# _load returns None on IOError
if contents is not None:
data, expiration_time = contents
if expiration_time < now:
# Session expired: deleting it
os.unlink(path)
finally:
self.release_lock(path)
def __len__(self):
"""Return the number of active sessions."""
return len([fname for fname in os.listdir(self.storage_path)
if (fname.startswith(self.SESSION_PREFIX)
and not fname.endswith(self.LOCK_SUFFIX))])
class PostgresqlSession(Session):
""" Implementation of the PostgreSQL backend for sessions. It assumes
a table like this:
create table session (
id varchar(40),
data text,
expiration_time timestamp
)
You must provide your own get_db function.
"""
pickle_protocol = pickle.HIGHEST_PROTOCOL
def __init__(self, id=None, **kwargs):
Session.__init__(self, id, **kwargs)
self.cursor = self.db.cursor()
def setup(cls, **kwargs):
"""Set up the storage system for Postgres-based sessions.
This should only be called once per process; this will be done
automatically when using sessions.init (as the built-in Tool does).
"""
for k, v in kwargs.iteritems():
setattr(cls, k, v)
self.db = self.get_db()
setup = classmethod(setup)
def __del__(self):
if self.cursor:
self.cursor.close()
self.db.commit()
def _exists(self):
# Select session data from table
self.cursor.execute('select data, expiration_time from session '
'where id=%s', (self.id,))
rows = self.cursor.fetchall()
return bool(rows)
def _load(self):
# Select session data from table
self.cursor.execute('select data, expiration_time from session '
'where id=%s', (self.id,))
rows = self.cursor.fetchall()
if not rows:
return None
pickled_data, expiration_time = rows[0]
data = pickle.loads(pickled_data)
return data, expiration_time
def _save(self, expiration_time):
pickled_data = pickle.dumps(self._data, self.pickle_protocol)
self.cursor.execute('update session set data = %s, '
'expiration_time = %s where id = %s',
(pickled_data, expiration_time, self.id))
def _delete(self):
self.cursor.execute('delete from session where id=%s', (self.id,))
def acquire_lock(self):
"""Acquire an exclusive lock on the currently-loaded session data."""
# We use the "for update" clause to lock the row
self.locked = True
self.cursor.execute('select id from session where id=%s for update',
(self.id,))
def release_lock(self):
"""Release the lock on the currently-loaded session data."""
# We just close the cursor and that will remove the lock
# introduced by the "for update" clause
self.cursor.close()
self.locked = False
def clean_up(self):
"""Clean up expired sessions."""
self.cursor.execute('delete from session where expiration_time < %s',
(datetime.datetime.now(),))
class MemcachedSession(Session):
# The most popular memcached client for Python isn't thread-safe.
# Wrap all .get and .set operations in a single lock.
mc_lock = threading.RLock()
# This is a seperate set of locks per session id.
locks = {}
servers = ['127.0.0.1:11211']
def setup(cls, **kwargs):
"""Set up the storage system for memcached-based sessions.
This should only be called once per process; this will be done
automatically when using sessions.init (as the built-in Tool does).
"""
for k, v in kwargs.iteritems():
setattr(cls, k, v)
import memcache
cls.cache = memcache.Client(cls.servers)
setup = classmethod(setup)
def _exists(self):
self.mc_lock.acquire()
try:
return bool(self.cache.get(self.id))
finally:
self.mc_lock.release()
def _load(self):
self.mc_lock.acquire()
try:
return self.cache.get(self.id)
finally:
self.mc_lock.release()
def _save(self, expiration_time):
# Send the expiration time as "Unix time" (seconds since 1/1/1970)
td = int(time.mktime(expiration_time.timetuple()))
self.mc_lock.acquire()
try:
if not self.cache.set(self.id, (self._data, expiration_time), td):
raise AssertionError("Session data for id %r not set." % self.id)
finally:
self.mc_lock.release()
def _delete(self):
self.cache.delete(self.id)
def acquire_lock(self):
"""Acquire an exclusive lock on the currently-loaded session data."""
self.locked = True
self.locks.setdefault(self.id, threading.RLock()).acquire()
def release_lock(self):
"""Release the lock on the currently-loaded session data."""
self.locks[self.id].release()
self.locked = False
def __len__(self):
"""Return the number of active sessions."""
raise NotImplementedError
# Hook functions (for CherryPy tools)
def save():
"""Save any changed session data."""
if not hasattr(cherrypy.serving, "session"):
return
# Guard against running twice
if hasattr(cherrypy.request, "_sessionsaved"):
return
cherrypy.request._sessionsaved = True
if cherrypy.response.stream:
# If the body is being streamed, we have to save the data
# *after* the response has been written out
cherrypy.request.hooks.attach('on_end_request', cherrypy.session.save)
else:
# If the body is not being streamed, we save the data now
# (so we can release the lock).
if isinstance(cherrypy.response.body, types.GeneratorType):
cherrypy.response.collapse_body()
cherrypy.session.save()
save.failsafe = True
def close():
"""Close the session object for this request."""
sess = getattr(cherrypy.serving, "session", None)
if getattr(sess, "locked", False):
# If the session is still locked we release the lock
sess.release_lock()
close.failsafe = True
close.priority = 90
def init(storage_type='ram', path=None, path_header=None, name='session_id',
timeout=60, domain=None, secure=False, clean_freq=5,
persistent=True, **kwargs):
"""Initialize session object (using cookies).
storage_type: one of 'ram', 'file', 'postgresql'. This will be used
to look up the corresponding class in cherrypy.lib.sessions
globals. For example, 'file' will use the FileSession class.
path: the 'path' value to stick in the response cookie metadata.
path_header: if 'path' is None (the default), then the response
cookie 'path' will be pulled from request.headers[path_header].
name: the name of the cookie.
timeout: the expiration timeout (in minutes) for the stored session data.
If 'persistent' is True (the default), this is also the timeout
for the cookie.
domain: the cookie domain.
secure: if False (the default) the cookie 'secure' value will not
be set. If True, the cookie 'secure' value will be set (to 1).
clean_freq (minutes): the poll rate for expired session cleanup.
persistent: if True (the default), the 'timeout' argument will be used
to expire the cookie. If False, the cookie will not have an expiry,
and the cookie will be a "session cookie" which expires when the
browser is closed.
Any additional kwargs will be bound to the new Session instance,
and may be specific to the storage type. See the subclass of Session
you're using for more information.
"""
request = cherrypy.request
# Guard against running twice
if hasattr(request, "_session_init_flag"):
return
request._session_init_flag = True
# Check if request came with a session ID
id = None
if name in request.cookie:
id = request.cookie[name].value
# Find the storage class and call setup (first time only).
storage_class = storage_type.title() + 'Session'
storage_class = globals()[storage_class]
if not hasattr(cherrypy, "session"):
if hasattr(storage_class, "setup"):
storage_class.setup(**kwargs)
# Create and attach a new Session instance to cherrypy.serving.
# It will possess a reference to (and lock, and lazily load)
# the requested session data.
kwargs['timeout'] = timeout
kwargs['clean_freq'] = clean_freq
cherrypy.serving.session = sess = storage_class(id, **kwargs)
def update_cookie(id):
"""Update the cookie every time the session id changes."""
cherrypy.response.cookie[name] = id
sess.id_observers.append(update_cookie)
# Create cherrypy.session which will proxy to cherrypy.serving.session
if not hasattr(cherrypy, "session"):
cherrypy.session = cherrypy._ThreadLocalProxy('session')
if persistent:
cookie_timeout = timeout
else:
# See http://support.microsoft.com/kb/223799/EN-US/
# and http://support.mozilla.com/en-US/kb/Cookies
cookie_timeout = None
set_response_cookie(path=path, path_header=path_header, name=name,
timeout=cookie_timeout, domain=domain, secure=secure)
def set_response_cookie(path=None, path_header=None, name='session_id',
timeout=60, domain=None, secure=False):
"""Set a response cookie for the client.
path: the 'path' value to stick in the response cookie metadata.
path_header: if 'path' is None (the default), then the response
cookie 'path' will be pulled from request.headers[path_header].
name: the name of the cookie.
timeout: the expiration timeout for the cookie. If 0 or other boolean
False, no 'expires' param will be set, and the cookie will be a
"session cookie" which expires when the browser is closed.
domain: the cookie domain.
secure: if False (the default) the cookie 'secure' value will not
be set. If True, the cookie 'secure' value will be set (to 1).
"""
# Set response cookie
cookie = cherrypy.response.cookie
cookie[name] = cherrypy.serving.session.id
cookie[name]['path'] = (path or cherrypy.request.headers.get(path_header)
or '/')
# We'd like to use the "max-age" param as indicated in
# http://www.faqs.org/rfcs/rfc2109.html but IE doesn't
# save it to disk and the session is lost if people close
# the browser. So we have to use the old "expires" ... sigh ...
## cookie[name]['max-age'] = timeout * 60
if timeout:
cookie[name]['expires'] = http.HTTPDate(time.time() + (timeout * 60))
if domain is not None:
cookie[name]['domain'] = domain
if secure:
cookie[name]['secure'] = 1
def expire():
"""Expire the current session cookie."""
name = cherrypy.request.config.get('tools.sessions.name', 'session_id')
one_year = 60 * 60 * 24 * 365
exp = time.gmtime(time.time() - one_year)
t = time.strftime("%a, %d-%b-%Y %H:%M:%S GMT", exp)
cherrypy.response.cookie[name]['expires'] = t

View File

@@ -1,229 +0,0 @@
import mimetypes
mimetypes.init()
mimetypes.types_map['.dwg']='image/x-dwg'
mimetypes.types_map['.ico']='image/x-icon'
import os
import re
import stat
import time
import urllib
import cherrypy
from cherrypy.lib import cptools, http, file_generator_limited
def serve_file(path, content_type=None, disposition=None, name=None):
"""Set status, headers, and body in order to serve the given file.
The Content-Type header will be set to the content_type arg, if provided.
If not provided, the Content-Type will be guessed by the file extension
of the 'path' argument.
If disposition is not None, the Content-Disposition header will be set
to "<disposition>; filename=<name>". If name is None, it will be set
to the basename of path. If disposition is None, no Content-Disposition
header will be written.
"""
response = cherrypy.response
# If path is relative, users should fix it by making path absolute.
# That is, CherryPy should not guess where the application root is.
# It certainly should *not* use cwd (since CP may be invoked from a
# variety of paths). If using tools.staticdir, you can make your relative
# paths become absolute by supplying a value for "tools.staticdir.root".
if not os.path.isabs(path):
raise ValueError("'%s' is not an absolute path." % path)
try:
st = os.stat(path)
except OSError:
raise cherrypy.NotFound()
# Check if path is a directory.
if stat.S_ISDIR(st.st_mode):
# Let the caller deal with it as they like.
raise cherrypy.NotFound()
# Set the Last-Modified response header, so that
# modified-since validation code can work.
response.headers['Last-Modified'] = http.HTTPDate(st.st_mtime)
cptools.validate_since()
if content_type is None:
# Set content-type based on filename extension
ext = ""
i = path.rfind('.')
if i != -1:
ext = path[i:].lower()
content_type = mimetypes.types_map.get(ext, "text/plain")
response.headers['Content-Type'] = content_type
if disposition is not None:
if name is None:
name = os.path.basename(path)
cd = '%s; filename="%s"' % (disposition, name)
response.headers["Content-Disposition"] = cd
# Set Content-Length and use an iterable (file object)
# this way CP won't load the whole file in memory
c_len = st.st_size
bodyfile = open(path, 'rb')
# HTTP/1.0 didn't have Range/Accept-Ranges headers, or the 206 code
if cherrypy.request.protocol >= (1, 1):
response.headers["Accept-Ranges"] = "bytes"
r = http.get_ranges(cherrypy.request.headers.get('Range'), c_len)
if r == []:
response.headers['Content-Range'] = "bytes */%s" % c_len
message = "Invalid Range (first-byte-pos greater than Content-Length)"
raise cherrypy.HTTPError(416, message)
if r:
if len(r) == 1:
# Return a single-part response.
start, stop = r[0]
if stop > c_len:
stop = c_len
r_len = stop - start
response.status = "206 Partial Content"
response.headers['Content-Range'] = ("bytes %s-%s/%s" %
(start, stop - 1, c_len))
response.headers['Content-Length'] = r_len
bodyfile.seek(start)
response.body = file_generator_limited(bodyfile, r_len)
else:
# Return a multipart/byteranges response.
response.status = "206 Partial Content"
import mimetools
boundary = mimetools.choose_boundary()
ct = "multipart/byteranges; boundary=%s" % boundary
response.headers['Content-Type'] = ct
if response.headers.has_key("Content-Length"):
# Delete Content-Length header so finalize() recalcs it.
del response.headers["Content-Length"]
def file_ranges():
# Apache compatibility:
yield "\r\n"
for start, stop in r:
yield "--" + boundary
yield "\r\nContent-type: %s" % content_type
yield ("\r\nContent-range: bytes %s-%s/%s\r\n\r\n"
% (start, stop - 1, c_len))
bodyfile.seek(start)
for chunk in file_generator_limited(bodyfile, stop-start):
yield chunk
yield "\r\n"
# Final boundary
yield "--" + boundary + "--"
# Apache compatibility:
yield "\r\n"
response.body = file_ranges()
return response.body
response.headers['Content-Length'] = c_len
response.body = bodyfile
return response.body
def serve_download(path, name=None):
"""Serve 'path' as an application/x-download attachment."""
# This is such a common idiom I felt it deserved its own wrapper.
return serve_file(path, "application/x-download", "attachment", name)
def _attempt(filename, content_types):
try:
# you can set the content types for a
# complete directory per extension
content_type = None
if content_types:
r, ext = os.path.splitext(filename)
content_type = content_types.get(ext[1:], None)
serve_file(filename, content_type=content_type)
return True
except cherrypy.NotFound:
# If we didn't find the static file, continue handling the
# request. We might find a dynamic handler instead.
return False
def staticdir(section, dir, root="", match="", content_types=None, index=""):
"""Serve a static resource from the given (root +) dir.
If 'match' is given, request.path_info will be searched for the given
regular expression before attempting to serve static content.
If content_types is given, it should be a Python dictionary of
{file-extension: content-type} pairs, where 'file-extension' is
a string (e.g. "gif") and 'content-type' is the value to write
out in the Content-Type response header (e.g. "image/gif").
If 'index' is provided, it should be the (relative) name of a file to
serve for directory requests. For example, if the dir argument is
'/home/me', the Request-URI is 'myapp', and the index arg is
'index.html', the file '/home/me/myapp/index.html' will be sought.
"""
if match and not re.search(match, cherrypy.request.path_info):
return False
# Allow the use of '~' to refer to a user's home directory.
dir = os.path.expanduser(dir)
# If dir is relative, make absolute using "root".
if not os.path.isabs(dir):
if not root:
msg = "Static dir requires an absolute dir (or root)."
raise ValueError(msg)
dir = os.path.join(root, dir)
# Determine where we are in the object tree relative to 'section'
# (where the static tool was defined).
if section == 'global':
section = "/"
section = section.rstrip(r"\/")
branch = cherrypy.request.path_info[len(section) + 1:]
branch = urllib.unquote(branch.lstrip(r"\/"))
# If branch is "", filename will end in a slash
filename = os.path.join(dir, branch)
# There's a chance that the branch pulled from the URL might
# have ".." or similar uplevel attacks in it. Check that the final
# filename is a child of dir.
if not os.path.normpath(filename).startswith(os.path.normpath(dir)):
raise cherrypy.HTTPError(403) # Forbidden
handled = _attempt(filename, content_types)
if not handled:
# Check for an index file if a folder was requested.
if index:
handled = _attempt(os.path.join(filename, index), content_types)
if handled:
cherrypy.request.is_index = filename[-1] in (r"\/")
return handled
def staticfile(filename, root=None, match="", content_types=None):
"""Serve a static resource from the given (root +) filename.
If 'match' is given, request.path_info will be searched for the given
regular expression before attempting to serve static content.
If content_types is given, it should be a Python dictionary of
{file-extension: content-type} pairs, where 'file-extension' is
a string (e.g. "gif") and 'content-type' is the value to write
out in the Content-Type response header (e.g. "image/gif").
"""
if match and not re.search(match, cherrypy.request.path_info):
return False
# If filename is relative, make absolute using "root".
if not os.path.isabs(filename):
if not root:
msg = "Static tool requires an absolute filename (got '%s')." % filename
raise ValueError(msg)
filename = os.path.join(root, filename)
return _attempt(filename, content_types)

View File

@@ -1,184 +0,0 @@
"""Functions to run cherrypy.response through Tidy or NSGML."""
import cgi
import os
import StringIO
import traceback
import cherrypy
def tidy(temp_dir, tidy_path, strict_xml=False, errors_to_ignore=None,
indent=False, wrap=False, warnings=True):
"""Run cherrypy.response through Tidy.
If either 'indent' or 'wrap' are specified, then response.body will be
set to the output of tidy. Otherwise, only errors (including warnings,
if warnings is True) will change the body.
Note that we use the standalone Tidy tool rather than the python
mxTidy module. This is because this module does not seem to be
stable and it crashes on some HTML pages (which means that the
server would also crash)
"""
response = cherrypy.response
# the tidy tool, by its very nature it's not generator friendly,
# so we just collapse the body and work with it.
orig_body = response.collapse_body()
fct = response.headers.get('Content-Type', '')
ct = fct.split(';')[0]
encoding = ''
i = fct.find('charset=')
if i != -1:
encoding = fct[i + 8:]
if ct == 'text/html':
page_file = os.path.join(temp_dir, 'page.html')
open(page_file, 'wb').write(orig_body)
out_file = os.path.join(temp_dir, 'tidy.out')
err_file = os.path.join(temp_dir, 'tidy.err')
tidy_enc = encoding.replace('-', '')
if tidy_enc:
tidy_enc = '-' + tidy_enc
strict_xml = ("", " -xml")[bool(strict_xml)]
if indent:
indent = ' -indent'
else:
indent = ''
if wrap is False:
wrap = ''
else:
try:
wrap = ' -wrap %d' % int(tidyWrap)
except:
wrap = ''
result = os.system('"%s" %s%s%s%s -f %s -o %s %s' %
(tidy_path, tidy_enc, strict_xml, indent, wrap,
err_file, out_file, page_file))
use_output = bool(indent or wrap) and not result
if use_output:
output = open(out_file, 'rb').read()
new_errs = []
for err in open(err_file, 'rb').read().splitlines():
if (err.find('Error') != -1 or
(warnings and err.find('Warning') != -1)):
ignore = 0
for err_ign in errors_to_ignore or []:
if err.find(err_ign) != -1:
ignore = 1
break
if not ignore:
new_errs.append(err)
if new_errs:
response.body = wrong_content('<br />'.join(new_errs), orig_body)
if response.headers.has_key("Content-Length"):
# Delete Content-Length header so finalize() recalcs it.
del response.headers["Content-Length"]
return
elif strict_xml:
# The HTML is OK, but is it valid XML?
# Use elementtree to parse XML
from elementtree.ElementTree import parse
tag_list = ['nbsp', 'quot']
for tag in tag_list:
orig_body = orig_body.replace('&' + tag + ';', tag.upper())
if encoding:
enctag = '<?xml version="1.0" encoding="%s"?>' % encoding
orig_body = enctag + orig_body
f = StringIO.StringIO(orig_body)
try:
tree = parse(f)
except:
# Wrong XML
body_file = StringIO.StringIO()
traceback.print_exc(file = body_file)
body_file = '<br />'.join(body_file.getvalue())
response.body = wrong_content(body_file, orig_body, "XML")
if response.headers.has_key("Content-Length"):
# Delete Content-Length header so finalize() recalcs it.
del response.headers["Content-Length"]
return
if use_output:
response.body = [output]
if response.headers.has_key("Content-Length"):
# Delete Content-Length header so finalize() recalcs it.
del response.headers["Content-Length"]
def html_space(text):
"""Escape text, replacing space with nbsp and tab with 4 nbsp's."""
return cgi.escape(text).replace('\t', ' ').replace(' ', '&nbsp;')
def html_break(text):
"""Escape text, replacing newline with HTML br element."""
return cgi.escape(text).replace('\n', '<br />')
def wrong_content(header, body, content_type="HTML"):
output = ["Wrong %s:<br />%s<br />" % (content_type, html_break(header))]
for i, line in enumerate(body.splitlines()):
output.append("%03d - %s" % (i + 1, html_space(line)))
return "<br />".join(output)
def nsgmls(temp_dir, nsgmls_path, catalog_path, errors_to_ignore=None):
response = cherrypy.response
# the tidy tool, by its very nature it's not generator friendly,
# so we just collect the body and work with it.
orig_body = response.collapse_body()
fct = response.headers.get('Content-Type', '')
ct = fct.split(';')[0]
encoding = ''
i = fct.find('charset=')
if i != -1:
encoding = fct[i + 8:]
if ct == 'text/html':
# Remove bits of Javascript (nsgmls doesn't seem to handle
# them correctly (for instance, if <a appears in your
# Javascript code nsgmls complains about it)
while True:
i = orig_body.find('<script')
if i == -1:
break
j = orig_body.find('</script>', i)
if j == -1:
break
orig_body = orig_body[:i] + orig_body[j+9:]
page_file = os.path.join(temp_dir, 'page.html')
open(page_file, 'wb').write(orig_body)
err_file = os.path.join(temp_dir, 'nsgmls.err')
command = ('%s -c%s -f%s -s -E10 %s' %
(nsgmls_path, catalog_path, err_file, page_file))
command = command.replace('\\', '/')
os.system(command)
errs = open(err_file, 'rb').read()
new_errs = []
for err in errs.splitlines():
ignore = False
for err_ign in errors_to_ignore or []:
if err.find(err_ign) != -1:
ignore = True
break
if not ignore:
new_errs.append(err)
if new_errs:
response.body = wrong_content('<br />'.join(new_errs), orig_body)
if response.headers.has_key("Content-Length"):
# Delete Content-Length header so finalize() recalcs it.
del response.headers["Content-Length"]

View File

@@ -1,77 +0,0 @@
"""A CherryPy tool for hosting a foreign WSGI application."""
import sys
import warnings
import cherrypy
# is this sufficient for start_response?
def start_response(status, response_headers, exc_info=None):
cherrypy.response.status = status
headers_dict = dict(response_headers)
cherrypy.response.headers.update(headers_dict)
def make_environ():
"""grabbed some of below from wsgiserver.py
for hosting WSGI apps in non-WSGI environments (yikes!)
"""
request = cherrypy.request
# create and populate the wsgi environ
environ = dict()
environ["wsgi.version"] = (1,0)
environ["wsgi.url_scheme"] = request.scheme
environ["wsgi.input"] = request.rfile
environ["wsgi.errors"] = sys.stderr
environ["wsgi.multithread"] = True
environ["wsgi.multiprocess"] = False
environ["wsgi.run_once"] = False
environ["REQUEST_METHOD"] = request.method
environ["SCRIPT_NAME"] = request.script_name
environ["PATH_INFO"] = request.path_info
environ["QUERY_STRING"] = request.query_string
environ["SERVER_PROTOCOL"] = request.protocol
environ["SERVER_NAME"] = request.local.name
environ["SERVER_PORT"] = request.local.port
environ["REMOTE_HOST"] = request.remote.name
environ["REMOTE_ADDR"] = request.remote.ip
environ["REMOTE_PORT"] = request.remote.port
# then all the http headers
headers = request.headers
environ["CONTENT_TYPE"] = headers.get("Content-type", "")
environ["CONTENT_LENGTH"] = headers.get("Content-length", "")
for (k, v) in headers.iteritems():
envname = "HTTP_" + k.upper().replace("-","_")
environ[envname] = v
return environ
def run(app, env=None):
"""Run the given WSGI app and set response.body to its output."""
warnings.warn("This module is deprecated and will be removed in "
"Cherrypy 3.2. See http://www.cherrypy.org/ticket/700 "
"for more information.")
try:
environ = cherrypy.request.wsgi_environ.copy()
environ['SCRIPT_NAME'] = cherrypy.request.script_name
environ['PATH_INFO'] = cherrypy.request.path_info
except AttributeError:
environ = make_environ()
if env:
environ.update(env)
# run the wsgi app and have it set response.body
response = app(environ, start_response)
try:
cherrypy.response.body = [x for x in response]
finally:
if hasattr(response, "close"):
response.close()
return True

View File

@@ -1,49 +0,0 @@
import sys
import cherrypy
def process_body():
"""Return (params, method) from request body."""
try:
import xmlrpclib
return xmlrpclib.loads(cherrypy.request.body.read())
except Exception:
return ('ERROR PARAMS', ), 'ERRORMETHOD'
def patched_path(path):
"""Return 'path', doctored for RPC."""
if not path.endswith('/'):
path += '/'
if path.startswith('/RPC2/'):
# strip the first /rpc2
path = path[5:]
return path
def _set_response(body):
# The XML-RPC spec (http://www.xmlrpc.com/spec) says:
# "Unless there's a lower-level error, always return 200 OK."
# Since Python's xmlrpclib interprets a non-200 response
# as a "Protocol Error", we'll just return 200 every time.
response = cherrypy.response
response.status = '200 OK'
response.body = body
response.headers['Content-Type'] = 'text/xml'
response.headers['Content-Length'] = len(body)
def respond(body, encoding='utf-8', allow_none=0):
import xmlrpclib
if not isinstance(body, xmlrpclib.Fault):
body = (body,)
_set_response(xmlrpclib.dumps(body, methodresponse=1,
encoding=encoding,
allow_none=allow_none))
def on_error(*args, **kwargs):
body = str(sys.exc_info()[1])
import xmlrpclib
_set_response(xmlrpclib.dumps(xmlrpclib.Fault(1, body)))

View File

@@ -1,14 +0,0 @@
"""Site container for an HTTP server.
A Web Site Process Bus object is used to connect applications, servers,
and frameworks with site-wide services such as daemonization, process
reload, signal handling, drop privileges, PID file management, logging
for all of these, and many more.
The 'plugins' module defines a few abstract and concrete services for
use with the bus. Some use tool-specific channels; see the documentation
for each class.
"""
from cherrypy.process.wspbus import bus
from cherrypy.process import plugins, servers

View File

@@ -1,529 +0,0 @@
"""Site services for use with a Web Site Process Bus."""
import os
import re
try:
set
except NameError:
from sets import Set as set
import signal as _signal
import sys
import time
import threading
class SimplePlugin(object):
"""Plugin base class which auto-subscribes methods for known channels."""
def __init__(self, bus):
self.bus = bus
def subscribe(self):
"""Register this object as a (multi-channel) listener on the bus."""
for channel in self.bus.listeners:
# Subscribe self.start, self.exit, etc. if present.
method = getattr(self, channel, None)
if method is not None:
self.bus.subscribe(channel, method)
def unsubscribe(self):
"""Unregister this object as a listener on the bus."""
for channel in self.bus.listeners:
# Unsubscribe self.start, self.exit, etc. if present.
method = getattr(self, channel, None)
if method is not None:
self.bus.unsubscribe(channel, method)
class SignalHandler(object):
"""Register bus channels (and listeners) for system signals.
By default, instantiating this object subscribes the following signals
and listeners:
TERM: bus.exit
HUP : bus.restart
USR1: bus.graceful
"""
# Map from signal numbers to names
signals = {}
for k, v in vars(_signal).items():
if k.startswith('SIG') and not k.startswith('SIG_'):
signals[v] = k
del k, v
def __init__(self, bus):
self.bus = bus
# Set default handlers
self.handlers = {'SIGTERM': self.bus.exit,
'SIGHUP': self.handle_SIGHUP,
'SIGUSR1': self.bus.graceful,
}
self._previous_handlers = {}
def subscribe(self):
for sig, func in self.handlers.iteritems():
try:
self.set_handler(sig, func)
except ValueError:
pass
def unsubscribe(self):
for signum, handler in self._previous_handlers.iteritems():
signame = self.signals[signum]
if handler is None:
self.bus.log("Restoring %s handler to SIG_DFL." % signame)
handler = _signal.SIG_DFL
else:
self.bus.log("Restoring %s handler %r." % (signame, handler))
try:
our_handler = _signal.signal(signum, handler)
if our_handler is None:
self.bus.log("Restored old %s handler %r, but our "
"handler was not registered." %
(signame, handler), level=30)
except ValueError:
self.bus.log("Unable to restore %s handler %r." %
(signame, handler), level=40, traceback=True)
def set_handler(self, signal, listener=None):
"""Subscribe a handler for the given signal (number or name).
If the optional 'listener' argument is provided, it will be
subscribed as a listener for the given signal's channel.
If the given signal name or number is not available on the current
platform, ValueError is raised.
"""
if isinstance(signal, basestring):
signum = getattr(_signal, signal, None)
if signum is None:
raise ValueError("No such signal: %r" % signal)
signame = signal
else:
try:
signame = self.signals[signal]
except KeyError:
raise ValueError("No such signal: %r" % signal)
signum = signal
prev = _signal.signal(signum, self._handle_signal)
self._previous_handlers[signum] = prev
if listener is not None:
self.bus.log("Listening for %s." % signame)
self.bus.subscribe(signame, listener)
def _handle_signal(self, signum=None, frame=None):
"""Python signal handler (self.set_handler subscribes it for you)."""
signame = self.signals[signum]
self.bus.log("Caught signal %s." % signame)
self.bus.publish(signame)
def handle_SIGHUP(self):
if os.isatty(sys.stdin.fileno()):
# not daemonized (may be foreground or background)
self.bus.log("SIGHUP caught but not daemonized. Exiting.")
self.bus.exit()
else:
self.bus.log("SIGHUP caught while daemonized. Restarting.")
self.bus.restart()
try:
import pwd, grp
except ImportError:
pwd, grp = None, None
class DropPrivileges(SimplePlugin):
"""Drop privileges. uid/gid arguments not available on Windows.
Special thanks to Gavin Baker: http://antonym.org/node/100.
"""
def __init__(self, bus, umask=None, uid=None, gid=None):
SimplePlugin.__init__(self, bus)
self.finalized = False
self.uid = uid
self.gid = gid
self.umask = umask
def _get_uid(self):
return self._uid
def _set_uid(self, val):
if val is not None:
if pwd is None:
self.bus.log("pwd module not available; ignoring uid.",
level=30)
val = None
elif isinstance(val, basestring):
val = pwd.getpwnam(val)[2]
self._uid = val
uid = property(_get_uid, _set_uid, doc="The uid under which to run.")
def _get_gid(self):
return self._gid
def _set_gid(self, val):
if val is not None:
if grp is None:
self.bus.log("grp module not available; ignoring gid.",
level=30)
val = None
elif isinstance(val, basestring):
val = grp.getgrnam(val)[2]
self._gid = val
gid = property(_get_gid, _set_gid, doc="The gid under which to run.")
def _get_umask(self):
return self._umask
def _set_umask(self, val):
if val is not None:
try:
os.umask
except AttributeError:
self.bus.log("umask function not available; ignoring umask.",
level=30)
val = None
self._umask = val
umask = property(_get_umask, _set_umask, doc="The umask under which to run.")
def start(self):
# uid/gid
def current_ids():
"""Return the current (uid, gid) if available."""
name, group = None, None
if pwd:
name = pwd.getpwuid(os.getuid())[0]
if grp:
group = grp.getgrgid(os.getgid())[0]
return name, group
if self.finalized:
if not (self.uid is None and self.gid is None):
self.bus.log('Already running as uid: %r gid: %r' %
current_ids())
else:
if self.uid is None and self.gid is None:
if pwd or grp:
self.bus.log('uid/gid not set', level=30)
else:
self.bus.log('Started as uid: %r gid: %r' % current_ids())
if self.gid is not None:
os.setgid(self.gid)
if self.uid is not None:
os.setuid(self.uid)
self.bus.log('Running as uid: %r gid: %r' % current_ids())
# umask
if self.finalized:
if self.umask is not None:
self.bus.log('umask already set to: %03o' % self.umask)
else:
if self.umask is None:
self.bus.log('umask not set', level=30)
else:
old_umask = os.umask(self.umask)
self.bus.log('umask old: %03o, new: %03o' %
(old_umask, self.umask))
self.finalized = True
# This is slightly higher than the priority for server.start
# in order to facilitate the most common use: starting on a low
# port (which requires root) and then dropping to another user.
start.priority = 77
class Daemonizer(SimplePlugin):
"""Daemonize the running script.
Use this with a Web Site Process Bus via:
Daemonizer(bus).subscribe()
When this component finishes, the process is completely decoupled from
the parent environment. Please note that when this component is used,
the return code from the parent process will still be 0 if a startup
error occurs in the forked children. Errors in the initial daemonizing
process still return proper exit codes. Therefore, if you use this
plugin to daemonize, don't use the return code as an accurate indicator
of whether the process fully started. In fact, that return code only
indicates if the process succesfully finished the first fork.
"""
def __init__(self, bus, stdin='/dev/null', stdout='/dev/null',
stderr='/dev/null'):
SimplePlugin.__init__(self, bus)
self.stdin = stdin
self.stdout = stdout
self.stderr = stderr
self.finalized = False
def start(self):
if self.finalized:
self.bus.log('Already deamonized.')
# forking has issues with threads:
# http://www.opengroup.org/onlinepubs/000095399/functions/fork.html
# "The general problem with making fork() work in a multi-threaded
# world is what to do with all of the threads..."
# So we check for active threads:
if threading.activeCount() != 1:
self.bus.log('There are %r active threads. '
'Daemonizing now may cause strange failures.' %
threading.enumerate(), level=30)
# See http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
# (or http://www.faqs.org/faqs/unix-faq/programmer/faq/ section 1.7)
# and http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012
# Finish up with the current stdout/stderr
sys.stdout.flush()
sys.stderr.flush()
# Do first fork.
try:
pid = os.fork()
if pid == 0:
# This is the child process. Continue.
pass
else:
# This is the first parent. Exit, now that we've forked.
self.bus.log('Forking once.')
os._exit(0)
except OSError, exc:
# Python raises OSError rather than returning negative numbers.
sys.exit("%s: fork #1 failed: (%d) %s\n"
% (sys.argv[0], exc.errno, exc.strerror))
os.setsid()
# Do second fork
try:
pid = os.fork()
if pid > 0:
self.bus.log('Forking twice.')
os._exit(0) # Exit second parent
except OSError, exc:
sys.exit("%s: fork #2 failed: (%d) %s\n"
% (sys.argv[0], exc.errno, exc.strerror))
os.chdir("/")
os.umask(0)
si = open(self.stdin, "r")
so = open(self.stdout, "a+")
se = open(self.stderr, "a+", 0)
# os.dup2(fd, fd2) will close fd2 if necessary,
# so we don't explicitly close stdin/out/err.
# See http://docs.python.org/lib/os-fd-ops.html
os.dup2(si.fileno(), sys.stdin.fileno())
os.dup2(so.fileno(), sys.stdout.fileno())
os.dup2(se.fileno(), sys.stderr.fileno())
self.bus.log('Daemonized to PID: %s' % os.getpid())
self.finalized = True
start.priority = 65
class PIDFile(SimplePlugin):
"""Maintain a PID file via a WSPBus."""
def __init__(self, bus, pidfile):
SimplePlugin.__init__(self, bus)
self.pidfile = pidfile
self.finalized = False
def start(self):
pid = os.getpid()
if self.finalized:
self.bus.log('PID %r already written to %r.' % (pid, self.pidfile))
else:
open(self.pidfile, "wb").write(str(pid))
self.bus.log('PID %r written to %r.' % (pid, self.pidfile))
self.finalized = True
start.priority = 70
def exit(self):
try:
os.remove(self.pidfile)
self.bus.log('PID file removed: %r.' % self.pidfile)
except (KeyboardInterrupt, SystemExit):
raise
except:
pass
class PerpetualTimer(threading._Timer):
"""A subclass of threading._Timer whose run() method repeats."""
def run(self):
while True:
self.finished.wait(self.interval)
if self.finished.isSet():
return
self.function(*self.args, **self.kwargs)
class Monitor(SimplePlugin):
"""WSPBus listener to periodically run a callback in its own thread.
bus: a Web Site Process Bus object.
callback: the function to call at intervals.
frequency: the time in seconds between callback runs.
"""
frequency = 60
def __init__(self, bus, callback, frequency=60):
SimplePlugin.__init__(self, bus)
self.callback = callback
self.frequency = frequency
self.thread = None
def start(self):
"""Start our callback in its own perpetual timer thread."""
if self.frequency > 0:
threadname = self.__class__.__name__
if self.thread is None:
self.thread = PerpetualTimer(self.frequency, self.callback)
self.thread.setName(threadname)
self.thread.start()
self.bus.log("Started monitor thread %r." % threadname)
else:
self.bus.log("Monitor thread %r already started." % threadname)
start.priority = 70
def stop(self):
"""Stop our callback's perpetual timer thread."""
if self.thread is None:
self.bus.log("No thread running for %s." % self.__class__.__name__)
else:
if self.thread is not threading.currentThread():
name = self.thread.getName()
self.thread.cancel()
self.thread.join()
self.bus.log("Stopped thread %r." % name)
self.thread = None
def graceful(self):
"""Stop the callback's perpetual timer thread and restart it."""
self.stop()
self.start()
class Autoreloader(Monitor):
"""Monitor which re-executes the process when files change."""
frequency = 1
match = '.*'
def __init__(self, bus, frequency=1, match='.*'):
self.mtimes = {}
self.files = set()
self.match = match
Monitor.__init__(self, bus, self.run, frequency)
def start(self):
"""Start our own perpetual timer thread for self.run."""
if self.thread is None:
self.mtimes = {}
Monitor.start(self)
start.priority = 70
def run(self):
"""Reload the process if registered files have been modified."""
sysfiles = set()
for k, m in sys.modules.items():
if re.match(self.match, k):
if hasattr(m, '__loader__'):
if hasattr(m.__loader__, 'archive'):
k = m.__loader__.archive
k = getattr(m, '__file__', None)
sysfiles.add(k)
for filename in sysfiles | self.files:
if filename:
if filename.endswith('.pyc'):
filename = filename[:-1]
oldtime = self.mtimes.get(filename, 0)
if oldtime is None:
# Module with no .py file. Skip it.
continue
try:
mtime = os.stat(filename).st_mtime
except OSError:
# Either a module with no .py file, or it's been deleted.
mtime = None
if filename not in self.mtimes:
# If a module has no .py file, this will be None.
self.mtimes[filename] = mtime
else:
if mtime is None or mtime > oldtime:
# The file has been deleted or modified.
self.bus.log("Restarting because %s changed." % filename)
self.thread.cancel()
self.bus.log("Stopped thread %r." % self.thread.getName())
self.bus.restart()
return
class ThreadManager(SimplePlugin):
"""Manager for HTTP request threads.
If you have control over thread creation and destruction, publish to
the 'acquire_thread' and 'release_thread' channels (for each thread).
This will register/unregister the current thread and publish to
'start_thread' and 'stop_thread' listeners in the bus as needed.
If threads are created and destroyed by code you do not control
(e.g., Apache), then, at the beginning of every HTTP request,
publish to 'acquire_thread' only. You should not publish to
'release_thread' in this case, since you do not know whether
the thread will be re-used or not. The bus will call
'stop_thread' listeners for you when it stops.
"""
def __init__(self, bus):
self.threads = {}
SimplePlugin.__init__(self, bus)
self.bus.listeners.setdefault('acquire_thread', set())
self.bus.listeners.setdefault('release_thread', set())
def acquire_thread(self):
"""Run 'start_thread' listeners for the current thread.
If the current thread has already been seen, any 'start_thread'
listeners will not be run again.
"""
thread_ident = threading._get_ident()
if thread_ident not in self.threads:
# We can't just use _get_ident as the thread ID
# because some platforms reuse thread ID's.
i = len(self.threads) + 1
self.threads[thread_ident] = i
self.bus.publish('start_thread', i)
def release_thread(self):
"""Release the current thread and run 'stop_thread' listeners."""
thread_ident = threading._get_ident()
i = self.threads.pop(thread_ident, None)
if i is not None:
self.bus.publish('stop_thread', i)
def stop(self):
"""Release all threads and run all 'stop_thread' listeners."""
for thread_ident, i in self.threads.iteritems():
self.bus.publish('stop_thread', i)
self.threads.clear()
graceful = stop

View File

@@ -1,275 +0,0 @@
"""Adapt an HTTP server."""
import time
class ServerAdapter(object):
"""Adapter for an HTTP server.
If you need to start more than one HTTP server (to serve on multiple
ports, or protocols, etc.), you can manually register each one and then
start them all with bus.start:
s1 = ServerAdapter(bus, MyWSGIServer(host='0.0.0.0', port=80))
s2 = ServerAdapter(bus, another.HTTPServer(host='127.0.0.1', SSL=True))
s1.subscribe()
s2.subscribe()
bus.start()
"""
def __init__(self, bus, httpserver=None, bind_addr=None):
self.bus = bus
self.httpserver = httpserver
self.bind_addr = bind_addr
self.interrupt = None
self.running = False
def subscribe(self):
self.bus.subscribe('start', self.start)
self.bus.subscribe('stop', self.stop)
def unsubscribe(self):
self.bus.unsubscribe('start', self.start)
self.bus.unsubscribe('stop', self.stop)
def start(self):
"""Start the HTTP server."""
if self.bind_addr is None:
on_what = "unknown interface (dynamic?)"
elif isinstance(self.bind_addr, tuple):
host, port = self.bind_addr
on_what = "%s:%s" % (host, port)
else:
on_what = "socket file: %s" % self.bind_addr
if self.running:
self.bus.log("Already serving on %s" % on_what)
return
self.interrupt = None
if not self.httpserver:
raise ValueError("No HTTP server has been created.")
# Start the httpserver in a new thread.
if isinstance(self.bind_addr, tuple):
wait_for_free_port(*self.bind_addr)
import threading
t = threading.Thread(target=self._start_http_thread)
t.setName("HTTPServer " + t.getName())
t.start()
self.wait()
self.running = True
self.bus.log("Serving on %s" % on_what)
start.priority = 75
def _start_http_thread(self):
"""HTTP servers MUST be running in new threads, so that the
main thread persists to receive KeyboardInterrupt's. If an
exception is raised in the httpserver's thread then it's
trapped here, and the bus (and therefore our httpserver)
are shut down.
"""
try:
self.httpserver.start()
except KeyboardInterrupt, exc:
self.bus.log("<Ctrl-C> hit: shutting down HTTP server")
self.interrupt = exc
self.bus.exit()
except SystemExit, exc:
self.bus.log("SystemExit raised: shutting down HTTP server")
self.interrupt = exc
self.bus.exit()
raise
except:
import sys
self.interrupt = sys.exc_info()[1]
self.bus.log("Error in HTTP server: shutting down",
traceback=True, level=40)
self.bus.exit()
raise
def wait(self):
"""Wait until the HTTP server is ready to receive requests."""
while not getattr(self.httpserver, "ready", False):
if self.interrupt:
raise self.interrupt
time.sleep(.1)
# Wait for port to be occupied
if isinstance(self.bind_addr, tuple):
host, port = self.bind_addr
wait_for_occupied_port(host, port)
def stop(self):
"""Stop the HTTP server."""
if self.running:
# stop() MUST block until the server is *truly* stopped.
self.httpserver.stop()
# Wait for the socket to be truly freed.
if isinstance(self.bind_addr, tuple):
wait_for_free_port(*self.bind_addr)
self.running = False
self.bus.log("HTTP Server %s shut down" % self.httpserver)
else:
self.bus.log("HTTP Server %s already shut down" % self.httpserver)
stop.priority = 25
def restart(self):
"""Restart the HTTP server."""
self.stop()
self.start()
class FlupFCGIServer(object):
"""Adapter for a flup.server.fcgi.WSGIServer."""
def __init__(self, *args, **kwargs):
if kwargs.get('bindAddress', None) is None:
import socket
if not hasattr(socket.socket, 'fromfd'):
raise ValueError(
'Dynamic FCGI server not available on this platform. '
'You must use a static or external one by providing a '
'legal bindAddress.')
self.args = args
self.kwargs = kwargs
self.ready = False
def start(self):
"""Start the FCGI server."""
# We have to instantiate the server class here because its __init__
# starts a threadpool. If we do it too early, daemonize won't work.
from flup.server.fcgi import WSGIServer
self.fcgiserver = WSGIServer(*self.args, **self.kwargs)
# TODO: report this bug upstream to flup.
# If we don't set _oldSIGs on Windows, we get:
# File "C:\Python24\Lib\site-packages\flup\server\threadedserver.py",
# line 108, in run
# self._restoreSignalHandlers()
# File "C:\Python24\Lib\site-packages\flup\server\threadedserver.py",
# line 156, in _restoreSignalHandlers
# for signum,handler in self._oldSIGs:
# AttributeError: 'WSGIServer' object has no attribute '_oldSIGs'
self.fcgiserver._installSignalHandlers = lambda: None
self.fcgiserver._oldSIGs = []
self.ready = True
self.fcgiserver.run()
def stop(self):
"""Stop the HTTP server."""
# Forcibly stop the fcgi server main event loop.
self.fcgiserver._keepGoing = False
# Force all worker threads to die off.
self.fcgiserver._threadPool.maxSpare = self.fcgiserver._threadPool._idleCount
self.ready = False
class FlupSCGIServer(object):
"""Adapter for a flup.server.scgi.WSGIServer."""
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
self.ready = False
def start(self):
"""Start the SCGI server."""
# We have to instantiate the server class here because its __init__
# starts a threadpool. If we do it too early, daemonize won't work.
from flup.server.scgi import WSGIServer
self.scgiserver = WSGIServer(*self.args, **self.kwargs)
# TODO: report this bug upstream to flup.
# If we don't set _oldSIGs on Windows, we get:
# File "C:\Python24\Lib\site-packages\flup\server\threadedserver.py",
# line 108, in run
# self._restoreSignalHandlers()
# File "C:\Python24\Lib\site-packages\flup\server\threadedserver.py",
# line 156, in _restoreSignalHandlers
# for signum,handler in self._oldSIGs:
# AttributeError: 'WSGIServer' object has no attribute '_oldSIGs'
self.scgiserver._installSignalHandlers = lambda: None
self.scgiserver._oldSIGs = []
self.ready = True
self.scgiserver.run()
def stop(self):
"""Stop the HTTP server."""
self.ready = False
# Forcibly stop the scgi server main event loop.
self.scgiserver._keepGoing = False
# Force all worker threads to die off.
self.scgiserver._threadPool.maxSpare = 0
def client_host(server_host):
"""Return the host on which a client can connect to the given listener."""
if server_host == '0.0.0.0':
# 0.0.0.0 is INADDR_ANY, which should answer on localhost.
return '127.0.0.1'
if server_host == '::':
# :: is IN6ADDR_ANY, which should answer on localhost.
return '::1'
return server_host
def check_port(host, port, timeout=1.0):
"""Raise an error if the given port is not free on the given host."""
if not host:
raise ValueError("Host values of '' or None are not allowed.")
host = client_host(host)
port = int(port)
import socket
# AF_INET or AF_INET6 socket
# Get the correct address family for our host (allows IPv6 addresses)
for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,
socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
s = None
try:
s = socket.socket(af, socktype, proto)
# See http://groups.google.com/group/cherrypy-users/
# browse_frm/thread/bbfe5eb39c904fe0
s.settimeout(timeout)
s.connect((host, port))
s.close()
raise IOError("Port %s is in use on %s; perhaps the previous "
"httpserver did not shut down properly." %
(repr(port), repr(host)))
except socket.error:
if s:
s.close()
def wait_for_free_port(host, port):
"""Wait for the specified port to become free (drop requests)."""
if not host:
raise ValueError("Host values of '' or None are not allowed.")
for trial in xrange(50):
try:
# we are expecting a free port, so reduce the timeout
check_port(host, port, timeout=0.1)
except IOError:
# Give the old server thread time to free the port.
time.sleep(0.1)
else:
return
raise IOError("Port %r not free on %r" % (port, host))
def wait_for_occupied_port(host, port):
"""Wait for the specified port to become active (receive requests)."""
if not host:
raise ValueError("Host values of '' or None are not allowed.")
for trial in xrange(50):
try:
check_port(host, port)
except IOError:
return
else:
time.sleep(.1)
raise IOError("Port %r not bound on %r" % (port, host))

View File

@@ -1,175 +0,0 @@
"""Windows service. Requires pywin32."""
import os
import thread
import win32api
import win32con
import win32event
import win32service
import win32serviceutil
from cherrypy.process import wspbus, plugins
class ConsoleCtrlHandler(plugins.SimplePlugin):
"""A WSPBus plugin for handling Win32 console events (like Ctrl-C)."""
def __init__(self, bus):
self.is_set = False
plugins.SimplePlugin.__init__(self, bus)
def start(self):
if self.is_set:
self.bus.log('Handler for console events already set.', level=40)
return
result = win32api.SetConsoleCtrlHandler(self.handle, 1)
if result == 0:
self.bus.log('Could not SetConsoleCtrlHandler (error %r)' %
win32api.GetLastError(), level=40)
else:
self.bus.log('Set handler for console events.', level=40)
self.is_set = True
def stop(self):
if not self.is_set:
self.bus.log('Handler for console events already off.', level=40)
return
try:
result = win32api.SetConsoleCtrlHandler(self.handle, 0)
except ValueError:
# "ValueError: The object has not been registered"
result = 1
if result == 0:
self.bus.log('Could not remove SetConsoleCtrlHandler (error %r)' %
win32api.GetLastError(), level=40)
else:
self.bus.log('Removed handler for console events.', level=40)
self.is_set = False
def handle(self, event):
"""Handle console control events (like Ctrl-C)."""
if event in (win32con.CTRL_C_EVENT, win32con.CTRL_LOGOFF_EVENT,
win32con.CTRL_BREAK_EVENT, win32con.CTRL_SHUTDOWN_EVENT,
win32con.CTRL_CLOSE_EVENT):
self.bus.log('Console event %s: shutting down bus' % event)
# Remove self immediately so repeated Ctrl-C doesn't re-call it.
try:
self.stop()
except ValueError:
pass
self.bus.exit()
# 'First to return True stops the calls'
return 1
return 0
class Win32Bus(wspbus.Bus):
"""A Web Site Process Bus implementation for Win32.
Instead of time.sleep, this bus blocks using native win32event objects.
"""
def __init__(self):
self.events = {}
wspbus.Bus.__init__(self)
def _get_state_event(self, state):
"""Return a win32event for the given state (creating it if needed)."""
try:
return self.events[state]
except KeyError:
event = win32event.CreateEvent(None, 0, 0,
u"WSPBus %s Event (pid=%r)" %
(state.name, os.getpid()))
self.events[state] = event
return event
def _get_state(self):
return self._state
def _set_state(self, value):
self._state = value
event = self._get_state_event(value)
win32event.PulseEvent(event)
state = property(_get_state, _set_state)
def wait(self, state, interval=0.1):
"""Wait for the given state(s), KeyboardInterrupt or SystemExit.
Since this class uses native win32event objects, the interval
argument is ignored.
"""
if isinstance(state, (tuple, list)):
# Don't wait for an event that beat us to the punch ;)
if self.state not in state:
events = tuple([self._get_state_event(s) for s in state])
win32event.WaitForMultipleObjects(events, 0, win32event.INFINITE)
else:
# Don't wait for an event that beat us to the punch ;)
if self.state != state:
event = self._get_state_event(state)
win32event.WaitForSingleObject(event, win32event.INFINITE)
class _ControlCodes(dict):
"""Control codes used to "signal" a service via ControlService.
User-defined control codes are in the range 128-255. We generally use
the standard Python value for the Linux signal and add 128. Example:
>>> signal.SIGUSR1
10
control_codes['graceful'] = 128 + 10
"""
def key_for(self, obj):
"""For the given value, return its corresponding key."""
for key, val in self.iteritems():
if val is obj:
return key
raise ValueError("The given object could not be found: %r" % obj)
control_codes = _ControlCodes({'graceful': 138})
def signal_child(service, command):
if command == 'stop':
win32serviceutil.StopService(service)
elif command == 'restart':
win32serviceutil.RestartService(service)
else:
win32serviceutil.ControlService(service, control_codes[command])
class PyWebService(win32serviceutil.ServiceFramework):
"""Python Web Service."""
_svc_name_ = "Python Web Service"
_svc_display_name_ = "Python Web Service"
_svc_deps_ = None # sequence of service names on which this depends
_exe_name_ = "pywebsvc"
_exe_args_ = None # Default to no arguments
# Only exists on Windows 2000 or later, ignored on windows NT
_svc_description_ = "Python Web Service"
def SvcDoRun(self):
from cherrypy import process
process.bus.start()
process.bus.block()
def SvcStop(self):
from cherrypy import process
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
process.bus.exit()
def SvcOther(self, control):
process.bus.publish(control_codes.key_for(control))
if __name__ == '__main__':
win32serviceutil.HandleCommandLine(PyWebService)

View File

@@ -1,345 +0,0 @@
"""An implementation of the Web Site Process Bus.
This module is completely standalone, depending only on the stdlib.
Web Site Process Bus
--------------------
A Bus object is used to contain and manage site-wide behavior:
daemonization, HTTP server start/stop, process reload, signal handling,
drop privileges, PID file management, logging for all of these,
and many more.
In addition, a Bus object provides a place for each web framework
to register code that runs in response to site-wide events (like
process start and stop), or which controls or otherwise interacts with
the site-wide components mentioned above. For example, a framework which
uses file-based templates would add known template filenames to an
autoreload component.
Ideally, a Bus object will be flexible enough to be useful in a variety
of invocation scenarios:
1. The deployer starts a site from the command line via a framework-
neutral deployment script; applications from multiple frameworks
are mixed in a single site. Command-line arguments and configuration
files are used to define site-wide components such as the HTTP server,
WSGI component graph, autoreload behavior, signal handling, etc.
2. The deployer starts a site via some other process, such as Apache;
applications from multiple frameworks are mixed in a single site.
Autoreload and signal handling (from Python at least) are disabled.
3. The deployer starts a site via a framework-specific mechanism;
for example, when running tests, exploring tutorials, or deploying
single applications from a single framework. The framework controls
which site-wide components are enabled as it sees fit.
The Bus object in this package uses topic-based publish-subscribe
messaging to accomplish all this. A few topic channels are built in
('start', 'stop', 'exit', and 'graceful'). Frameworks and site containers
are free to define their own. If a message is sent to a channel that has
not been defined or has no listeners, there is no effect.
In general, there should only ever be a single Bus object per process.
Frameworks and site containers share a single Bus object by publishing
messages and subscribing listeners.
The Bus object works as a finite state machine which models the current
state of the process. Bus methods move it from one state to another;
those methods then publish to subscribed listeners on the channel for
the new state.
O
|
V
STOPPING --> STOPPED --> EXITING -> X
A A |
| \___ |
| \ |
| V V
STARTED <-- STARTING
"""
import atexit
import os
try:
set
except NameError:
from sets import Set as set
import sys
import threading
import time
import traceback as _traceback
import warnings
# Use a flag to indicate the state of the bus.
class _StateEnum(object):
class State(object):
name = None
def __repr__(self):
return "states.%s" % self.name
def __setattr__(self, key, value):
if isinstance(value, self.State):
value.name = key
object.__setattr__(self, key, value)
states = _StateEnum()
states.STOPPED = states.State()
states.STARTING = states.State()
states.STARTED = states.State()
states.STOPPING = states.State()
states.EXITING = states.State()
class Bus(object):
"""Process state-machine and messenger for HTTP site deployment.
All listeners for a given channel are guaranteed to be called even
if others at the same channel fail. Each failure is logged, but
execution proceeds on to the next listener. The only way to stop all
processing from inside a listener is to raise SystemExit and stop the
whole server.
"""
states = states
state = states.STOPPED
execv = False
def __init__(self):
self.execv = False
self.state = states.STOPPED
self.listeners = dict(
[(channel, set()) for channel
in ('start', 'stop', 'exit', 'graceful', 'log')])
self._priorities = {}
def subscribe(self, channel, callback, priority=None):
"""Add the given callback at the given channel (if not present)."""
if channel not in self.listeners:
self.listeners[channel] = set()
self.listeners[channel].add(callback)
if priority is None:
priority = getattr(callback, 'priority', 50)
self._priorities[(channel, callback)] = priority
def unsubscribe(self, channel, callback):
"""Discard the given callback (if present)."""
listeners = self.listeners.get(channel)
if listeners and callback in listeners:
listeners.discard(callback)
del self._priorities[(channel, callback)]
def publish(self, channel, *args, **kwargs):
"""Return output of all subscribers for the given channel."""
if channel not in self.listeners:
return []
exc = None
output = []
items = [(self._priorities[(channel, listener)], listener)
for listener in self.listeners[channel]]
items.sort()
for priority, listener in items:
try:
output.append(listener(*args, **kwargs))
except KeyboardInterrupt:
raise
except SystemExit, e:
# If we have previous errors ensure the exit code is non-zero
if exc and e.code == 0:
e.code = 1
raise
except:
exc = sys.exc_info()[1]
if channel == 'log':
# Assume any further messages to 'log' will fail.
pass
else:
self.log("Error in %r listener %r" % (channel, listener),
level=40, traceback=True)
if exc:
raise
return output
def _clean_exit(self):
"""An atexit handler which asserts the Bus is not running."""
if self.state != states.EXITING:
warnings.warn(
"The main thread is exiting, but the Bus is in the %r state; "
"shutting it down automatically now. You must either call "
"bus.block() after start(), or call bus.exit() before the "
"main thread exits." % self.state, RuntimeWarning)
self.exit()
def start(self):
"""Start all services."""
atexit.register(self._clean_exit)
self.state = states.STARTING
self.log('Bus STARTING')
try:
self.publish('start')
self.state = states.STARTED
self.log('Bus STARTED')
except (KeyboardInterrupt, SystemExit):
raise
except:
self.log("Shutting down due to error in start listener:",
level=40, traceback=True)
e_info = sys.exc_info()
try:
self.exit()
except:
# Any stop/exit errors will be logged inside publish().
pass
raise e_info[0], e_info[1], e_info[2]
def exit(self):
"""Stop all services and prepare to exit the process."""
try:
self.stop()
self.state = states.EXITING
self.log('Bus EXITING')
self.publish('exit')
# This isn't strictly necessary, but it's better than seeing
# "Waiting for child threads to terminate..." and then nothing.
self.log('Bus EXITED')
except:
# This method is often called asynchronously (whether thread,
# signal handler, console handler, or atexit handler), so we
# can't just let exceptions propagate out unhandled.
# Assume it's been logged and just die.
os._exit(70) # EX_SOFTWARE
def restart(self):
"""Restart the process (may close connections).
This method does not restart the process from the calling thread;
instead, it stops the bus and asks the main thread to call execv.
"""
self.execv = True
self.exit()
def graceful(self):
"""Advise all services to reload."""
self.log('Bus graceful')
self.publish('graceful')
def block(self, interval=0.1):
"""Wait for the EXITING state, KeyboardInterrupt or SystemExit.
This function is intended to be called only by the main thread.
After waiting for the EXITING state, it also waits for all threads
to terminate, and then calls os.execv if self.execv is True. This
design allows another thread to call bus.restart, yet have the main
thread perform the actual execv call (required on some platforms).
"""
try:
self.wait(states.EXITING, interval=interval)
except (KeyboardInterrupt, IOError):
# The time.sleep call might raise
# "IOError: [Errno 4] Interrupted function call" on KBInt.
self.log('Keyboard Interrupt: shutting down bus')
self.exit()
except SystemExit:
self.log('SystemExit raised: shutting down bus')
self.exit()
raise
# Waiting for ALL child threads to finish is necessary on OS X.
# See http://www.cherrypy.org/ticket/581.
# It's also good to let them all shut down before allowing
# the main thread to call atexit handlers.
# See http://www.cherrypy.org/ticket/751.
self.log("Waiting for child threads to terminate...")
for t in threading.enumerate():
if t != threading.currentThread() and t.isAlive():
# Note that any dummy (external) threads are always daemonic.
if hasattr(threading.Thread, "daemon"):
# Python 2.6+
d = t.daemon
else:
d = t.isDaemon()
if not d:
t.join()
if self.execv:
self._do_execv()
def wait(self, state, interval=0.1):
"""Wait for the given state(s)."""
if isinstance(state, (tuple, list)):
states = state
else:
states = [state]
def _wait():
while self.state not in states:
time.sleep(interval)
# From http://psyco.sourceforge.net/psycoguide/bugs.html:
# "The compiled machine code does not include the regular polling
# done by Python, meaning that a KeyboardInterrupt will not be
# detected before execution comes back to the regular Python
# interpreter. Your program cannot be interrupted if caught
# into an infinite Psyco-compiled loop."
try:
sys.modules['psyco'].cannotcompile(_wait)
except (KeyError, AttributeError):
pass
_wait()
def _do_execv(self):
"""Re-execute the current process.
This must be called from the main thread, because certain platforms
(OS X) don't allow execv to be called in a child thread very well.
"""
args = sys.argv[:]
self.log('Re-spawning %s' % ' '.join(args))
args.insert(0, sys.executable)
if sys.platform == 'win32':
args = ['"%s"' % arg for arg in args]
os.execv(sys.executable, args)
def stop(self):
"""Stop all services."""
self.state = states.STOPPING
self.log('Bus STOPPING')
self.publish('stop')
self.state = states.STOPPED
self.log('Bus STOPPED')
def start_with_callback(self, func, args=None, kwargs=None):
"""Start 'func' in a new thread T, then start self (and return T)."""
if args is None:
args = ()
if kwargs is None:
kwargs = {}
args = (func,) + args
def _callback(func, *a, **kw):
self.wait(states.STARTED)
func(*a, **kw)
t = threading.Thread(target=_callback, args=args, kwargs=kwargs)
t.setName('Bus Callback ' + t.getName())
t.start()
self.start()
return t
def log(self, msg="", level=20, traceback=False):
"""Log the given message. Append the last traceback if requested."""
if traceback:
exc = sys.exc_info()
msg += "\n" + "".join(_traceback.format_exception(*exc))
self.publish('log', msg, level)
bus = Bus()

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
##
## Bad URL Fetch Email template for SABnzbd
## This a Cheetah template
## Documentation: http://sabnzbd.wikidot.com/email-templates
## Documentation: https://sabnzbd.org/wiki/extra/email-templates
##
## Newlines and whitespace are significant!
##

View File

@@ -1,7 +1,7 @@
##
## Default Email template for SABnzbd
## This a Cheetah template
## Documentation: http://sabnzbd.wikidot.com/email-templates
## Documentation: https://sabnzbd.org/wiki/extra/email-templates
##
## Newlines and whitespace are significant!
##

View File

@@ -1,7 +1,7 @@
##
## RSS Email template for SABnzbd
## This a Cheetah template
## Documentation: http://sabnzbd.wikidot.com/email-templates
## Documentation: https://sabnzbd.org/wiki/extra/email-templates
##
## Newlines and whitespace are significant!
##

View File

@@ -1,509 +0,0 @@
import re
import hashlib
import time
import StringIO
__version__ = '0.8'
#GNTP/<version> <messagetype> <encryptionAlgorithmID>[:<ivValue>][ <keyHashAlgorithmID>:<keyHash>.<salt>]
GNTP_INFO_LINE = re.compile(
'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)' +
' (?P<encryptionAlgorithmID>[A-Z0-9]+(:(?P<ivValue>[A-F0-9]+))?) ?' +
'((?P<keyHashAlgorithmID>[A-Z0-9]+):(?P<keyHash>[A-F0-9]+).(?P<salt>[A-F0-9]+))?\r\n',
re.IGNORECASE
)
GNTP_INFO_LINE_SHORT = re.compile(
'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)',
re.IGNORECASE
)
GNTP_HEADER = re.compile('([\w-]+):(.+)')
GNTP_EOL = '\r\n'
class BaseError(Exception):
def gntp_error(self):
error = GNTPError(self.errorcode, self.errordesc)
return error.encode()
class ParseError(BaseError):
errorcode = 500
errordesc = 'Error parsing the message'
class AuthError(BaseError):
errorcode = 400
errordesc = 'Error with authorization'
class UnsupportedError(BaseError):
errorcode = 500
errordesc = 'Currently unsupported by gntp.py'
class _GNTPBuffer(StringIO.StringIO):
"""GNTP Buffer class"""
def writefmt(self, message="", *args):
"""Shortcut function for writing GNTP Headers"""
self.write((message % args).encode('utf8', 'replace'))
self.write(GNTP_EOL)
class _GNTPBase(object):
"""Base initilization
:param string messagetype: GNTP Message type
:param string version: GNTP Protocol version
:param string encription: Encryption protocol
"""
def __init__(self, messagetype=None, version='1.0', encryption=None):
self.info = {
'version': version,
'messagetype': messagetype,
'encryptionAlgorithmID': encryption
}
self.headers = {}
self.resources = {}
def __str__(self):
return self.encode()
def _parse_info(self, data):
"""Parse the first line of a GNTP message to get security and other info values
:param string data: GNTP Message
:return dict: Parsed GNTP Info line
"""
match = GNTP_INFO_LINE.match(data)
if not match:
raise ParseError('ERROR_PARSING_INFO_LINE')
info = match.groupdict()
if info['encryptionAlgorithmID'] == 'NONE':
info['encryptionAlgorithmID'] = None
return info
def set_password(self, password, encryptAlgo='MD5'):
"""Set a password for a GNTP Message
:param string password: Null to clear password
:param string encryptAlgo: Supports MD5, SHA1, SHA256, SHA512
"""
hash = {
'MD5': hashlib.md5,
'SHA1': hashlib.sha1,
'SHA256': hashlib.sha256,
'SHA512': hashlib.sha512,
}
self.password = password
self.encryptAlgo = encryptAlgo.upper()
if not password:
self.info['encryptionAlgorithmID'] = None
self.info['keyHashAlgorithm'] = None
return
if not self.encryptAlgo in hash.keys():
raise UnsupportedError('INVALID HASH "%s"' % self.encryptAlgo)
hashfunction = hash.get(self.encryptAlgo)
password = password.encode('utf8')
seed = time.ctime()
salt = hashfunction(seed).hexdigest()
saltHash = hashfunction(seed).digest()
keyBasis = password + saltHash
key = hashfunction(keyBasis).digest()
keyHash = hashfunction(key).hexdigest()
self.info['keyHashAlgorithmID'] = self.encryptAlgo
self.info['keyHash'] = keyHash.upper()
self.info['salt'] = salt.upper()
def _decode_hex(self, value):
"""Helper function to decode hex string to `proper` hex string
:param string value: Human readable hex string
:return string: Hex string
"""
result = ''
for i in range(0, len(value), 2):
tmp = int(value[i:i + 2], 16)
result += chr(tmp)
return result
def _decode_binary(self, rawIdentifier, identifier):
rawIdentifier += '\r\n\r\n'
dataLength = int(identifier['Length'])
pointerStart = self.raw.find(rawIdentifier) + len(rawIdentifier)
pointerEnd = pointerStart + dataLength
data = self.raw[pointerStart:pointerEnd]
if not len(data) == dataLength:
raise ParseError('INVALID_DATA_LENGTH Expected: %s Recieved %s' % (dataLength, len(data)))
return data
def _validate_password(self, password):
"""Validate GNTP Message against stored password"""
self.password = password
if password == None:
raise AuthError('Missing password')
keyHash = self.info.get('keyHash', None)
if keyHash is None and self.password is None:
return True
if keyHash is None:
raise AuthError('Invalid keyHash')
if self.password is None:
raise AuthError('Missing password')
password = self.password.encode('utf8')
saltHash = self._decode_hex(self.info['salt'])
keyBasis = password + saltHash
key = hashlib.md5(keyBasis).digest()
keyHash = hashlib.md5(key).hexdigest()
if not keyHash.upper() == self.info['keyHash'].upper():
raise AuthError('Invalid Hash')
return True
def validate(self):
"""Verify required headers"""
for header in self._requiredHeaders:
if not self.headers.get(header, False):
raise ParseError('Missing Notification Header: ' + header)
def _format_info(self):
"""Generate info line for GNTP Message
:return string:
"""
info = u'GNTP/%s %s' % (
self.info.get('version'),
self.info.get('messagetype'),
)
if self.info.get('encryptionAlgorithmID', None):
info += ' %s:%s' % (
self.info.get('encryptionAlgorithmID'),
self.info.get('ivValue'),
)
else:
info += ' NONE'
if self.info.get('keyHashAlgorithmID', None):
info += ' %s:%s.%s' % (
self.info.get('keyHashAlgorithmID'),
self.info.get('keyHash'),
self.info.get('salt')
)
return info
def _parse_dict(self, data):
"""Helper function to parse blocks of GNTP headers into a dictionary
:param string data:
:return dict:
"""
dict = {}
for line in data.split('\r\n'):
match = GNTP_HEADER.match(line)
if not match:
continue
key = unicode(match.group(1).strip(), 'utf8', 'replace')
val = unicode(match.group(2).strip(), 'utf8', 'replace')
dict[key] = val
return dict
def add_header(self, key, value):
if isinstance(value, unicode):
self.headers[key] = value
else:
self.headers[key] = unicode('%s' % value, 'utf8', 'replace')
def add_resource(self, data):
"""Add binary resource
:param string data: Binary Data
"""
identifier = hashlib.md5(data).hexdigest()
self.resources[identifier] = data
return 'x-growl-resource://%s' % identifier
def decode(self, data, password=None):
"""Decode GNTP Message
:param string data:
"""
self.password = password
self.raw = data
parts = self.raw.split('\r\n\r\n')
self.info = self._parse_info(data)
self.headers = self._parse_dict(parts[0])
def encode(self):
"""Encode a generic GNTP Message
:return string: GNTP Message ready to be sent
"""
buffer = _GNTPBuffer()
buffer.writefmt(self._format_info())
#Headers
for k, v in self.headers.iteritems():
buffer.writefmt('%s: %s', k, v)
buffer.writefmt()
#Resources
for resource, data in self.resources.iteritems():
buffer.writefmt('Identifier: %s', resource)
buffer.writefmt('Length: %d', len(data))
buffer.writefmt()
buffer.write(data)
buffer.writefmt()
buffer.writefmt()
return buffer.getvalue()
class GNTPRegister(_GNTPBase):
"""Represents a GNTP Registration Command
:param string data: (Optional) See decode()
:param string password: (Optional) Password to use while encoding/decoding messages
"""
_requiredHeaders = [
'Application-Name',
'Notifications-Count'
]
_requiredNotificationHeaders = ['Notification-Name']
def __init__(self, data=None, password=None):
_GNTPBase.__init__(self, 'REGISTER')
self.notifications = []
if data:
self.decode(data, password)
else:
self.set_password(password)
self.add_header('Application-Name', 'pygntp')
self.add_header('Notifications-Count', 0)
def validate(self):
'''Validate required headers and validate notification headers'''
for header in self._requiredHeaders:
if not self.headers.get(header, False):
raise ParseError('Missing Registration Header: ' + header)
for notice in self.notifications:
for header in self._requiredNotificationHeaders:
if not notice.get(header, False):
raise ParseError('Missing Notification Header: ' + header)
def decode(self, data, password):
"""Decode existing GNTP Registration message
:param string data: Message to decode
"""
self.raw = data
parts = self.raw.split('\r\n\r\n')
self.info = self._parse_info(data)
self._validate_password(password)
self.headers = self._parse_dict(parts[0])
for i, part in enumerate(parts):
if i == 0:
continue # Skip Header
if part.strip() == '':
continue
notice = self._parse_dict(part)
if notice.get('Notification-Name', False):
self.notifications.append(notice)
elif notice.get('Identifier', False):
notice['Data'] = self._decode_binary(part, notice)
#open('register.png','wblol').write(notice['Data'])
self.resources[notice.get('Identifier')] = notice
def add_notification(self, name, enabled=True):
"""Add new Notification to Registration message
:param string name: Notification Name
:param boolean enabled: Enable this notification by default
"""
notice = {}
notice['Notification-Name'] = u'%s' % name
notice['Notification-Enabled'] = u'%s' % enabled
self.notifications.append(notice)
self.add_header('Notifications-Count', len(self.notifications))
def encode(self):
"""Encode a GNTP Registration Message
:return string: Encoded GNTP Registration message
"""
buffer = _GNTPBuffer()
buffer.writefmt(self._format_info())
#Headers
for k, v in self.headers.iteritems():
buffer.writefmt('%s: %s', k, v)
buffer.writefmt()
#Notifications
if len(self.notifications) > 0:
for notice in self.notifications:
for k, v in notice.iteritems():
buffer.writefmt('%s: %s', k, v)
buffer.writefmt()
#Resources
for resource, data in self.resources.iteritems():
buffer.writefmt('Identifier: %s', resource)
buffer.writefmt('Length: %d', len(data))
buffer.writefmt()
buffer.write(data)
buffer.writefmt()
buffer.writefmt()
return buffer.getvalue()
class GNTPNotice(_GNTPBase):
"""Represents a GNTP Notification Command
:param string data: (Optional) See decode()
:param string app: (Optional) Set Application-Name
:param string name: (Optional) Set Notification-Name
:param string title: (Optional) Set Notification Title
:param string password: (Optional) Password to use while encoding/decoding messages
"""
_requiredHeaders = [
'Application-Name',
'Notification-Name',
'Notification-Title'
]
def __init__(self, data=None, app=None, name=None, title=None, password=None):
_GNTPBase.__init__(self, 'NOTIFY')
if data:
self.decode(data, password)
else:
self.set_password(password)
if app:
self.add_header('Application-Name', app)
if name:
self.add_header('Notification-Name', name)
if title:
self.add_header('Notification-Title', title)
def decode(self, data, password):
"""Decode existing GNTP Notification message
:param string data: Message to decode.
"""
self.raw = data
parts = self.raw.split('\r\n\r\n')
self.info = self._parse_info(data)
self._validate_password(password)
self.headers = self._parse_dict(parts[0])
for i, part in enumerate(parts):
if i == 0:
continue # Skip Header
if part.strip() == '':
continue
notice = self._parse_dict(part)
if notice.get('Identifier', False):
notice['Data'] = self._decode_binary(part, notice)
#open('notice.png','wblol').write(notice['Data'])
self.resources[notice.get('Identifier')] = notice
class GNTPSubscribe(_GNTPBase):
"""Represents a GNTP Subscribe Command
:param string data: (Optional) See decode()
:param string password: (Optional) Password to use while encoding/decoding messages
"""
_requiredHeaders = [
'Subscriber-ID',
'Subscriber-Name',
]
def __init__(self, data=None, password=None):
_GNTPBase.__init__(self, 'SUBSCRIBE')
if data:
self.decode(data, password)
else:
self.set_password(password)
class GNTPOK(_GNTPBase):
"""Represents a GNTP OK Response
:param string data: (Optional) See _GNTPResponse.decode()
:param string action: (Optional) Set type of action the OK Response is for
"""
_requiredHeaders = ['Response-Action']
def __init__(self, data=None, action=None):
_GNTPBase.__init__(self, '-OK')
if data:
self.decode(data)
if action:
self.add_header('Response-Action', action)
class GNTPError(_GNTPBase):
"""Represents a GNTP Error response
:param string data: (Optional) See _GNTPResponse.decode()
:param string errorcode: (Optional) Error code
:param string errordesc: (Optional) Error Description
"""
_requiredHeaders = ['Error-Code', 'Error-Description']
def __init__(self, data=None, errorcode=None, errordesc=None):
_GNTPBase.__init__(self, '-ERROR')
if data:
self.decode(data)
if errorcode:
self.add_header('Error-Code', errorcode)
self.add_header('Error-Description', errordesc)
def error(self):
return (self.headers.get('Error-Code', None),
self.headers.get('Error-Description', None))
def parse_gntp(data, password=None):
"""Attempt to parse a message as a GNTP message
:param string data: Message to be parsed
:param string password: Optional password to be used to verify the message
"""
match = GNTP_INFO_LINE_SHORT.match(data)
if not match:
raise ParseError('INVALID_GNTP_INFO')
info = match.groupdict()
if info['messagetype'] == 'REGISTER':
return GNTPRegister(data, password=password)
elif info['messagetype'] == 'NOTIFY':
return GNTPNotice(data, password=password)
elif info['messagetype'] == 'SUBSCRIBE':
return GNTPSubscribe(data, password=password)
elif info['messagetype'] == '-OK':
return GNTPOK(data)
elif info['messagetype'] == '-ERROR':
return GNTPError(data)
raise ParseError('INVALID_GNTP_MESSAGE')

View File

@@ -1,247 +0,0 @@
"""
The gntp.notifier module is provided as a simple way to send notifications
using GNTP
.. note::
This class is intended to mostly mirror the older Python bindings such
that you should be able to replace instances of the old bindings with
this class.
`Original Python bindings <http://code.google.com/p/growl/source/browse/Bindings/python/Growl.py>`_
"""
import gntp
import socket
import logging
import platform
__all__ = [
'mini',
'GrowlNotifier',
]
logger = logging.getLogger(__name__)
def mini(description, applicationName='PythonMini', noteType="Message",
title="Mini Message", applicationIcon=None, hostname='localhost',
password=None, port=23053, sticky=False, priority=None,
callback=None, notificationIcon=None, identifier=None):
"""Single notification function
Simple notification function in one line. Has only one required parameter
and attempts to use reasonable defaults for everything else
:param string description: Notification message
.. warning::
For now, only URL callbacks are supported. In the future, the
callback argument will also support a function
"""
growl = GrowlNotifier(
applicationName=applicationName,
notifications=[noteType],
defaultNotifications=[noteType],
applicationIcon=applicationIcon,
hostname=hostname,
password=password,
port=port,
)
result = growl.register()
if result is not True:
return result
return growl.notify(
noteType=noteType,
title=title,
description=description,
icon=notificationIcon,
sticky=sticky,
priority=priority,
callback=callback,
identifier=identifier,
)
class GrowlNotifier(object):
"""Helper class to simplfy sending Growl messages
:param string applicationName: Sending application name
:param list notification: List of valid notifications
:param list defaultNotifications: List of notifications that should be enabled
by default
:param string applicationIcon: Icon URL
:param string hostname: Remote host
:param integer port: Remote port
"""
passwordHash = 'MD5'
socketTimeout = 3
def __init__(self, applicationName='Python GNTP', notifications=[],
defaultNotifications=None, applicationIcon=None, hostname='localhost',
password=None, port=23053):
self.applicationName = applicationName
self.notifications = list(notifications)
if defaultNotifications:
self.defaultNotifications = list(defaultNotifications)
else:
self.defaultNotifications = self.notifications
self.applicationIcon = applicationIcon
self.password = password
self.hostname = hostname
self.port = int(port)
def _checkIcon(self, data):
'''
Check the icon to see if it's valid
If it's a simple URL icon, then we return True. If it's a data icon
then we return False
'''
logger.debug('Checking icon')
return data.startswith('http')
def register(self):
"""Send GNTP Registration
.. warning::
Before sending notifications to Growl, you need to have
sent a registration message at least once
"""
logger.debug('Sending registration to %s:%s', self.hostname, self.port)
register = gntp.GNTPRegister()
register.add_header('Application-Name', self.applicationName)
for notification in self.notifications:
enabled = notification in self.defaultNotifications
register.add_notification(notification, enabled)
if self.applicationIcon:
if self._checkIcon(self.applicationIcon):
register.add_header('Application-Icon', self.applicationIcon)
else:
id = register.add_resource(self.applicationIcon)
register.add_header('Application-Icon', id)
if self.password:
register.set_password(self.password, self.passwordHash)
self.add_origin_info(register)
self.register_hook(register)
return self._send('register', register)
def notify(self, noteType, title, description, icon=None, sticky=False,
priority=None, callback=None, identifier=None):
"""Send a GNTP notifications
.. warning::
Must have registered with growl beforehand or messages will be ignored
:param string noteType: One of the notification names registered earlier
:param string title: Notification title (usually displayed on the notification)
:param string description: The main content of the notification
:param string icon: Icon URL path
:param boolean sticky: Sticky notification
:param integer priority: Message priority level from -2 to 2
:param string callback: URL callback
.. warning::
For now, only URL callbacks are supported. In the future, the
callback argument will also support a function
"""
logger.debug('Sending notification [%s] to %s:%s', noteType, self.hostname, self.port)
assert noteType in self.notifications
notice = gntp.GNTPNotice()
notice.add_header('Application-Name', self.applicationName)
notice.add_header('Notification-Name', noteType)
notice.add_header('Notification-Title', title)
if self.password:
notice.set_password(self.password, self.passwordHash)
if sticky:
notice.add_header('Notification-Sticky', sticky)
if priority:
notice.add_header('Notification-Priority', priority)
if icon:
if self._checkIcon(icon):
notice.add_header('Notification-Icon', icon)
else:
id = notice.add_resource(icon)
notice.add_header('Notification-Icon', id)
if description:
notice.add_header('Notification-Text', description)
if callback:
notice.add_header('Notification-Callback-Target', callback)
if identifier:
notice.add_header('Notification-Coalescing-ID', identifier)
self.add_origin_info(notice)
self.notify_hook(notice)
return self._send('notify', notice)
def subscribe(self, id, name, port):
"""Send a Subscribe request to a remote machine"""
sub = gntp.GNTPSubscribe()
sub.add_header('Subscriber-ID', id)
sub.add_header('Subscriber-Name', name)
sub.add_header('Subscriber-Port', port)
if self.password:
sub.set_password(self.password, self.passwordHash)
self.add_origin_info(sub)
self.subscribe_hook(sub)
return self._send('subscribe', sub)
def add_origin_info(self, packet):
"""Add optional Origin headers to message"""
packet.add_header('Origin-Machine-Name', platform.node())
packet.add_header('Origin-Software-Name', 'gntp.py')
packet.add_header('Origin-Software-Version', gntp.__version__)
packet.add_header('Origin-Platform-Name', platform.system())
packet.add_header('Origin-Platform-Version', platform.platform())
def register_hook(self, packet):
pass
def notify_hook(self, packet):
pass
def subscribe_hook(self, packet):
pass
def _send(self, messagetype, packet):
"""Send the GNTP Packet"""
packet.validate()
data = packet.encode()
#logger.debug('To : %s:%s <%s>\n%s', self.hostname, self.port, packet.__class__, data)
#Less verbose
logger.debug('To : %s:%s <%s>', self.hostname, self.port, packet.__class__)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(self.socketTimeout)
s.connect((self.hostname, self.port))
s.send(data)
recv_data = s.recv(1024)
while not recv_data.endswith("\r\n\r\n"):
recv_data += s.recv(1024)
response = gntp.parse_gntp(recv_data)
s.close()
#logger.debug('From : %s:%s <%s>\n%s', self.hostname, self.port, response.__class__, response)
#Less verbose
logger.debug('From : %s:%s <%s>', self.hostname, self.port, response.__class__)
if type(response) == gntp.GNTPOK:
return True
if response.error()[0] == '404' and 'disabled' in response.error()[1]:
# Ignore message saying that user has disabled this class
return True
logger.error('Invalid response: %s', response.error())
return response.error()
if __name__ == '__main__':
# If we're running this module directly we're likely running it as a test
# so extra debugging is useful
logging.basicConfig(level=logging.DEBUG)
mini('Testing mini notification')

1
icons/logo-arrow.svg Normal file
View File

@@ -0,0 +1 @@
<svg viewBox="0 0 608 608" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M630.988 320.63V188.324h99.863v-35.62l110.197 101.773L730.85 356.25v-35.62h-99.86z" fill="none" stroke-width="16.62" stroke="#000" transform="matrix(0 2.665 -2.7482 0 1003.016 -1657.67)"/><path d="M121.86 23.913h363.604v266.135h97.89l-279.69 293.667L23.97 290.048h97.89V23.913z" fill="#FFB300" class="logo-arrow-outer"/><path d="M303.664 583.797L122.274 23.975h362.78l-181.39 559.822z" class="logo-arrow-inner" fill="#FFCA28"/></svg>

After

Width:  |  Height:  |  Size: 594 B

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 608 608" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M630.988 320.63V188.324h99.863v-35.62l110.197 101.773L730.85 356.25v-35.62h-99.86z" fill="none" stroke-width="16.62" stroke="#000" transform="matrix(0 2.665 -2.7482 0 1003.016 -1657.67)"/><path d="M121.86 23.913h363.604v266.135h97.89l-279.69 293.667L23.97 290.048h97.89V23.913z" fill="#B9B9B9" class="logo-arrow-outer"/><path d="M303.664 583.797L122.274 23.975h362.78l-181.39 559.822z" class="logo-arrow-inner" fill="#D5D5D5"/></svg>

After

Width:  |  Height:  |  Size: 594 B

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 608 608" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M630.988 320.63V188.324h99.863v-35.62l110.197 101.773L730.85 356.25v-35.62h-99.86z" fill="none" stroke-width="16.62" stroke="#000" transform="matrix(0 2.665 -2.7482 0 1003.016 -1657.67)"/><path d="M121.86 23.913h363.604v266.135h97.89l-279.69 293.667L23.97 290.048h97.89V23.913z" fill="#7CB342" class="logo-arrow-outer"/><path d="M303.664 583.797L122.274 23.975h362.78l-181.39 559.822z" class="logo-arrow-inner" fill="#9CCC65"/></svg>

After

Width:  |  Height:  |  Size: 594 B

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
icons/sabnzbd16_32.ico Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
icons/sabnzbd16_32green.ico Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Some files were not shown because too many files have changed in this diff Show More