18/08/2022 vnc, AntOS, Remote Desktop, WVNC, VDE

Web based VNC client with AntOS docker image

Long time ago i developed WVNC, a simple protocol based on Web socket that allows to connect to VNC server from browser. WVNC consist of

  • A server side plugin (for Antd web server) that (1) acts as a bridge between VNC server and the web server; (2) defines the base protocol on top of websocket for streaming screen data and events to client. JPEG is used as data compression to reduce stream bandwidth.
  • A client side API called wvnc.js that implements the protocol defined by the server plugin, decodes JPEG data from the server and renders the data on HTML5 canvas

The protocol works really well for my personal need as i used it on a daily basis to access to my VNC home server from work :), using nothing but the web browser. However, setting up WVNC from scratch is not a trivial task, as it depends on my Antd server which is not a popular web server, thus Stack overflow is not an option :). I've received many contacts from readers on the howto instruction.

As WVNC is finally a part of AntOS eco-system, and AntOS is available as an all-in-one docker image, anyone can now easily run their own web-base VNC client via a single command line without the headache of building every thing from scratch.

Monitoring and collecting syslog messages from Unix Domain Socket

Application log is the traditional way to monitor an application/service. On *nix-based system, Syslog is a common but powerful tool for centrally monitoring applications logs. The primary use of syslog is for system management as capturing log data is critical for sysadmin, devOp team, or system analysts, etc. This log data is helpful in case of investigating/troubleshooting problems and maintaining healthy functioning of systems.

Syslog offers a standard log format and a standard alert system with different severity levels to applications in form of a log API. Log daemons such as rsyslog are versatile and flexible with various configuration options that enable different way to interact with the logs: log to file, log to a remote server via network (TCP, UDP sockets), log to local Unix domain socket. Log clients or log analytic applications can collect log data from the log daemon via these interfaces.

Although it is feasible to directly read log messages from the regular syslog output files, it is more preferable to collect log data from the daemon using the socket interface since socket is more suitable for data streaming. TCP/UDP sockets can be used to access log data from the network (TCP/IP). But if the application runs locally on the same machine as the log daemon, Unix domain socket (UDS) may be the best option.

Unix Domain Socket is an inter-process communication mechanism that allows bidirectional data exchange between processes running on the same machine. Thus, UDSs can avoid some checks and operations (like routing); which makes them faster and lighter than IP sockets.

In this post, we will learn how to collect log data from syslog via UDS in C. We will use rsyslog as log daemon in this post.

A use case will be presented at the end of the post.

13/06/2021 release, AntOS, SDK, documentation

AntOS v1.2.0-beta release

After a long testing period, AntOS v1.2.0-beta is now released!!!

Change logs

  • Improvement GUI API
    • [x] File dialog should remember last opened folder
    • [x] Add dynamic key-value dialog that work on any object
    • [x] Window list panel should show window title in tooltip when mouse hovering on an application icon
    • [x] Allow pinning application to system panel
    • [x] Improvement application list in market place
    • [x] Allow triplet keyboard shortcut in GUI
    • [x] CodePad allows setting shortcut in CommandPalette commands
    • [x] CodePad should have recent menu entry that remember top n file opened
    • [x] Improve File application grid view
    • [x] Label text should be selectable
    • [x] switch window using shortcut (CTRL+ALT+1, CTRL+ALT+2)
    • [x] Loading bar animation on system panel
    • [x] Multiple file upload support
    • [x] Generic key-value dialog
    • [x] Add bootstrap font support for icons
    • [x] Classify applications by categories in start menu
    • [x] Support vertical and horizontal resize window
  • MarketPlace now classifies application by categories
  • CodePad is no longer default system application, it has been moved to MarketPlace
  • More applications added to MarketPlace
  • Antos SDK
    • SDK is no longer included in Antos base release, it can be installed via MarketPlace
    • The SDK now has a generic API that can be used in different development tasks other than AntOS application
    • Heavy SDK tasks are now offloaded to workers
    • Introduce new JSON based syntax for SDK task/target definition
  • From this version, docker image of All-in-one AntOS system is available at: https://hub.docker.com/r/xsangle/antosaio

