Browse Source

Do renames

master
Yang Luo 2 years ago
parent
commit
b377c4fc52
13 changed files with 60 additions and 60 deletions
  1. +30
    -30
      README.md
  2. +3
    -3
      conf/app.conf
  3. +1
    -1
      controllers/dataset.go
  4. +1
    -1
      go.mod
  5. +2
    -2
      main.go
  6. +1
    -1
      object/dataset.go
  7. +1
    -1
      routers/filter.go
  8. +1
    -1
      routers/router.go
  9. +1
    -1
      web/package.json
  10. +1
    -1
      web/public/index.html
  11. +2
    -2
      web/public/manifest.json
  12. +1
    -1
      web/src/App.js
  13. +15
    -15
      web/src/Setting.js

+ 30
- 30
README.md View File

@@ -1,94 +1,94 @@
<h1 align="center" style="border-bottom: none;">📦⚡️ Casvisor</h1>
<h1 align="center" style="border-bottom: none;">📦⚡️ Caswire</h1>
<h3 align="center">An open-source logging and auditing system developed by Go and React.</h3>
<p align="center">
<a href="#badge">
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a>
<a href="https://hub.docker.com/r/casbin/casvisor">
<img alt="docker pull casbin/casvisor" src="https://img.shields.io/docker/pulls/casbin/casvisor.svg">
<a href="https://hub.docker.com/r/casbin/caswire">
<img alt="docker pull casbin/caswire" src="https://img.shields.io/docker/pulls/casbin/caswire.svg">
</a>
<a href="https://github.com/casbin/casvisor/releases/latest">
<img alt="GitHub Release" src="https://img.shields.io/github/v/release/casbin/casvisor.svg">
<a href="https://github.com/casbin/caswire/releases/latest">
<img alt="GitHub Release" src="https://img.shields.io/github/v/release/casbin/caswire.svg">
</a>
<a href="https://hub.docker.com/repository/docker/casbin/casvisor">
<a href="https://hub.docker.com/repository/docker/casbin/caswire">
<img alt="Docker Image Version (latest semver)" src="https://img.shields.io/badge/Docker%20Hub-latest-brightgreen">
</a>
</p>

<p align="center">
<a href="https://goreportcard.com/report/github.com/casbin/casvisor">
<img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/casbin/casvisor?style=flat-square">
<a href="https://goreportcard.com/report/github.com/casbin/caswire">
<img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/casbin/caswire?style=flat-square">
</a>
<a href="https://github.com/casbin/casvisor/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/casbin/casvisor?style=flat-square" alt="license">
<a href="https://github.com/casbin/caswire/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/casbin/caswire?style=flat-square" alt="license">
</a>
<a href="https://github.com/casbin/casvisor/issues">
<img alt="GitHub issues" src="https://img.shields.io/github/issues/casbin/casvisor?style=flat-square">
<a href="https://github.com/casbin/caswire/issues">
<img alt="GitHub issues" src="https://img.shields.io/github/issues/casbin/caswire?style=flat-square">
</a>
<a href="#">
<img alt="GitHub stars" src="https://img.shields.io/github/stars/casbin/casvisor?style=flat-square">
<img alt="GitHub stars" src="https://img.shields.io/github/stars/casbin/caswire?style=flat-square">
</a>
<a href="https://github.com/casbin/casvisor/network">
<img alt="GitHub forks" src="https://img.shields.io/github/forks/casbin/casvisor?style=flat-square">
<a href="https://github.com/casbin/caswire/network">
<img alt="GitHub forks" src="https://img.shields.io/github/forks/casbin/caswire?style=flat-square">
</a>
</p>

## Architecture
Casvisor contains 2 parts:
Caswire contains 2 parts:
Name | Description | Language | Source code
----|------|----|----
Frontend | Web frontend UI for Casvisor | Javascript + React | https://github.com/casbin/casvisor/tree/master/web
Backend | RESTful API backend for Casvisor | Golang + Beego + MySQL | https://github.com/casbin/casvisor
Frontend | Web frontend UI for Caswire | Javascript + React | https://github.com/casbin/caswire/tree/master/web
Backend | RESTful API backend for Caswire | Golang + Beego + MySQL | https://github.com/casbin/caswire

## Installation
Casvisor uses Casdoor to manage members. So you need to create an organization and an application for Casvisor in a Casdoor instance.
Caswire uses Casdoor to manage members. So you need to create an organization and an application for Caswire in a Casdoor instance.

### Necessary configuration

#### Get the code
```bash
go get github.com/casbin/casdoor
go get github.com/casbin/casvisor
go get github.com/casbin/caswire
```

or

```bash
git clone https://github.com/casbin/casdoor
git clone https://github.com/casbin/casvisor
git clone https://github.com/casbin/caswire
```

#### Setup database

Casvisor will store its users, nodes and topics informations in a MySQL database named: `casvisor`, will create it if not existed. The DB connection string can be specified at: https://github.com/casbin/casvisor/blob/master/conf/app.conf
Caswire will store its users, nodes and topics informations in a MySQL database named: `caswire`, will create it if not existed. The DB connection string can be specified at: https://github.com/casbin/caswire/blob/master/conf/app.conf

```ini
dataSourceName = root:123@tcp(localhost:3306)/
```
Casvisor uses XORM to connect to DB, so all DBs supported by XORM can also be used.
Caswire uses XORM to connect to DB, so all DBs supported by XORM can also be used.

#### Configure Casdoor

After creating an organization and an application for Casvisor in a Casdoor, you need to update `clientID`, `clientSecret`, `casdoorOrganization` and `casdoorApplication` in app.conf.
After creating an organization and an application for Caswire in a Casdoor, you need to update `clientID`, `clientSecret`, `casdoorOrganization` and `casdoorApplication` in app.conf.

