src: include warning in the secret file
This commit is contained in:
parent
c3fe4c7230
commit
4111aed599
|
@ -59,7 +59,16 @@ impl SSBKeypair for Keypair {
|
|||
} else {
|
||||
let mut csprng = OsRng {};
|
||||
let keypair = Keypair::generate(&mut csprng);
|
||||
std::fs::write(path, keypair.to_json().pretty(2)).unwrap();
|
||||
let keypair_json = keypair.to_json();
|
||||
std::fs::write(
|
||||
path,
|
||||
format!(
|
||||
include_str!("warning.txt"),
|
||||
keys = keypair_json.pretty(2),
|
||||
id = keypair_json["id"]
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
keypair
|
||||
}
|
||||
}
|
||||
|
|
15
src/warning.txt
Normal file
15
src/warning.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
# WARNING: Never show this to anyone.
|
||||
# WARNING: Never edit it or use it on multiple devices at once.
|
||||
#
|
||||
# This is your SECRET, it gives you magical powers. With your secret you can
|
||||
# sign your messages so that your friends can verify that the messages came
|
||||
# from you. If anyone learns your secret, they can use it to impersonate you.
|
||||
#
|
||||
# If you use this secret on more than one device you will create a fork and
|
||||
# your friends will stop replicating your content.
|
||||
#
|
||||
{keys}
|
||||
#
|
||||
# The only part of this file that's safe to share is your public name:
|
||||
#
|
||||
# {id}
|
Loading…
Reference in a new issue