-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
Fix bugs with Redis in docker and Kamailio startup and configuration, add WebUI to autostart #179
Open
lfoxdev
wants to merge
7
commits into
hnimminh:master
Choose a base branch
from
lfoxdev:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+186
−48
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. When running in Docker container with built-in Redis, LibreSBC starts Redis, but doesn't wait for it to be ready and tries to retrive Kamailio layers from database immediatly. If Redis is not started yet, basestartup() will simply exit with no Kamailio instances started. 2. By default, Redis saves database to disk after a very long time, so many changes in configuration are lost if server failed/rebooted soon after changes. # Unless specified otherwise, by default Redis will save the DB: # * After 3600 seconds (an hour) if at least 1 change was performed # * After 300 seconds (5 minutes) if at least 100 changes were performed # * After 60 seconds if at least 10000 changes were performed One of solutions is to use "--appendonly yes" which make Redis to immediatly write changes to AOF file (https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/). Note: AOF file will become bigger on every change, but is reduced when it reaches 64mb by default. This can be managed with '--auto-aof-rewrite-min-size 64mb'. 3. If server or container with running Kamailio is not shut down properly, the /run/kamailio/{layer}.pid file persists and blocks Kamailio from starting next time, so i suppose to delete it manually.
If TLS is included in transports of AccessService, Kamailio module tls.so is added to 'layer.cfg' with config file "{{layer}}.tls.cfg". Howewer, this TLS config file is not created anywhere, so Kamailio simply fails to start. This fix adds template for this file and makes it be created when user enables TLS transport. A new TLS class is also added to AccessService class to make Kamailio TLS configurable by user. The most common settings are included: - TLS version - path to certificate - path to private key - custom Server Name Indication string
…C domain mames Many SIP clients have only one 'domain' field, which implies both the hostname of SIP registrar and the 'domain' field in AOR. A field to set SIP registrar address separately may be missing or hidden deep in the settings. On the other hand, server with LibreSBC may not have a real domain name. It seems to be good to allow administrator of such server create Access Domains with IP address instead of RFC domain name to simplify setup of various SIP clients.
First, the Go must be installed: curl -L https://go.dev/dl/go1.23.2.linux-amd64.tar.gz -o /usr/local/go1.23.2.linux-amd64.tar.gz && tar -xzf /usr/local/go1.23.2.linux-amd64.tar.gz -C /usr/local And then WebUI compiled: cd /opt/libresbc/webui && /usr/local/go/bin/go build -o /opt/libresbc/webui/webuisrv (These steps will be automated when installing in Docker. Dockerfile coming soon.) If LIBRE_WEBUI environmental variable is set to TRUE, 1 or YES, WebUI will be started with LibreSBC on port 8088.
lfoxdev
changed the title
Fix bugs with Redis in docker and Kamailio startup and configuration
Fix bugs with Redis in docker and Kamailio startup and configuration, add WebUI to autostart
Nov 19, 2024
1. With Docker multi-stage builds, entire process is divided for two stages: build and runtime. In build stage all build tools and packages are installed and sources are downloaded and compiled. In runtime stage, a smaller debian image is used, only runtime necessary packages are installed, and only binaries are copied from build stage. This made it possible to reduce the size of container from 2.64 Gb to less than 1 Gb (!) 2. All heavy steps such as downloading tons of sources and building freeswitch and kamailio are moved to the beginning of the Dockerfile. Now, when the changes are made only to LibreSBC code, docker uses build cache for these heavy steps, so subsequent bulds are made MUCH faster. 3. A docker volume 'libresbc' for storing Redis database and other data created by user. Now the libresbc container can be safely deleted and replaced (e.g. for update), and all user settings are persisted in real host file system (currently /var/lib/docker/volumes/libresbc) 4. WebUI is included into image 5. Built-in Redis and WebUI are enabled by default for smoother user experience. Docker best practices recommend to build ready-to-use container with all components inside it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some bugs were found&fixed when running LibreSBC in Docker container.