feat: updated pkg implementations
This commit is contained in:
parent
86f37555b2
commit
8b161135ff
10 changed files with 579 additions and 140 deletions
|
|
@ -4,48 +4,67 @@ const (
|
|||
RELPATH_PLUGINS = "/plugins"
|
||||
RELPATH_PROFILES = "/profiles"
|
||||
RELPATH_DATA = "/data"
|
||||
RELPATH_METADATA = "/.configurator"
|
||||
RELPATH_METADATA = "/.makeshift"
|
||||
RELPATH_HELP = RELPATH_DATA + "/index.html"
|
||||
RELPATH_PROFILE = RELPATH_PROFILES + "/default.json"
|
||||
|
||||
PATH_CONFIG = "$HOME/.config/makeshift/config.yaml"
|
||||
|
||||
DEFAULT_TIMEOUT_IN_SECS = 60
|
||||
DEFAULT_PLUGINS_MAX_COUNT = 64
|
||||
DEFAULT_PLUGINS_MAX_COUNT = 32
|
||||
DEFAULT_PROFILES_MAX_COUNT = 256
|
||||
DEFAULT_METADATA = ``
|
||||
DEFAULT_HOME = `
|
||||
|
||||
FILE_METADATA = ``
|
||||
FILE_HOME_PAGE = `
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<p>
|
||||
# setup environment variables</br>
|
||||
export CONFIGURATOR_HOST={{ configurator.host }}</br>
|
||||
export CONFIGURATOR_PATH={{ configurator.path }}</br>
|
||||
export CONFIGURATOR_SERVER_ROOT={{ configurator.server_root }}</br>
|
||||
export MAKESHIFT_HOST={{ makeshift.host }}</br>
|
||||
export MAKESHIFT_PATH={{ makeshift.path }}</br>
|
||||
export MAKESHIFT_SERVER_ROOT={{ makeshift.server.root }}</br>
|
||||
</br>
|
||||
# start the service</br>
|
||||
configurator serve --root $HOME/apps/configurator/server --init</br>
|
||||
makeshift serve --root $HOME/apps/makeshift/server --init</br>
|
||||
</br>
|
||||
# download a file or directory (as archive)</br>
|
||||
configurator download</br>
|
||||
configurator download --host http://localhost:5050 --path help.txt</br>
|
||||
makeshift download</br>
|
||||
makeshift download --host http://localhost:5050 --path help.txt</br>
|
||||
</br>
|
||||
# download files with rendering using plugins</br>
|
||||
configurator download --plugins smd,jinja2 --profile compute</br>
|
||||
curl $CONFIGURATOR_HOST/download/help.txt?plugins=smd,jinja2</br>
|
||||
makeshift download --plugins smd,jinja2 --profile compute</br>
|
||||
curl $MAKESHIFT_HOST/download/help.txt?plugins=smd,jinja2</br>
|
||||
</br>
|
||||
# upload a file or directory (recursively)</br>
|
||||
configurator upload</br>
|
||||
configurator upload --host http://localhost:5050 --path help.txt</br>
|
||||
makeshift upload</br>
|
||||
makeshift upload --host http://localhost:5050 --path help.txt</br>
|
||||
</br>
|
||||
# list the files in a directory</br>
|
||||
configurator list --path help.txt</br>
|
||||
configurator list --host http://localhost:5050 --path help.txt</br>
|
||||
makeshift list --path help.txt</br>
|
||||
makeshift list --host http://localhost:5050 --path help.txt</br>
|
||||
curl http://localhost:5050/list/test</br>
|
||||
</p>
|
||||
<body>
|
||||
</html>
|
||||
`
|
||||
FILE_DEFAULT_PROFILE = `
|
||||
{
|
||||
"id": "default",
|
||||
"description": "Makeshift default profile",
|
||||
"data": {
|
||||
"makeshift": {
|
||||
"host": "localhost",
|
||||
"path": "/test",
|
||||
"server": {
|
||||
"root": "/test"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
)
|
||||
|
||||
// configurator.host: https://example.com
|
||||
// configurator.path: test
|
||||
// configurator.server_root: $HOME/apps/configurator
|
||||
// makeshift.host: https://localhost:5050
|
||||
// makeshift.path: test
|
||||
// makeshift.server.root: $HOME/apps/makeshift
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue