Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
N
node-bigstream
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bs
node-bigstream
Commits
0e8d95a9
Commit
0e8d95a9
authored
May 26, 2020
by
Kamron Aroonrua
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pgpcrypt
parent
016d72bb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
3 deletions
+26
-3
config.js
conf/config.js
+1
-0
keystore.json
conf/template/keystore.json
+3
-0
default.json
env/default.json
+2
-1
perform.js
plugins/dt/dt-pgpcrypt/perform.js
+20
-2
No files found.
conf/config.js
View file @
0e8d95a9
...
...
@@ -5,6 +5,7 @@ var cfg = {
'mqtt'
:
cfg_load
(
'mqtt.json'
),
'memstore'
:
cfg_load
(
'memstore.json'
),
'storage'
:
cfg_load
(
'storage.json'
),
'keystore'
:
cfg_load
(
'keystore.json'
),
'auth'
:
{
'secret'
:
cfg_load
(
'secret.json'
),
'acl'
:
cfg_load
(
'acl.json'
)
...
...
conf/template/keystore.json
0 → 100644
View file @
0e8d95a9
{
"dir"
:
"./keys"
}
\ No newline at end of file
env/default.json
View file @
0e8d95a9
...
...
@@ -6,5 +6,6 @@
{
"env"
:
"BSCONFIG_MEMSTORE_URL"
,
"conf"
:
"memstore.url"
},
{
"env"
:
"BSCONFIG_STORAGE_REPOSITORY"
,
"conf"
:
"storage.repository"
},
{
"env"
:
"BSCONFIG_STORAGE_APIHOSTNAME"
,
"conf"
:
"storage.api_hostname"
},
{
"env"
:
"BSCONFIG_SECRET_TEXT"
,
"conf"
:
"auth.secret.value"
}
{
"env"
:
"BSCONFIG_SECRET_TEXT"
,
"conf"
:
"auth.secret.value"
},
{
"env"
:
"BSCONFIG_KEYSTORE_DIR"
,
"conf"
:
"keystore.dir"
}
]
\ No newline at end of file
plugins/dt/dt-pgpcrypt/perform.js
View file @
0e8d95a9
var
ctx
=
require
(
'../../../context'
);
var
Utils
=
ctx
.
getLib
(
'lib/util/plugin-utils'
);
var
pgplib
=
require
(
'./pgp'
)
var
pgplib
=
require
(
'./pgp'
);
var
path
=
require
(
'path'
);
var
fs
=
require
(
'fs'
);
function
perform_function
(
context
,
request
,
response
){
var
job_id
=
context
.
jobconfig
.
job_id
;
...
...
@@ -18,10 +20,26 @@ function perform_function(context,request,response){
var
req_passphrase
=
param
.
passphrase
||
""
var
req_output
=
param
.
output
||
"binary"
var
key_dir
=
ctx
.
getConfig
(
'keystore.dir'
,
'./keys'
);
var
fn_load_key
=
function
(
name
)
{
var
k
=
""
;
var
fp
=
path
.
join
(
key_dir
,
path
.
basename
(
name
));
try
{
k
=
fs
.
readFileSync
(
fp
).
toString
(
'utf8'
);
}
catch
(
e
){
}
return
k
;
}
var
env
=
{
'type'
:
output_type
,
'data'
:
data
,
'meta'
:
meta
'meta'
:
meta
,
'_fn'
:
{
'load_key'
:
fn_load_key
}
}
req_publickey
=
Utils
.
vm_execute_text
(
env
,
req_publickey
);
...
...
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