Pillow 9.5 deprecated the getsize method for fonts in favor of its
new getbbox, and then getsize was removed in Pillow 10.. Adjust the
call we use for captcha generation so it will continue working, and
declare a requirement for the earliest forward-compatible release.
Change-Id: Ib35eea077d7f8c428493ef8e4cfe00e05e580a6f
Python 3.11 removed the long deprecated inspect.getargspec. Update
lodgeit to use inspect.signature instead. The signature api appears to
be the modern thing that is expected to work into the future.
Change-Id: Ic5603f848c0fffd15d9ce07cd7450638552c82c7
Python 3.11 appears to want global regex options to be set at the
beginning of the regex string. Setting them elsewhere results in:
re.error: global flags not at the start of the expression at position foo
A followup change will switch lodgeit over to python3.11 making this
necessary cleanup beforehand.
Change-Id: Idc21e39f7f4e3a9a3bcdc657f0fd6b352a20d617
Check the input length, if it's over 64k then this will put up an
error page that says "Could not submit your paste because ..."
Change-Id: I0ba3efbb33050272543b2f76a1cf0f49df26185c
This goes into a mysql "text" type field which is 65,535 characters
long. Set maxlength just under this to avoid interactive use sending
too much data, which fails with a 502 error currently.
Change-Id: Ieedef0fd956a5d31e682a4c808fb1197b55121b6
With Python 3, it doesn't work to decode type str. The str() recast
is still necessary however, since the exception data type is not
directly serializable in this way.
Change-Id: I3925cbb0d0ff594407c7b93b0d982f2cad386ad6
This simply adds a global template variable taken from
LODGEIT_TITLE_OVERRIDE that allows setting the site title for some
minimal customisation.
Previously, the opendev puppet would copy a custom layout.html over
the shipped version. This allows us to simply set a variable and not
have duplicate copies of templates in config managment.
Change-Id: If25dcece0ecd2b7dfc0178c6886559ac2507b28f
The captcha system may raise an error, when calculations were
float; added box argument for calling Pillow paste method.
This commit is also changing string encode in calculate_hash
function due "TypeError" exception.
Change-Id: Ibe175b78a8c446a7552c82732ec0ae25ef47c536
Work around the way Pygments maintainers have decided to list
"deprecated" lexers, but just skipping them if attempting to add
raises an IndexError because they look like JSONBareObject here:
https: //github.com/pygments/pygments/commit/5ee1754
Change-Id: Ia7b896263b4118ec369c5ce130addef3295a91a5
In diff.py the line iteration inline function relied on an iterable
named "l" (lower-case L) which is easily confused with the number 1
in some poorly-designed fonts. Because this is the only occurrence
for which newer pycodestyle is objecting, just go ahead and adjust
it rather than altering our style checks.
Also temporarily pin Pygments to deal which a regression which
arises in 2.7.3 and later.
Change-Id: I29cc8e5680d3fed3645b26f8b03d2ca299d974b0
Adds script that makes operations (like pastes removal)
that are not secure to do via API without auth. It connects to DB and
interacts directly with DB.
Change-Id: I8ef65feda92387bf4dc548b8876fc9fb82dadc64
Some time after lodgeit application have no load
SQLalchemy connection expires and application dies
with 5xx error and MySQL Server gone away exception.
By using a shorter default pool_recycle of 3600s which
can also be tweaked using environment variables, it allows
you to avoid dealing with this issue.
Change-Id: I79eb823458c604b2faff9bb1e9531c45fc1ed3cb
This is an initial go at building this Python package and uploading
an image for it. This will be followed up with some changes which
will make it easier to execute with an entrypoint and environment
variables later.
Change-Id: Ie2219fc96f32554bde1cac37faa0b961dc53b95e
This change fix python3 compatibility:
* replace except obj, name with except obj as name
* use print function
* replace iteritems by six.iteritems
* replace xrange by range
* convert items() result to list
Change-Id: I70364e47541274d446c4449f820dce3e0b331b27
- E722 do not use bare 'except'
Replace bare except clauses with explicit exception types.
- E741 ambiguous variable name 'l'
Rename 'l' to 'locale'
In addition this patch squashes 684782 to use older
werkzeug version to not face with exceptions.
Generally this patch fixes lodgeit CI.
Also, add tox jobs to in-tree zuul config
These were defined in project-config, but we don't need to manage
that centrally.
Change-Id: Id750715472f88fa5dba0a2414fb1667df4a6dc40
Signed-off-by: David Pursehouse <dpursehouse@collab.net>
There are several instances of the error:
E305 expected 2 blank lines after class or function definition
Fix them all by adding the necessary blank lines.
Change-Id: I37e2990772f05a100fe303c1512b7bdfb10a660d
Previously, some links would have double slashes at the end, one from
url_for and one from the HTML template. This would cause a 404 if the
user attempted to follow the link.
Additionally, use url_for instead of manually building the link for the
unified diff.
Change-Id: Ic576c13c6785bd5ac47aa4095fb5e42dd774dc9e
Commit f413281 removed unused pagination code, but the i18n
files were not updated and thus the translation files still
contain a lot of strings that don't exist in the code any more.
Change-Id: Ibe85e86ac55628e01341d869e9871e97d7f8fac4
Commit 0dc543a7 changed the background image used in the style
sheet, but did not remove the previous image that is now unused.
Change-Id: Iba306ab10fb9603fe8d41272dbca7cd56759cc9b
http://paste.openstack.org/help/integration/ points to the original
vim plugin, which is obviously not using paste.openstack.org. I find
it worthy to keep the plugin in OSt infra with the necessary
modifications.
Change-Id: I435571a99a7ced2f958114238ea090054ac6797e
- E126 continuation line over-indented for hanging indent
- E127 continuation line over-indented for visual indent
- E128 continuation line under-indented for visual indent
- E131 continuation line unaligned for hanging indent
- E265 block comment should start with '# '
- E272 multiple spaces before keyword
- E302 expected 2 blank lines, found <n>
- E712 comparison to False should be 'if cond is False:' or 'if not cond:'
- F401 '<name>' imported but unused
Change-Id: I2344cf2e8fd7910e72e9d8043423d25e43065ef2
There was an ability to fetch private pastes by their numbers(paste_id)
which looks like security issue since could be used for bruteforcing.
Change-Id: I8e8bc9a05427a70b4203739e30a8fd8e532cfe96
Signed-off-by: Igor Shishkin <ishishkin@mirantis.com>
The current link is to the 'tree' version. If the user right-clicks
and selects "save as", the file will be downloaded as an HTML file.
If the user clicks through to the tree page, another click is needed
on the "plain" link to either download the file with "save link as"
or to navigate to the plain link and then download.
Link directly to the "plain" page instead. This allows users to
directly download the file with "save link as".
Change-Id: I5d6a2f299ee264e5f06f68f72933a575b9042945
The old link of lodgeit.py is outdated(404 not found). This patch
replace it with git.openstack.org link as new one.
Change-Id: Ib12ed531e0811d94aa18d64e908717ff050ce743