Skip to content

Commit

Permalink
Rename from consoleserver to goconserver
Browse files Browse the repository at this point in the history
  • Loading branch information
chenglch committed Nov 2, 2017
1 parent cc8afb3 commit 6d34760
Show file tree
Hide file tree
Showing 29 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
autogen/
.idea/
vendor/
consoleserver
goconserver
congo
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
GITHUB_DIR=${GOPATH}/src/github.com/chenglch/
REPO_DIR=${GOPATH}/src/github.com/chenglch/consoleserver
REPO_DIR=${GOPATH}/src/github.com/chenglch/goconserver
CURRENT_DIR=$(shell pwd)
REPO_DIR_LINK=$(shell readlink -f ${REPO_DIR})
SERVER_CONF_FILE=/etc/consoleserver/server.conf
SERVER_CONF_FILE=/etc/goconserver/server.conf
CLIENT_CONF_FILE=~/congo.sh
SERVER_BINARY=consoleserver
SERVER_BINARY=goconserver
CLIENT_BINARY=congo
COMMIT=$(shell git rev-parse HEAD)
VERSION=0.1
Expand Down Expand Up @@ -33,20 +33,20 @@ fmt:

build: link
cd ${REPO_DIR}; \
go build ${LDFLAGS} -o ${SERVER_BINARY} consoleserver.go; \
go build ${LDFLAGS} -o ${SERVER_BINARY} goconserver.go; \
go build ${LDFLAGS} -o ${CLIENT_BINARY} cmd/congo.go; \
cd -

install: build
cp ${SERVER_BINARY} /usr/local/bin/${SERVER_BINARY}
cp ${CLIENT_BINARY} /usr/local/bin/${CLIENT_BINARY}
mkdir -p /etc/consoleserver /var/log/consoleserver/nodes /var/lib/consoleserver
mkdir -p /etc/goconserver /var/log/goconserver/nodes /var/lib/goconserver

if [ ! -f "/etc/consoleserver/server.conf" ]; then \
cp etc/consoleserver/server.conf /etc/consoleserver/; \
if [ ! -f "/etc/goconserver/server.conf" ]; then \
cp etc/goconserver/server.conf /etc/goconserver/; \
fi;
if [ ! -f "/etc/profile.d/congo.sh" ]; then \
cp etc/consoleserver/client.sh /etc/profile.d/congo.sh; \
cp etc/goconserver/client.sh /etc/profile.d/congo.sh; \
fi

clean:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
## consoleserver
## goconserver

