1
0
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:
Alberto Bertogli
2016-09-18 01:12:41 +01:00
parent 5c6fb934fe
commit 394067bbd3
12 changed files with 384 additions and 316 deletions

4
test/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Ignore the user databases - we create them each time.
t-*/config/**/users

View File

@@ -1,2 +0,0 @@
#chasquid-userdb-v1
user SCRYPT@n:14,r:8,p:1,l:32,r00XqNmRkV505R2X6KT8+Q== aAiBBIVNNzmDXwxLLdJezFuxGtc2/wcHsy3FiOMAH4c=

View File

@@ -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 &

View File

@@ -1,2 +0,0 @@
#chasquid-userdb-v1
user SCRYPT@n:14,r:8,p:1,l:32,r00XqNmRkV505R2X6KT8+Q== aAiBBIVNNzmDXwxLLdJezFuxGtc2/wcHsy3FiOMAH4c=

View File

@@ -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.

View File

@@ -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