Trust, this'll be cool.
  • JavaScript 66.9%
  • Vue 11.2%
  • CSS 6.4%
  • HTML 5.3%
  • Go 4.9%
  • Other 5.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-06-02 06:35:55 +00:00
.github Update issue templates 2023-07-15 19:46:49 +05:30
docs fix: doc typos 2024-05-25 11:47:27 +00:00
filebrowser-ui update: deps 2023-10-27 23:31:53 +05:30
other update: geip db 2024-05-25 11:43:42 +00:00
ui add: TZ metric 2024-06-02 06:35:40 +00:00
.dockerignore Added Docker Image Support 2023-06-04 06:45:53 +00:00
.gitignore add: initial ip ban feature 2023-10-03 22:57:06 +05:30
ban.go fix: ban api 2023-10-11 21:38:15 +05:30
client.go fix: race in client deletion 2024-01-13 08:41:57 +00:00
config.go add: openobserve compatability to metric logger 2024-02-21 16:44:54 +00:00
config_example.yaml add: openobserve compatability to metric logger 2024-02-21 16:44:54 +00:00
desktop.go del: removed uncessary logs 2023-11-13 10:25:18 +00:00
docker-compose.yaml update: docs and utilities 2024-01-30 17:06:09 +00:00
Dockerfile fix: docker build 2024-04-06 11:29:03 +00:00
filebrowser.go fix: add content types header,typo fixes 2023-11-13 09:53:23 +00:00
geoip.go fix: nil defer issue 2023-11-24 16:55:13 +00:00
go.mod add: country info to logger 2023-09-18 20:18:54 +05:30
go.sum add: country info to logger 2023-09-18 20:18:54 +05:30
LICENSE Create LICENSE 2023-02-15 18:04:12 +05:30
main.go add: TZ metric 2024-06-02 06:35:40 +00:00
Makefile Reduce Lock Contention 2023-06-30 15:02:11 +05:30
metrics.go add: TZ metric 2024-06-02 06:35:40 +00:00
README.md Updated Readme 2023-07-01 10:41:34 +05:30
router.go add: admin utilities, client kill 2023-10-28 23:52:16 +05:30
service.go Reduce Lock Contention 2023-06-30 15:02:11 +05:30
ssh.go fix: refactored code, add more metrics to admin api 2023-10-24 07:30:18 +00:00
terminal.go del: removed uncessary logs 2023-11-13 10:25:18 +00:00
ui.go update: refactored router, bound ban endpoints 2023-10-04 22:14:43 +05:30
utils.go fix: add content types header,typo fixes 2023-11-13 09:53:23 +00:00
wsvnc.go fix: mem leak in timeout 2024-04-06 11:06:20 +00:00

Segfault UI

A UI frontend for the services provided by segfault.

segfault

Install With Docker

  • Clone the repo : git clone https://github.com/messede-degod/SF-UI && cd SF-UI
  • Make any changes to config.yaml if you wish
  • Build the image: sudo docker build -t sfui .
  • Run the container: sudo docker compose up -d
  • Access SFUI at http://localhost:7171

Regular Installation

Install Deps

  • Install Basics: sudo apt install -y npm make golang

  • Install Angular: npm install -g @angular/cli

  • Install JS Deps: cd ui && npm install

Building

  • Run make all to build the complete application, binary can be found in the bin directory.

Recipes to build individual components

  • Run make filebrowser to build the filebrowser UI (Run this only if building for the first time, or the filebrowser sources have changed).

  • Run make UI to build the UI (Run this only if building for the first time, or the UI sources have changed).

  • Run make prod to build a production ready static binary (Run make UI if neccessary beforehand).

Install & Run

Run ./bin/sfui -install to install sfui, visit http://127.0.0.1:7171 in browser to access SFUI. From here on use systemctl to control sfui.

Development environment

  • Start Angular dev server by runnning cd ui and ng serve -c development
  • Start SFUI local server by running make dev and ./bin/sfui, make sure you have debug set to true in config.yaml.

How it works


             Websockets          SSH-Over-TCP

WebBrowser <------------> SFUI <-------------> Segfault

SFUI starts by accepting a secret and a domain (ex: segfault.net, de.segfault.net .etc) from the user, it then establishes a connection to the given segfault domain using the secret (this is similar to running ssh -o "SetEnv SECRET=aabbccddefgh" root@segfault.net), once the SSH connection is established, SFUI attaches the obatined SSH shell to a websocket endpoint (/ws),

xterm.js then allows the web browser to interact with the websocket, hence enabling the user to interact with the shell.

Info

Application currently embeds the UI files into binary, using go's embed feature (this is for convenience).

In production it may be preferable to serve the UI content using a webserver like nginx, See other/nginx/Readme.md for further instructions.

Consider increasing ulimit if serving large number of clients

Acknowledgement

This project is inspired by :

This project uses :