#### Run Casvisor
#### Run Caswire

- Configure and run Casvisor by yourself. If you want to learn more about casvisor.
- Configure and run Caswire by yourself. If you want to learn more about caswire.
- Open browser: http://localhost:16001/

### Optional configuration

#### Setup your Casvisor to enable some third-party login platform
#### Setup your Caswire to enable some third-party login platform

Casvisor uses Casdoor to manage members. If you want to log in with oauth, you should see [casdoor oauth configuration](https://casdoor.org/docs/provider/oauth/overview).
Caswire uses Casdoor to manage members. If you want to log in with oauth, you should see [casdoor oauth configuration](https://casdoor.org/docs/provider/oauth/overview).

#### OSS, Mail, and SMS services

Casvisor uses Casdoor to upload files to cloud storage, send Emails and send SMSs. See Casdoor for more details.
Caswire uses Casdoor to upload files to cloud storage, send Emails and send SMSs. See Casdoor for more details.

## Contribute

For Casvisor, if you have any questions, you can give Issues, or you can also directly start Pull Requests(but we recommend giving issues first to communicate with the community).
For Caswire, if you have any questions, you can give Issues, or you can also directly start Pull Requests(but we recommend giving issues first to communicate with the community).

## License



+ 3
- 3
conf/app.conf View File

@@ -1,11 +1,11 @@
appname = casvisor
httpport = 19000
appname = caswire
httpport = 20000
runmode = dev
SessionOn = true
copyrequestbody = true
driverName = mysql
dataSourceName = root:123@tcp(localhost:3306)/
dbName = casvisor
dbName = caswire
redisEndpoint =
casdoorEndpoint = http://localhost:8000
clientId = af6b5aa958822fb9dc33


+ 1
- 1
controllers/dataset.go View File

@@ -17,7 +17,7 @@ package controllers
import (
"encoding/json"

"github.com/casbin/casvisor/object"
"github.com/casbin/caswire/object"
)

func (c *ApiController) GetGlobalDatasets() {


+ 1
- 1
go.mod View File

@@ -1,4 +1,4 @@
module github.com/casbin/casvisor
module github.com/casbin/caswire

go 1.17



+ 2
- 2
main.go View File

@@ -18,8 +18,8 @@ import (
"github.com/beego/beego"
"github.com/beego/beego/plugins/cors"
_ "github.com/beego/beego/session/redis"
"github.com/casbin/casvisor/object"
"github.com/casbin/casvisor/routers"
"github.com/casbin/caswire/object"
"github.com/casbin/caswire/routers"
)

func main() {


+ 1
- 1
object/dataset.go View File

@@ -15,7 +15,7 @@
package object

import (
"github.com/casbin/casvisor/util"
"github.com/casbin/caswire/util"
"xorm.io/core"
)



+ 1
- 1
routers/filter.go View File

@@ -19,7 +19,7 @@ import (
"strings"

"github.com/beego/beego/context"
"github.com/casbin/casvisor/util"
"github.com/casbin/caswire/util"
)

func TransparentStatic(ctx *context.Context) {


+ 1
- 1
routers/router.go View File

@@ -17,7 +17,7 @@ package routers
import (
"github.com/beego/beego"

"github.com/casbin/casvisor/controllers"
"github.com/casbin/caswire/controllers"
)

func init() {


+ 1
- 1
web/package.json View File

@@ -19,7 +19,7 @@
"react-scripts": "5.0.1"
},
"scripts": {
"start": "set PORT=18001 && craco start",
"start": "set PORT=19001 && craco start",
"build": "del build.zip 2>nul && set \"GENERATE_SOURCEMAP=false\" && set \"SKIP_PREFLIGHT_CHECK=true\" && craco build && 360zip.exe -ar build %cd%/build.zip || ECHO.",
"test": "craco test",
"eject": "craco eject",


+ 1
- 1
web/public/index.html View File

@@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Casvisor</title>
<title>Caswire</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>


+ 2
- 2
web/public/manifest.json View File

@@ -1,6 +1,6 @@
{
"short_name": "Casvisor",
"name": "Casvisor",
"short_name": "Caswire",
"name": "Caswire",
"icons": [
{
"src": "favicon.ico",


+ 1
- 1
web/src/App.js View File

@@ -309,7 +309,7 @@ class App extends Component {
textAlign: 'center',
}
}>
Made with <span style={{color: 'rgb(255, 255, 255)'}}>❤️</span> by <a style={{fontWeight: "bold", color: "black"}} target="_blank" href="https://github.com/casbin/casvisor">Casvisor</a>, { Setting.isMobile() ? "Mobile" : "Desktop" } View
Made with <span style={{color: 'rgb(255, 255, 255)'}}>❤️</span> by <a style={{fontWeight: "bold", color: "black"}} target="_blank" href="https://github.com/casbin/caswire">Caswire</a>, { Setting.isMobile() ? "Mobile" : "Desktop" } View
</Footer>
)
}


+ 15
- 15
web/src/Setting.js View File

@@ -1,17 +1,17 @@
// Copyright 2023 The casbin Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2023 The casbin Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import {message} from "antd";
import {isMobile as isMobileDevice} from "react-device-detect";
import i18next from "i18next";
@@ -24,7 +24,7 @@ export let CasdoorSdk;
export function initServerUrl() {
const hostname = window.location.hostname;
if (hostname === 'localhost') {
ServerUrl = `http://${hostname}:19000`;
ServerUrl = `http://${hostname}:20000`;
}
}


Loading…
Cancel
Save