Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MeloTTS #336

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,10 @@ Install these other services at your leisure/preference:
* [Invidious](invidious#readme) - a Youtube proxy
* [Jitsi Meet](jitsi-meet#readme) - a video conferencing and screencasting service
* [Jupyterlab](jupyterlab#readme) - a web based code editing environment / reproducible research tool
* [Larynx](larynx#readme) - a speech synthesis engine
* [Lemmy](lemmy#readme) - a link aggregator and forum for the fediverse
* [Matterbridge](matterbridge#readme) - a chat room bridge (IRC, Matrix, XMPP, etc)
* [Maubot](maubot#readme) - a matrix Bot
* [MeloTTS](melotts#readme) - a text to speech synthesis engine
* [Minio](minio#readme) - an S3 storage server
* [Mopidy](mopidy#readme) - a streaming music server built with MPD and Snapcast
* [Mosquitto](mosquitto#readme) - an MQTT server
Expand Down
26 changes: 0 additions & 26 deletions larynx/Makefile

This file was deleted.

38 changes: 0 additions & 38 deletions larynx/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions larynx/docker-compose.yaml

This file was deleted.

26 changes: 16 additions & 10 deletions larynx/.env-dist → melotts/.env-dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# https://hub.docker.com/r/rhasspy/larynx/tags
LARYNX_VERSION=1.1.0
LARYNX_TRAEFIK_HOST=larynx.example.com
LARYNX_INSTANCE=
# The docker image to use:
MELOTTS_GIT_REPO=https://github.com/myshell-ai/MeloTTS.git
MELOTTS_GIT_REF=main

# The domain name for the melotts service:
MELOTTS_TRAEFIK_HOST=melotts.example.com

# The name of this instance. If there is only one instance, use 'default'.
MELOTTS_INSTANCE=

# Filter access by IP address source range (CIDR):
##Disallow all access: 0.0.0.0/32
##Allow all access: 0.0.0.0/0
LARYNX_IP_SOURCERANGE=0.0.0.0/0
MELOTTS_IP_SOURCERANGE=0.0.0.0/0

# HTTP Basic Authentication:
# Use `make config` to fill this in properly, or set this to blank to disable.
LARYNX_HTTP_AUTH=
MELOTTS_HTTP_AUTH=

# OAUTH2
# Set to `true` to use OpenID/OAuth2 authentication via the
Expand All @@ -23,15 +28,16 @@ LARYNX_HTTP_AUTH=
# header, or if your app doesn't have built-in authentication at all, then
# any person with an account on your Gitea server can log into your app and
# have full access.
LARYNX_OAUTH2=
MELOTTS_OAUTH2=
# In addition to Oauth2 authentication, you can configure basic authorization
# by entering which authorization group can log into your app. You create
# groups of email addresses in the `traefik` folder by running `make groups`.
LARYNX_OAUTH2_AUTHORIZED_GROUP=
MELOTTS_OAUTH2_AUTHORIZED_GROUP=

# Mutual TLS (mTLS):
# Set true or false. If true, all clients must present a certificate signed by Step-CA:
LARYNX_MTLS_AUTH=false
MELOTTS_MTLS_AUTH=false
# Enter a comma separated list of client domains allowed to connect via mTLS.
# Wildcards are allowed and encouraged on a per-app basis:
LARYNX_MTLS_AUTHORIZED_CERTS=*.clients.larynx.example.com
MELOTTS_MTLS_AUTHORIZED_CERTS=*.clients.melotts.example.com

32 changes: 32 additions & 0 deletions melotts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ROOT_DIR = ..
include ${ROOT_DIR}/_scripts/Makefile.projects
include ${ROOT_DIR}/_scripts/Makefile.instance

.PHONY: config-hook
config-hook:
#### This interactive configuration wizard creates the .env_{DOCKER_CONTEXT}_{INSTANCE} config file using .env-dist as the template:
#### reconfigure_ask asks the user a question to set the variable into the .env file, and with a provided default value.
#### reconfigure sets the value of a variable in the .env file without asking.
#### reconfigure_htpasswd will configure the HTTP Basic Authentication setting the var name and with a provided default value.
@${BIN}/reconfigure_ask ${ENV_FILE} MELOTTS_TRAEFIK_HOST "Enter the melotts domain name" melotts${INSTANCE_URL_SUFFIX}.${ROOT_DOMAIN}
@${BIN}/reconfigure ${ENV_FILE} MELOTTS_INSTANCE=$${instance:-default}
@${BIN}/reconfigure_auth ${ENV_FILE} MELOTTS
@echo ""

.PHONY: override-hook
override-hook:
#### This sets the override template variables for docker-compose.instance.yaml:
#### The template dynamically renders to docker-compose.override_{DOCKER_CONTEXT}_{INSTANCE}.yaml
#### These settings are used to automatically generate the service container labels, and traefik config, inside the template.
#### The variable arguments have three forms: `=` `=:` `=@`
#### name=VARIABLE_NAME # sets the template 'name' field to the value of VARIABLE_NAME found in the .env file
#### # (this hardcodes the value into docker-compose.override.yaml)
#### name=:VARIABLE_NAME # sets the template 'name' field to the literal string 'VARIABLE_NAME'
#### # (this hardcodes the string into docker-compose.override.yaml)
#### name=@VARIABLE_NAME # sets the template 'name' field to the literal string '${VARIABLE_NAME}'
#### # (used for regular docker-compose expansion of env vars by name.)
@${BIN}/docker_compose_override ${ENV_FILE} project=:melotts instance=@MELOTTS_INSTANCE traefik_host=@MELOTTS_TRAEFIK_HOST http_auth=MELOTTS_HTTP_AUTH http_auth_var=@MELOTTS_HTTP_AUTH ip_sourcerange=@MELOTTS_IP_SOURCERANGE oauth2=MELOTTS_OAUTH2 authorized_group=MELOTTS_OAUTH2_AUTHORIZED_GROUP enable_mtls_auth=MELOTTS_MTLS_AUTH mtls_authorized_certs=MELOTTS_MTLS_AUTHORIZED_CERTS

.PHONY: shell
shell:
@make --no-print-directory docker-compose-shell SERVICE=melotts
21 changes: 21 additions & 0 deletions melotts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MeloTTS

[MeloTTS](https://github.com/myshell-ai/MeloTTS) is a text-to-speech engine.


## Configure

```
make clean
```


## Install

```
make install
```

MeloTTS is built from source, so it may take many minutes to complete.


Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#@yaml/text-templated-strings
services:
larynx:
#@ service = "larynx"
melotts:
#@ service = "melotts"
labels:
#! Services must opt-in to be proxied by Traefik:
- "traefik.enable=true"
Expand All @@ -33,9 +33,9 @@ services:
#! The host matching router rule:
- "traefik.http.routers.(@= router @).rule=Host(`(@= traefik_host @)`)"
- "traefik.http.routers.(@= router @).entrypoints=websecure"

#@ enabled_middlewares.append("{}-ipallowlist".format(router))
- "traefik.http.middlewares.(@= router @)-ipallowlist.ipallowlist.sourcerange=(@= ip_sourcerange @)"

#@ if enable_http_auth:
#@ enabled_middlewares.append("{}-basicauth".format(router))
- "traefik.http.middlewares.(@= router @)-basicauth.basicauth.users=(@= http_auth @)"
Expand All @@ -55,6 +55,11 @@ services:
#@ end
#@ enabled_middlewares.append("mtls-header@file")
#@ end

#! Override the default port that the app binds to:
#! You don't normally need to do this, as long as your image has
#! an EXPOSE directive in it, Traefik will autodetect it, but this is how you can override it:
- "traefik.http.services.(@= router @).loadbalancer.server.port=8888"

#! Apply all middlewares (do this at the end!)
- "traefik.http.routers.(@= router @).middlewares=(@= ','.join(enabled_middlewares) @)"
13 changes: 13 additions & 0 deletions melotts/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
melotts:
build:
context: ${MELOTTS_GIT_REPO}#${MELOTTS_GIT_REF}
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
sysctls:
- net.ipv4.ip_unprivileged_port_start=1024
restart: unless-stopped
# All labels are defined in the template: docker-compose.instance.yaml
labels: []