`consoleserver` is written in golang and is a part of microservice of
`goconserver` is written in golang and is a part of microservice of
[xcat3](https://github.com/chenglch/xcat3). It can work as a independent
tool to provide the terminal session service. Terminal session could run in
the background and help logging the terminal content.

### Support plugin
`consoleserver` intent to support multiple types of terminal plugins, currently
`goconserver` intent to support multiple types of terminal plugins, currently
`ssh` is support as OpenBMC use `ssh` as the SOL method and `cmd` is a general
driver to support command session.

### Structure
`consoleserver` can be divided into two parts:
- daemon part: `consoleserver`, expose rest api interface to define and control
`goconserver` can be divided into two parts:
- daemon part: `goconserver`, expose rest api interface to define and control
the session node.

- client part: `congo`, a command line tool to define session or connect to the
Expand All @@ -28,8 +28,8 @@ Please setup golang SDK, GOPATH environment variable and glide tool at first.
### Build and installation

```
git clone https://github.com/chenglch/consoleserver.git
cd consoleserver
git clone https://github.com/chenglch/goconserver.git
cd goconserver
make install
```

Expand All @@ -43,7 +43,7 @@ Please refer to [ssl](/scripts/ssl/)
daemon is running in the background. To support a large amount of sessions,
please use `ulimit -n <number>` command to set the number of open files.
```
consoleserver &
goconserver &
```
### Define testnode node session
congo is the client command. Use congo help to see the detail.
Expand Down
8 changes: 4 additions & 4 deletions api/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (
"io/ioutil"
"net/http"

"github.com/chenglch/consoleserver/common"
"github.com/chenglch/consoleserver/console"
"github.com/chenglch/consoleserver/storage"
"github.com/chenglch/goconserver/common"
"github.com/chenglch/goconserver/console"
"github.com/chenglch/goconserver/storage"
"github.com/gorilla/mux"
)

var (
nodeManager *console.NodeManager
plog = common.GetLogger("github.com/chenglch/consoleserver/api/node")
plog = common.GetLogger("github.com/chenglch/goconserver/api/node")
serverConfig = common.GetServerConfig()
)

Expand Down
6 changes: 3 additions & 3 deletions benchmark/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## consoleserver benchmark
This benchmark is to test the rest api performance of consoleserver. It could
## goconserver benchmark
This benchmark is to test the rest api performance of goconserver. It could
be used to compare the performance of bulk interface and the normal one.

## requirements
Expand All @@ -9,7 +9,7 @@ pip install eventlet requests futurist
```

## run the script
Start the consoleserver daemon at first, then run the script:
Start the goconserver daemon at first, then run the script:
```
python api.py
```
Expand Down
4 changes: 2 additions & 2 deletions cmd/congo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
"github.com/chenglch/consoleserver/console"
"github.com/chenglch/goconserver/console"
"github.com/spf13/cobra"
)

Expand All @@ -29,7 +29,7 @@ func version(cmd *cobra.Command, args []string) {
func main() {
cmd := &cobra.Command{
Use: "congo",
Short: "This is golang client for consoleserver",
Short: "This is golang client for goconserver",
Long: `Congo --help and congo help COMMAND to see the usage for specfied
command.`}
cmd.AddCommand(versionCommand())
Expand Down
4 changes: 2 additions & 2 deletions common/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func InitServerConfig(confFile string) (*ServerConfig, error) {
serverConfig.API.Port = "8089"
serverConfig.API.HttpTimeout = 10
serverConfig.Console.Port = "12430"
serverConfig.Console.DataDir = "/var/lib/consoleserver/"
serverConfig.Console.LogDir = "/var/log/consoleserver/nodes/"
serverConfig.Console.DataDir = "/var/lib/goconserver/"
serverConfig.Console.LogDir = "/var/log/goconserver/nodes/"
serverConfig.Console.ClientTimeout = 30
serverConfig.Console.TargetTimeout = 30
serverConfig.Console.ReconnectInterval = 5
Expand Down
2 changes: 1 addition & 1 deletion common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
)

var (
plog = GetLogger("github.com/chenglch/consoleserver/common")
plog = GetLogger("github.com/chenglch/goconserver/common")
)

func init() {
Expand Down
10 changes: 5 additions & 5 deletions console/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package console

import (
"fmt"
"github.com/chenglch/consoleserver/common"
"github.com/chenglch/goconserver/common"
"github.com/spf13/cobra"
"net"
"os"
Expand Down Expand Up @@ -81,8 +81,8 @@ func NewCongoCli(cmd *cobra.Command) {
func (c *CongoCli) listCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "list",
Short: "List node(s) in consoleserver service",
Long: `List node(s) in consoleserver service`,
Short: "List node(s) in goconserver service",
Long: `List node(s) in goconserver service`,
Run: c.list,
}
return cmd
Expand All @@ -108,8 +108,8 @@ func (c *CongoCli) list(cmd *cobra.Command, args []string) {
func (c *CongoCli) showCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "show <node>",
Short: "show node detail in consoleserver service",
Long: `show node detail in consoleserver service. congo show <node>`,
Short: "show node detail in goconserver service",
Long: `show node detail in goconserver service. congo show <node>`,
Run: c.show,
}
return cmd
Expand Down
2 changes: 1 addition & 1 deletion console/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"syscall"

"crypto/tls"
"github.com/chenglch/consoleserver/common"
"github.com/chenglch/goconserver/common"
"golang.org/x/crypto/ssh/terminal"
"io"
"net/http"
Expand Down
4 changes: 2 additions & 2 deletions console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"path/filepath"
"time"

"github.com/chenglch/consoleserver/common"
"github.com/chenglch/consoleserver/plugins"
"github.com/chenglch/goconserver/common"
"github.com/chenglch/goconserver/plugins"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions console/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"errors"
"fmt"
"github.com/chenglch/consoleserver/common"
pb "github.com/chenglch/consoleserver/console/consolepb"
"github.com/chenglch/goconserver/common"
pb "github.com/chenglch/goconserver/console/consolepb"
net_context "golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
Expand Down
10 changes: 5 additions & 5 deletions console/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/chenglch/consoleserver/common"
pb "github.com/chenglch/consoleserver/console/consolepb"
"github.com/chenglch/consoleserver/plugins"
"github.com/chenglch/consoleserver/storage"
"github.com/chenglch/goconserver/common"
pb "github.com/chenglch/goconserver/console/consolepb"
"github.com/chenglch/goconserver/plugins"
"github.com/chenglch/goconserver/storage"

"net"
"net/http"
Expand All @@ -32,7 +32,7 @@ const (
)

var (
plog = common.GetLogger("github.com/chenglch/consoleserver/service")
plog = common.GetLogger("github.com/chenglch/goconserver/service")
nodeManager *NodeManager
serverConfig = common.GetServerConfig()
STATUS_MAP = map[int]string{
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions etc/consoleserver/server.conf → etc/goconserver/server.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
global:
host: 127.0.0.1
# ssl_key_file: /etc/consoleserver/cert/server-key.pem
# ssl_cert_file: /etc/consoleserver/cert/server-cert.pem
# ssl_ca_cert_file: /etc/consoleserver/cert/ca.pem
logfile: "/var/log/consoleserver/server.log"
# ssl_key_file: /etc/goconserver/cert/server-key.pem
# ssl_cert_file: /etc/goconserver/cert/server-cert.pem
# ssl_ca_cert_file: /etc/goconserver/cert/ca.pem
logfile: "/var/log/goconserver/server.log"
log_level: "info" # debug, info, warn, error, fatal, panic
worker: 4
storage_type: file
Expand All @@ -14,8 +14,8 @@ api:

console:
port: 12430
datadir: "/var/lib/consoleserver/"
logdir: "/var/log/consoleserver/nodes/"
datadir: "/var/lib/goconserver/"
logdir: "/var/log/goconserver/nodes/"
target_timeout: 30
client_timeout: 30
reconnect_interval: 5 # retry interval in seconds if console could not be connected
Expand Down
2 changes: 1 addition & 1 deletion glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package: .
import:
- package: github.com/chenglch/consoleserver
- package: github.com/chenglch/goconserver
subpackages:
- api
- common
Expand Down
14 changes: 7 additions & 7 deletions consoleserver.go → goconserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"crypto/tls"
"crypto/x509"
"github.com/chenglch/consoleserver/api"
"github.com/chenglch/consoleserver/common"
"github.com/chenglch/goconserver/api"
"github.com/chenglch/goconserver/common"
"github.com/gorilla/mux"
"github.com/spf13/cobra"
"io/ioutil"
Expand All @@ -29,11 +29,11 @@ var (

func init() {
ServerCmd = &cobra.Command{
Use: "consoleserver",
Short: "This is consoleserver damon service",
Long: `Consoleserver daemon service`}
ServerCmd.Flags().StringVarP(&confFile, "config-file", "c", "/etc/consoleserver/server.conf", "Specify the configuration file for consoleserver daemon.")
ServerCmd.Flags().BoolVarP(&showVer, "version", "v", false, "Show the version of consoleserver.")
Use: "goconserver",
Short: "This is goconserver damon service",
Long: `goconserver daemon service`}
ServerCmd.Flags().StringVarP(&confFile, "config-file", "c", "/etc/goconserver/server.conf", "Specify the configuration file for goconserver daemon.")
ServerCmd.Flags().BoolVarP(&showVer, "version", "v", false, "Show the version of goconserver.")
}

func loadTlsConfig(serverConfig *common.ServerConfig) *tls.Config {
Expand Down
4 changes: 2 additions & 2 deletions plugins/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package plugins
import (
"errors"
"fmt"
"github.com/chenglch/consoleserver/common"
"github.com/chenglch/goconserver/common"
"io"
)

var (
DRIVER_INIT_MAP = map[string]func(string, map[string]string) (ConsolePlugin, error){}
DRIVER_VALIDATE_MAP = map[string]func(string, map[string]string) error{}
plog = common.GetLogger("github.com/chenglch/consoleserver/plugins")
plog = common.GetLogger("github.com/chenglch/goconserver/plugins")
)

type ConsoleSession interface {
Expand Down
2 changes: 1 addition & 1 deletion plugins/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package plugins
import (
"errors"
"fmt"
"github.com/chenglch/consoleserver/common"
"github.com/chenglch/goconserver/common"
"github.com/kr/pty"
"os"
"os/exec"
Expand Down
2 changes: 1 addition & 1 deletion plugins/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"log"
"time"

"github.com/chenglch/consoleserver/common"
"github.com/chenglch/goconserver/common"
"golang.org/x/crypto/ssh"
"os"
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/sshcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package plugins
import (
"errors"
"fmt"
"github.com/chenglch/consoleserver/common"
"github.com/chenglch/goconserver/common"
"golang.org/x/crypto/ssh"
"os"
)
Expand Down
6 changes: 3 additions & 3 deletions scripts/ssl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ cat /etc/consoloserver/server.conf
```
global:
host: 0.0.0.0
ssl_key_file: /etc/consoleserver/cert/server-key.pem
ssl_cert_file: /etc/consoleserver/cert/server-cert.pem
ssl_ca_cert_file: /etc/consoleserver/cert/ca.pem
ssl_key_file: /etc/goconserver/cert/server-key.pem
ssl_cert_file: /etc/goconserver/cert/server-cert.pem
ssl_ca_cert_file: /etc/goconserver/cert/ca.pem
```

cat /etc/profile.d/congo.sh
Expand Down
2 changes: 1 addition & 1 deletion scripts/ssl/setup_ca_cert.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

if [ -z "$CONSOLESERVER_DIR" ]; then
CONSOLESERVER_DIR=/etc/consoleserver
CONSOLESERVER_DIR=/etc/goconserver
fi
if [ -z "$1" ]; then
echo "Usage: $0 <CA name>"
Expand Down
2 changes: 1 addition & 1 deletion scripts/ssl/setup_client_cert.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

if [ -z "$CONSOLESERVER_DIR" ]; then
CONSOLESERVER_DIR=/etc/consoleserver
CONSOLESERVER_DIR=/etc/goconserver
fi
# if `-f`|`--force` option is supplied, set a variable and remove option from paraameters
# This allows use of the old code without modification
Expand Down
Loading

0 comments on commit 6d34760

Please sign in to comment.