Compare commits
No commits in common. "3e29e04ac3266629f3d6578e6e72917235129c01" and "25cf158c3ac5b6cd94e14519a66498fb5cd09fdc" have entirely different histories.
3e29e04ac3
...
25cf158c3a
8 changed files with 27 additions and 119 deletions
|
@ -10,11 +10,6 @@ repos:
|
||||||
rev: v2.4.1
|
rev: v2.4.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: prettier
|
- id: prettier
|
||||||
- repo: https://github.com/dudefellah/pre-commit-openapi
|
|
||||||
rev: "v0.0.1"
|
|
||||||
hooks:
|
|
||||||
- id: check-openapi
|
|
||||||
|
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: tsc
|
- id: tsc
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -4,6 +4,7 @@ UI_DIR=./ui
|
||||||
VERSION=$(shell git tag --sort=-version:refname | head -n 1)
|
VERSION=$(shell git tag --sort=-version:refname | head -n 1)
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
|
go get -t ./src/...
|
||||||
cd ${UI_DIR} && pnpm install
|
cd ${UI_DIR} && pnpm install
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
@ -16,7 +17,3 @@ build-server:
|
||||||
go build -tags prod -ldflags "-s -w -X code.thetadev.de/TSGRain/SEBRAUC/src/util.version=${VERSION}" -o build/sebrauc ./src/.
|
go build -tags prod -ldflags "-s -w -X code.thetadev.de/TSGRain/SEBRAUC/src/util.version=${VERSION}" -o build/sebrauc ./src/.
|
||||||
|
|
||||||
build: build-ui build-server
|
build: build-ui build-server
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f build/*
|
|
||||||
rm -rf ${UI_DIR}/dist/**
|
|
||||||
|
|
134
openapi.yml
134
openapi.yml
|
@ -1,48 +1,27 @@
|
||||||
openapi: 3.0.3
|
openapi: "3.0.3"
|
||||||
info:
|
info:
|
||||||
title: SEBRAUC
|
title: SEBRAUC
|
||||||
version: 0.1.0
|
version: "0.0.1"
|
||||||
description: REST API for the SEBRAUC firmware updater
|
|
||||||
servers:
|
servers:
|
||||||
- url: http://localhost:8080/api
|
- url: http://localhost:8080/api
|
||||||
paths:
|
paths:
|
||||||
/status:
|
/status:
|
||||||
get:
|
get:
|
||||||
operationId: getStatus
|
|
||||||
responses:
|
responses:
|
||||||
200:
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
content:
|
content:
|
||||||
application/json:
|
"application/json":
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/RaucStatus"
|
$ref: "#/components/schemas/RaucStatus"
|
||||||
default:
|
default:
|
||||||
description: Server error
|
description: "Server error"
|
||||||
content:
|
content:
|
||||||
application/json:
|
"application/json":
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/StatusMessage"
|
$ref: "#/components/schemas/StatusMessage"
|
||||||
|
|
||||||
/info:
|
|
||||||
get:
|
|
||||||
operationId: getInfo
|
|
||||||
responses:
|
|
||||||
200:
|
|
||||||
description: OK
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: "#/components/schemas/SystemInfo"
|
|
||||||
default:
|
|
||||||
description: Server error
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: "#/components/schemas/StatusMessage"
|
|
||||||
|
|
||||||
/update:
|
/update:
|
||||||
post:
|
post:
|
||||||
operationId: startUpdate
|
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
multipart/form-data:
|
multipart/form-data:
|
||||||
|
@ -53,33 +32,32 @@ paths:
|
||||||
type: string
|
type: string
|
||||||
format: binary
|
format: binary
|
||||||
responses:
|
responses:
|
||||||
200:
|
"200":
|
||||||
description: OK
|
description: "OK"
|
||||||
content:
|
content:
|
||||||
application/json:
|
"application/json":
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/StatusMessage"
|
$ref: "#/components/schemas/StatusMessage"
|
||||||
default:
|
default:
|
||||||
description: Server error
|
description: "Server error"
|
||||||
content:
|
content:
|
||||||
application/json:
|
"application/json":
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/StatusMessage"
|
$ref: "#/components/schemas/StatusMessage"
|
||||||
|
|
||||||
/reboot:
|
/reboot:
|
||||||
post:
|
post:
|
||||||
operationId: startReboot
|
|
||||||
responses:
|
responses:
|
||||||
200:
|
"200":
|
||||||
description: OK
|
description: "OK"
|
||||||
content:
|
content:
|
||||||
application/json:
|
"application/json":
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/StatusMessage"
|
$ref: "#/components/schemas/StatusMessage"
|
||||||
default:
|
default:
|
||||||
description: Server error
|
description: "Server error"
|
||||||
content:
|
content:
|
||||||
application/json:
|
"application/json":
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/StatusMessage"
|
$ref: "#/components/schemas/StatusMessage"
|
||||||
|
|
||||||
|
@ -89,23 +67,23 @@ components:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
installing:
|
installing:
|
||||||
description: True if the installer is running
|
description: "True if the installer is running"
|
||||||
type: boolean
|
type: boolean
|
||||||
percent:
|
percent:
|
||||||
description: Installation progress
|
description: "Installation progress"
|
||||||
type: integer
|
type: integer
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
message:
|
message:
|
||||||
description: Current installation step
|
description: "Current installation step"
|
||||||
type: string
|
type: string
|
||||||
example: Copying image to rootfs.0
|
example: "Copying image to rootfs.0"
|
||||||
last_error:
|
last_error:
|
||||||
description: Installation error message
|
description: "Installation error message"
|
||||||
type: string
|
type: string
|
||||||
example: "Failed to check bundle identifier: Invalid identifier. Did you pass a valid RAUC bundle?"
|
example: "Failed to check bundle identifier: Invalid identifier. Did you pass a valid RAUC bundle?"
|
||||||
log:
|
log:
|
||||||
description: Full command line output of the current installation
|
description: "Full command line output of the current installation"
|
||||||
type: string
|
type: string
|
||||||
example: "0% Installing\n0% Determining slot states\n20% Determining slot states done.\n"
|
example: "0% Installing\n0% Determining slot states\n20% Determining slot states done.\n"
|
||||||
required:
|
required:
|
||||||
|
@ -115,77 +93,15 @@ components:
|
||||||
- last_error
|
- last_error
|
||||||
- log
|
- log
|
||||||
|
|
||||||
SystemInfo:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
os_name:
|
|
||||||
description: Name of the os distribution
|
|
||||||
type: string
|
|
||||||
example: "Poky"
|
|
||||||
os_version:
|
|
||||||
description: Operating system version
|
|
||||||
type: string
|
|
||||||
example: "1.0.2"
|
|
||||||
uptime:
|
|
||||||
description: System uptime in seconds
|
|
||||||
type: integer
|
|
||||||
example: 5832
|
|
||||||
rauc_compatible:
|
|
||||||
description: Compatible firmware name
|
|
||||||
type: string
|
|
||||||
example: "Poky"
|
|
||||||
rauc_variant:
|
|
||||||
description: Compatible firmware variant
|
|
||||||
type: string
|
|
||||||
example: "rpi-prod"
|
|
||||||
rauc_booted:
|
|
||||||
description: Currently booted rootfs
|
|
||||||
type: string
|
|
||||||
example: "rootfs.0"
|
|
||||||
rauc_boot_primary:
|
|
||||||
description: Primary rootfs to boot from
|
|
||||||
type: string
|
|
||||||
example: "rootfs.1"
|
|
||||||
rauc_rootfs:
|
|
||||||
description: List of RAUC root filesystems
|
|
||||||
type: object
|
|
||||||
additionalProperties:
|
|
||||||
$ref: "#/components/schemas/RaucFS"
|
|
||||||
|
|
||||||
RaucFS:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
device:
|
|
||||||
description: Block device
|
|
||||||
type: string
|
|
||||||
example: "/dev/mmcblk0p2"
|
|
||||||
type:
|
|
||||||
description: Filesystem
|
|
||||||
type: string
|
|
||||||
example: ext4
|
|
||||||
state:
|
|
||||||
description: Current state of filesystem
|
|
||||||
type: string
|
|
||||||
enum: [active, inactive, booted]
|
|
||||||
example: booted
|
|
||||||
mountpoint:
|
|
||||||
description: Mount path (null when not mounted)
|
|
||||||
type: string
|
|
||||||
nullable: true
|
|
||||||
example: "/"
|
|
||||||
bootable:
|
|
||||||
description: "Is the filesystem bootable"
|
|
||||||
type: boolean
|
|
||||||
|
|
||||||
StatusMessage:
|
StatusMessage:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
success:
|
success:
|
||||||
description: Is operation successful
|
description: "Is operation successful"
|
||||||
type: boolean
|
type: boolean
|
||||||
msg:
|
msg:
|
||||||
description: Success message
|
description: "Success message"
|
||||||
type: string
|
type: string
|
||||||
example: Update started
|
example: "Update started"
|
||||||
required:
|
required:
|
||||||
- msg
|
- msg
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {Component} from "preact"
|
import {Component} from "preact"
|
||||||
import Updater from "./Updater/Updater"
|
import Updater from "./Upload/Updater"
|
||||||
import logo from "../assets/logo.svg"
|
import logo from "../assets/logo.svg"
|
||||||
import {version} from "../util/version"
|
import {version} from "../util/version"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue