Skip to content

Optional Post-Installation Steps

LWT is a all-in-one product, but you can extend its capabilities in various ways. Here are the additional features unavailable by default.

Parse Japanese with MeCab

MeCab is a Japanese parser. Installing it has two main advantages:

  • Much better parsing of Japanese texts than RegExp.
  • Automatic romanization of words.
  • Enables text-to-speech for any character group.

Installation

Standard Installtion

  1. Follow the instructions to download MeCab at https://taku910.github.io/mecab/#install.
  2. Add MeCab to your system PATH.
  3. In LWT, go to "Edit Languages" → "Japanese" and change from the value for "RegExp Word Characters" to mecab.

Using Docker

Original instructions provided on Easily Set Up and Use MeCab With Docker and NodeJS (Medium).

  1. Run your LWT container in interactive mode and install MeCab.

    bash
    docker exec -it lwt bash
    apt-get update && apt-get install -y mecab libmecab-dev mecab-ipadic-utf8
  2. In LWT, go to "Edit Languages" → "Japanese" and change from the value for "RegExp Word Characters" to mecab.

Automatic Translation

LibreTranslate

LibreTranslate is a great open-source tool that allows you to translate text and provides an API. With it you can achieve the following:

  • Translation of sentences without using Google Translate.
  • Automatic translation of words (so you don't need to fill by hand!).

LibreTranslate Demo

To use it, please read the following steps:

  1. Install it on a local or remote server or using Docker.
  2. In LWT, go to "Edit Langagues", either create a new or edit an existing language
  3. In the field "Sentence Translator URI", replace it by the URL of you libre translate instance.
    • Do not forget to add the parameter lwt_translator=libretranslate for the automatic translation!
    • source= should be followed by two letters indicating the language translating from.
    • target= should be followed by two letters indicating the language to translate to.

Enhanced Text-to-Speech

The Text-to-Speech may sound robotic with some languages or operating systems. A workaround is to download a Text-To-Speech (TTS) plugin such as Read Aloud.

Multi-User Mode

LWT supports a multi-user mode where each user has their own isolated data. This is useful for:

  • Sharing a single LWT instance among multiple learners
  • Securing data access in a shared environment
  • Enabling user registration and authentication

Enabling Multi-User Mode

  1. Edit your .env file and add:

    dotenv
    MULTI_USER_ENABLED=true
  2. Restart your web server.

  3. The first time you access LWT, you'll be prompted to create an admin account.

Password Requirements

When creating accounts in multi-user mode, passwords must meet the following requirements:

RequirementDescription
Minimum Length8 characters
Maximum Length128 characters
LettersAt least one letter (a-z or A-Z)
NumbersAt least one number (0-9)

Security Best Practices

For production deployments, we recommend:

  • Use a strong, unique password (12+ characters with mixed case, numbers, and symbols)
  • Never reuse passwords from other services
  • Consider using a password manager
  • Always use HTTPS in production

Password Hashing

LWT uses modern password hashing algorithms:

  • Argon2ID (preferred) - Memory-hard algorithm resistant to GPU attacks
  • bcrypt (fallback) - Used if Argon2ID is unavailable

Passwords are never stored in plain text and cannot be recovered—only reset.

YouTube Import

LWT can import captions from YouTube videos. To enable this feature:

  1. Create a Google Cloud project at Google Cloud Console

  2. Enable the YouTube Data API v3 for your project

  3. Create an API key in the Credentials section

  4. Add the key to your .env file:

    dotenv
    YT_API_KEY=your_api_key_here
  5. Restart your web server

The YouTube import option will now appear when creating new texts.

External Audio Sources (CSP Configuration)

By default, LWT only allows audio files from the same server (for security). If you want to use audio from external sources (e.g., language learning websites), you can configure the Content Security Policy.

Configuration

Add the CSP_MEDIA_SOURCES setting to your .env file:

dotenv
# Option 1: Allow any HTTPS source (recommended for self-hosted instances)
CSP_MEDIA_SOURCES=https

# Option 2: Allow specific domains only
CSP_MEDIA_SOURCES=https://example.com,https://other-site.org

# Option 3: Strict mode - only local files (default)
CSP_MEDIA_SOURCES=self

Security Considerations

SettingSecurityUse Case
selfHighestMulti-user servers where privacy is critical
httpsModerateSelf-hosted instances with trusted users
Specific domainsHighWhen you know exactly which audio sources you'll use

Privacy Note for Multi-User Servers

When https is enabled, users can add audio URLs pointing to external servers. When other users play that audio, the external server can log their IP addresses. For public multi-user servers where privacy matters, consider:

  • Keeping the default self setting
  • Implementing a media proxy (future feature)
  • Whitelisting only trusted domains

Released into the Public Domain under the Unlicense.