81 lines
2.1 KiB
Python
81 lines
2.1 KiB
Python
defaults = {
|
|
'apt': {
|
|
'packages': {
|
|
# for paperless itself
|
|
'fonts-liberation': {},
|
|
'gnupg': {},
|
|
'imagemagick': {},
|
|
'libmagic-dev': {},
|
|
'default-libmysqlclient-dev': {},
|
|
'libpq-dev': {},
|
|
'mariadb-client': {},
|
|
'mime-support': {},
|
|
'optipng': {},
|
|
'python3-wheel': {},
|
|
|
|
# for OCRmyPDF
|
|
'ghostscript': {},
|
|
'icc-profiles-free': {},
|
|
'liblept5': {},
|
|
'libxml2': {},
|
|
'pngquant': {},
|
|
'qpdf': {},
|
|
'tesseract-ocr': {},
|
|
'tesseract-ocr-deu': {},
|
|
'tesseract-ocr-eng': {},
|
|
'unpaper': {},
|
|
'zlib1g': {},
|
|
},
|
|
},
|
|
'backups': {
|
|
'paths': {
|
|
'/mnt/paperless',
|
|
},
|
|
},
|
|
'postgresql': {
|
|
'roles': {
|
|
'paperless': {
|
|
'password': repo.vault.password_for(f'{node.name} postgresql paperless'),
|
|
},
|
|
},
|
|
'databases': {
|
|
'paperless': {
|
|
'owner': 'paperless',
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
@metadata_reactor.provides(
|
|
'apt/packages',
|
|
)
|
|
def paperless_tesseract_languages(metadata):
|
|
packages = {}
|
|
|
|
for lang in metadata.get('paperless/ocr_languages', {'deu', 'eng'}):
|
|
packages[f'tesseract-ocr-{lang}'] = {}
|
|
|
|
return {
|
|
'apt': {
|
|
'packages': packages,
|
|
},
|
|
}
|
|
|
|
|
|
@metadata_reactor.provides(
|
|
'icinga2_api/paperless/services',
|
|
)
|
|
def icinga_check_for_new_release(metadata):
|
|
return {
|
|
'icinga2_api': {
|
|
'paperless': {
|
|
'services': {
|
|
'PAPERLESS UPDATE': {
|
|
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_github_for_new_release paperless-ngx/paperless-ngx {}'.format(metadata.get('paperless/version')),
|
|
'vars.notification.mail': True,
|
|
'check_interval': '60m',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|