Gildas Chabot 6728e851bc Write to websocket only on plugins change 7 years ago
base64Encode be8a531fde Add Malifious filter 7 years ago
pluginSrc be8a531fde Add Malifious filter 7 years ago
PITCHME.md 2bfe62f371 Updated PITCHME 7 years ago
PITCHME.yaml ee4c7701f8 Add theme in PITCHME settings 7 years ago
README.md be8a531fde Add Malifious filter 7 years ago
buildAndRun.sh ec3b375789 Process image only on fs event on plugin folder 7 years ago
index.html c741deca92 Websockets for auto-reloading of the image 7 years ago
lca.jpg 6677a9a322 Move to image transform plugins + web server 7 years ago
main.go 6728e851bc Write to websocket only on plugins change 7 years ago

README.md

Run

Run with:

./buildAndRun.sh

To activate the plugins, move the .so files from the plugins.available directory to the plugins directory.

Todo

  • Malicious plugin -> read a folder and write to image
    • Check source code?
  • Panic in plugin?
  • In presentation
    • Add background about the solutions before the plugins: see the presentation from the dotGo.

Presentation

  • Add Go code at runtime
  • Works only on linux for now
  • Based on dlfcn.h (dynamic linking) with cgo

  • Only two functions: Open(path string) (*Plugin, error) and (p *Plugin) Lookup(symName string) (Symbol, error)

  • Two types: Plugin, Symbol

  • Nothing special on the code of the plugin, only the -buildmode=plugin build option

Example (from the doc):

p, err := plugin.Open("plugin_name.so")
if err != nil {
	panic(err)
}
v, err := p.Lookup("V")
if err != nil {
	panic(err)
}
f, err := p.Lookup("F")
if err != nil {
	panic(err)
}
*v.(*int) = 7
f.(func())() // prints "Hello, number 7"