License¶
This project is licensed under the MIT License, except for the following files:
kernel/c/libjwt/* Mozilla Public License 2.0 (MPL-2.0)
System Requirements¶
python 3.7+
Dependencies for C and Linux:
Jansson MIT License
libjwt MPL-2.0 License
liburing MIT License, LGPL-2.1, GPL-2.0
mbedtls Apache-2.0 or GPL-2.0
openssl Apache-2.0 License
pcre2 BSD License and others
libbacktrace BSD 3-Clause License
argp-standalone LGPL-2.1 License
ncurses MIT License
llhttp MIT License
Dependencies for deploying in Linux:
nginx BSD-2-Clause license
openresty BSD 2-Clause, BSD 3-Clause, MIT, OpenSSL, Zlib, SSLeay
curl curl license, MIT/X derivate license,
Create environment¶
Firstly you must create the user/group yuneta and the directory /yuneta.
sudo adduser yuneta
sudo mkdir /yuneta
sudo chown yuneta:yuneta /yunetaRe-enter with the user yuneta
Install system dependencies¶
Install the C dependencies:
sudo apt -y install --no-install-recommends \
git mercurial make cmake ninja-build \
gcc clang g++ \
python3-dev python3-pip python3-setuptools \
python3-tk python3-wheel python3-venv \
libjansson-dev libpcre2-dev liburing-dev libcurl4-openssl-dev \
libpcre3-dev zlib1g-dev libssl-dev \
perl dos2unix tree curl \
postgresql-server-dev-all libpq-dev \
kconfig-frontends telnet pipx \
patch gettext fail2ban rsync \
build-essential pkg-config ca-certificates linux-libc-dev
pipx install kconfiglibWhy these dependencies?
libjansson-dev— required for libjwtlibpcre2-dev— required by openrestyperl dos2unix mercurial— required by openrestypipx kconfiglib— used by yunetas, configuration toolkconfig-frontends— used by yunetas, other configuration tooltelnet— required by tests
Install yunetas¶
Install pipx¶
pipx is used to install Python CLI applications globally while still isolating them in virtual environments.
On Linux:
Ubuntu 23.04 or above:
sudo apt install pipx pipx ensurepathUbuntu 22.04 or below
python3 -m pip install --user pipx python3 -m pipx ensurepath
Install yunetas¶
pipx install yunetas
Update or uninstall yunetas¶
Click to see
Update yunetas:
pipx upgrade yunetasUninstall yunetas:
pipx uninstall yunetas
Steps to install and create a virtual environment:
Install conda:
mkdir -p ~/miniconda3 wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 rm -rf ~/miniconda3/miniconda.sh ~/miniconda3/bin/conda init bashNow you must close and re-open your current shell:
exit # exit and RE-open bash to continue !!Add conda-forge channel:
conda config --add channels conda-forgeCreate the virtual environment
conda_yunetasand activate:conda create -y -n conda_yunetas pip conda config --set auto_activate_base false echo 'conda activate conda_yunetas' >> ~/.bashrc echo '' >> ~/.bashrc source ~/.bashrc
Install yunetas¶
pip install yunetasClone¶
Clone Yunetas with submodules:
Build your own project directory:
mkdir ~/yunetaprojects
cd ~/yunetaprojectsGet the current version of yunetas:
git clone --recurse-submodules https://github.com/artgins/yunetas.gitOr Get some version of yunetas:
git clone -b <version> --recurse-submodules https://github.com/artgins/yunetas.git <version>Activating yunetas¶
Go to the yunetas directory in your project and activate:
cd ~/yunetaprojects/yunetas
source yunetas-env.shConfigure .bashrc¶
Next times, to activate yunetas environment,
(you can add these lines to ~/.bashrc :
# edit: "vim ~/.bashrc" and add next lines:
cd ~/yunetaprojects/yunetas
source yunetas-env.shConfigure .yunetasrc¶
The script source yunetas-env.sh also sources the file
~/.yunetasrcwhere you can place your own scripts.
Configuring (Kconfig)¶
Configuration options are defined in Kconfig file.
The output from Kconfig is a header file yuneta_config.h with macros that can be tested at build time.
Goto yunetas directory:
cd ~/yunetaprojects/yunetasUse this utility to edit the Kconfig file and to select the compiler, build type, etc:
menuconfig
Options:
(Top) → Compiler Selection
(X) GCC compiler (default)
( ) Clang compiler
WARNING: Remember to call set_compiler.sh if you change the compiler
(Top) → Build Configuration
Build Type
(X) RelWithDebInfo (default)
( ) Release
( ) Debug
( ) MinSizeRel
[*] Build fully static binaries (default y)
(Top) → TLS Library
(X) OpenSSL (default)
( ) Mbed-TLS
(Top) → Debug Options
[*] Use backtrace library (default y)
[ ] Enable track memory
[ ] Print times of yev_loop
(Top) → Modules
*** Available modules. ***
[*] C_CONSOLE support
[*] C_MQTT support
[*] C_MODBUS support
[*] C_POSTGRES support
[*] C_TEST support⚠️ Warning: Save the configuration, otherwise the compilation will fail, the .config file is required.
⚠️ Warning: Execute the ./set_compiler.sh to compile the external libs with the same compiler as Yunetas.
Install dependencies¶
Firstly, install yuneta dependencies:
Goto linux-ext-libs directory:
cd ~/yunetaprojects/yunetas/kernel/c/linux-ext-libs/Extract, compile and install:
./extrae.sh # clone libraries
./configure-libs.sh # configure, build and install librariesℹ️ Fully static builds (
CONFIG_FULLY_STATIC=y) use the sameconfigure-libs.shwith GCC or Clang — no separate toolchain needed. OpenSSL is built withno-dsoandno-sockto avoid glibc resolver stubs in the static binary. Seekernel/c/linux-ext-libs/HACKS.rstfor details.
Compile Yunetas¶
Compiling and Installing Yunetas¶
To build and install yunetas:
yunetas init
yunetas buildTest¶
To test:
yunetas testBy default, the installation directory of include files,
libraries and binaries will be in /yuneta/development/outputs/
Want the old /var/log/syslog back?¶
sudo apt-get update
sudo apt-get install rsyslog
sudo systemctl enable --now rsyslogHow remove warning: Setting locale failed:¶
dpkg-reconfigure locales