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
We update the upper bound in testing from python3.10 to python3.11 to
match. This will allow the opendev team to clean up old bullseye images
and look ahead to python3.12.
Change-Id: I5321b2e75b4cf50f9342efa13fd4ef37cf87e1e0
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
This reverts commit 305d665492.
This reverts commit e0aef11145.
OpenDev is moving back to docker.io to preserve speculative container
image testing.
Change-Id: I3f0962790f48a33edc5f6414ab875a2a38cfdc91
The repository metadata needs to be fully qualified to push to quay.io
properly. Otherwise it pushes to docker hub and fails with invalid
credentials.
Change-Id: I43f3330f98aaf806c0c05e78c9908948f22c2193
We are moving all of our images to quay.io. Move lodgeit too. This also
updates the source location for the python base images which have
already moved to quay.io.
Change-Id: I8fc391018463fc8df81bdf2bc81a05b4fb330d63
SQLAlchemy 2.0 is a very large non backward compatible update. We should
probably take the time to update lodgeit to work with SQLAlchemy 2.0,
but for now lets just make the software buildable and pin the dep.
Change-Id: Ie4fcc6e8aae92b54adb30ac6028907217613165f
Python 3.6 is sufficiently old at this point that we don't need to keep
testing on it. This will reduce the number of things we need to tend and
care for with this application and service.
Change-Id: Iadea5270f54631ef72a68a37073fd8d337bc4c5c
OpenDev has stopped building python3.8 images at this point. This means
we need to update our Dockerfile to use a newer python version. In this
case python3.10 is chosen as it is newer but still easy to test on
Ubuntu. This will also update the version of uwsgi we are using.
Change-Id: I3eb4c580d854ebe0437114701d1b3f9c721e530e
This modernizes the lodgeit testsuite to use stestr instead of nose. The
primary reason for this is nose is not python3.10 compatible and we
would like to use newer python with lodgeit.
Change-Id: I8ae480d22bbef0258afc9d6ffd6cd820993430a1
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
This is a Dockerfile update to force a rebuild of the lodgeit image. The
depends-on is the reason we want a rebuild. Long story short our
uwsgi-base bullseye image isn't actually bullseye due to a bug. The
depends on should fix this and we can rebuild onto bullseye.
Depends-On: https://review.opendev.org/c/opendev/system-config/+/821339
Change-Id: I85119c85457ef6b6b0cc95e4fdb2e1c92637949e
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
This changes switches the Docker image to use the uwsgi-base image which
have no changes in the consumption of the image.
Depends-On: https://review.opendev.org/713953
Change-Id: Ia04425ca7bf22f0e9cc2dbe35daefa466c92dd56
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
The python-builder base image was updated to no longer install
recommends. This is inline with the other Infra images and keeps
image sizes smaller. gcc recommended libc6-dev - but it turns out
we need that for stdio.h for one of our depends. Add it to fix
our image builds.
Pygments released a python3-only release. Pin back to before
that for python2.
Change-Id: I18a808748979b7167361d2e5ebce04bc8eaf1347
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
In python3 you can't use a cmp function and have to use a key function
when sorting. Python2 supports both so we switch to a key function that
takes a single arg in the sort of supported languages in the pasting
script.
Change-Id: Ib49bcb22653bd577078a386750027fc5acee3180
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