onstatic

module
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2023 License: MIT

README

onstatic

go codecov go-report

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.

Other Information

See conf/conf.go, onstatic/handler.go. You can customize it.

Directories

Path Synopsis
cmd
plugins

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL