11---
22id : hydra-janitor
33title : hydra janitor
4- description :
5- hydra janitor Clean the database of old tokens, login/consent requests and jwt
6- grant issuers
4+ description : hydra janitor Clean the database of old tokens, login/consent requests and jwt grant issuers
75---
86
97<!--
108This file is auto-generated.
119
1210To improve this file please make your change against the appropriate "./cmd/*.go" file.
1311-->
14-
1512## hydra janitor
1613
1714Clean the database of old tokens, login/consent requests and jwt grant issuers
1815
1916### Synopsis
2017
21- This command will cleanup any expired oauth2 tokens as well as login/consent
22- requests. This will select records to delete with a limit and delete records in
23- batch to ensure that no table locking issues arise in big production databases.
18+ This command will cleanup any expired oauth2 tokens as well as login/consent requests.
19+ This will select records to delete with a limit and delete records in batch to ensure that no table locking issues arise in big production databases.
2420
25- ### Warning
21+ ### Warning ###
2622
2723This command is in beta. Proceed with caution!
2824
2925This is a destructive command and will purge data directly from the database.
30- Please use this command with caution if you need to keep historic data for any
31- reason.
26+ Please use this command with caution if you need to keep historic data for any reason.
3227
3328###############
3429
3530Janitor can be used in several ways.
3631
37- 1 . By passing the database connection string (DSN) as an argument Pass the
38- database url (dsn) as an argument to janitor. E.g. janitor
39- < ; database-url> ;
40- 2 . By passing the DSN as an environment variable
32+ 1 . By passing the database connection string (DSN) as an argument
33+ Pass the database url (dsn) as an argument to janitor. E.g. janitor < ; database-url> ;
34+ 2 . By passing the DSN as an environment variable
4135
42- export DSN=...
43- janitor -e
36+ export DSN=...
37+ janitor -e
4438
45- 3 . By passing a configuration file containing the DSN janitor -c
46- /path/to/conf.yml
47- 4 . Extra _ optional _ parameters can also be added such as
39+ 3 . By passing a configuration file containing the DSN
40+ janitor -c /path/to/conf.yml
41+ 4 . Extra * optional * parameters can also be added such as
4842
49- janitor --keep-if-younger 23h --access-lifespan 1h --refresh-lifespan 40h --consent-request-lifespan 10m <database-url>
43+ janitor --keep-if-younger 23h --access-lifespan 1h --refresh-lifespan 40h --consent-request-lifespan 10m <database-url>
5044
51- 5 . Running only a certain cleanup
45+ 5 . Running only a certain cleanup
5246
53- janitor --tokens <database-url>
47+ janitor --tokens <database-url>
5448
55- or
49+ or
5650
57- janitor --requests <database-url>
51+ janitor --requests <database-url>
5852
5953 or
6054
61- janitor --grants <database-url>
55+ janitor --grants <database-url>
6256
63- or any combination of them
57+ or any combination of them
58+
59+ janitor --tokens --requests --grants <database-url>
6460
65- janitor --tokens --requests --grants <database-url>
6661
6762```
6863hydra janitor [<database-url>] [flags]
@@ -87,4 +82,5 @@ hydra janitor [<database-url>] [flags]
8782
8883### SEE ALSO
8984
90- - [ hydra] ( hydra ) - Run and manage Ory Hydra
85+ * [ hydra] ( hydra ) - Run and manage Ory Hydra
86+
0 commit comments