Demo

A demo of the VDE is available at https://app.iohub.dev/antos/ using username: demo and password: demo.

If one want to run AntOS VDE locally in their system, a docker image is available at:
https://hub.docker.com/r/xsangle/antosaio/

AntOS applications (Available on the MarketPlace)

https://github.com/lxsang/antosdk-apps

Documentation

26/06/2020 docker, AntOS, image, container, API

Running your own AntOS VDE system using a Docker image

Update: The image is now available on Docker Hub at: https://hub.docker.com/r/xsangle/antosaio (image: xsangle/antosaio:latest). This post has been updated with the latest instructions on how to host a local instance of AntOS VDE using Docker.

Building and setting up AntOS from scratch can be complex, as it requires configuring and connecting many backend and front-end components. To simplify the use of AntOS as a self-hosted environment, I have created a Docker image layer for an all-in-one AntOS system that contains everything needed to host AntOS on your server. This layer allows you to build a minimal Docker image with a working AntOS system out-of-the-box:

  • The web server (HTTP/HTTPS depending on the server configuration) + plugins
  • AntOS server-side API
  • AntOS client-side API

The Docker images are available at: https://hub.docker.com/r/xsangle/antosaio/

How does it work?

Follow the steps below to create an AntOS instance. First, create the working directory (e.g., /tmp/antos). All user data will be stored in this location. In this example, we use /tmp/antos, but in a real scenario, you should use a permanent storage location.

# modify with your own working directory
mkdir -p /tmp/antos

Run a container with docker

docker run \
    -p 8080:80 \
    --rm \
    -v /tmp/antos:/app \
    -e ANTOS_USER=demo \
    -e ANTOS_PASSWORD=demo \
    -it xsangle/antosaio:latest

Or with docker compose: docker-compose.yml

version: '3.7'
services:
  antos:
    image: xsangle/antosaio:latest
    privileged: true
    restart: always
    ports:
      - 8080:80
    container_name: antos_demo
    deploy:
      resources:
        limits:
          memory: 200m
          cpus: '0.5'
    hostname: demo
    environment:
      - ANTOS_USER=demo
      - ANTOS_PASSWORD=demo
    volumes:
      - /tmp/antos/:/app

Run:

docker compose up

AntOS is now accessible via http://localhost:8080/os/ or using IP address http://YOUR_MACHINE_IP:8080/os/

Conclusion

The docker image provides user with a ready to go (out-of-the-box) AntOS VDE system. This is useful in many user-cases:

  • Quickly setup environment for AntOS applications development
  • Scalable multi-user cloud-base service with AntOS and Kubenetes. Alternative to Ownclod, Google Cloud, Dropbox etc, with a more intuitive and user-friendly GUI, and more applications

AntOS 1.0.0-alpha

Github: https://github.com/lxsang/antos branch antos-1.0.0a

Demo: https://app.iohub.dev/antos/ using user name and password: demo/demo

If one wants to run AntOS VDE locally in their system, a docker image is available at:
https://github.com/lxsang/antosaio

API Documentation: https://doc.iohub.dev/antos

It has been a long time since version 0.x.x and now AntOS hits a major changes in its API. From version 1.0.0, AntOS no longer depends on Riot.js in its core UI API. This version introduces a brand new AntOS UI API called AFX API which is rewritten from bottom up. The entire AntOS core API is rewritten in Typescript (from Coffeescript) for better debugging, code maintenance and documenting.

Browser support: tested on Chrome, Firefox and partly Safari. Any browser that supports custom elements API should work. May have problem with Microsoft Edge.

AntOSDK tutorial: Developing a simple text editor

AntOS API in a nutshell

AntOS provides an abstract API for application development. The core API contains three main elements: the UI API, the VFS API and the VDB API, as shown in the following graph:

