mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-19 20:26:26 +08:00
fix: change app name in cmd (#36)
This commit is contained in:
@ -26,8 +26,8 @@ var AdminCmd = &cobra.Command{
|
|||||||
} else {
|
} else {
|
||||||
utils.Log.Infof("Admin user's username: %s", admin.Username)
|
utils.Log.Infof("Admin user's username: %s", admin.Username)
|
||||||
utils.Log.Infof("The password can only be output at the first startup, and then stored as a hash value, which cannot be reversed")
|
utils.Log.Infof("The password can only be output at the first startup, and then stored as a hash value, which cannot be reversed")
|
||||||
utils.Log.Infof("You can reset the password with a random string by running [alist admin random]")
|
utils.Log.Infof("You can reset the password with a random string by running [openlist admin random]")
|
||||||
utils.Log.Infof("You can also set a new password by running [alist admin set NEW_PASSWORD]")
|
utils.Log.Infof("You can also set a new password by running [openlist admin set NEW_PASSWORD]")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"os"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// KillCmd represents the kill command
|
// KillCmd represents the kill command
|
||||||
var KillCmd = &cobra.Command{
|
var KillCmd = &cobra.Command{
|
||||||
Use: "kill",
|
Use: "kill",
|
||||||
Short: "Force kill alist server process by daemon/pid file",
|
Short: "Force kill openlist server process by daemon/pid file",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
kill()
|
kill()
|
||||||
},
|
},
|
||||||
@ -18,7 +19,7 @@ var KillCmd = &cobra.Command{
|
|||||||
func kill() {
|
func kill() {
|
||||||
initDaemon()
|
initDaemon()
|
||||||
if pid == -1 {
|
if pid == -1 {
|
||||||
log.Info("Seems not have been started. Try use `alist start` to start server.")
|
log.Info("Seems not have been started. Try use `openlist start` to start server.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
process, err := os.FindProcess(pid)
|
process, err := os.FindProcess(pid)
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
// RestartCmd represents the restart command
|
// RestartCmd represents the restart command
|
||||||
var RestartCmd = &cobra.Command{
|
var RestartCmd = &cobra.Command{
|
||||||
Use: "restart",
|
Use: "restart",
|
||||||
Short: "Restart alist server by daemon/pid file",
|
Short: "Restart openlist server by daemon/pid file",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
stop()
|
stop()
|
||||||
start()
|
start()
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var RootCmd = &cobra.Command{
|
var RootCmd = &cobra.Command{
|
||||||
Use: "alist",
|
Use: "openlist",
|
||||||
Short: "A file list program that supports multiple storage.",
|
Short: "A file list program that supports multiple storage.",
|
||||||
Long: `A file list program that supports multiple storage,
|
Long: `A file list program that supports multiple storage,
|
||||||
built with love by Xhofe and friends in Go/Solid.js.
|
built with love by Xhofe and friends in Go/Solid.js.
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
// StartCmd represents the start command
|
// StartCmd represents the start command
|
||||||
var StartCmd = &cobra.Command{
|
var StartCmd = &cobra.Command{
|
||||||
Use: "start",
|
Use: "start",
|
||||||
Short: "Silent start alist server with `--force-bin-dir`",
|
Short: "Silent start openlist server with `--force-bin-dir`",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
start()
|
start()
|
||||||
},
|
},
|
||||||
@ -27,7 +27,7 @@ func start() {
|
|||||||
if pid != -1 {
|
if pid != -1 {
|
||||||
_, err := os.FindProcess(pid)
|
_, err := os.FindProcess(pid)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Info("alist already started, pid ", pid)
|
log.Info("openlist already started, pid ", pid)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ func start() {
|
|||||||
log.Infof("success start pid: %d", cmd.Process.Pid)
|
log.Infof("success start pid: %d", cmd.Process.Pid)
|
||||||
err = os.WriteFile(pidFile, []byte(strconv.Itoa(cmd.Process.Pid)), 0666)
|
err = os.WriteFile(pidFile, []byte(strconv.Itoa(cmd.Process.Pid)), 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("failed to record pid, you may not be able to stop the program with `./alist stop`")
|
log.Warn("failed to record pid, you may not be able to stop the program with `./openlist stop`")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
// StopCmd represents the stop command
|
// StopCmd represents the stop command
|
||||||
var StopCmd = &cobra.Command{
|
var StopCmd = &cobra.Command{
|
||||||
Use: "stop",
|
Use: "stop",
|
||||||
Short: "Stop alist server by daemon/pid file",
|
Short: "Stop openlist server by daemon/pid file",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
stop()
|
stop()
|
||||||
},
|
},
|
||||||
@ -22,7 +22,7 @@ var StopCmd = &cobra.Command{
|
|||||||
func stop() {
|
func stop() {
|
||||||
initDaemon()
|
initDaemon()
|
||||||
if pid == -1 {
|
if pid == -1 {
|
||||||
log.Info("Seems not have been started. Try use `alist start` to start server.")
|
log.Info("Seems not have been started. Try use `openlist start` to start server.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
process, err := os.FindProcess(pid)
|
process, err := os.FindProcess(pid)
|
||||||
|
@ -15,7 +15,7 @@ import (
|
|||||||
// VersionCmd represents the version command
|
// VersionCmd represents the version command
|
||||||
var VersionCmd = &cobra.Command{
|
var VersionCmd = &cobra.Command{
|
||||||
Use: "version",
|
Use: "version",
|
||||||
Short: "Show current version of AList",
|
Short: "Show current version of OpenList",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
goVersion := fmt.Sprintf("%s %s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
goVersion := fmt.Sprintf("%s %s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user