Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Commits
330ca261
Commit
330ca261
authored
4 years ago
by
Éloïs
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix/1416' into dev
parents
ec96572a
75c94aa1
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/lib/dal/fileDALs/CFSCore.ts
+14
-2
14 additions, 2 deletions
app/lib/dal/fileDALs/CFSCore.ts
app/lib/system/directory.ts
+5
-1
5 additions, 1 deletion
app/lib/system/directory.ts
app/modules/keypair/index.ts
+1
-1
1 addition, 1 deletion
app/modules/keypair/index.ts
with
20 additions
and
4 deletions
app/lib/dal/fileDALs/CFSCore.ts
+
14
−
2
View file @
330ca261
...
...
@@ -112,9 +112,21 @@ export class CFSCore {
* @param content String content to write.
* @param deep Wether to make a deep write or not.
*/
async
write
(
filePath
:
string
,
content
:
string
,
deep
:
boolean
):
Promise
<
void
>
{
async
write
(
filePath
:
string
,
content
:
string
,
deep
:
boolean
,
secureMode
:
boolean
=
false
):
Promise
<
void
>
{
if
(
secureMode
)
{
return
this
.
qfs
.
fsWriteSecure
(
path
.
join
(
this
.
rootPath
,
filePath
),
content
);
}
else
{
return
this
.
qfs
.
fsWrite
(
path
.
join
(
this
.
rootPath
,
filePath
),
content
);
}
}
/**
* REMOVE operation of CFS. Set given file as removed. Logical deletion since physical won't work due to the algorithm of CFS.
...
...
This diff is collapsed.
Click to expand it.
app/lib/system/directory.ts
+
5
−
1
View file @
330ca261
...
...
@@ -50,6 +50,7 @@ export interface FileSystem {
fsUnlink
(
file
:
string
):
Promise
<
boolean
>
;
fsList
(
dir
:
string
):
Promise
<
string
[]
>
;
fsWrite
(
file
:
string
,
content
:
string
):
Promise
<
void
>
;
fsWriteSecure
(
file
:
string
,
content
:
string
):
Promise
<
void
>
;
fsMakeDirectory
(
dir
:
string
):
Promise
<
void
>
;
fsRemoveTree
(
dir
:
string
):
Promise
<
void
>
;
fsStreamTo
(
file
:
string
,
iterator
:
IterableIterator
<
string
>
):
Promise
<
void
>
;
...
...
@@ -69,7 +70,6 @@ class QioFileSystem implements FileSystem {
async
fsReadFile
(
file
:
string
)
{
return
this
.
qio
.
read
(
file
);
}
async
fsUnlink
(
file
:
string
)
{
return
this
.
qio
.
remove
(
file
);
}
...
...
@@ -85,6 +85,10 @@ class QioFileSystem implements FileSystem {
return
this
.
qio
.
write
(
file
,
content
);
}
fsWriteSecure
(
file
:
string
,
content
:
string
):
Promise
<
void
>
{
return
this
.
qio
.
write
(
file
,
content
,
undefined
,
undefined
,
{
mode
:
0o640
});
}
async
fsStreamTo
(
file
:
string
,
iterator
:
IterableIterator
<
string
>
...
...
This diff is collapsed.
Click to expand it.
app/modules/keypair/index.ts
+
1
−
1
View file @
330ca261
...
...
@@ -152,7 +152,7 @@ export const KeypairDependency = {
// We save the key in a separate file
const
keyring
=
'
pub: "
'
+
conf
.
pair
.
pub
+
'
"
\n
'
+
'
sec: "
'
+
conf
.
pair
.
sec
+
'
"
'
;
await
confDAL
.
coreFS
.
write
(
"
keyring.yml
"
,
keyring
);
await
confDAL
.
coreFS
.
write
(
"
keyring.yml
"
,
keyring
,
false
,
true
);
// We never want to store salt, password or keypair in the conf.json file
delete
conf
.
salt
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment