forked from michael.heier/citadel-core
Extend app standard with custom bitcoin mount dir
This commit is contained in:
parent
c52a0dd222
commit
f4e5e0e35e
|
@ -150,6 +150,10 @@
|
|||
"type": ["string", "array"],
|
||||
"description": "The entrypoint for the container"
|
||||
},
|
||||
"bitcoin_mount_dir": {
|
||||
"type": "string",
|
||||
"description": "Where to mount the bitcoin dir"
|
||||
},
|
||||
"command": {
|
||||
"type": ["string", "array"],
|
||||
"description": "The command for the container"
|
||||
|
|
|
@ -43,6 +43,18 @@ def convertDataDirToVolume(app: dict):
|
|||
print("Data dir " + dataDir +
|
||||
" contains invalid characters")
|
||||
del container['data']
|
||||
if 'bitcoin_mount_dir' in container:
|
||||
if not 'permissions' in container or not 'bitcoind' in container['permissions']:
|
||||
print("Warning: container {} of app {} defines bitcoin_mount_dir but has no permissions for bitcoind".format(container['name'], app['metadata']['name']))
|
||||
# Skip this container
|
||||
continue
|
||||
if not 'volumes' in container:
|
||||
container['volumes'] = []
|
||||
# Also skip the container if container['bitcoin_mount_dir'] contains a :
|
||||
if(container['bitcoin_mount_dir'].find(":") == -1):
|
||||
container['volumes'].append('"${BITCOIN_DATA_DIR}:' + container['bitcoin_mount_dir'] + ':ro"')
|
||||
del container['bitcoin_mount_dir']
|
||||
|
||||
return app
|
||||
|
||||
def addStopConfig(app: dict):
|
||||
|
|
Loading…
Reference in New Issue
Block a user