-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of http://github.com/sipcapture/rtcagent
- Loading branch information
Showing
5 changed files
with
192 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: RTCAgent Builder | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [created] | ||
|
||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- name: Setup Build Env | ||
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com//sipcapture/rtcagent/master/builder/init_env.sh)" | ||
- name: Build RTCAgent | ||
run: make | ||
- name: Compress | ||
run: | | ||
strip bin/rtcagent | ||
upx bin/rtcagent | ||
- name: Check & Run | ||
run: | | ||
ls -alFh bin/rtcagent | ||
./bin/rtcagent --help | ||
- name: Patch NFPM Version | ||
run: | | ||
sudo sed -i "s/0.0.0/${{ github.ref_name }}/g" rtcagent.yml | ||
- name: Create deb package | ||
id: nfpm-deb | ||
uses: burningalchemist/nfpm-action@v1 | ||
env: | ||
VERSION: ${{ github.event.release.tag_name }} | ||
with: | ||
packager: deb | ||
config: rtcagent.yml | ||
target: rtcagent_${{ github.ref_name }}_all.deb | ||
- name: Create rpm package | ||
id: nfpm-rpm | ||
uses: burningalchemist/nfpm-action@v1 | ||
env: | ||
VERSION: ${{ github.event.release.tag_name }} | ||
with: | ||
packager: rpm | ||
config: rtcagent.yml | ||
target: rtcagent_${{ github.ref_name }}.amd64.rpm | ||
|
||
- name: Upload Release | ||
if: github.event_name != 'pull_request' | ||
uses: boxpositron/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
release_config: | | ||
./bin/rtcagent | ||
./rtcagent_${{ github.ref_name }}_all.deb | ||
./rtcagent_${{ github.ref_name }}.amd64.rpm | ||
tag_name: ${{ github.ref_name }} | ||
release_name: rtcagent_${{ github.ref_name }} | ||
draft: false | ||
prerelease: false | ||
overwrite: true | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker Build and push | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/sipcapture/rtcagent:latest | ||
ghcr.io/sipcapture/rtcagent:${{ github.ref_name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM alpine as builder | ||
RUN apk add --allow-untrusted --update --no-cache curl ca-certificates | ||
WORKDIR / | ||
RUN curl -fsSL github.com/sipcapture/rtcagent/releases/latest/download/rtcagent -O && chmod +x rtcagent | ||
|
||
FROM scratch | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /rtcagent /rtcagent | ||
CMD ["/rtcagent"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,107 @@ | ||
# RtcAgent | ||
<a href="https://github.com/sipcapture"> | ||
<img src="https://github.com/sipcapture/rtcagent/assets/1423657/e1d78a7e-cf2e-4775-9177-b0a730ba66c6" height=100> | ||
</a> | ||
|
||
The agent is focusing on VoIP/RTC Applications to make troubleshooting, support and monitoring much easily. | ||
RTCagent is an HEP/eBPF powered observability tool for VoIP/WebRTC Applications. | ||
|
||
The Project was inspired by Cilum, Odigos, eCapture. Thank you these projects for nice libraries, implementations and huge job! Without you it will be impossible! | ||
<br> | ||
|
||
> **Note** | ||
> | ||
> Supports Linux/Android kernel versions x86_64 4.18 and above, **aarch64 5.5** and above. | ||
> Does not support Windows and macOS system. | ||
---- | ||
### Made with eBPF | ||
Before proceeding, learn everything you need to know about [eBPF](https://ebpf.io) | ||
|
||
# What's eBPF | ||
[eBPF](https://ebpf.io) | ||
<a href="https://github.com/sipcapture"> | ||
<img src="https://github.com/sipcapture/rtcagent/assets/1423657/8a8d5057-12d0-432a-847e-80a8354825b6" height=400> | ||
</a> | ||
|
||
# How to compile | ||
Linux Kernel: >= 4.18. | ||
### Download | ||
Download an `amd64/x86` static build of `rtcagent` and use it immediately. | ||
```bash | ||
curl -fsSL github.com/sipcapture/rtcagent/releases/latest/download/rtcagent -O && chmod +x rtcagent | ||
``` | ||
|
||
Prefer using packages? Get the latest [deb and rpm](https://github.com/sipcapture/rtcagent/releases) releases for `amd64/x86` | ||
|
||
### Usage | ||
|
||
``` | ||
NAME: rtcagent - Capture and debug RTC Projects. | ||
USAGE: rtcagent [flags] | ||
COMMANDS: | ||
freeswitch capture SIP messages from freeswitch (libsofia): t_port, su_recv | ||
help Help about any command | ||
kamailio capture SIP messages from kamailio: recv_msg, udp_send, tcp_send. | ||
tcpdrop show tcp drops | ||
DESCRIPTION: | ||
RTCAgent is a tool that can capture and trace SIP packets using eBPF hooks and HEP | ||
Usage: | ||
rtcagent <command> -h | ||
## Tools | ||
OPTIONS: | ||
-d, --debug[=false] enable debug logging | ||
-h, --help[=false] help for rtcagent | ||
-P, --hep-port="9060" hep port - default 9060 | ||
-S, --hep-server="" hep server to duplicate: i.e. 10.0.0.1 | ||
-T, --hep-transport="udp" hep transport default udp. Can be udp, tcp, tls | ||
--hex[=false] print byte strings as hex encoded strings | ||
-l, --log-file="" -l save the packets to file | ||
--nosearch[=false] no lib search | ||
-p, --pid=0 if pid is 0 then we target all pids | ||
-u, --uid=0 if uid is 0 then we target all users | ||
-v, --version[=false] version for rtcagent | ||
``` | ||
|
||
<br> | ||
|
||
### Build | ||
|
||
> Compatible with Linux/Android kernel versions >= **x86_64 4.18**, >= **aarch64 5.5**.<br> | ||
> Linux only. Does not support Windows and macOS. | ||
#### Requirements | ||
* golang 1.18 or newer | ||
* clang 9.0 or newer | ||
* cmake 3.18.4 or newer | ||
* clang backend: llvm 9.0 or newer | ||
* kernel config:CONFIG_DEBUG_INFO_BTF=y | ||
|
||
## command | ||
#### Instructions | ||
|
||
### ubuntu | ||
##### Ubuntu | ||
If you are using Ubuntu 20.04 or later versions, you can use a single command to complete the initialization of the compilation environment. | ||
```shell | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com//sipcapture/rtcagent/master/builder/init_env.sh)" | ||
``` | ||
### other Linux | ||
In addition to the software listed in the 'Toolchain Version' section above, the following software is also required for the compilation environment. Please install it yourself. | ||
##### Any Linux | ||
In addition to the software listed in the 'Toolchain Version' section above, the following software is also required for the compilation environment. Please install before proceeding. | ||
|
||
* linux-tools-common | ||
* linux-tools-generic | ||
* pkgconf | ||
* libelf-dev | ||
|
||
**Clone the repository code and compile it** | ||
**Clone the repository code and compile** | ||
```shell | ||
git clone [email protected]:/sipcapture/rtcagent.git | ||
cd rtcagent | ||
make | ||
bin/rtcagent | ||
``` | ||
## compile without BTF | ||
RtcAgent support BTF disabled with command `make nocore` to compile at 2022/04/17. It can work normally even on Linux systems that do not support BTF. | ||
#### compile without BTF | ||
RTCAgent support BTF disabled with command `make nocore` to compile at 2022/04/17 and can run on Linux systems that do not support BTF. | ||
```shell | ||
make nocore | ||
bin/rtcagent --help | ||
``` | ||
|
||
<br> | ||
|
||
### Credits | ||
|
||
RTCAgent is inspired by Cilum, Odigos, eCapture and the many eBPF guides, libraries and implementations. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: rtcagent | ||
arch: amd64 | ||
platform: linux | ||
version: 0.0.0 | ||
release: 1 | ||
section: default | ||
priority: extra | ||
replaces: | ||
- rtcagent | ||
provides: | ||
- rtcagent | ||
maintainer: Alexandr Dubovikob <[email protected]> | ||
description: RTCagent is a HEP/eBPF sniffer for VoiP/RTC Applications | ||
vendor: sipcapture.org | ||
homepage: http://sipcapture.org | ||
license: AGPLv3 | ||
contents: | ||
- src: ./bin/rtcagent | ||
dst: /usr/bin/rtcagent |