Go to file
evanchen db1f9f3ee8 wip/refact-lib (#36)
Co-authored-by: Evan Chen <evanchen@kumoly.io>
Co-authored-by: Evan <evanchen333@gmail.com>
Reviewed-on: #36
Co-authored-by: evanchen <evanchen@kumoly.io>
Co-committed-by: evanchen <evanchen@kumoly.io>
2021-10-23 04:56:24 +00:00
cmd/configui wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
docs wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
public wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
src wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
templates wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
.dockerignore build: add npm 2021-10-19 14:32:10 +08:00
.gitignore wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
CHANGELOG.md wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
Dockerfile wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
Makefile wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
README.md wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
app.go wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
configui.go wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
file.go wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
go.mod first commit 2021-10-18 16:49:16 +08:00
handler.go wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
netutil.go wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
package-lock.json tmp 2021-10-21 19:00:25 +08:00
package.json tmp 2021-10-21 19:00:25 +08:00
release.sh feat: #26, #21 fix: #34 2021-10-21 16:04:57 +08:00
server.go wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00
util.go wip/refact-lib (#36) 2021-10-23 04:56:24 +00:00

README.md

Config UI

a web app to edit and action on update powered by ACE

Usage: configui [options]
  -allow string
        IPs to allow, blank to allow all
  -bind string
        address to bind (default "0.0.0.0:8000")
  -c string
        cmd to apply
  -f string
        path to config file
  -log string
        log to file
  -n string
        Name of file
  -p string
        path to file, precedence over config
  -static
        disable config api
  -v    show version

Install

sudo rm -f /usr/local/bin/configui
sudo sh -c "curl -fsSL RELEASE_URL | tar -C /usr/local/bin/ -xz"

Config

[
	{
		"path": "configui.log",
		"ro": true
	},
	{
		"path": "etc/test.ini",
		"name": "test",
		"action": "myip local -P"
	}
]

configui -f PATH/TO/CONFIG

Systemd

; /etc/systemd/system/configui.service
[Unit]
Description=CoonfigUI Server

[Service]
WorkingDirectory=/home/ubuntu/ConfigUI
ExecStart=configui -log access.log -f conf.json -bind 0.0.0.0:80
Restart=always

[Install]
WantedBy=multi-user.target

Api

Files

GET /api/files

res:

{
  "test": {
    "path": "test",
    "name": "test",
    "action": "myip local -P",
    "data": ""
  }
}

File

GET /api/file?name=Name

res:

{
  "action": "myip local -P",
  "data": "test",
  "name": "test",
  "path": "test"
}

Update

POST /api/file

req:

{
  "data": "test",
  "name": "test",
}

Apply

POST /api/apply?name=Name