mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
userdb: Use protocol buffers instead of our custom format
Protocol buffers are a more portable, practical and safe format for the user database.
This commit is contained in:
4
test/.gitignore
vendored
Normal file
4
test/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
# Ignore the user databases - we create them each time.
|
||||
t-*/config/**/users
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#chasquid-userdb-v1
|
||||
user SCRYPT@n:14,r:8,p:1,l:32,r00XqNmRkV505R2X6KT8+Q== aAiBBIVNNzmDXwxLLdJezFuxGtc2/wcHsy3FiOMAH4c=
|
||||
@@ -6,6 +6,7 @@ set -e
|
||||
init
|
||||
|
||||
generate_certs_for testserver
|
||||
add_user testserver user secretpassword
|
||||
|
||||
mkdir -p .logs
|
||||
chasquid -v=2 --log_dir=.logs --config_dir=config &
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#chasquid-userdb-v1
|
||||
user SCRYPT@n:14,r:8,p:1,l:32,r00XqNmRkV505R2X6KT8+Q== aAiBBIVNNzmDXwxLLdJezFuxGtc2/wcHsy3FiOMAH4c=
|
||||
@@ -33,6 +33,7 @@ mkdir -p .exim4
|
||||
EXIMDIR="$PWD/.exim4" envsubst < config/exim4.in > .exim4/config
|
||||
|
||||
generate_certs_for srv-chasquid
|
||||
add_user srv-chasquid user secretpassword
|
||||
|
||||
# Launch chasquid at port 1025 (in config).
|
||||
# Use outgoing port 2025 which is where exim will be at.
|
||||
|
||||
@@ -32,6 +32,14 @@ function chasquid() {
|
||||
go run ${TBASE}/../../chasquid.go "$@"
|
||||
}
|
||||
|
||||
function add_user() {
|
||||
go run ${TBASE}/../../cmd/chasquid-userdb/chasquid-userdb.go \
|
||||
--database "config/domains/${1}/users" \
|
||||
--add_user "${2}" \
|
||||
--password "${3}" \
|
||||
>> .add_user_logs
|
||||
}
|
||||
|
||||
function run_msmtp() {
|
||||
# msmtp will check that the rc file is only user readable.
|
||||
chmod 600 msmtprc
|
||||
|
||||
Reference in New Issue
Block a user