From a7df1fa687ec92eba66eb160909f85952ea79499 Mon Sep 17 00:00:00 2001 From: asandikci Date: Thu, 24 Aug 2023 21:06:05 +0300 Subject: [PATCH] push latest changes --- README.md | 26 ++++++------------- cmd/ahenk-go/main.go | 5 ---- cmd/ahenk-go/plugin-manager.go | 5 ++++ cmd/ahenk-go/plugin-opener.go | 4 +-- .../{ahenkd-go.service => ahenk-go.service} | 0 5 files changed, 15 insertions(+), 25 deletions(-) rename debian/{ahenkd-go.service => ahenk-go.service} (100%) diff --git a/README.md b/README.md index 6ee79c2..e18b188 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,6 @@ Ahenk-go is a Linux agent written in Go which enables Lider to manage & monitor clients remotely. -### Creating Docker Development Environment (Optional) -1. Install and Create docker environment, [Quick Start](https://sulincix.github.io/sayfalar/html/docker-kullanimi.html) -2. Pull docker image -```sh -docker pull asandikci/godeb -``` -> Or alternatively build Dockerfile with `docker build -t godeb:latest` code for lower data usage - -3. Create container from image and attach to container, an example: -```sh -docker run -it -d --name build1 asandikci/godeb:latest "bin/bash" -docker attach build1 --detach-keys "ctrl-k" -``` ## Packaging 1. Install necessary packages (You dont need this step if you are using docker file) ```sh @@ -34,8 +21,9 @@ dpkg-buildpackage > Refer to Makefile for more info ### Documentation -- See [Liderahenk/ahenk-docs](https://git.aliberksandikci.com.tr/Liderahenk/ahenk-docs/) for comprehensively prepared documentation. - +- See comprehensively prepared [documentation](https://git.aliberksandikci.com.tr/Liderahenk/ahenk-docs/) +- See how to [setup development environment](https://git.aliberksandikci.com.tr/Liderahenk/ahenk-docs/src/branch/main/dev/environment.md) + ## Other Liderahenk Projects - [Pardus-LiderAhenk/ahenk](https://github.com/Pardus-LiderAhenk/ahenk/): Current Python Implementation of Ahenk @@ -47,9 +35,11 @@ dpkg-buildpackage ## Changelog -See [changelog](./debian/changelog) to learn what have been changed between releases or refer to [Releases](./releases) Tab above - +- [ahenk-docs/admin/changelog](https://git.aliberksandikci.com.tr/Liderahenk/ahenk-docs/src/branch/main/admin/changelog.md): changes between releases with easy-to-understand annotations +- [ahenk-docs/dev/changelog](https://git.aliberksandikci.com.tr/Liderahenk/ahenk-docs/src/branch/main/dev/changelog.md): detailed development changelog, includes all issues, feature implementations, breaking changes, code comments, todo etc. - **long** +- [debian/changelog](./debian/changelog): changes between debian releases + ## License -Lider Ahenk and its sub projects are licensed under the [LGPL v3](./LICENSE). +Liderahenk and its sub projects are licensed under the [LGPL v3](./LICENSE). diff --git a/cmd/ahenk-go/main.go b/cmd/ahenk-go/main.go index 72afee4..ac957e9 100644 --- a/cmd/ahenk-go/main.go +++ b/cmd/ahenk-go/main.go @@ -4,7 +4,6 @@ import ( "log" "os" "syscall" - "time" "git.aliberksandikci.com.tr/Liderahenk/ahenk-go/pkg/utils" @@ -56,10 +55,6 @@ func main() { f := utils.OpenLogFile(LogFile) defer f.Close() log.SetOutput(f) - log.Printf("Log test") - - time.Sleep(10 * time.Second) - log.Print("Killed") case "tmptest": log.Print("TEMPORARY TEST STARTED, log files are NOT redirecting!") } diff --git a/cmd/ahenk-go/plugin-manager.go b/cmd/ahenk-go/plugin-manager.go index 7aa4bdf..26e85c3 100644 --- a/cmd/ahenk-go/plugin-manager.go +++ b/cmd/ahenk-go/plugin-manager.go @@ -10,10 +10,15 @@ type Resources interface { AgentInfo() map[string]interface{} } +// type NewPluginInterface interface { +// PluginMethod() returnType +// } + // Loads Plugins and runs them. // When you create a new plugin create a new interface and call this plugin in this function func PluginManager() { var resources Resources = LoadPlugin("resources").(Resources) + // var pluginName NewPluginInterface = LoadPlugin("pluginName").(NewPluginInterface) for { logPlugin("AgentInfo", resources.AgentInfo()) time.Sleep(30 * time.Second) diff --git a/cmd/ahenk-go/plugin-opener.go b/cmd/ahenk-go/plugin-opener.go index ba26b37..123422f 100644 --- a/cmd/ahenk-go/plugin-opener.go +++ b/cmd/ahenk-go/plugin-opener.go @@ -19,11 +19,11 @@ func LoadPlugin(plugName string) interface{} { utils.Check(err) // TODO also allow lookup another symbol other than PlugnameConnect - symGreeter, err := plug.Lookup(utils.FirstUpperEN(plugName) + "Connect") + symPlug, err := plug.Lookup(utils.FirstUpperEN(plugName) + "Connect") utils.Check(err) var plugOut interface{} - plugOut, ok := symGreeter.(interface{}) + plugOut, ok := symPlug.(interface{}) if !ok { fmt.Println("unexpected type from module symbol") os.Exit(1) diff --git a/debian/ahenkd-go.service b/debian/ahenk-go.service similarity index 100% rename from debian/ahenkd-go.service rename to debian/ahenk-go.service