| 1 | | = How do I redact a password or other sensitive info from a ticket? = |
| 2 | | |
| 3 | | Note: this process will change after [ticket:3716 upgrading support.mayfirst.org to Postgres]. |
| 4 | | |
| 5 | | The trac installation is on moses.mayfirst.org. |
| 6 | | |
| 7 | | Begin by logging into moses: |
| 8 | | |
| 9 | | {{{ |
| 10 | | ssh root@moses.mayfirst.org |
| 11 | | }}} |
| 12 | | |
| 13 | | Then, open the database: |
| 14 | | |
| 15 | | {{{ |
| 16 | | sqlite3 /srv/trac/support/db/trac.db |
| 17 | | }}} |
| 18 | | |
| 19 | | The SQL statement to execute depends on whether the string you want to redact is in the original ticket or in a comment. In both cases below, replace THING_TO_REPLACE with the actual private string to redact and replace TICKET_NUMBER with the number of the ticket. |
| 20 | | |
| 21 | | If you are redacting the body of an initial ticket, try: |
| 22 | | |
| 23 | | {{{ |
| 24 | | UPDATE ticket SET description = REPLACE(description,'THING_TO_REPLACE','xxxxxx') where id = TICKET_NUMBER; |
| 25 | | }}} |
| 26 | | |
| 27 | | If you are redacting an ticket comment try: |
| 28 | | |
| 29 | | {{{ |
| 30 | | UPDATE ticket_change SET newvalue = REPLACE(newvalue,'THING_TO_REPLACE','xxxxxxxx') where ticket = TICKET_NUMBER; |
| 31 | | }}} |
| 32 | | |
| 33 | | When you are done type: |
| 34 | | |
| 35 | | {{{ |
| 36 | | .quit |
| 37 | | }}} |
| | 1 | This page has been [wiki:trac-redact renamed]. |