From 139c31f45070ad5c7c42b69fe549c49b2c3ec442 Mon Sep 17 00:00:00 2001 From: BT Date: Mon, 6 Jul 2020 14:48:40 +0700 Subject: [PATCH] Store TOR data on drive closes https://github.com/getumbrel/umbrel-compose/issues/40 --- contrib/partitioner/partitioner.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/contrib/partitioner/partitioner.py b/contrib/partitioner/partitioner.py index cfbe322..7be5a17 100755 --- a/contrib/partitioner/partitioner.py +++ b/contrib/partitioner/partitioner.py @@ -126,11 +126,12 @@ def main(): ''' Setup secrets, db, bitcoin, nginx, and lnd directory.. as a new install ''' - print('Setup secrets, db, bitcoin, nginx, and lnd directory.. as a new install') + print('Setup secrets, db, bitcoin, nginx, tor and lnd directory.. as a new install') os.system('/bin/cp -fr ' + homedirpath + '/secrets /mnt/data') os.system('/bin/cp -fr ' + homedirpath + '/db /mnt/data') os.system('/bin/cp -fr ' + homedirpath + '/bitcoin /mnt/data') os.system('/bin/cp -fr ' + homedirpath + '/lnd /mnt/data') + os.system('/bin/cp -fr ' + homedirpath + '/tor /mnt/data') os.system('/bin/cp -fr ' + homedirpath + '/nginx /mnt/data') if not os.path.exists('/mnt/data/swap'): @@ -153,11 +154,17 @@ def main(): - db - lnd - nginx + - tor ''' # Secrets folder if not os.path.exists('/mnt/data/secrets'): print('secrets folder does\'nt exist!') os.system('/bin/cp -fr ' + homedirpath + '/secrets /mnt/data') + + # tor folder + if not os.path.exists('/mnt/data/tor'): + print('secrets folder does\'nt exist!') + os.system('/bin/cp -fr ' + homedirpath + '/tor /mnt/data') # db folder if not os.path.exists('/mnt/data/db'): @@ -206,12 +213,14 @@ def main(): os.system('/bin/rm -fr ' + homedirpath + '/db') os.system('/bin/rm -fr ' + homedirpath + '/bitcoin') os.system('/bin/rm -fr ' + homedirpath + '/lnd') + os.system('/bin/rm -fr ' + homedirpath + '/tor') os.system('/bin/rm -fr ' + homedirpath + '/nginx') print('Set up symlinks') os.system('/bin/ln -s /mnt/data/secrets ' + homedirpath + '/secrets') os.system('/bin/ln -s /mnt/data/db ' + homedirpath + '/db') os.system('/bin/ln -s /mnt/data/bitcoin ' + homedirpath + '/bitcoin') os.system('/bin/ln -s /mnt/data/lnd ' + homedirpath + '/lnd') + os.system('/bin/ln -s /mnt/data/tor ' + homedirpath + '/tor') os.system('/bin/ln -s /mnt/data/nginx ' + homedirpath + '/nginx') else: print('No drives or unexpected number of drives detected!')