35 Commits

Author SHA1 Message Date
HgO
2bea13b75e fix caddyfile 2021-03-28 23:04:35 +02:00
HgO
f052123d06 validate caddyfile 2021-03-28 10:54:32 +02:00
HgO
66b27f9087 replace nginx with caddy2 2021-03-28 10:48:06 +02:00
HgO
7bb919e184 remove umurmur support 2021-03-26 23:55:52 +01:00
HgO
1ef7fbb1b5 move templates into subdirs 2021-03-26 23:48:36 +01:00
HgO
ea80f2e2f5 rename variables 2021-03-26 18:06:25 +01:00
HgO
698f1ee1e3 custom nginx log location 2021-03-26 18:01:16 +01:00
HgO
b8e3d60767 fix config self-signed 2020-12-30 14:42:07 +01:00
HgO
b0b5d8c24a simplify acme config 2020-12-30 14:27:29 +01:00
HgO
3365215ceb fix self-signed certificates 2020-12-27 18:18:17 +01:00
HgO
7f7079db9e fix nginx acme challenge location 2020-12-26 14:40:54 +01:00
HgO
398d08cc12 remove old config 2020-12-26 11:31:39 +01:00
HgO
843c94ef96 parse channels config as a list 2020-12-26 11:10:59 +01:00
HgO
0eb99184b0 increase width of yaml config 2020-12-26 11:04:38 +01:00
HgO
bc0cb0139f murmur: multiline welcome text and channels' config as a variable 2020-12-26 10:48:14 +01:00
HgO
26fa2cb9ad disable murmur, umurmur, mumble-web and acme install by default 2020-12-26 10:30:22 +01:00
HgO
c5e6f88adc allow multiple nginx domains 2020-12-26 01:48:42 +01:00
HgO
de1948ebc7 simplify mumble domains 2020-12-26 01:33:14 +01:00
HgO
55f1735deb adapt keys path 2020-12-25 20:48:36 +01:00
HgO
6ddabfda41 define acme_config variable 2020-12-25 19:52:24 +01:00
HgO
00c6bfd41a Merge pull request 'Allow to install murmur server' (#2) from 1-install-murmur-server into master
Reviewed-on: #2
2020-12-06 19:43:29 +01:00
HgO
0f070764aa fix umurmur deployment and remove ispublic flag 2020-12-06 19:37:02 +01:00
HgO
6914b83d96 manage murmur channels; install mumble-web's self-signed cert; add molecule default scenario 2020-12-06 14:10:29 +01:00
HgO
31d3221d05 print channels for each server 2020-06-14 20:02:32 +02:00
HgO
816157a9d7 fix conflicting parameter 2020-06-14 20:01:07 +02:00
HgO
d47ce40487 fix when condition for Murmur slice compilation 2020-06-14 19:59:38 +02:00
HgO
2c6ed18182 fix syntax error 2020-06-14 19:58:32 +02:00
HgO
8c3a74266a fix syntax error 2020-06-14 19:57:31 +02:00
HgO
7d976f56cf create helper script to manage Murmur 2020-06-14 19:56:23 +02:00
HgO
40dc40385d fix failure when changing superuser password 2020-06-14 16:33:50 +02:00
HgO
98fee2ebac setup murmur superuser password 2020-06-14 16:20:28 +02:00
HgO
5f25887e6a add ssl-cert group for mumble-server user 2020-06-14 14:21:50 +02:00
HgO
8ae266b3c5 fix undefined var 2020-06-14 14:07:46 +02:00
HgO
df227041f3 fix undefined var 2020-06-14 14:07:05 +02:00
HgO
656c3a1cb1 allow to install murmur server 2020-06-14 14:01:16 +02:00
34 changed files with 1560 additions and 272 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
.venv
.vscode
.gitignore

View File

@@ -1,26 +1,130 @@
umurmur_user_password: "" mumble_domain: "{{ inventory_hostname }}.local"
umurmur_channel_links:
- source: "{{ umurmur_default_channel }}"
destinations: >-
{{ umurmur_channels
| selectattr('parent', 'defined')
| selectattr('parent', '==', umurmur_default_channel)
| map(attribute='name')
| list
}}
umurmur_ssl_group: "{{ acme_ssl_group }}"
umurmur_certificate: "{{ acme_certs_dir }}/{{ umurmur_domain }}.d/fullchain.pem"
umurmur_private_key: "{{ acme_keys_dir }}/{{ umurmur_domain }}.pem"
umurmur_version: master
umurmur_ispublic: yes
umurmur_port: "64738"
acme_enabled: no
acme_domains:
- name: "{{ murmur_domains | first }}"
alt_domains: "{{ murmur_domains[1:] }}"
hooks:
- systemctl restart mumble-server
acme_directory_url: https://acme-v02.api.letsencrypt.org/directory
mumble_web_enabled: no
mumble_web_domains:
- "{{ mumble_domain }}"
mumble_web_owner: mumble-web mumble_web_owner: mumble-web
mumble_web_group: "{{ mumble_web_owner }}" mumble_web_group: "{{ mumble_web_owner }}"
mumble_web_certificate: "{{ acme_certs_dir }}/{{ mumble_web_domain }}.d/fullchain.pem" mumble_web_home_dir: /var/www/mumble-web
mumble_web_trusted_certificate: "{{ acme_certs_dir }}/{{ mumble_web_domain }}.d/chain.pem" mumble_web_code_dir: "{{ mumble_web_home_dir }}/code"
mumble_web_private_key: "{{ acme_keys_dir }}/{{ mumble_web_domain }}.pem" mumble_web_dist_dir: "{{ mumble_web_code_dir }}/dist"
mumble_web_dhparam: "/etc/nginx/ssl/dhparam.pem"
mumble_web_www_dir: /var/www/mumble-web
mumble_web_version: master mumble_web_version: master
mumble_web_websockify_port: "64737" mumble_web_websockify_port: "64737"
mumble_web_caddy_enabled: yes
caddy_config_dir: /etc/caddy/conf.d
caddy_log_dir: /var/log/caddy
caddy_owner: caddy
caddy_group: caddy
murmur_enabled: no
murmur_domains:
- "{{ mumble_domain }}"
murmur_superuser_password: supersecret
murmur_database:
path: "/var/lib/mumble-server/mumble-server.sqlite"
# driver: "QMYSQL"
# username: "mumble"
# password: "password"
# host: "localhost"
# port: 3306
# prefix: "murmur_"
murmur_ice_host: "127.0.0.1"
murmur_ice_port: 6502
# Give read permission on ICE connection. Empty secret will deny read permission to anybody.
murmur_ice_secret_read: "{{ lookup('password', '/tmp/murmur-ice-read.secret length=50') }}"
# Give write permission on ICE connection. Empty secret will deny write permission to anybody.
murmur_ice_secret_write: "{{ lookup('password', '/tmp/murmur-ice-write.secret length=50') }}"
murmur_autoban_attempts: 10
murmur_autoban_timeframe: 120
murmur_autoban_time: 300
murmur_log_file: "/var/log/mumble-server/mumble-server.log"
murmur_pid_file: "/var/run/mumble-server/mumble-server.pid"
murmur_welcome_text: "Welcome on the {{ inventory_hostname }} Mumble server!"
# Leave blank to let Murmur bind to all available addresses
murmur_host: ""
murmur_port: 64738
# Password to join the server
murmur_server_password: ""
murmur_max_bandwidth: 72000
murmur_max_users: 100
murmur_opus_threshold: 100
murmur_channel_nesting_limit: 10
murmur_channel_count_limit: 1000
# Regex to validate channel or usernames
# murmur_channel_name_regex: ""
# murmur_username_regex: ""
murmur_text_message_max_length: 5000
murmur_image_message_max_length: 131072
murmur_allow_html: yes
# Set to 0 to keep logs forever, or -1 to disable logging to the DB.
murmur_log_days: -1
# Name for root channel and entry in mumble main server list
murmur_register_enabled: no
murmur_register:
name: "MyMumbleServerRegisterName"
password: "password"
url: "https://mymumbleserverurl.org"
hostname: "mymumblehostname.domain.org"
# Enable Bonjour for dev purpose
murmur_bonjour_enabled: no
murmur_certificate: "{{ acme_certs_dir }}/{{ murmur_domains | first }}.d/fullchain.pem"
murmur_trusted_certificate: "{{ acme_certs_dir }}/{{ murmur_domains | first }}.d/chain.pem"
murmur_private_key: "{{ acme_keys_dir }}/{{ murmur_domains | first }}.key"
murmur_dhparam: "@ffdhe4096"
murmur_owner: "mumble-server"
murmur_group: "{{ murmur_owner }}"
murmur_client_certificate_required: no
murmur_send_server_version: yes
murmur_ice_warn_unknown_properties: yes
murmur_ice_message_size_max: 65536
murmur_channels:
- name: Root
description: Root channel. No entry.
groups:
admin:
inherit: yes
inheritable: yes
permissions:
- group: all
deny:
- Enter
recursive: no
enabled: yes
- group: all
allow:
- RegisterSelf
- MakeTempChannel
- group: admin
allow:
- MuteDeafen
- Move
- Kick
- Ban
- Register
- name: Welcome
parent: Root
description: Welcome channel
position: 0
isdefault: yes
- name: Silent
parent: Root
description: Silent channel
position: 1
permissions:
- group: all
deny:
- Speak
- MakeTempChannel
- group: admin
allow:
- MakeTempChannel

View File

@@ -0,0 +1,346 @@
#!/usr/bin/python3
import argparse
import logging
import os
import sys
from typing import List, Dict
import Ice
import yaml
import Murmur
CONFIG_SEARCH_PATH = [".", "/etc"]
CONFIG_DEFAULT_NAME = "mice.yml"
ICE_DEFAULT_HOST = "127.0.0.1"
ICE_DEFAULT_PORT = 6502
ICE_DEFAULT_TIMEOUT = 1000
class Mice:
def __init__(self, host: str = ICE_DEFAULT_HOST,
port: int = ICE_DEFAULT_PORT, secret: str = None,
timeout: int = ICE_DEFAULT_TIMEOUT):
logging.debug("Initializing ICE connection")
properties = Ice.createProperties()
properties.setProperty("Ice.ImplicitContext", "Shared")
init_data = Ice.InitializationData()
init_data.properties = properties
self._communicator = Ice.initialize(init_data)
if secret:
logging.debug("Providing ICE secret")
self._communicator.getImplicitContext().put("secret", secret)
logging.debug("Creating meta proxy")
proxy_str = f"Meta: tcp -h {host} -p {port} -t {timeout}"
proxy = self._communicator.stringToProxy(proxy_str)
self.meta = Murmur.MetaPrx.checkedCast(proxy)
if not self.meta:
self._communicator.destroy()
raise RuntimeError(f"Invalid Proxy: {proxy_str}")
try:
logging.debug("Retrieving the list of Mumble servers")
servers = self.meta.getAllServers()
except Murmur.InvalidSecretException:
self._communicator.destroy()
raise RuntimeError(f"Failed to connect to {host} "
f"on port {port}: Invalid secret.") from None
self.servers = [MurmurServer(server) for server in servers]
if len(self.servers) == 0:
self._communicator.destroy()
raise RuntimeError("No Mumble server found")
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self._communicator.destroy()
class ChannelGroup:
def __init__(self, name: str, inherit: bool = True,
inheritable: bool = True):
self.name = name
self.inherit = inherit
self.inheritable = inheritable
def get_state(self) -> Murmur.Group:
return Murmur.Group(
name=self.name,
inherit=self.inherit,
inheritable=self.inheritable
)
@staticmethod
def from_dict(group_dict: Dict[str, object]) -> "ChannelGroup":
return ChannelGroup(
name=group_dict["name"],
inherit=group_dict.get("inherit", True),
inheritable=group_dict.get("inheritable", True)
)
class ChannelPermission:
def __init__(self, group: str = "all", userid: int = -1,
allow: int = 0, deny: int = 0,
recursive: bool = True, enabled: bool = True):
self.group = group
self.userid = userid
self.allow = allow
self.deny = deny
self.recursive = recursive
self.enabled = enabled
def get_acl(self) -> Murmur.ACL:
return Murmur.ACL(
applyHere=self.enabled,
applySubs=self.recursive,
userid=self.userid,
group=self.group,
allow=self.allow,
deny=self.deny)
@staticmethod
def from_dict(permission_dict: Dict[str, object]) -> "ChannelPermission":
allow = ChannelPermission._parse_rules(
permission_dict.get("allow", []))
deny = ChannelPermission._parse_rules(
permission_dict.get("deny", []))
return ChannelPermission(
group=permission_dict["group"],
allow=allow,
deny=deny,
recursive=permission_dict.get("recursive", True),
enabled=permission_dict.get("enabled", True))
@staticmethod
def _parse_rule(rule: str) -> int:
return getattr(Murmur, "Permission" + rule)
@staticmethod
def _parse_rules(rules: List[str]) -> int:
result = 0
for rule in rules:
result |= ChannelPermission._parse_rule(rule)
return result
class Channel:
def __init__(self, name: str, description: str = "", position: int = 0,
groups: List[ChannelGroup] = [],
permissions: List[ChannelPermission] = [],
inherit: bool = True, isdefault: bool = False,
parent: "Channel" = None):
self.id = -1
self.name = name
self.description = description
self.position = position
self.groups = groups
self.permissions = permissions
self.inherit = inherit
self.isdefault = isdefault
self.parent = parent
self.children = []
def __str__(self) -> str:
return self.name
def get_state(self) -> Murmur.Channel:
if self.parent is None:
parent_id = 0
else:
parent_id = self.parent.id
return Murmur.Channel(
id=self.id,
name=self.name,
description=self.description,
position=self.position,
parent=parent_id)
def add(self, channel: "Channel") -> None:
self.children.append(channel)
channel.parent = self
@staticmethod
def from_dict(channel_dict: Dict[str, object]) -> "Channel":
if "parent" in channel_dict:
parent = Channel(channel_dict["parent"])
else:
parent = None
groups = []
for group_name, group_dict in channel_dict.get("groups", {}).items():
group_dict["name"] = group_name
group = ChannelGroup.from_dict(group_dict)
groups.append(group)
permissions = []
for permission_dict in channel_dict.get("permissions", []):
permission = ChannelPermission.from_dict(permission_dict)
permissions.append(permission)
return Channel(
name=channel_dict["name"],
description=channel_dict.get("description", ''),
position=channel_dict.get("position", 0),
groups=groups,
permissions=permissions,
inherit=channel_dict.get("inherit", True),
isdefault=channel_dict.get("isdefault", False),
parent=parent)
class MurmurServer:
def __init__(self, server: Murmur.Server):
self._server = server
def clear_acls(self, channel_id=0):
_, groups, inherit = self._server.getACL(0)
self._server.setACL(channel_id, [], groups, inherit)
def clear_channels(self) -> None:
for channel_state in self._server.getChannels().values():
if channel_state.id != 0 and channel_state.parent == 0:
self._server.removeChannel(channel_state.id)
self.clear_acls()
def set_channel_acls(self, channel: Channel) -> None:
acls = []
for permission in channel.permissions:
acl = permission.get_acl()
acls.append(acl)
_, current_groups, _ = self._server.getACL(channel.id)
current_group_names = {group.name: group for group in current_groups}
groups = []
for group in channel.groups:
group_state = group.get_state()
if group.name in current_group_names:
current_group_state = current_group_names[group.name]
group_state.add = current_group_state.add
group_state.remove = current_group_state.remove
del current_group_names[group.name]
groups.append(group_state)
groups.extend(current_group_names.values())
self._server.setACL(channel.id, acls, groups, channel.inherit)
def create_channels(self, channel: Channel) -> None:
if channel.parent is None:
channel.id = 0
else:
channel.id = self._server.addChannel(
channel.name,
channel.parent.id)
self._server.setChannelState(channel.get_state())
self.set_channel_acls(channel)
if channel.isdefault:
self._server.setConf("defaultchannel", str(channel.id))
for child in channel.children:
self.create_channels(child)
class Config:
def __init__(self, filename: str = None):
self.filename = filename
self._data = {}
self.load(filename)
def load(self, filename: str = None):
if not filename:
for config_path in CONFIG_SEARCH_PATH:
filename = os.path.join(config_path, CONFIG_DEFAULT_NAME)
if os.path.exists(filename) and os.path.isfile(filename):
break
with open(filename, 'r') as ifd:
self._data = yaml.safe_load(ifd)
def parse_channels(self) -> Channel:
channels = []
for channel_dict in self._data:
channel = Channel.from_dict(channel_dict)
channels.append(channel)
channel_names = {channel.name: channel for channel in channels}
for channel in channels:
if channel.parent is None:
continue
if channel.parent.name not in channel_names:
continue
channel_names[channel.parent.name].add(channel)
root_channels = [channel for channel in channels
if channel.parent is None]
if len(root_channels) == 0:
raise RuntimeError("No root channel found.")
if len(root_channels) > 1:
root_names = root_channels.join(', ')
raise RuntimeError(f"Multiple root channels found: {root_names}")
default_channels = [channel for channel in channels
if channel.isdefault]
if len(default_channels) > 1:
default_names = default_channels.join(', ')
raise RuntimeError("Multiple default channels found: "
f"{default_names}")
return root_channels[0]
def main():
parser = argparse.ArgumentParser(
description="Manage Mumble server through ICE connection",
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument("--host", "-H", default=ICE_DEFAULT_HOST,
help="ICE host or ip")
parser.add_argument("--port", "-p", default=ICE_DEFAULT_PORT,
help="ICE port number")
parser.add_argument("--timeout", "-t", default=ICE_DEFAULT_TIMEOUT,
help="Connection timeout in milliseconds")
parser.add_argument("--secret", "-s",
default=os.environ.get("MICE_SECRET"),
help="ICE write secret")
parser.add_argument("--server-id", "-i", type=int, default=0,
help="Server ID to manage")
parser.add_argument("--config", "-c",
help="Path to the config file.")
args = parser.parse_args()
config = Config(args.config)
root_channel = config.parse_channels()
server_id = args.server_id
try:
with Mice(args.host, args.port, args.secret, args.timeout) as mice:
if not 0 <= server_id < len(mice.servers):
raise RuntimeError(f"Cannot find server with ID {server_id}")
server = mice.servers[server_id]
server.clear_channels()
server.create_channels(root_channel)
except RuntimeError as e:
logging.error(e, exc_info=e)
return 1
if __name__ == "__main__":
sys.exit(main())

View File

@@ -3,14 +3,12 @@
daemon_reload: yes daemon_reload: yes
register: systemd_reloaded register: systemd_reloaded
# In order to take into account rooms config changes, umurmur must be restarted. - name: restart murmur
# A simple reload won't work for rooms positionning, for instance.
- name: restart umurmur
service: service:
name: umurmur name: mumble-server
state: restarted state: restarted
when: when:
- not (umurmur_started.changed | default(false)) - not (murmur_started.changed | default(false))
- name: reload mumble-web - name: reload mumble-web
service: service:
@@ -19,5 +17,20 @@
when: when:
- not (mumble_web_started.changed | default(false)) - not (mumble_web_started.changed | default(false))
- name: reload nginx - name: reload caddy
include_tasks: ../handlers/nginx.yml service:
name: caddy
state: reloaded
- name: change murmur superuser password
command: murmurd -ini /etc/mumble-server.ini -supw "{{ murmur_superuser_password }}"
# See https://github.com/mumble-voip/mumble/issues/3911
# Should be fixed in 1.3.1
failed_when: no
- name: create murmur channels
command:
cmd: ./mice.py -c {{ murmur_ice_config_path | quote }}
chdir: "{{ murmur_ice_script_dir }}"
environment:
MICE_SECRET: "{{ murmur_ice_secret_write }}"

View File

@@ -1,7 +0,0 @@
- name: Validate Nginx config
command: nginx -t
- name: Reload Nginx server
service:
name: nginx
state: reloaded

View File

@@ -1,16 +1,16 @@
dependencies: dependencies:
- role: ppbe.acme - role: ppbe.acme
tags: [acme] tags: [never]
- role: geerlingguy.nodejs - role: geerlingguy.nodejs
vars: vars:
nodejs_install_npm_user: root nodejs_install_npm_user: root
tags: [nodejs,mumble_web] tags: [never]
galaxy_info: galaxy_info:
role_name: mumble role_name: mumble
author: HgO author: HgO
description: Ansible role to install umurmur, the minimalistic Mumble server, and mumble-web client. description: Ansible role to install murmur (mumble server) and mumble-web client.
company: PPBe company: PPBe
# If the issue tracker for your role is not on github, uncomment the # If the issue tracker for your role is not on github, uncomment the
@@ -50,7 +50,7 @@ galaxy_info:
versions: versions:
- all - all
galaxy_tags: [mumble,voip,umurmur] galaxy_tags: [mumble,voip,murmur,mumble-web]
# List tags for your role here, one per line. A tag is a keyword that describes # List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to # and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list. # remove the '[]' above, if you add tags to this list.

View File

@@ -0,0 +1,23 @@
*********************************
Vagrant driver installation guide
*********************************
Requirements
============
* Vagrant
* Virtualbox, Parallels, VMware Fusion, VMware Workstation or VMware Desktop
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule_vagrant'

View File

@@ -0,0 +1,12 @@
---
- name: Converge
hosts: all
become: yes
vars:
mumble_web_enabled: yes
murmur_enabled: yes
acme_enabled: no
roles:
- ansible-role-mumble

View File

@@ -0,0 +1,61 @@
---
.hardware: &hardware
memory: 1024
cpu: 2
dependency:
name: galaxy
driver:
name: vagrant
provider:
name: virtualbox
platforms:
- name: buster-mumble-molecule
box: debian/buster64
<<: *hardware
interfaces:
# Mumble web client
- network_name: forwarded_port
guest: 80
host: 8080
- network_name: forwarded_port
guest: 443
host: 8443
# Murmur server
- network_name: forwarded_port
guest: 64738
host: 14738
protocol: udp
- network_name: forwarded_port
guest: 64738
host: 14738
protocol: tcp
- name: focal-mumble-molecule
box: ubuntu/focal64
<<: *hardware
interfaces:
# Mumble web client
- network_name: forwarded_port
guest: 80
host: 9080
- network_name: forwarded_port
guest: 443
host: 9443
# Murmur server
- network_name: forwarded_port
guest: 64738
host: 24738
protocol: udp
- network_name: forwarded_port
guest: 64738
host: 24738
protocol: tcp
provisioner:
name: ansible
config_options:
defaults:
interpreter_python: /usr/bin/python3
ssh_connection:
pipelining: true
verifier:
name: ansible

View File

@@ -0,0 +1,55 @@
- name: Prepare
hosts: all
become: yes
tasks:
- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 3600
- name: Install GPG package
package:
name: gpg
state: present
- name: Add Caddy2 APT key
apt_key:
url: https://dl.cloudsmith.io/public/caddy/stable/gpg.155B6D79CA56EA34.key
state: present
- name: Add Caddy2 APT repository
apt_repository:
repo: deb https://dl.cloudsmith.io/public/caddy/stable/deb/{{ ansible_distribution | lower }} any-version main
filename: caddy-stable
state: present
- name: Install caddy package
package:
name: caddy
state: present
- name: Create Caddy2 config directory
file:
path: "/etc/caddy/conf.d"
state: directory
owner: root
group: root
mode: "0755"
- name: Create Caddy2 log directory
file:
path: "/var/log/caddy"
state: directory
owner: caddy
group: caddy
mode: "0755"
- name: Copy Caddy2 config file
copy:
content:
import conf.d/*.conf
dest: /etc/caddy/Caddyfile
owner: root
group: root
mode: "0644"

View File

@@ -0,0 +1,23 @@
*********************************
Vagrant driver installation guide
*********************************
Requirements
============
* Vagrant
* Virtualbox, Parallels, VMware Fusion, VMware Workstation or VMware Desktop
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule_vagrant'

View File

@@ -0,0 +1,12 @@
---
- name: Converge
hosts: all
become: yes
vars:
mumble_web_enabled: yes
murmur_enabled: yes
acme_enabled: no
roles:
- ansible-role-mumble

View File

@@ -0,0 +1,43 @@
---
.hardware: &hardware
memory: 1024
cpu: 2
dependency:
name: galaxy
driver:
name: vagrant
provider:
name: virtualbox
platforms:
- name: buster-mumble-molecule
box: debian/buster64
<<: *hardware
interfaces:
# Mumble web client
- network_name: forwarded_port
guest: 80
host: 8080
- network_name: forwarded_port
guest: 443
host: 8443
- name: focal-mumble-molecule
box: ubuntu/focal64
<<: *hardware
interfaces:
# Mumble web client
- network_name: forwarded_port
guest: 80
host: 9080
- network_name: forwarded_port
guest: 443
host: 9443
provisioner:
name: ansible
config_options:
defaults:
interpreter_python: /usr/bin/python3
ssh_connection:
pipelining: true
verifier:
name: ansible

View File

@@ -0,0 +1,55 @@
- name: Prepare
hosts: all
become: yes
tasks:
- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 3600
- name: Install GPG package
package:
name: gpg
state: present
- name: Add Caddy2 APT key
apt_key:
url: https://dl.cloudsmith.io/public/caddy/stable/gpg.155B6D79CA56EA34.key
state: present
- name: Add Caddy2 APT repository
apt_repository:
repo: deb https://dl.cloudsmith.io/public/caddy/stable/deb/{{ ansible_distribution | lower }} any-version main
filename: caddy-stable
state: present
- name: Install caddy package
package:
name: caddy
state: present
- name: Create Caddy2 config directory
file:
path: "/etc/caddy/conf.d"
state: directory
owner: root
group: root
mode: "0755"
- name: Create Caddy2 log directory
file:
path: "/var/log/caddy"
state: directory
owner: caddy
group: caddy
mode: "0755"
- name: Copy Caddy2 config file
copy:
content:
import conf.d/*.conf
dest: /etc/caddy/Caddyfile
owner: root
group: root
mode: "0644"

View File

@@ -0,0 +1,23 @@
*********************************
Vagrant driver installation guide
*********************************
Requirements
============
* Vagrant
* Virtualbox, Parallels, VMware Fusion, VMware Workstation or VMware Desktop
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule_vagrant'

View File

@@ -0,0 +1,12 @@
---
- name: Converge
hosts: all
become: yes
vars:
mumble_web_enabled: no
murmur_enabled: yes
acme_enabled: no
roles:
- ansible-role-mumble

View File

@@ -0,0 +1,47 @@
---
.hardware: &hardware
memory: 1024
cpu: 2
dependency:
name: galaxy
driver:
name: vagrant
provider:
name: virtualbox
platforms:
- name: buster-mumble-molecule
box: debian/buster64
<<: *hardware
interfaces:
# Murmur server
- network_name: forwarded_port
guest: 64738
host: 14738
protocol: udp
- network_name: forwarded_port
guest: 64738
host: 14738
protocol: tcp
- name: focal-mumble-molecule
box: ubuntu/focal64
<<: *hardware
interfaces:
# Murmur server
- network_name: forwarded_port
guest: 64738
host: 24738
protocol: udp
- network_name: forwarded_port
guest: 64738
host: 24738
protocol: tcp
provisioner:
name: ansible
config_options:
defaults:
interpreter_python: /usr/bin/python3
ssh_connection:
pipelining: true
verifier:
name: ansible

View File

@@ -0,0 +1,55 @@
- name: Prepare
hosts: all
become: yes
tasks:
- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 3600
- name: Install GPG package
package:
name: gpg
state: present
- name: Add Caddy2 APT key
apt_key:
url: https://dl.cloudsmith.io/public/caddy/stable/gpg.155B6D79CA56EA34.key
state: present
- name: Add Caddy2 APT repository
apt_repository:
repo: deb https://dl.cloudsmith.io/public/caddy/stable/deb/{{ ansible_distribution | lower }} any-version main
filename: caddy-stable
state: present
- name: Install caddy package
package:
name: caddy
state: present
- name: Create Caddy2 config directory
file:
path: "/etc/caddy/conf.d"
state: directory
owner: root
group: root
mode: "0755"
- name: Create Caddy2 log directory
file:
path: "/var/log/caddy"
state: directory
owner: caddy
group: caddy
mode: "0755"
- name: Copy Caddy2 config file
copy:
content:
import conf.d/*.conf
dest: /etc/caddy/Caddyfile
owner: root
group: root
mode: "0644"

13
tasks/caddy.yml Normal file
View File

@@ -0,0 +1,13 @@
- name: Copy Caddy2 config file
template:
src: mumble-web/Caddyfile.j2
dest: "{{ caddy_config_dir }}/mumble.conf"
owner: "{{ caddy_owner }}"
group: "{{ caddy_group }}"
mode: "0640"
validate: caddy validate -adapter caddyfile -config %s
notify: reload caddy
tags: caddy_config
- name: Trigger Caddy2 handlers
meta: flush_handlers

View File

@@ -1,11 +1,29 @@
- name: Install and configure umurmur server - name: Install ACME certificates
import_tasks: umurmur.yml import_role:
tags: umurmur name: ppbe.acme
when: acme_enabled and murmur_enabled
tags:
- certificate
- acme
- name: Install and configure mumble web client - name: Install Self-Signed certificates
import_tasks: self_signed.yml
when: not acme_enabled and murmur_enabled
tags:
- certificate
- self_signed
- name: Deploy Murmur server
import_tasks: murmur.yml
when: murmur_enabled
tags: murmur
- name: Deploy mumble web client
import_tasks: mumble_web.yml import_tasks: mumble_web.yml
when: mumble_web_enabled
tags: mumble_web tags: mumble_web
- name: Configure Nginx for mumble web client - name: Configure Caddy2 for mumble web client
import_tasks: nginx.yml import_tasks: caddy.yml
tags: nginx when: mumble_web_enabled and mumble_web_caddy_enabled
tags: caddy

View File

@@ -1,5 +1,16 @@
- name: Install NodeJS
import_role:
name: geerlingguy.nodejs
tags: nodejs
- name: Install git package
package:
name: git
state: present
tags: mumble_web_install
- name: Install websockify - name: Install websockify
apt: package:
name: websockify name: websockify
state: present state: present
notify: reload mumble-web notify: reload mumble-web
@@ -8,7 +19,7 @@
- name: Create mumble-web system user - name: Create mumble-web system user
user: user:
name: "{{ mumble_web_owner }}" name: "{{ mumble_web_owner }}"
home: "{{ mumble_web_www_dir }}" home: "{{ mumble_web_home_dir }}"
groups: groups:
- www-data - www-data
shell: /sbin/nologin shell: /sbin/nologin
@@ -16,11 +27,11 @@
state: present state: present
system: yes system: yes
append: yes append: yes
create_home: no tags: mumble_web_install
- name: Change mumble-web home directory's permissions - name: Change mumble-web home directory's permissions
file: file:
path: "{{ mumble_web_www_dir }}" path: "{{ mumble_web_home_dir }}"
owner: "{{ mumble_web_owner }}" owner: "{{ mumble_web_owner }}"
group: "{{ mumble_web_group }}" group: "{{ mumble_web_group }}"
mode: "755" mode: "755"
@@ -30,33 +41,45 @@
- name: Clone mumble-web git repository - name: Clone mumble-web git repository
git: git:
repo: https://github.com/Johni0702/mumble-web.git repo: https://github.com/Johni0702/mumble-web.git
dest: "{{ mumble_web_www_dir }}" dest: "{{ mumble_web_code_dir }}"
version: "{{ mumble_web_version }}" version: "{{ mumble_web_version }}"
register: mumble_web_cloned register: mumble_web_cloned
become_user: "{{ mumble_web_owner }}" become_user: "{{ mumble_web_owner }}"
tags: mumble_web_install tags: mumble_web_install
- name: Check if mumble-web dist directory exists
stat:
path: "{{ mumble_web_dist_dir }}"
register: _mumble_web_dist
tags:
- mumble_web_install
- mumble_web_build
- name: Build mumble-web from sources - name: Build mumble-web from sources
command: npm clean-install command: npm clean-install {{ mumble_web_dist_dir | quote }}
args: args:
chdir: "{{ mumble_web_www_dir }}" chdir: "{{ mumble_web_code_dir }}"
register: _mumble_web_installed register: _mumble_web_installed
become_user: "{{ mumble_web_owner }}" become_user: "{{ mumble_web_owner }}"
when: mumble_web_cloned is changed when: mumble_web_cloned is changed or not _mumble_web_dist.stat.exists
tags: [mumble_web_install,mumble_web_build] tags:
- mumble_web_install
- mumble_web_build
- name: Copy mumble-web config file - name: Copy mumble-web config file
template: template:
src: mumble-web.js.j2 src: mumble-web/config.js.j2
dest: "{{ mumble_web_www_dir }}/dist/config.local.js" dest: "{{ mumble_web_dist_dir }}/config.local.js"
owner: "{{ mumble_web_owner }}" owner: "{{ mumble_web_owner }}"
group: "{{ mumble_web_group }}" group: "{{ mumble_web_group }}"
mode: "644" mode: "644"
tags: [mumble_web_install,mumble_web_config] tags:
- mumble_web_install
- mumble_web_config
- name: Copy mumble-web systemd service - name: Copy mumble-web systemd service
template: template:
src: mumble-web.service.j2 src: mumble-web/mumble-web.service.j2
dest: /etc/systemd/system/mumble-web.service dest: /etc/systemd/system/mumble-web.service
owner: root owner: root
group: root group: root
@@ -64,7 +87,9 @@
notify: notify:
- reload systemd - reload systemd
- reload mumble-web - reload mumble-web
tags: [mumble_web_install,mumble_web_config] tags:
- mumble_web_install
- mumble_web_config
- name: Start mumble-web service - name: Start mumble-web service
service: service:

116
tasks/murmur.yml Normal file
View File

@@ -0,0 +1,116 @@
- name: Install mumble-server package
package:
name: mumble-server
state: present
register: murmur_installed
tags: murmur_install
- name: Install ICE dependencies for Python
package:
name:
- python3-zeroc-ice
- python3-yaml
- zeroc-ice-compilers
state: present
tags: murmur_install
- name: Append ssl-cert group to {{ murmur_owner }} user
user:
name: "{{ murmur_owner }}"
state: present
groups:
- "{{ acme_ssl_group }}"
append: yes
system: yes
notify: restart murmur
tags: murmur_install
- name: Copy Murmur config file
template:
src: murmur/mumble-server.ini.j2
dest: /etc/mumble-server.ini
owner: root
group: "{{ murmur_group }}"
mode: "640"
notify: restart murmur
tags:
- murmur_install
- murmur_config
- name: Start mumble-server service
service:
name: mumble-server
enabled: yes
state: started
tags: murmur_install
- name: Write superuser password to a file
copy:
content: "{{ murmur_superuser_password }}"
dest: /etc/mumble-server.secret
owner: root
group: root
mode: "600"
when: murmur_superuser_password is defined
notify: change murmur superuser password
tags:
- murmur_install
- murmur_config
- name: Trigger Murmur handlers
meta: flush_handlers
- name: Create mumble-ice directory
file:
path: "{{ murmur_ice_script_dir }}"
state: directory
owner: root
group: root
mode: "755"
tags:
- murmur_install
- murmur_ice
- name: Copy mice Python script
copy:
src: murmur/scripts/mice.py
dest: "{{ murmur_ice_script_dir }}/mice.py"
owner: root
group: root
mode: "755"
notify: create murmur channels
register: _murmur_mice_script_copied
tags:
- murmur_install
- murmur_ice
- name: Compile Murmur.ice slice file
command: |-
slice2py --checksum \
-I/usr/local/share/Ice \
-I/usr/share/Ice/slice \
-I/usr/share/ice/slice \
/usr/share/slice/Murmur.ice
args:
chdir: "{{ murmur_ice_script_dir }}"
when: _murmur_mice_script_copied is changed
tags:
- murmur_install
- murmur_ice
- name: Copy mice config
copy:
# See https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#formatting-data-yaml-and-json
content: "{{ murmur_channels | to_nice_yaml(indent=2, width=10000) }}"
dest: "{{ murmur_ice_config_path }}"
owner: root
group: root
mode: "644"
notify: create murmur channels
tags:
- murmur_install
- murmur_config
- murmur_ice
- name: Trigger Mice handlers
meta: flush_handlers

View File

@@ -1,18 +0,0 @@
- name: Copy Nginx config file
template:
src: nginx.conf.j2
dest: /etc/nginx/sites-available/mumble.conf
owner: root
group: www-data
mode: "755"
notify: reload nginx
- name: Enable Nginx config file
file:
src: /etc/nginx/sites-available/mumble.conf
path: /etc/nginx/sites-enabled/mumble.conf
state: link
notify: reload nginx
- name: Trigger Nginx handlers
meta: flush_handlers

38
tasks/self_signed.yml Normal file
View File

@@ -0,0 +1,38 @@
- name: Install SSL dependencies
package:
name:
- ssl-cert
- python3-openssl
state: present
tags: selfsigned_install
- name: Create SSL config directories
file:
path: "{{ config_dir }}"
state: directory
owner: root
group: root
mode: "755"
loop:
- "{{ acme_config_dir }}"
- "{{ acme_certs_dir }}"
- "{{ acme_csr_dir }}"
loop_control:
loop_var: config_dir
tags: selfsigned_install
- name: Create ACME private keys directory
file:
path: "{{ acme_keys_dir }}"
state: directory
owner: root
group: "{{ acme_ssl_group }}"
mode: "750"
tags: acme_install
- name: Install Self-Signed certificate for each domain
include_tasks: self_signed_domain.yml
loop: "{{ acme_domains }}"
loop_control:
loop_var: domain
label: "{{ domain.name }}"

View File

@@ -0,0 +1,42 @@
- name: Create {{ domain.name }} certificates directory
file:
path: "{{ acme_certs_dir }}/{{ domain.name }}.d"
state: directory
owner: root
group: root
mode: "755"
tags: selfsigned_install
- name: Generate private key for {{ domain.name }} certificate
openssl_privatekey:
path: "{{ acme_keys_dir }}/{{ domain.name }}.key"
owner: root
group: "{{ acme_ssl_group }}"
mode: "640"
type: RSA
size: 4096
tags: selfsigned_config
- name: Generate CSR for {{ domain.name }} certificate
openssl_csr:
path: "{{ acme_csr_dir }}/{{ domain.name }}.csr"
owner: root
group: root
mode: "644"
privatekey_path: "{{ acme_keys_dir }}/{{ domain.name }}.key"
common_name: "{{ domain.name }}"
subject_alt_name: "{{ domain.alt_names | default([]) | map('regex_replace', '^', 'DNS:') | list }}"
tags: selfsigned_config
- name: Generate self-signed certificate
openssl_certificate:
path: "{{ acme_certs_dir }}/{{ domain.name }}.d/fullchain.pem"
csr_path: "{{ acme_csr_dir }}/{{ domain.name }}.csr"
privatekey_path: "{{ acme_keys_dir }}/{{ domain.name }}.key"
provider: selfsigned
state: present
owner: root
group: root
mode: "644"
tags: selfsigned_config

View File

@@ -1,91 +0,0 @@
- name: Install umurmur build dependencies
apt:
name: "{{ package }}"
loop:
- git
- build-essential
- cmake
- libconfig-dev
- libprotobuf-c-dev
- libmbedtls-dev
- ssl-cert
loop_control:
loop_var: package
- name: Clone umurmur git repository
git:
repo: https://github.com/umurmur/umurmur.git
dest: /opt/umurmur
version: "{{ umurmur_version }}"
- name: Change umurmur git repository's permissions
file:
path: /opt/umurmur
owner: root
group: root
mode: "775"
state: directory
- name: Create the build directory
file:
path: /opt/umurmur/build
owner: root
group: root
mode: "775"
state: directory
- name: Generate the Makefile with cmake
shell: cd /opt/umurmur/build && cmake .. -DSSL=mbedtls
changed_when: no
- name: Build umurmur from source
make:
chdir: /opt/umurmur/build
changed_when: _umurmur_built.stdout_lines | length > 1
register: _umurmur_built
- name: Install umurmur
make:
chdir: /opt/umurmur/build
target: install
changed_when: "'Installing' in _umurmur_installed.stdout"
register: _umurmur_installed
notify: restart umurmur
- name: Copy umurmur config file
template:
src: umurmur.conf.j2
dest: /usr/local/etc/umurmur.conf
owner: root
group: "{{ umurmur_ssl_group }}"
mode: "640"
validate: /usr/local/bin/umurmurd -t -c %s
notify: restart umurmur
tags: umurmur_config
- name: Copy umurmur systemd service
template:
src: umurmur.service.j2
dest: /etc/systemd/system/umurmur.service
owner: root
group: root
mode: "644"
notify:
- reload systemd
- restart umurmur
- name: Start umurmur service
service:
name: umurmur
enabled: yes
state: started
register: umurmur_started
- name: Trigger umurmur handlers
meta: flush_handlers
- name: Open umurmur port with UFW
ufw:
rule: allow
port: "{{ umurmur_port }}"
when: umurmur_ispublic | bool

View File

@@ -0,0 +1,14 @@
{{ ansible_managed | comment }}
{{ mumble_web_domains | join(', ') }} {
root * {{ mumble_web_dist_dir }}
file_server
{% if not acme_enabled %}
tls internal
{% endif %}
reverse_proxy /mumble* http://localhost:{{ mumble_web_websockify_port }}
log {
output file {{ caddy_log_dir }}/{{ mumble_web_domains | first }}.log
}
}

View File

@@ -13,11 +13,11 @@ let config = window.mumbleWebConfig // eslint-disable-line no-unused-vars
config.connectDialog.address = false config.connectDialog.address = false
config.connectDialog.port = false config.connectDialog.port = false
config.connectDialog.token = false config.connectDialog.token = false
config.connectDialog.password = {{ (umurmur_user_password != '') | lower }} config.connectDialog.password = {{ (murmur_server_password != '') | lower }}
// Default values for user settings // Default values for user settings
// You can see your current value by typing `localStorage.getItem('mumble.$setting')` in the web console. // You can see your current value by typing `localStorage.getItem('mumble.$setting')` in the web console.
config.settings.pttKey = 'shift' config.settings.pttKey = 'shift'
// Default values (can be changed by passing a query parameter of the same name) // Default values (can be changed by passing a query parameter of the same name)
config.defaults.address = "{{ mumble_web_domain }}/mumble" config.defaults.address = "{{ mumble_web_domains | first }}/mumble"

View File

@@ -1,7 +1,7 @@
[Unit] [Unit]
Description=Mumble web client using websockets Description=Mumble web client using websockets
After=network.target umurmur.service After=network.target murmur.service
Wants=umurmur.service Wants=murmur.service
[Service] [Service]
Type=simple Type=simple
@@ -9,7 +9,7 @@ User=nobody
Group=nogroup Group=nogroup
Restart=always Restart=always
RestartSec=3 RestartSec=3
ExecStart=/usr/bin/websockify --ssl-target {{ mumble_web_websockify_port }} localhost:{{ umurmur_port }} ExecStart=/usr/bin/websockify --ssl-target {{ mumble_web_websockify_port }} localhost:{{ murmur_port }}
ExecReload=/bin/kill -HUP $MAINPID ExecReload=/bin/kill -HUP $MAINPID
[Install] [Install]

View File

@@ -2,26 +2,29 @@
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name {{ mumble_web_domain }}; server_name {{ mumble_web_domains | join(' ') }};
location / { location / {
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
} }
{% if acme_challenge_dir is defined %} {% if acme_enabled %}
location ^~ /.well-known/acme-challenge/ { location ^~ /.well-known/acme-challenge/ {
allow all; allow all;
root {{ acme_challenge_dir }}; root {{ acme_root_dir }};
try_files $uri =404; try_files $uri =404;
} }
{% endif %} {% endif %}
access_log {{ nginx_log_dir }}/{{ mumble_web_domains | first }}-access.log;
error_log {{ nginx_log_dir }}/{{ mumble_web_domains | first }}-error.log;
} }
server { server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
server_name {{ mumble_web_domain }}; server_name {{ mumble_web_domains | join(' ') }};
ssl_certificate {{ mumble_web_certificate }}; ssl_certificate {{ mumble_web_certificate }};
ssl_certificate_key {{ mumble_web_private_key }}; ssl_certificate_key {{ mumble_web_private_key }};
@@ -30,8 +33,8 @@ server {
ssl_session_cache shared:AnsibleSSL:10m; # about 40000 sessions ssl_session_cache shared:AnsibleSSL:10m; # about 40000 sessions
ssl_session_tickets off; ssl_session_tickets off;
{% if mumble_web_dhparam is defined and mumble_web_dhparam != '' %} {% if nginx_dhparam %}
ssl_dhparam {{ mumble_web_dhparam }}; ssl_dhparam {{ nginx_dhparam }};
{% endif %} {% endif %}
ssl_protocols TLSv1.2 TLSv1.3; ssl_protocols TLSv1.2 TLSv1.3;
@@ -44,19 +47,24 @@ server {
ssl_stapling on; ssl_stapling on;
ssl_stapling_verify on; ssl_stapling_verify on;
{% if acme_enabled %}
# Verify chain of trust of OCSP response using Root CA and Intermediate certs # Verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate {{ mumble_web_trusted_certificate }}; ssl_trusted_certificate {{ mumble_web_trusted_certificate }};
{% endif %}
location / { location / {
root /var/www/mumble-web/dist/; root {{ mumble_web_dist_dir }};
} }
location /mumble { location /mumble {
proxy_pass http://127.0.0.1:{{ mumble_web_websockify_port }}; proxy_pass http://localhost:{{ mumble_web_websockify_port }};
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade; proxy_set_header Connection $connection_upgrade;
} }
access_log {{ nginx_log_dir }}/{{ mumble_web_domains | first }}-access.log;
error_log {{ nginx_log_dir }}/{{ mumble_web_domains | first }}-error.log;
} }
map $http_upgrade $connection_upgrade { map $http_upgrade $connection_upgrade {

View File

@@ -0,0 +1,329 @@
{{ ansible_managed | comment(decoration="; ") }}
; Murmur configuration file.
;
; General notes:
; * Settings in this file are default settings and many of them can be overridden
; with virtual server specific configuration via the Ice or DBus interface.
; * Due to the way this configuration file is read some rules have to be
; followed when specifying variable values (as in variable = value):
; * Make sure to quote the value when using commas in strings or passwords.
; NOT variable = super,secret BUT variable = "super,secret"
; * Make sure to escape special characters like '\' or '"' correctly
; NOT variable = """ BUT variable = "\""
; NOT regex = \w* BUT regex = \\w*
; Path to database. If blank, will search for
; murmur.sqlite in default locations or create it if not found.
database={{ murmur_database.path | to_json }}
; Murmur defaults to using SQLite with its default rollback journal.
; In some situations, using SQLite's write-ahead log (WAL) can be
; advantageous.
; If you encounter slowdowns when moving between channels and similar
; operations, enabling the SQLite write-ahead log might help.
;
; To use SQLite's write-ahead log, set sqlite_wal to one of the following
; values:
;
; 0 - Use SQLite's default rollback journal.
; 1 - Use write-ahead log with synchronous=NORMAL.
; If Murmur crashes, the database will be in a consistent state, but
; the most recent changes might be lost if the operating system did
; not write them to disk yet. This option can improve Murmur's
; interactivity on busy servers, or servers with slow storage.
; 2 - Use write-ahead log with synchronous=FULL.
; All database writes are synchronized to disk when they are made.
; If Murmur crashes, the database will be include all completed writes.
;sqlite_wal=0
; If you wish to use something other than SQLite, you'll need to set the name
; of the database above, and also uncomment the below.
; Sticking with SQLite is strongly recommended, as it's the most well tested
; and by far the fastest solution.
;
;dbDriver=QMYSQL
;dbUsername=
;dbPassword=
;dbHost=
;dbPort=
;dbPrefix=murmur_
;dbOpts=
{% if murmur_database.driver is defined %}
dbDriver={{ murmur_database.driver | to_json }}
dbUsername={{ murmur_database.username | to_json }}
dbPassword={{ murmur_database.password | to_json }}
dbHost={{ murmur_database.host | default('localhost') | to_json }}
dbPort={{ murmur_database.port }}
dbPrefix={{ murmur_database.prefix | default('') | to_json }}
dbOpts={{ murmur_database.opts | default('') | to_json }}
{% endif %}
; Murmur defaults to not using D-Bus. If you wish to use dbus, which is one of the
; RPC methods available in Murmur, please specify so here.
;
;dbus=session
; Alternate D-Bus service name. Only use if you are running distinct
; murmurd processes connected to the same D-Bus daemon.
;dbusservice=net.sourceforge.mumble.murmur
; If you want to use ZeroC Ice to communicate with Murmur, you need
; to specify the endpoint to use. Since there is no authentication
; with ICE, you should only use it if you trust all the users who have
; shell access to your machine.
; Please see the ICE documentation on how to specify endpoints.
ice="tcp -h {{ murmur_ice_host | quote }} -p {{ murmur_ice_port | int }}"
; Ice primarily uses local sockets. This means anyone who has a
; user account on your machine can connect to the Ice services.
; You can set a plaintext "secret" on the Ice connection, and
; any script attempting to access must then have this secret
; (as context with name "secret").
; Access is split in read (look only) and write (modify)
; operations. Write access always includes read access,
; unless read is explicitly denied (see note below).
;
; Note that if this is uncommented and with empty content,
; access will be denied.
{% if murmur_ice_secret_read is defined %}
icesecretread={{ murmur_ice_secret_read | to_json }}
{% else %}
;icesecretread=
{% endif %}
{% if murmur_ice_secret_write is defined %}
icesecretwrite={{ murmur_ice_secret_write | to_json }}
{% else %}
;icesecretwrite=
{% endif %}
; If you want to expose Murmur's experimental gRPC API, you
; need to specify an address to bind on.
; Note: not all builds of Murmur support gRPC. If gRPC is not
; available, Murmur will warn you in its log output.
;grpc="127.0.0.1:50051"
; Specifying both a certificate and key file below will cause gRPC to use
; secured, TLS connections.
;grpccert=""
;grpckey=""
; How many login attempts do we tolerate from one IP
; inside a given timeframe before we ban the connection?
; Note that this is global (shared between all virtual servers), and that
; it counts both successfull and unsuccessfull connection attempts.
; Set either Attempts or Timeframe to 0 to disable.
;autobanAttempts = 10
;autobanTimeframe = 120
;autobanTime = 300
autobanAttempts={{ murmur_autoban_attempts }}
autobanTimeframe={{ murmur_autoban_timeframe }}
autobanTime={{ murmur_autoban_time }}
; Specifies the file Murmur should log to. By default, Murmur
; logs to the file 'murmur.log'. If you leave this field blank
; on Unix-like systems, Murmur will force itself into foreground
; mode which logs to the console.
;logfile=murmur.log
logfile={{ murmur_log_file | to_json }}
; If set, Murmur will write its process ID to this file
; when running in daemon mode (when the -fg flag is not
; specified on the command line). Only available on
; Unix-like systems.
;pidfile=
pidfile={{ murmur_pid_file | to_json }}
; The below will be used as defaults for new configured servers.
; If you're just running one server (the default), it's easier to
; configure it here than through D-Bus or Ice.
;
; Welcome message sent to clients when they connect.
; If the welcome message is set to an empty string,
; no welcome message will be sent to clients.
{% if murmur_welcome_text is string %}
welcometext={{ murmur_welcome_text | to_json }}
{% else %}
welcometext = {{ murmur_welcome_text | join('<br />') | to_json }};
{% endif %}
; Port to bind TCP and UDP sockets to.
port={{ murmur_port }}
; Specific IP or hostname to bind to.
; If this is left blank (default), Murmur will bind to all available addresses.
;host=
host={{ murmur_host | to_json }}
; Password to join server.
serverpassword={{ murmur_server_password | to_json }}
; Maximum bandwidth (in bits per second) clients are allowed
; to send speech at.
bandwidth={{ murmur_max_bandwidth }}
; Maximum number of concurrent clients allowed.
users={{ murmur_max_users }}
; Per-user rate limiting
;
; These two settings allow to configure the per-user rate limiter for some
; command messages sent from the client to the server. The messageburst setting
; specifies an amount of messages which are allowed in short bursts. The
; messagelimit setting specifies the number of messages per second allowed over
; a longer period. If a user hits the rate limit, his packages are then ignored
; for some time. Both of these settings have a minimum of 1 as setting either to
; 0 could render the server unusable.
messageburst=5
messagelimit=1
; Respond to UDP ping packets.
;
; Setting to true exposes the current user count, the maximum user count, and
; the server's maximum bandwidth per client to unauthenticated users. In the
; Mumble client, this information is shown in the Connect dialog.
allowping=true
; Amount of users with Opus support needed to force Opus usage, in percent.
; 0 = Always enable Opus, 100 = enable Opus if it's supported by all clients.
;opusthreshold=100
opusthreshold={{ murmur_opus_threshold }}
; Maximum depth of channel nesting. Note that some databases like MySQL using
; InnoDB will fail when operating on deeply nested channels.
;channelnestinglimit=10
channelnestinglimit={{ murmur_channel_nesting_limit }}
; Maximum number of channels per server. 0 for unlimited. Note that an
; excessive number of channels will impact server performance
;channelcountlimit=1000
channelcountlimit={{ murmur_channel_count_limit }}
; Regular expression used to validate channel names.
; (Note that you have to escape backslashes with \ )
;channelname=[ \\-=\\w\\#\\[\\]\\{\\}\\(\\)\\@\\|]+
{% if murmur_channel_name_regex is defined %}
channelname={{ murmur_channel_name_regex }}
{% endif %}
; Regular expression used to validate user names.
; (Note that you have to escape backslashes with \ )
;username=[-=\\w\\[\\]\\{\\}\\(\\)\\@\\|\\.]+
{% if murmur_username_regex is defined %}
username={{ murmur_username_regex }}
{% endif %}
; Maximum length of text messages in characters. 0 for no limit.
;textmessagelength=5000
textmessagelength={{ murmur_text_message_max_length }}
; Maximum length of text messages in characters, with image data. 0 for no limit.
;imagemessagelength=131072
imagemessagelength={{ murmur_image_message_max_length }}
; Allow clients to use HTML in messages, user comments and channel descriptions?
;allowhtml=true
allowhtml={{ murmur_allow_html }}
; Murmur retains the per-server log entries in an internal database which
; allows it to be accessed over D-Bus/ICE.
; How many days should such entries be kept?
; Set to 0 to keep forever, or -1 to disable logging to the DB.
;logdays=31
logdays={{ murmur_log_days }}
{% if murmur_register_enabled %}
; To enable public server registration, the serverpassword must be blank, and
; this must all be filled out.
; The password here is used to create a registry for the server name; subsequent
; updates will need the same password. Don't lose your password.
; The URL is your own website, and only set the registerHostname for static IP
; addresses.
; Only uncomment the 'registerName' parameter if you wish to give your "Root" channel a custom name.
;
registerName={{ murmur_register.name | to_json }}
registerPassword={{ murmur_register.password | to_json }}
registerUrl={{ murmur_register.url | to_json }}
registerHostname={{ murmur_register.hostname | to_json }}
{% endif %}
; If this option is enabled, the server will announce its presence via the
; bonjour service discovery protocol. To change the name announced by bonjour
; adjust the registerName variable.
; See http://developer.apple.com/networking/bonjour/index.html for more information
; about bonjour.
;bonjour=True
bonjour={{ murmur_bonjour_enabled }}
; If you have a proper SSL certificate, you can provide the filenames here.
; Otherwise, Murmur will create its own certificate automatically.
;sslCert=
;sslKey=
sslCert={{ murmur_certificate | to_json }}
sslKey={{ murmur_private_key | to_json }}
{% if acme_enabled %}
sslCa={{ murmur_trusted_certificate | to_json }}
{% endif %}
; The sslDHParams option allows you to specify a PEM-encoded file with
; Diffie-Hellman parameters, which will be used as the default Diffie-
; Hellman parameters for all virtual servers.
;
; Instead of pointing sslDHParams to a file, you can also use the option
; to specify a named set of Diffie-Hellman parameters for Murmur to use.
; Murmur comes bundled with the Diffie-Hellman parameters from RFC 7919.
; These parameters are available by using the following names:
;
; @ffdhe2048, @ffdhe3072, @ffdhe4096, @ffdhe6144, @ffdhe8192
;
; By default, Murmur uses @ffdhe2048.
sslDHParams={{ murmur_dhparam | to_json }}
; The sslCiphers option chooses the cipher suites to make available for use
; in SSL/TLS. This option is server-wide, and cannot be set on a
; per-virtual-server basis.
;
; This option is specified using OpenSSL cipher list notation (see
; https://www.openssl.org/docs/apps/ciphers.html#CIPHER-LIST-FORMAT).
;
; It is recommended that you try your cipher string using 'openssl ciphers <string>'
; before setting it here, to get a feel for which cipher suites you will get.
;
; After setting this option, it is recommend that you inspect your Murmur log
; to ensure that Murmur is using the cipher suites that you expected it to.
;
; Note: Changing this option may impact the backwards compatibility of your
; Murmur server, and can remove the ability for older Mumble clients to be able
; to connect to it.
;sslCiphers=EECDH+AESGCM:EDH+aRSA+AESGCM:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:AES256-SHA:AES128-SHA
; If Murmur is started as root, which user should it switch to?
; This option is ignored if Murmur isn't started with root privileges.
;uname=
uname={{ murmur_owner }}
; If this options is enabled, only clients which have a certificate are allowed
; to connect.
;certrequired=False
certrequired={{ murmur_client_certificate_required }}
; If enabled, clients are sent information about the servers version and operating
; system.
;sendversion=True
sendversion={{ murmur_send_server_version }}
; This sets password hash storage to legacy mode (1.2.4 and before)
; (Note that setting this to true is insecure and should not be used unless absolutely necessary)
;legacyPasswordHash=false
; By default a strong amount of PBKDF2 iterations are chosen automatically. If >0 this setting
; overrides the automatic benchmark and forces a specific number of iterations.
; (Note that you should only change this value if you know what you are doing)
;kdfIterations=-1
; You can configure any of the configuration options for Ice here. We recommend
; leave the defaults as they are.
; Please note that this section has to be last in the configuration file.
;
[Ice]
Ice.Warn.UnknownProperties={{ murmur_ice_warn_unknown_properties | int }}
Ice.MessageSizeMax={{ murmur_ice_message_size_max }}

View File

@@ -1,72 +0,0 @@
{{ ansible_managed | comment }}
max_bandwidth = 48000;
welcometext = {{ umurmur_welcome_text
if umurmur_welcome_text is string
else (umurmur_welcome_text | join('<br />'))
| to_json }};
certificate = {{ umurmur_certificate | to_json }};
private_key = {{ umurmur_private_key | to_json }};
password = {{ umurmur_user_password | to_json }};
{% if umurmur_admin_password is defined %}
admin_password = {{ umurmur_admin_password | to_json }}; # Set to enable admin functionality.
{% endif %}
# ban_length = 0; # Length in seconds for a ban. Default is 0. 0 = forever.
# enable_ban = false; # Default is false
# banfile = "banfile.txt"; # File to save bans to. Default is to not save bans to file.
# sync_banfile = false; # Keep banfile synced. Default is false, which means it is saved to at shutdown only.
allow_textmessage = true; # Default is true
# opus_threshold = 100; # Percentage of users supporting Opus codec for it to be chosen. Default is 100.
# show_addresses = true; # Whether to show client's IP addresses under user information
max_users = {{ umurmur_max_users }};
bindport = {{ umurmur_port }};
# bindaddr = "0.0.0.0";
# username and groupname for privilege dropping.
# Will attempt to switch user if set.
# username = "";
# If groupname not set the user's default login group will be used
# groupname = "";
# Log to file option. Default is logging to syslog.
# umurmurd will close and reopen the logfile if SIGHUP is received.
logfile = "/var/log/umurmurd.log";
# CA location for CA-signed certificates
# ca_path = "/path/to/ca/certificates/";
# Channel tree definition:
# Root channel must always be defined first.
# If a channel has a parent, the parent must be defined before the child channel(s).
channels = (
{% for channel in umurmur_channels %}
{
name = {{ channel.name | to_json }};
description = {{ channel.description | default('') | to_json }};
parent = {{ channel.parent | default('') | to_json }};
noenter = {{ channel.noenter | default(false) | string | lower }};
silent = {{ channel.silent | default(false) | string | lower }};
{% if channel.position is defined %}
position = {{ channel.position }};
{% endif %}
{% if channel.password is defined %}
password = {{ channel.password | to_json }};
{% endif %}
}{{ loop.last | ternary("", ",") }}
{% endfor %}
);
# Channel links configuration.
channel_links = (
{% for channel in umurmur_channel_links %}
{% for destination in channel.destinations %}
{
source = {{ channel.source | to_json }};
destination = {{ destination | to_json }};
}{{ loop.last | ternary('', ',') }}
{% endfor %}
{% endfor %}
);
# The channel in which users will appear in when connecting.
# Note that default channel can't have 'noenter = true' or password set
default_channel = {{ umurmur_default_channel | to_json }};

View File

@@ -1,16 +0,0 @@
[Unit]
Description=Minimalistic Mumble server
After=network.target
[Service]
Type=simple
User=nobody
Group={{ umurmur_ssl_group }}
Restart=always
RestartSec=3
ExecStartPre=/usr/local/bin/umurmurd -t -c /usr/local/etc/umurmur.conf
ExecStart=/usr/local/bin/umurmurd -d -r -c /usr/local/etc/umurmur.conf
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

2
vars/main.yml Normal file
View File

@@ -0,0 +1,2 @@
murmur_ice_script_dir: /opt/mice
murmur_ice_config_path: /etc/mice.yml