2021-05-23 15:41:19 +00:00
|
|
|
defaults = {
|
|
|
|
'apt': {
|
|
|
|
'packages': {
|
|
|
|
# for paperless itself
|
|
|
|
'fonts-liberation': {},
|
|
|
|
'gnupg': {},
|
|
|
|
'imagemagick': {},
|
|
|
|
'libmagic-dev': {},
|
2023-12-07 20:07:33 +00:00
|
|
|
'default-libmysqlclient-dev': {},
|
2021-05-23 15:41:19 +00:00
|
|
|
'libpq-dev': {},
|
2023-12-07 20:07:33 +00:00
|
|
|
'mariadb-client': {},
|
2021-05-23 15:41:19 +00:00
|
|
|
'mime-support': {},
|
|
|
|
'optipng': {},
|
2024-03-04 20:23:00 +00:00
|
|
|
'poppler-utils': {},
|
2021-05-23 15:41:19 +00:00
|
|
|
'python3-wheel': {},
|
|
|
|
|
|
|
|
# for OCRmyPDF
|
|
|
|
'ghostscript': {},
|
|
|
|
'icc-profiles-free': {},
|
|
|
|
'liblept5': {},
|
|
|
|
'libxml2': {},
|
|
|
|
'pngquant': {},
|
|
|
|
'qpdf': {},
|
|
|
|
'tesseract-ocr': {},
|
2023-12-07 20:07:33 +00:00
|
|
|
'tesseract-ocr-deu': {},
|
|
|
|
'tesseract-ocr-eng': {},
|
2021-05-23 15:41:19 +00:00
|
|
|
'unpaper': {},
|
|
|
|
'zlib1g': {},
|
|
|
|
},
|
|
|
|
},
|
2022-01-05 06:50:22 +00:00
|
|
|
'backups': {
|
|
|
|
'paths': {
|
|
|
|
'/mnt/paperless',
|
|
|
|
},
|
|
|
|
},
|
2024-07-19 17:20:23 +00:00
|
|
|
'nodejs': {
|
2024-12-22 03:59:29 +00:00
|
|
|
'version': 22,
|
2024-07-19 17:20:23 +00:00
|
|
|
},
|
2021-05-23 15:41:19 +00:00
|
|
|
'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,
|
|
|
|
},
|
|
|
|
}
|
2023-11-12 10:28:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
@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',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2024-02-17 03:44:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
@metadata_reactor.provides(
|
|
|
|
'nginx/vhosts/paperless',
|
|
|
|
)
|
|
|
|
def nginx(metadata):
|
|
|
|
if not node.has_bundle('nginx'):
|
|
|
|
raise DoNotRunAgain
|
|
|
|
|
|
|
|
return {
|
|
|
|
'nginx': {
|
|
|
|
'vhosts': {
|
|
|
|
'paperless': {
|
|
|
|
'domain': metadata.get('paperless/domain'),
|
|
|
|
'locations': {
|
|
|
|
'/': {
|
|
|
|
'target': 'http://127.0.0.1:22070',
|
|
|
|
'websockets': True,
|
|
|
|
'proxy_set_header': {
|
|
|
|
'X-Forwarded-Host': '$server_name',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'/static/': {
|
|
|
|
'alias': '/opt/paperless/src/paperless-ngx/static/',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'max_body_size': '100M',
|
|
|
|
'website_check_path': '/accounts/login/',
|
|
|
|
'website_check_string': 'Paperless-ngx',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|