1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
|
# content of conftest.py
# pylint: disable=unused-import
import pytest
import tests.base # NOQA
@pytest.fixture
def doctor_output():
return """Using configuration file found at ./tests/invalid-thumbor.conf
Thumbor doctor will analyze your install and verify if everything is working as expected.
Verifying libraries support...
✅ pycurl is installed correctly.
✅ cairosvg is installed correctly.
Verifying thumbor compiled extensions...
✅ _alpha
✅ _bounding_box
✅ _brightness
✅ _colorize
✅ _composite
✅ _contrast
✅ _convolution
✅ _curve
✅ _equalize
✅ _fill
✅ _nine_patch
✅ _noise
✅ _rgb
✅ _round_corner
✅ _saturation
✅ _sharpen
Verifying extensibility modules found in your thumbor.conf...
❎ thumbor.storages.file_storagee - Storage for source images could not be imported.
❎ thumbor.loaders.http_loaderer - Loader for source images could not be imported.
❎ thumbor.result_storages.file_storagee - ResultStorage could not be imported.
❎ thumbor.engines.pillage - Engine for transforming images could not be imported.
❎ thumbor.storages.file_storager - Uploading to thumbor is enabled and the Upload Storage could not be imported.
✅ thumbor.detectors.face_detector
❎ thumbor.detectors.face_detectorer - Detector could not be imported.
❎ thumbor.detectors.other_invalid - Detector could not be imported.
❎ invalid-filter - Filter could not be imported.
✅ thumbor.filters.redeye
❎ thumbor.optimizers.gifver - Optimizer could not be imported.
❎ thumbor.optimizers.jpegtraner - Optimizer could not be imported.
❎ thumbor.error_handlers.sentryer - Custom error handling is enabled and the error handler module could not be imported.
❎ my.invalid.handler - Custom http handler could not be imported.
✅ thumbor.handler_lists.blacklist
✅ thumbor.handler_lists.healthcheck
✅ thumbor.handler_lists.upload
Verifying security...
❎ Using default security key.
❎ Allowing unsafe URLs.
😞 Oh no! We found some things that could improve... 😞
⚠️Warnings⚠️
* Security
Error Message:
Using default security key configuration in thumbor.conf.
Error Description:
You should specify a unique security key for thumbor or use a command line param to specify a security key.
\tFor more information visit https://thumbor.readthedocs.io/en/latest/running.html
⛔Errors⛔
* thumbor.storages.file_storagee
Error Message:
No module named 'thumbor.storages.file_storagee'
Error Description:
Storage for source images could not be imported.
* thumbor.loaders.http_loaderer
Error Message:
No module named 'thumbor.loaders.http_loaderer'
Error Description:
Loader for source images could not be imported.
* thumbor.result_storages.file_storagee
Error Message:
No module named 'thumbor.result_storages.file_storagee'
Error Description:
ResultStorage could not be imported.
* thumbor.engines.pillage
Error Message:
No module named 'thumbor.engines.pillage'
Error Description:
Engine for transforming images could not be imported.
* thumbor.storages.file_storager
Error Message:
No module named 'thumbor.storages.file_storager'
Error Description:
Uploading to thumbor is enabled and the Upload Storage could not be imported.
* thumbor.detectors.face_detectorer
Error Message:
No module named 'thumbor.detectors.face_detectorer'
Error Description:
Detector could not be imported.
* thumbor.detectors.other_invalid
Error Message:
No module named 'thumbor.detectors.other_invalid'
Error Description:
Detector could not be imported.
* invalid-filter
Error Message:
No module named 'invalid-filter'
Error Description:
Filter could not be imported.
* thumbor.optimizers.gifver
Error Message:
No module named 'thumbor.optimizers.gifver'
Error Description:
Optimizer could not be imported.
* thumbor.optimizers.jpegtraner
Error Message:
No module named 'thumbor.optimizers.jpegtraner'
Error Description:
Optimizer could not be imported.
* thumbor.error_handlers.sentryer
Error Message:
No module named 'thumbor.error_handlers.sentryer'
Error Description:
Custom error handling is enabled and the error handler module could not be imported.
* my.invalid.handler
Error Message:
No module named 'my'
Error Description:
Custom http handler could not be imported.
* Security
Error Message:
Unsafe URLs are enabled.
Error Description:
It is STRONGLY recommended that you turn off ALLOW_UNSAFE_URLS flag in production environments as this can lead to DDoS attacks against thumbor.
\tFor more information visit https://thumbor.readthedocs.io/en/latest/security.html
❓Need Help❓
If you don't know how to fix the above problems, please open an issue with thumbor.
Don't forget to copy this log and add it to the description.
Open an issue at https://github.com/thumbor/thumbor/issues/new
"""
@pytest.fixture
def doctor_output_no_config():
return """
Thumbor doctor will analyze your install and verify if everything is working as expected.
Verifying libraries support...
✅ pycurl is installed correctly.
✅ cairosvg is installed correctly.
Verifying thumbor compiled extensions...
✅ _alpha
✅ _bounding_box
✅ _brightness
✅ _colorize
✅ _composite
✅ _contrast
✅ _convolution
✅ _curve
✅ _equalize
✅ _fill
✅ _nine_patch
✅ _noise
✅ _rgb
✅ _round_corner
✅ _saturation
✅ _sharpen
Verifying extension programs...
✅ jpegtran is installed correctly.
✅ ffmpeg is installed correctly.
✅ gifsicle is installed correctly.
Verifying security...
🎉 Congratulations! No errors found! 🎉
"""
|