Add variables for maintenance cleanup
This commit is contained in:
parent
4f0878d038
commit
1a65942f36
1 changed files with 10 additions and 2 deletions
|
@ -70,6 +70,12 @@
|
||||||
# WARNING! This token will be in plain text in the System unit
|
# WARNING! This token will be in plain text in the System unit
|
||||||
# definition, so restrict it to only read public repos.
|
# definition, so restrict it to only read public repos.
|
||||||
#
|
#
|
||||||
|
# [*media_retention_days*]
|
||||||
|
# Integer with the number of days to keep media attachments. Default 7.
|
||||||
|
#
|
||||||
|
# [*cards_retention_days*]
|
||||||
|
# Integer with the number of days to keep preview cards. Default 180.
|
||||||
|
#
|
||||||
class mastodon (
|
class mastodon (
|
||||||
String $ensure = 'present',
|
String $ensure = 'present',
|
||||||
String $hostname = 'mastodon.example.org',
|
String $hostname = 'mastodon.example.org',
|
||||||
|
@ -114,6 +120,8 @@ class mastodon (
|
||||||
String $cert_admin_mail = 'cert-admin@example.org',
|
String $cert_admin_mail = 'cert-admin@example.org',
|
||||||
Boolean $manage_updater_task = false,
|
Boolean $manage_updater_task = false,
|
||||||
String $github_token = '',
|
String $github_token = '',
|
||||||
|
Integer $media_retention_days = 7,
|
||||||
|
Integer $cards_retention_days = 180,
|
||||||
) {
|
) {
|
||||||
case $ensure {
|
case $ensure {
|
||||||
default: {
|
default: {
|
||||||
|
@ -512,7 +520,7 @@ class mastodon (
|
||||||
User=${mastodon_user}
|
User=${mastodon_user}
|
||||||
WorkingDirectory=${mastodon_home}/live
|
WorkingDirectory=${mastodon_home}/live
|
||||||
Environment='RAILS_ENV=production' 'PATH=${mastodon_home}/.rbenv/shims:${mastodon_home}/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
|
Environment='RAILS_ENV=production' 'PATH=${mastodon_home}/.rbenv/shims:${mastodon_home}/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
|
||||||
ExecStart=/opt/mastodon/live/bin/tootctl media remove --days 180
|
ExecStart=/opt/mastodon/live/bin/tootctl media remove --days ${media_retention_days}
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
OnFailure=status_email_antoniodelgado@%n.service
|
OnFailure=status_email_antoniodelgado@%n.service
|
||||||
|
@ -545,7 +553,7 @@ class mastodon (
|
||||||
User=${mastodon_user}
|
User=${mastodon_user}
|
||||||
WorkingDirectory=${mastodon_home}/live
|
WorkingDirectory=${mastodon_home}/live
|
||||||
Environment='RAILS_ENV=production' 'PATH=${mastodon_home}/.rbenv/shims:${mastodon_home}/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
|
Environment='RAILS_ENV=production' 'PATH=${mastodon_home}/.rbenv/shims:${mastodon_home}/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
|
||||||
ExecStart=/opt/mastodon/live/bin/tootctl preview_cards remove --days 180
|
ExecStart=/opt/mastodon/live/bin/tootctl preview_cards remove --days ${cards_retention_days}
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
OnFailure=status_email_antoniodelgado@%n.service
|
OnFailure=status_email_antoniodelgado@%n.service
|
||||||
|
|
Loading…
Reference in a new issue