onstatic
![go-report](https://goreportcard.com/badge/github.com/sters/onstatic)
The onstatic is static page hosting controller.
Quick Start
Start application from Releases or yourself.
go run cmd/server/main.go
Then, do register. Like this.
curl -X POST -H "X-ONSTATIC-KEY: onstaticonstaticonstatic" -H "X-ONSTATIC-REPONAME: git@github.com:sters/onstatic.git" localhost:18888/register
And you can get SSH Public Key that register to Your git repository's access authentication.
Finally, do pull. Like this:
curl -v -X POST -H "X-ONSTATIC-KEY: onstaticonstaticonstatic" -H "X-ONSTATIC-REPONAME: git@github.com:sters/onstatic.git" localhost:18888/pull
You can get hashed repository name. Try access localhost:18888/{Hashed Repository Name}/{your file path}
.
Plugins
The plugin will run on another process. Even if your plugin has broken, it's no problem on onstatic itself. See plugins to understand implementations.
You need implement plugin.OnstaticPluginServer
on onstatic/plugin/plugin_grpc.pb.go and build it like this:
go build -o your_plugin_name your_plugin_dir/main.go;
Then, you need set binary file into .onstatic
dir on top of your repository. Like this:
- foobar_repository
- .onstatic
- foo
- bar
- other_dirs
- other_files
- more_other_files
onstatic will automatically load plugins and reflect to endpoints.
See conf/conf.go, onstatic/handler.go. You can customize it.