Files
system-config/doc/source/paste.rst
Jeremy Stanley aafa1c85d2 Document paste deletion from the Lodgeit database
This is a straightforward administrative task, albeit not one we're
asked to perform often.

Change-Id: I582f70c76c2de1afd7a7c7f6319f3f0202fb7494
2025-10-01 18:51:57 +00:00

72 lines
2.3 KiB
ReStructuredText

:title: Paste
.. _paste:
Paste
#####
Paste servers are an easy way to share long-form content such as
configuration files or log data with others over short-form
communication protocols such as IRC. OpenStack runs the "lodgeit"
paste software.
At a Glance
===========
:Hosts:
* http://paste.opendev.org
:Ansible:
* :git_file:`playbooks/roles/lodgeit/`
:Projects:
* https://opendev.org/opendev/lodgeit
:Bugs:
* https://storyboard.openstack.org/#!/project/748
Overview
========
For OpenStack we use `a fork
<https://opendev.org/opendev/lodgeit>`_ of lodgeit which is
based on one with bugfixes maintained by `dcolish
<https://bitbucket.org/dcolish/lodgeit-main>`_ but adds back missing
anti-spam features required by OpenStack.
Ansible configures lodgeit to use mariadb database backend, apache
as a front-end proxy.
Manual Administrative Tasks
===========================
Deleting a Paste
----------------
The quickest way to do this is database surgery. Lodgeit uses a
MariaDB container on the paste server, and only has a single table
in its database, so this is quite straightforward. Connect to the
database with an interactive client session like so::
sudo docker-compose -f /etc/lodgeit-compose/docker-compose.yaml exec \
mariadb bash -c '/usr/bin/mysql -uroot -p"$MYSQL_ROOT_PASSWORD" lodgeit'
These days we've configured Lodgeit to use so-called "private"
identifiers by default, so that's what you'll likely be keying from.
For the sake of example let's pretend the URL is
``https://paste.opendev.org/show/thisIsSomeMadeUpBlob/``. First
check the row you're about to delete::
SELECT code FROM pastes WHERE private_id='thisIsSomeMadeUpBlob';
Note that if you instead have an old-style integer index identifier,
you'll need to use ``paste_id`` with that instead of ``private_id``.
You should see the ``code`` field content from one row matching the
content of the page you're preparing to delete. If it looks correct,
proceed with the deletion::
DELETE FROM pastes WHERE private_id='thisIsSomeMadeUpBlob';
That command should return a response like ``1 row in set (0.001
sec)`` if it was successful. Try to load the paste in your browser
again and hopefully it now says ``PageNot Found`` instead of
returning the prior content. If all's as intended, ``^D`` out of the
interactive shell and you're done!