mirror of
https://github.com/openziti/zrok.git
synced 2025-02-24 14:11:37 +01:00
Merge branch 'main' into zrok_copy_p1
This commit is contained in:
commit
52643f174f
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## v0.4.21
|
## v0.4.21
|
||||||
|
|
||||||
|
FEATURE: The web console now supports deleting `zrok access` frontends (https://github.com/openziti/zrok/issues/504)
|
||||||
|
|
||||||
|
CHANGE: The web console now displays the frontend token as the label for any `zrok access` frontends throughout the user interface (https://github.com/openziti/zrok/issues/504)
|
||||||
|
|
||||||
CHANGE: Updated `github.com/rubenv/sql-migrate` to `v1.6.0`
|
CHANGE: Updated `github.com/rubenv/sql-migrate` to `v1.6.0`
|
||||||
|
|
||||||
FIX: The migration `sqlite3/015_v0_4_19_share_unique_name_constraint.sql` has been adjusted to delete the old `shares_old` table as the last step of the migration process. Not sure exactly why, but SQLite is unhappy otherwise (https://github.com/openziti/zrok/issues/504)
|
FIX: The migration `sqlite3/015_v0_4_19_share_unique_name_constraint.sql` has been adjusted to delete the old `shares_old` table as the last step of the migration process. Not sure exactly why, but SQLite is unhappy otherwise (https://github.com/openziti/zrok/issues/504)
|
||||||
|
@ -47,6 +47,7 @@ func (h *getFrontendDetailHandler) Handle(params metadata.GetFrontendDetailParam
|
|||||||
}
|
}
|
||||||
payload := &rest_model_zrok.Frontend{
|
payload := &rest_model_zrok.Frontend{
|
||||||
ID: int64(fe.Id),
|
ID: int64(fe.Id),
|
||||||
|
Token: fe.Token,
|
||||||
ZID: fe.ZId,
|
ZID: fe.ZId,
|
||||||
CreatedAt: fe.CreatedAt.UnixMilli(),
|
CreatedAt: fe.CreatedAt.UnixMilli(),
|
||||||
UpdatedAt: fe.UpdatedAt.UnixMilli(),
|
UpdatedAt: fe.UpdatedAt.UnixMilli(),
|
||||||
|
@ -95,6 +95,7 @@ func (h *overviewHandler) Handle(_ metadata.OverviewParams, principal *rest_mode
|
|||||||
for _, fe := range fes {
|
for _, fe := range fes {
|
||||||
envFe := &rest_model_zrok.Frontend{
|
envFe := &rest_model_zrok.Frontend{
|
||||||
ID: int64(fe.Id),
|
ID: int64(fe.Id),
|
||||||
|
Token: fe.Token,
|
||||||
ZID: fe.ZId,
|
ZID: fe.ZId,
|
||||||
CreatedAt: fe.CreatedAt.UnixMilli(),
|
CreatedAt: fe.CreatedAt.UnixMilli(),
|
||||||
UpdatedAt: fe.UpdatedAt.UnixMilli(),
|
UpdatedAt: fe.UpdatedAt.UnixMilli(),
|
||||||
|
@ -31,7 +31,7 @@ When the service starts it will:
|
|||||||
1. If you set up the repository by following the guide, then also install the `zrok-share` package. This package provides the systemd service.
|
1. If you set up the repository by following the guide, then also install the `zrok-share` package. This package provides the systemd service.
|
||||||
|
|
||||||
```bash title="Ubuntu, Debian"
|
```bash title="Ubuntu, Debian"
|
||||||
sudo sudo apt install zrok-share
|
sudo apt install zrok-share
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash title="Fedora, Rocky"
|
```bash title="Fedora, Rocky"
|
||||||
|
@ -26,6 +26,9 @@ type Frontend struct {
|
|||||||
// shr token
|
// shr token
|
||||||
ShrToken string `json:"shrToken,omitempty"`
|
ShrToken string `json:"shrToken,omitempty"`
|
||||||
|
|
||||||
|
// token
|
||||||
|
Token string `json:"token,omitempty"`
|
||||||
|
|
||||||
// updated at
|
// updated at
|
||||||
UpdatedAt int64 `json:"updatedAt,omitempty"`
|
UpdatedAt int64 `json:"updatedAt,omitempty"`
|
||||||
|
|
||||||
|
@ -1215,6 +1215,9 @@ func init() {
|
|||||||
"shrToken": {
|
"shrToken": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"token": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"updatedAt": {
|
"updatedAt": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
@ -2835,6 +2838,9 @@ func init() {
|
|||||||
"shrToken": {
|
"shrToken": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"token": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"updatedAt": {
|
"updatedAt": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
@ -1,20 +1,23 @@
|
|||||||
import os
|
# coding: utf-8
|
||||||
|
|
||||||
from setuptools import find_packages, setup # noqa: H301
|
"""
|
||||||
|
zrok
|
||||||
|
|
||||||
# optionally upload to TestPyPi with alternative name in testing repo
|
zrok client access # noqa: E501
|
||||||
NAME = os.getenv('ZROK_PY_NAME', "zrok_sdk")
|
|
||||||
# inherit zrok version from environment or default to dev version
|
|
||||||
VERSION = os.getenv('ZROK_VERSION', "0.4.0.dev")
|
|
||||||
|
|
||||||
|
OpenAPI spec version: 0.3.0
|
||||||
|
|
||||||
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
"""
|
||||||
|
|
||||||
|
from setuptools import setup, find_packages # noqa: H301
|
||||||
|
|
||||||
|
NAME = "zrok_sdk"
|
||||||
|
VERSION = "1.0.0"
|
||||||
# To install the library, run the following
|
# To install the library, run the following
|
||||||
#
|
#
|
||||||
# python setup.py install
|
# python setup.py install
|
||||||
#
|
#
|
||||||
# or
|
|
||||||
#
|
|
||||||
# pip install --editable .
|
|
||||||
#
|
|
||||||
# prerequisite: setuptools
|
# prerequisite: setuptools
|
||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
@ -24,14 +27,13 @@ setup(
|
|||||||
name=NAME,
|
name=NAME,
|
||||||
version=VERSION,
|
version=VERSION,
|
||||||
description="zrok",
|
description="zrok",
|
||||||
author_email="cameron.otts@netfoundry.io",
|
author_email="",
|
||||||
url="https://zrok.io",
|
url="",
|
||||||
python_requires='>=3.10',
|
|
||||||
keywords=["Swagger", "zrok"],
|
keywords=["Swagger", "zrok"],
|
||||||
install_requires=REQUIRES,
|
install_requires=REQUIRES,
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
long_description="""\
|
long_description="""\
|
||||||
Geo-scale, next-generation peer-to-peer sharing platform built on top of OpenZiti.
|
zrok client access # noqa: E501
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@ -29,6 +29,7 @@ class Frontend(object):
|
|||||||
"""
|
"""
|
||||||
swagger_types = {
|
swagger_types = {
|
||||||
'id': 'int',
|
'id': 'int',
|
||||||
|
'token': 'str',
|
||||||
'shr_token': 'str',
|
'shr_token': 'str',
|
||||||
'z_id': 'str',
|
'z_id': 'str',
|
||||||
'created_at': 'int',
|
'created_at': 'int',
|
||||||
@ -37,15 +38,17 @@ class Frontend(object):
|
|||||||
|
|
||||||
attribute_map = {
|
attribute_map = {
|
||||||
'id': 'id',
|
'id': 'id',
|
||||||
|
'token': 'token',
|
||||||
'shr_token': 'shrToken',
|
'shr_token': 'shrToken',
|
||||||
'z_id': 'zId',
|
'z_id': 'zId',
|
||||||
'created_at': 'createdAt',
|
'created_at': 'createdAt',
|
||||||
'updated_at': 'updatedAt'
|
'updated_at': 'updatedAt'
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, id=None, shr_token=None, z_id=None, created_at=None, updated_at=None): # noqa: E501
|
def __init__(self, id=None, token=None, shr_token=None, z_id=None, created_at=None, updated_at=None): # noqa: E501
|
||||||
"""Frontend - a model defined in Swagger""" # noqa: E501
|
"""Frontend - a model defined in Swagger""" # noqa: E501
|
||||||
self._id = None
|
self._id = None
|
||||||
|
self._token = None
|
||||||
self._shr_token = None
|
self._shr_token = None
|
||||||
self._z_id = None
|
self._z_id = None
|
||||||
self._created_at = None
|
self._created_at = None
|
||||||
@ -53,6 +56,8 @@ class Frontend(object):
|
|||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
if id is not None:
|
if id is not None:
|
||||||
self.id = id
|
self.id = id
|
||||||
|
if token is not None:
|
||||||
|
self.token = token
|
||||||
if shr_token is not None:
|
if shr_token is not None:
|
||||||
self.shr_token = shr_token
|
self.shr_token = shr_token
|
||||||
if z_id is not None:
|
if z_id is not None:
|
||||||
@ -83,6 +88,27 @@ class Frontend(object):
|
|||||||
|
|
||||||
self._id = id
|
self._id = id
|
||||||
|
|
||||||
|
@property
|
||||||
|
def token(self):
|
||||||
|
"""Gets the token of this Frontend. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The token of this Frontend. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._token
|
||||||
|
|
||||||
|
@token.setter
|
||||||
|
def token(self, token):
|
||||||
|
"""Sets the token of this Frontend.
|
||||||
|
|
||||||
|
|
||||||
|
:param token: The token of this Frontend. # noqa: E501
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._token = token
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def shr_token(self):
|
def shr_token(self):
|
||||||
"""Gets the shr_token of this Frontend. # noqa: E501
|
"""Gets the shr_token of this Frontend. # noqa: E501
|
||||||
|
@ -778,6 +778,8 @@ definitions:
|
|||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
type: integer
|
type: integer
|
||||||
|
token:
|
||||||
|
type: string
|
||||||
shrToken:
|
shrToken:
|
||||||
type: string
|
type: string
|
||||||
zId:
|
zId:
|
||||||
|
@ -111,6 +111,7 @@
|
|||||||
* @memberof module:types
|
* @memberof module:types
|
||||||
*
|
*
|
||||||
* @property {number} id
|
* @property {number} id
|
||||||
|
* @property {string} token
|
||||||
* @property {string} shrToken
|
* @property {string} shrToken
|
||||||
* @property {string} zId
|
* @property {string} zId
|
||||||
* @property {number} createdAt
|
* @property {number} createdAt
|
||||||
|
@ -4,6 +4,7 @@ import {useEffect, useState} from "react";
|
|||||||
import {getFrontendDetail} from "../../../api/metadata";
|
import {getFrontendDetail} from "../../../api/metadata";
|
||||||
import {Tab, Tabs} from "react-bootstrap";
|
import {Tab, Tabs} from "react-bootstrap";
|
||||||
import DetailTab from "./DetailTab";
|
import DetailTab from "./DetailTab";
|
||||||
|
import ActionsTab from "./ActionsTab";
|
||||||
|
|
||||||
const AccessDetail = (props) => {
|
const AccessDetail = (props) => {
|
||||||
const [detail, setDetail] = useState({});
|
const [detail, setDetail] = useState({});
|
||||||
@ -17,11 +18,14 @@ const AccessDetail = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h2><Icon path={mdiAccessPointNetwork} size={2} />{" "}{detail.shrToken} ({detail.id})</h2>
|
<h2><Icon path={mdiAccessPointNetwork} size={2} />{" "}{detail.token}</h2>
|
||||||
<Tabs defaultActiveKey={"detail"} className={"mb-3"}>
|
<Tabs defaultActiveKey={"detail"} className={"mb-3"}>
|
||||||
<Tab eventKey={"detail"} title={"Detail"}>
|
<Tab eventKey={"detail"} title={"Detail"}>
|
||||||
<DetailTab frontend={detail} />
|
<DetailTab frontend={detail} />
|
||||||
</Tab>
|
</Tab>
|
||||||
|
<Tab eventKey={"actions"} title={"Actions"}>
|
||||||
|
<ActionsTab frontend={detail} />
|
||||||
|
</Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
27
ui/src/console/detail/access/ActionsTab.js
Normal file
27
ui/src/console/detail/access/ActionsTab.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import * as share from "../../../api/share";
|
||||||
|
import {Button} from "react-bootstrap";
|
||||||
|
|
||||||
|
const ActionsTab = (props) => {
|
||||||
|
const deleteFrontend = (feToken, shrToken, envZId) => {
|
||||||
|
if(window.confirm("Really delete access frontend '" + feToken + "' for share '" + shrToken + "'?")) {
|
||||||
|
share.unaccess({body: {frontendToken: feToken, shrToken: shrToken, envZId: envZId}}).then(resp => {
|
||||||
|
console.log(resp);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={"actions-tab"}>
|
||||||
|
<h3>Delete your access frontend '{props.frontend.token}' for share '{props.frontend.shrToken}'?</h3>
|
||||||
|
<p>
|
||||||
|
This will remove your <code>zrok access</code> frontend from this environment. You will still need to
|
||||||
|
terminate the corresponding <code>zrok access</code> process in your local environment.
|
||||||
|
</p>
|
||||||
|
<Button variant={"danger"} onClick={() => deleteFrontend(props.frontend.token, props.frontend.shrToken, props.frontend.zId)}>
|
||||||
|
Delete '{props.frontend.token}'
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ActionsTab;
|
@ -78,7 +78,7 @@ export const mergeGraph = (oldGraph, user, accountLimited, newOverview) => {
|
|||||||
id: 'ac:' + fe.id,
|
id: 'ac:' + fe.id,
|
||||||
feId: fe.id,
|
feId: fe.id,
|
||||||
target: fe.shrToken,
|
target: fe.shrToken,
|
||||||
label: fe.shrToken,
|
label: fe.token,
|
||||||
type: "frontend",
|
type: "frontend",
|
||||||
val: 50
|
val: 50
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user