Merge branch 'main' into remove-sections
This commit is contained in:
commit
cedf562a7e
7 changed files with 35 additions and 4 deletions
2
NEWS
2
NEWS
|
@ -6,6 +6,8 @@
|
||||||
https://torsion.org/borgmatic/docs/how-to/run-arbitrary-borg-commands/
|
https://torsion.org/borgmatic/docs/how-to/run-arbitrary-borg-commands/
|
||||||
* #719: Fix an error when running "borg key export" through borgmatic.
|
* #719: Fix an error when running "borg key export" through borgmatic.
|
||||||
* #720: Fix an error when dumping a MySQL database and the "exclude_nodump" option is set.
|
* #720: Fix an error when dumping a MySQL database and the "exclude_nodump" option is set.
|
||||||
|
* #724: Add "check_i_know_what_i_am_doing" option to bypass Borg confirmation prompt when running
|
||||||
|
"check --repair".
|
||||||
* When merging two configuration files, error gracefully if the two files do not adhere to the same
|
* When merging two configuration files, error gracefully if the two files do not adhere to the same
|
||||||
format.
|
format.
|
||||||
* #721: Remove configuration sections ("location:", "storage:", "hooks:" etc.), while still keeping
|
* #721: Remove configuration sections ("location:", "storage:", "hooks:" etc.), while still keeping
|
||||||
|
|
|
@ -11,11 +11,15 @@ OPTION_TO_ENVIRONMENT_VARIABLE = {
|
||||||
'temporary_directory': 'TMPDIR',
|
'temporary_directory': 'TMPDIR',
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFAULT_BOOL_OPTION_TO_ENVIRONMENT_VARIABLE = {
|
DEFAULT_BOOL_OPTION_TO_DOWNCASE_ENVIRONMENT_VARIABLE = {
|
||||||
'relocated_repo_access_is_ok': 'BORG_RELOCATED_REPO_ACCESS_IS_OK',
|
'relocated_repo_access_is_ok': 'BORG_RELOCATED_REPO_ACCESS_IS_OK',
|
||||||
'unknown_unencrypted_repo_access_is_ok': 'BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK',
|
'unknown_unencrypted_repo_access_is_ok': 'BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFAULT_BOOL_OPTION_TO_UPPERCASE_ENVIRONMENT_VARIABLE = {
|
||||||
|
'check_i_know_what_i_am_doing': 'BORG_CHECK_I_KNOW_WHAT_I_AM_DOING',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def make_environment(config):
|
def make_environment(config):
|
||||||
'''
|
'''
|
||||||
|
@ -33,8 +37,15 @@ def make_environment(config):
|
||||||
for (
|
for (
|
||||||
option_name,
|
option_name,
|
||||||
environment_variable_name,
|
environment_variable_name,
|
||||||
) in DEFAULT_BOOL_OPTION_TO_ENVIRONMENT_VARIABLE.items():
|
) in DEFAULT_BOOL_OPTION_TO_DOWNCASE_ENVIRONMENT_VARIABLE.items():
|
||||||
value = config.get(option_name, False)
|
value = config.get(option_name, False)
|
||||||
environment[environment_variable_name] = 'yes' if value else 'no'
|
environment[environment_variable_name] = 'yes' if value else 'no'
|
||||||
|
|
||||||
|
for (
|
||||||
|
option_name,
|
||||||
|
environment_variable_name,
|
||||||
|
) in DEFAULT_BOOL_OPTION_TO_UPPERCASE_ENVIRONMENT_VARIABLE.items():
|
||||||
|
value = storage_config.get(option_name, False)
|
||||||
|
environment[environment_variable_name] = 'YES' if value else 'NO'
|
||||||
|
|
||||||
return environment
|
return environment
|
||||||
|
|
|
@ -373,6 +373,12 @@ properties:
|
||||||
Bypass Borg error about a previously unknown unencrypted repository.
|
Bypass Borg error about a previously unknown unencrypted repository.
|
||||||
Defaults to false.
|
Defaults to false.
|
||||||
example: true
|
example: true
|
||||||
|
check_i_know_what_i_am_doing:
|
||||||
|
type: boolean
|
||||||
|
description: |
|
||||||
|
Bypass Borg confirmation about check with repair option.
|
||||||
|
Defaults to false.
|
||||||
|
example: true
|
||||||
extra_borg_options:
|
extra_borg_options:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
|
5
docs/_data/borgmatic.js
Normal file
5
docs/_data/borgmatic.js
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
module.exports = function() {
|
||||||
|
return {
|
||||||
|
environment: process.env.NODE_ENV || "development"
|
||||||
|
};
|
||||||
|
};
|
|
@ -11,7 +11,7 @@ headerClass: elv-header-default
|
||||||
{% set navPages = collections.all | eleventyNavigation %}
|
{% set navPages = collections.all | eleventyNavigation %}
|
||||||
{% macro renderNavListItem(entry) -%}
|
{% macro renderNavListItem(entry) -%}
|
||||||
<li{% if entry.url == page.url %} class="elv-toc-active"{% endif %}>
|
<li{% if entry.url == page.url %} class="elv-toc-active"{% endif %}>
|
||||||
<a {% if entry.url %}href="https://torsion.org/borgmatic/docs{{ entry.url | url }}"{% endif %}>{{ entry.title }}</a>
|
<a {% if entry.url %}href="{% if borgmatic.environment == "production" %}https://torsion.org/borgmatic/docs{% else %}http://localhost:8080/docs{% endif %}{{ entry.url | url }}"{% endif %}>{{ entry.title }}</a>
|
||||||
{%- if entry.children.length -%}
|
{%- if entry.children.length -%}
|
||||||
<ul>
|
<ul>
|
||||||
{%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
|
{%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
|
||||||
|
|
|
@ -9,7 +9,7 @@ services:
|
||||||
dockerfile: docs/Dockerfile
|
dockerfile: docs/Dockerfile
|
||||||
context: ..
|
context: ..
|
||||||
args:
|
args:
|
||||||
ENVIRONMENT: dev
|
ENVIRONMENT: development
|
||||||
message:
|
message:
|
||||||
image: alpine
|
image: alpine
|
||||||
container_name: message
|
container_name: message
|
||||||
|
|
|
@ -25,6 +25,7 @@ def test_make_environment_without_configuration_should_only_set_default_environm
|
||||||
assert environment == {
|
assert environment == {
|
||||||
'BORG_RELOCATED_REPO_ACCESS_IS_OK': 'no',
|
'BORG_RELOCATED_REPO_ACCESS_IS_OK': 'no',
|
||||||
'BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK': 'no',
|
'BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK': 'no',
|
||||||
|
'BORG_CHECK_I_KNOW_WHAT_I_AM_DOING': 'NO',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,6 +35,12 @@ def test_make_environment_with_relocated_repo_access_should_override_default():
|
||||||
assert environment.get('BORG_RELOCATED_REPO_ACCESS_IS_OK') == 'yes'
|
assert environment.get('BORG_RELOCATED_REPO_ACCESS_IS_OK') == 'yes'
|
||||||
|
|
||||||
|
|
||||||
|
def test_make_environment_check_i_know_what_i_am_doing_should_override_default():
|
||||||
|
environment = module.make_environment({'check_i_know_what_i_am_doing': True})
|
||||||
|
|
||||||
|
assert environment.get('BORG_CHECK_I_KNOW_WHAT_I_AM_DOING') == 'YES'
|
||||||
|
|
||||||
|
|
||||||
def test_make_environment_with_integer_variable_value():
|
def test_make_environment_with_integer_variable_value():
|
||||||
environment = module.make_environment({'borg_files_cache_ttl': 40})
|
environment = module.make_environment({'borg_files_cache_ttl': 40})
|
||||||
assert environment.get('BORG_FILES_CACHE_TTL') == '40'
|
assert environment.get('BORG_FILES_CACHE_TTL') == '40'
|
||||||
|
|
Loading…
Reference in a new issue