The UI API defines the basic UI elements such as Window, List, Tree, Dialogs, etc, and provides a generic interface for application and dialog UI development. UI design consists two steps: (1) the first step is to layout UI elements using antOS' scheme syntax (in XML format); (2) the second step is to handle user interaction using the coffeescript/ Javascript API.

AntOS v 0.2.4-alpha release

I have too many work in the last few months and don't have time to deal with some known bugs of AntOS until now. This v0.2.4-a release focuses on improvement and bugs fix

Project page: https://github.com/lxsang/antos
Demo: https://os.lxsang.me/
AntOSDK tutorial: https://blog.lxsang.me/r:id:20

Applications developed using AntOSDK can be found on this repository: https://github.com/lxsang/antosdk-apps. They can be used as example projects for AntOSDK

Change logs

  • Improve API code
  • Fix the menu UI not updating/refreshing bug. This bug affects some applications: MarketPlace, AntOSDK
  • Fix the fileview UI updating automatically when its window title changes. This bug affects following applications: NotePad, AntOSDK
  • Fix the setting bug in File and release new version
  • Fix bug on MarketPlace and release new version
  • Fix bug on NotePad and release new version
  • Fix bug on AntOSDK and release new version

WARNING: Due to some recent attacks on my server, the web terminal access is disabled for the user: demo. Someone tried to run a TOR relay on my server using that user, so i decided to disable the terminal access on the demo user. You can still login, but you can't use the shell

AntOS v 0.2.3-alpha release: AntOSDK - a development kit for AntOS application

A new release of AntOS, it is now in the beta state, but i'll keep the alpha branch on the release for a few further releases.

Change logs

  • Fix bugs and improve stability
  • DotEditor app is renamed to GraphEditor and use mermaid to generate graphs instead of dot
  • AntOS in now under GPLv3 licence, if you want to use it for comercial purpose, please contact me
  • Blogger is no longer default application, it is moved to MarketPlace
  • Add svg support to Preview
  • MarketPlace now can detect if an application update is available
  • Add AntoSDK, a development kit that allows to develop, build, and package your own application right in the browser, it is available on MarketPlace
  • New UI elements: afx-slider, tooltip

AntOS 0.2.0a "Localization" release

AntOS 0.2.0-alpha is out now. The big change in this release is the support of localization. The UI now support multi-languages rendering based on the current system locale setting.

Github: https://github.com/lxsang/antos
Demo: https://os.lxsang.me

Change logs

  • The API now automatically translate text base on the current system locale setting
  • Current locales supported:
    • English: en_GB
    • French: fr_FR
    • Vietnamese: vi_VN
    • More to come...
  • Update all packages to support the new localization mechanism
  • Some minor changes:
    • Font-awesome is used as default icon font for the entire system
    • Add Setting package for system configuration
    • Wallpaper, language, VFS and startup applications/services now can be configured via Setting
    • Bug fix on some packages: File, Market Place
    • Stability improvement

AntOS web desktop 0.1.11-alpha release

I've started the development of the AntOS web desktop long time ago, but this post is the first official pre-release of the project. The idea on a web-based desktop came when i worked on embed Linux and remote server. These system are often headless, so accessing the resource on these systems is not always obvious. The aim of this project is to develop a client core API that provides a desktop like experience to remotely access resource on the server using web technologies. AntOS is based on jQuery (for the API development) and Riot JS (for the UI), it is first designed to be used along with my antd HTTP(S) server and Lua based server side app, but can be adapted to be used with any server side languages (PHP, etc) and server, by implementing all the system calls API . Basically, application design for the web desktop relies on these system calls to communicating with the server. The API defines the core UI, system calls (to server), Virtual File system, virtual database and the necessary libraries for easing the development of applications. Applications can be developped with coffee/javascript/css without the need of a server side script.


(click image for the full size version)

Powered by antd server, (c) 2017 - 2024 Dany LE.This site does not use cookie, but some third-party contents (e.g. Youtube, Twitter) may do.