diff --git a/.swp b/.swp deleted file mode 100644 index 43b4af2d..00000000 Binary files a/.swp and /dev/null differ diff --git a/api-docs/openapi.json b/api-docs/openapi.json index 8f4e0d66..97ed3857 100644 --- a/api-docs/openapi.json +++ b/api-docs/openapi.json @@ -4,7 +4,7 @@ "description": "REST API for Cosmos Cloud server management", "title": "Cosmos Server API", "contact": {}, - "version": "0.22.35" + "version": "0.23.00-unstable001" }, "paths": { "/_logs": { @@ -3113,6 +3113,62 @@ } } }, + "/api/constellation/force-reform": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "HA only. Bumps the op-log epoch, drops local JetStream state, blocks the other managers and restarts NATS, leaving this node writable in formation mode so replacements can be enrolled. Does not touch the CA, keys, config or device data.", + "tags": [ + "constellation" + ], + "summary": "Force the constellation to re-form around this manager", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.APIResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.HTTPErrorResult" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.HTTPErrorResult" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.HTTPErrorResult" + } + } + } + } + } + } + }, "/api/constellation/get-next-ip": { "get": { "security": [ diff --git a/api-docs/swagger.json b/api-docs/swagger.json index f7a019e6..4813cb4c 100644 --- a/api-docs/swagger.json +++ b/api-docs/swagger.json @@ -4,7 +4,7 @@ "description": "REST API for Cosmos Cloud server management", "title": "Cosmos Server API", "contact": {}, - "version": "0.22.35" + "version": "0.23.00-unstable001" }, "basePath": "/cosmos", "paths": { @@ -2563,6 +2563,49 @@ } } }, + "/api/constellation/force-reform": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "HA only. Bumps the op-log epoch, drops local JetStream state, blocks the other managers and restarts NATS, leaving this node writable in formation mode so replacements can be enrolled. Does not touch the CA, keys, config or device data.", + "produces": [ + "application/json" + ], + "tags": [ + "constellation" + ], + "summary": "Force the constellation to re-form around this manager", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/utils.APIResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/utils.HTTPErrorResult" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/utils.HTTPErrorResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/utils.HTTPErrorResult" + } + } + } + } + }, "/api/constellation/get-next-ip": { "get": { "security": [ diff --git a/api-docs/swagger.yaml b/api-docs/swagger.yaml index 2d6af002..61bc9ee7 100644 --- a/api-docs/swagger.yaml +++ b/api-docs/swagger.yaml @@ -2061,7 +2061,7 @@ info: contact: {} description: REST API for Cosmos Cloud server management title: Cosmos Server API - version: 0.22.35 + version: 0.23.00-unstable001 paths: /_logs: get: @@ -3694,6 +3694,36 @@ paths: summary: Edit the current Constellation device properties tags: - constellation + /api/constellation/force-reform: + post: + description: HA only. Bumps the op-log epoch, drops local JetStream state, blocks + the other managers and restarts NATS, leaving this node writable in formation + mode so replacements can be enrolled. Does not touch the CA, keys, config + or device data. + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/utils.APIResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/utils.HTTPErrorResult' + "403": + description: Forbidden + schema: + $ref: '#/definitions/utils.HTTPErrorResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/utils.HTTPErrorResult' + security: + - BearerAuth: [] + summary: Force the constellation to re-form around this manager + tags: + - constellation /api/constellation/get-next-ip: get: produces: diff --git a/changelog.md b/changelog.md index f17bc88d..24c5efd0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +## Version 0.23.00 + - Remove Lungo, use SQLite instead + - Remove date base sync - use message based sync + - Fix a couple of Constellation DNS resolution issues + - Fix quirks with inverted setups (agent is private) + ## Version 0.22.35 - Fix "JetStream Unavailable" once and for all (hopefully :p ) - Fix rare race condition breaking config file diff --git a/client/src/api/constellation.tsx b/client/src/api/constellation.tsx index 08f9449c..20e54d20 100644 --- a/client/src/api/constellation.tsx +++ b/client/src/api/constellation.tsx @@ -98,6 +98,16 @@ export default function createConstellationAPI(apiFetch: ApiFetch) { })) } + // HA only: re-form the constellation around this manager after a lost quorum + function forceReform() { + return wrap(apiFetch('/cosmos/api/constellation/force-reform', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + } + })) + } + function getConfig() { return wrap(apiFetch('/cosmos/api/constellation/config', { method: 'GET', @@ -230,6 +240,7 @@ export default function createConstellationAPI(apiFetch: ApiFetch) { getConfig, getLogs, reset, + forceReform, connect, block, ping, diff --git a/client/src/components/confirmModal.jsx b/client/src/components/confirmModal.jsx index 33d7b913..874104e9 100644 --- a/client/src/components/confirmModal.jsx +++ b/client/src/components/confirmModal.jsx @@ -10,7 +10,9 @@ import * as React from 'react'; import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; -const ConfirmModal = ({ callback, label, content, startIcon }) => { +// variant/color were already being passed by call sites but ignored; they now +// apply, with the previous hardcoded values as the defaults. +const ConfirmModal = ({ callback, label, content, startIcon, variant = 'outlined', color = 'warning' }) => { const { t } = useTranslation(); const [openModal, setOpenModal] = useState(false); @@ -36,8 +38,8 @@ const ConfirmModal = ({ callback, label, content, startIcon }) => {