Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
baas
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
baas
Commits
76db61c7
Commit
76db61c7
authored
Mar 03, 2016
by
Efthymia Bika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set gpg-homedir arg when calling duplicity
parent
4536ef7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
10 deletions
+18
-10
baas/config.js
baas/config.js
+5
-0
baas/dup_calls.js
baas/dup_calls.js
+1
-0
baas/timeview.js
baas/timeview.js
+2
-3
src/timeview.py
src/timeview.py
+10
-7
No files found.
baas/config.js
View file @
76db61c7
...
...
@@ -31,6 +31,11 @@ var BAAS_CACHE_DIR = path.join(get_user_home(), BAAS_HOME_DIR, 'cache');
var
BAAS_ARCHIVE_DIR
=
path
.
join
(
BAAS_CACHE_DIR
,
'
duplicity
'
);
var
RESTORE_DEFAULT_DIR
=
path
.
join
(
get_user_home
(),
"
Downloads
"
);
var
GPG_DIR
=
path
.
join
(
get_user_home
(),
'
.gnupg
'
);
if
(
process
.
platform
==
"
win32
"
)
{
GPG_DIR
=
get_unix_path
(
GPG_DIR
);
}
var
running_processes
=
[];
var
SHA256
=
require
(
"
crypto-js/sha256
"
);
...
...
baas/dup_calls.js
View file @
76db61c7
...
...
@@ -227,6 +227,7 @@ function call_duplicity(mode, backup_set, force) {
}
args
.
push
(
"
--log-file
"
,
log_file
);
args
.
push
(
"
--archive-dir
"
,
BAAS_ARCHIVE_DIR
);
args
.
push
(
"
--gpg-homedir
"
,
GPG_DIR
);
var
backup_name
=
(
backup_set
)
?
hashed_backup_name
(
backup_set
.
cloud
,
backup_set
.
name
)
:
...
...
baas/timeview.js
View file @
76db61c7
...
...
@@ -158,14 +158,13 @@ function get_contents_by_date(value) {
}
var
cert
=
(
clouds
[
$
(
"
#cloud
"
).
val
()].
cert
)
?
clouds
[
$
(
"
#cloud
"
).
val
()].
cert
:
DEFAULT_CERT
;
var
archive_dir
=
BAAS_ARCHIVE_DIR
;
var
backup_name
=
hashed_backup_name
(
$
(
"
#cloud
"
).
val
(),
$
(
"
#backup-name
"
).
val
());
var
datapath
=
path
.
join
(
BAAS_CACHE_DIR
,
'
timeviews
'
,
backup_name
);
var
args
=
[
"
python
"
,
TIMEVIEW_PATH
,
datapath
,
"
swift://
"
+
container
,
cert
,
archive_dir
,
backup_name
,
"
get
"
,
value
,
time_path
];
"
swift://
"
+
container
,
cert
,
BAAS_ARCHIVE_DIR
,
GPG_DIR
,
backup_name
,
"
get
"
,
value
,
time_path
];
execFile
(
ENV_CMD
,
args
,
{
env
:
make_env
()},
show_contents_by_date
);
}
...
...
src/timeview.py
View file @
76db61c7
...
...
@@ -85,6 +85,7 @@ def fetch_timepoint(config, timepoint):
args
=
[
duplicity
,
'list-current-files'
,
'-t'
,
timepoint
,
'--ssl-cacert-file'
,
config
[
'cacert_file'
],
'--archive-dir'
,
config
[
'archive_dir'
],
'--gpg-homedir'
,
config
[
'gpg_homedir'
],
'--name'
,
config
[
'backup_name'
],
config
[
'target_url'
]]
...
...
@@ -154,36 +155,38 @@ def get_config():
def
main
():
from
sys
import
argv
,
stdin
,
stdout
def
help
():
print
"Usage: %s <datapath> <target_url> <cacert_file> <archive_dir> <backup_name> [get <absolute_timepoint> <path> | list]"
%
argv
[
0
]
print
"Usage: %s <datapath> <target_url> <cacert_file> <archive_dir> <
gpg_homedir> <
backup_name> [get <absolute_timepoint> <path> | list]"
%
argv
[
0
]
raise
SystemExit
(
1
)
if
len
(
argv
)
<
7
:
if
len
(
argv
)
<
8
:
help
()
datapath
=
argv
[
1
]
ensure_datapath
(
datapath
)
target_url
=
argv
[
2
]
cmd
=
argv
[
6
]
cmd
=
argv
[
7
]
if
cmd
not
in
[
'get'
,
'list'
]:
help
()
cacert_file
=
argv
[
3
]
archive_dir
=
argv
[
4
]
backup_name
=
argv
[
5
]
gpg_homedir
=
argv
[
5
]
backup_name
=
argv
[
6
]
#config = get_config()
config
=
{
'datapath'
:
datapath
,
'target_url'
:
target_url
,
'cacert_file'
:
cacert_file
,
'archive_dir'
:
archive_dir
,
'gpg_homedir'
:
gpg_homedir
,
'backup_name'
:
backup_name
}
if
cmd
==
'get'
:
if
len
(
argv
)
<
9
:
if
len
(
argv
)
<
10
:
help
()
timepoint
=
argv
[
7
]
path
=
unicode
(
argv
[
8
],
encoding
=
'UTF-8'
)
timepoint
=
argv
[
8
]
path
=
unicode
(
argv
[
9
],
encoding
=
'UTF-8'
)
r
=
get_timepoint
(
config
,
timepoint
,
path
)
print
json
.
dumps
(
r
,
indent
=
2
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment