Skip to content

shakg/g-systemctl

Repository files navigation

G-Systemctl

g-systemctl is a graphical user interface for your services in *nix systems. You can see all of your service deamons, search and filter them, and control them.

Current Design WIP Design
old-design main

Table of Contents

Prerequisites

  • Go (Golang): Install Go
  • A web browser for frontend testing

Installation

  1. Clone the repository:

    git clone https://github.com/shakg/g-systemctl.git
    cd g-systemctl
  2. Build the project:

    go build src/server.go

One-Line Release Download

curl https://api.github.com/repos/shakg/g-systemctl/releases/latest | jq '.assets[0].browser_download_url' | xargs wget

Start development environment:

docker compose up

Build for production:

docker-compose -f docker-compose.prod.yml up --build

Usage

chmod +x server

and

./server <port>

could be any free port in your system; for example, 8080.

Running the Server

To start the server, run the executable or use go run with the following command:

./server <port>
# or
go run server.go <port> 

Replace <port> with the desired port number (e.g., 8080).

! IMPORTANT, run with sudo if password needed

The server will be accessible at http://localhost:<port>.

API

The API endpoint provides information about the running system's status.

  • Endpoint: /api
  • Method: GET

Example response:

[
   {
      "unit":"accounts-daemon.service",
      "load":"loaded",
      "active":"active",
      "sub":"running",
      "description":"Accounts"
   },
   {
      "unit":"acpid.service",
      "load":"loaded",
      "active":"active",
      "sub":"running",
      "description":"ACPI"
   }
]

Service

The service endpoint enables us to start and stop services.

  • Endpoint: /service
  • Method: GET

Example Usage:

/service?open=true&service_name=MyService

Frontend

The frontend of this project consists of vanilla HTML and JavaScript. The frontend files are served at the root path ("/").

  • HTML File: index.html
  • JavaScript File: app.js

You can access the frontend at http://localhost:<port>.

Contributing

Contributions are welcome! Please follow the Contributing Guidelines for details on how to contribute to this project.

About

graphical systemctl to manage services

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 5