mumble-voip / mumble-scripts

Mumble scripts is a place for gathering various scripts written for the Mumble VoIP application.
https://www.mumble.info
48 stars 33 forks source link

Suggestion for addition: gencerthash.py #18

Open johnnybubonic opened 6 years ago

johnnybubonic commented 6 years ago

Hello.

I wrote a python script for generating the certificate fingerprint hash client-side.

You can view it here: upstream/authoritative source, GitHub mirror

It:

It is useful for Murmur administrators that run a locked-down Murmur instance (such as myself) that refuse joining for unregistered users (ergo users cannot self-register). I'm still working on other tools that can use this fingerprint hash that do it The Right Way (Ice/GRPC for 1.3.x), but for now I've been simply just manually creating the user in the DB and restarting Murmur as needed.

johnnybubonic commented 6 years ago

p.s. For those curious how I add a user registration to Mumble myself, I do this via something like this (note that editing the sqlite3 like this is DANGEROUS if you have self-registration enabled/allowed, and it's a very flawed/quick demonstration. Education purposes only.):

#!/bin/bash

NOW=$(date '+%Y-%m-%d %H:%M:%S')
MURMURDB='/var/lib/murmur/murmur.sqlite'
USER='username'
FPR='fingerprinthash'
SRVR_ID='1'
LAST_CHAN='0'
LST_UID=$(sqlite3 ${MURMURDB} "SELECT user_id FROM users ORDER BY user_id DESC LIMIT 1")
NXT_UID=$(($LST_UID+1))

sqlite3 ${MURMURDB} \
    "INSERT INTO users (server_id,user_id,name,pw,lastchannel,texture,last_active) \
     VALUES ('${SRVR_ID}', '${NXT_UID}','${USER}','','${LAST_CHAN}','','${NOW}')"
sqlite3 ${MURMURDB} \
    "INSERT INTO user_info (server_id,user_id,key,value) \
     VALUES ('${SRVR_ID}','${NXT_UID}','3','${FPR}')"