Merge pull request #67 from bmartin5692/fix-66

create passwd file if it doesnt exist
This commit is contained in:
Brian Martin 2019-12-27 11:19:09 -05:00 committed by GitHub
commit 3aefbe2fd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -321,6 +321,11 @@ def main(argv=None):
first_run()
return
if not (
os.path.exists(os.path.join(data_dir, "passwd"))
):
with open(os.path.join(data_dir, "passwd"), 'w'): pass
parser = argparse.ArgumentParser()
parser.add_argument(
"--listen", type=str, default=None, help="start serving on address"

View file

@ -255,7 +255,7 @@ class MQTTServer:
"auth": {
"allow-anonymous": False,
"password-file": os.path.join(
os.path.dirname(os.path.realpath(__file__)), "passwd"
os.path.join(bumper.data_dir, "passwd")
),
"plugins": ["bumper"], # No plugins == no auth
},