<commit_before># sysadm

Official repo for PC-BSD's sysadm utility and websocket server

###

This repo contains all the Qt5 code necessary to build the following:

```

 sysadm-daemon - Backend daemon which handles all middleware / library
                 requests and functionality

     sysadm-ws - Websocket server, which handles incoming requests
                 for both remote and local wss:// connections 

        sysadm - Command line interface to send/recv json requests
```<commit_msg>Update the SysAdm README with much more useful information<commit_after># SysAdm

Official repo for PC-BSD's sysadm middleware WebSocket & REST server

This middleware acts as the core for controlling a PC-BSD or FreeBSD system either locally or remotely via WebSockets or REST.

### Required Qt Modules

Qt5 Core
Qt5 Concurrent
Qt5 Websockets

### Building SysAdm

```
% git clone https://github.com/pcbsd/sysadm.git
% cd sysadm/src
% /usr/local/lib/qt5/bin/qmake -recursive
% make && sudo make install
```

### Starting SysAdm

```
(For WebSockets - Required for SysAdm Client)
% sudo sysrc -f /etc/rc.conf sysadm_websocket_enable="YES"
% sudo service sysadm-websocket start

(Optional for REST)
% sudo sysrc -f /etc/rc.conf sysadm_restserver_enable="YES"
% sudo service sysadm-restserver start
```

### API Documentation

https://api.pcbsd.org

### Contributing new API calls

Adding new API calls to the middleware is very straight-forward, simply add a new function which accepts JSON in, and returns JSON, then connect it to the backend.

Example:
https://github.com/pcbsd/sysadm/commit/4d3b590f460d301b9376a063f9407dabfd7c9c66

### Adding new Classes for API calls

Adding a new API class requires tweaking a few more files than a new API call only.

Example:
https://github.com/pcbsd/sysadm/commit/1ba65b33880e2298ade3e5cc4f2718aa6112e44f

{'fraction_non_alphanumeric': 0.07638136511375948, 'fraction_numerical': 0.030335861321776816, 'mean_word_length': 4.005420054200542, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4239882', 'n_tokens_mistral': 633, 'n_tokens_neox': 550, 'n_words': 209}