Compare commits
46 Commits
module-osn
...
module-tap
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11ae166694 | ||
|
|
15a338ac99 | ||
|
|
54e80e142f | ||
|
|
88951ed3b8 | ||
|
|
34cd2a3d84 | ||
|
|
d13d233076 | ||
|
|
654918c682 | ||
|
|
73ea65b004 | ||
|
|
4ef2e7124a | ||
|
|
ef46f91ec7 | ||
|
|
0f5a346d86 | ||
|
|
caa799e902 | ||
|
|
2be5f6d108 | ||
|
|
05f3c8ffdc | ||
|
|
c0e242b05c | ||
|
|
7929e420b1 | ||
|
|
66de213f43 | ||
|
|
2166cec66f | ||
|
|
1a0f9727c4 | ||
|
|
810253fe94 | ||
|
|
23429a6193 | ||
|
|
49e40f316f | ||
|
|
1e7b655826 | ||
|
|
adea16ce7e | ||
|
|
c2222859a5 | ||
|
|
e7dde2ff51 | ||
|
|
d06c1e8a99 | ||
|
|
131faacce0 | ||
|
|
8133704761 | ||
|
|
09e61aecad | ||
|
|
bc5fd5fd82 | ||
|
|
1367355661 | ||
|
|
30195f1513 | ||
|
|
88b140ccc2 | ||
|
|
39947f464c | ||
|
|
7440e85c2e | ||
|
|
d71747928c | ||
|
|
b20d5c0876 | ||
|
|
c4fc3198bb | ||
|
|
260b6154f3 | ||
|
|
ecfcd0d1d8 | ||
|
|
a3032638e5 | ||
|
|
3e1efb19bd | ||
|
|
8b51b85cb9 | ||
|
|
1481178b48 | ||
|
|
71ffa42faa |
@@ -317,7 +317,7 @@ spec:
|
||||
chown -R 1000:1000 /uploadstemp && \
|
||||
chown -R 1000:1000 /appdata
|
||||
- name: olares-app-init
|
||||
image: beclab/system-frontend:v1.7.1
|
||||
image: beclab/system-frontend:v1.7.7
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/sh
|
||||
@@ -439,7 +439,7 @@ spec:
|
||||
- name: NATS_SUBJECT_VAULT
|
||||
value: os.vault.{{ .Values.bfl.username}}
|
||||
- name: user-service
|
||||
image: beclab/user-service:v0.0.81
|
||||
image: beclab/user-service:v0.0.82
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
|
||||
@@ -36,6 +36,7 @@ import (
|
||||
"github.com/beclab/Olares/cli/pkg/k3s/templates"
|
||||
"github.com/beclab/Olares/cli/pkg/manifest"
|
||||
"github.com/beclab/Olares/cli/pkg/registry"
|
||||
"github.com/beclab/Olares/cli/pkg/storage"
|
||||
)
|
||||
|
||||
type InstallContainerModule struct {
|
||||
@@ -470,6 +471,18 @@ func (j *JoinNodesModule) Init() {
|
||||
Parallel: true,
|
||||
}
|
||||
|
||||
createSharedLibDirForWorker := &task.RemoteTask{
|
||||
Name: "CreateSharedLibDir(k3s)",
|
||||
Desc: "Create shared lib directory on worker",
|
||||
Hosts: j.Runtime.GetHostsByRole(common.Worker),
|
||||
Prepare: &prepare.PrepareCollection{
|
||||
&kubernetes.NodeInCluster{Not: true},
|
||||
new(common.OnlyWorker),
|
||||
},
|
||||
Action: new(storage.CreateSharedLibDir),
|
||||
Parallel: true,
|
||||
}
|
||||
|
||||
enableK3s := &task.RemoteTask{
|
||||
Name: "EnableK3sService",
|
||||
Desc: "Enable k3s service",
|
||||
@@ -536,6 +549,7 @@ func (j *JoinNodesModule) Init() {
|
||||
k3sService,
|
||||
k3sEnv,
|
||||
k3sRegistryConfig,
|
||||
createSharedLibDirForWorker,
|
||||
enableK3s,
|
||||
copyKubeConfigForMaster,
|
||||
syncKubeConfigToWorker,
|
||||
|
||||
@@ -397,53 +397,23 @@ type CopyK3sKubeConfig struct {
|
||||
}
|
||||
|
||||
func (c *CopyK3sKubeConfig) Execute(runtime connector.Runtime) error {
|
||||
createConfigDirCmd := "mkdir -p /root/.kube && mkdir -p $HOME/.kube"
|
||||
getKubeConfigCmd := "cp -f /etc/rancher/k3s/k3s.yaml /root/.kube/config"
|
||||
chmodKubeConfigCmd := "chmod 0600 /root/.kube/config"
|
||||
targetHome, targetUID, targetGID, err := utils.ResolveSudoUserHomeAndIDs(runtime)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd := strings.Join([]string{createConfigDirCmd, getKubeConfigCmd, chmodKubeConfigCmd}, " && ")
|
||||
if _, err := runtime.GetRunner().SudoCmd(cmd, false, false); err != nil {
|
||||
cmds := []string{
|
||||
"mkdir -p /root/.kube",
|
||||
"cp -f /etc/rancher/k3s/k3s.yaml /root/.kube/config",
|
||||
"chmod 0600 /root/.kube/config",
|
||||
fmt.Sprintf("mkdir -p %s", filepath.Join(targetHome, ".kube")),
|
||||
fmt.Sprintf("cp -f /etc/rancher/k3s/k3s.yaml %s", filepath.Join(targetHome, ".kube", "config")),
|
||||
fmt.Sprintf("chmod 0600 %s", filepath.Join(targetHome, ".kube", "config")),
|
||||
fmt.Sprintf("chown -R %s:%s %s", targetUID, targetGID, filepath.Join(targetHome, ".kube")),
|
||||
}
|
||||
if _, err := runtime.GetRunner().SudoCmd(strings.Join(cmds, " && "), false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "copy k3s kube config failed")
|
||||
}
|
||||
|
||||
userMkdir := "mkdir -p $HOME/.kube"
|
||||
if _, err := runtime.GetRunner().Cmd(userMkdir, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "user mkdir $HOME/.kube failed")
|
||||
}
|
||||
|
||||
userCopyKubeConfig := "cp -f /etc/rancher/k3s/k3s.yaml $HOME/.kube/config"
|
||||
if _, err := runtime.GetRunner().SudoCmd(userCopyKubeConfig, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "user copy /etc/rancher/k3s/k3s.yaml to $HOME/.kube/config failed")
|
||||
}
|
||||
|
||||
if _, err := runtime.GetRunner().SudoCmd("chmod 0600 $HOME/.kube/config", false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "chmod k3s $HOME/.kube/config 0600 failed")
|
||||
}
|
||||
|
||||
// userId, err := runtime.GetRunner().Cmd("echo $(id -u)", false, false)
|
||||
// if err != nil {
|
||||
// return errors.Wrap(errors.WithStack(err), "get user id failed")
|
||||
// }
|
||||
|
||||
// userGroupId, err := runtime.GetRunner().Cmd("echo $(id -g)", false, false)
|
||||
// if err != nil {
|
||||
// return errors.Wrap(errors.WithStack(err), "get user group id failed")
|
||||
// }
|
||||
|
||||
userId, err := runtime.GetRunner().Cmd("echo $SUDO_UID", false, false)
|
||||
if err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "get user id failed")
|
||||
}
|
||||
|
||||
userGroupId, err := runtime.GetRunner().Cmd("echo $SUDO_GID", false, false)
|
||||
if err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "get user group id failed")
|
||||
}
|
||||
|
||||
chownKubeConfig := fmt.Sprintf("chown -R %s:%s $HOME/.kube", userId, userGroupId)
|
||||
if _, err := runtime.GetRunner().SudoCmd(chownKubeConfig, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "chown user kube config failed")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -493,59 +463,29 @@ func (s *SyncKubeConfigToWorker) Execute(runtime connector.Runtime) error {
|
||||
if v, ok := s.PipelineCache.Get(common.ClusterStatus); ok {
|
||||
cluster := v.(*K3sStatus)
|
||||
|
||||
createConfigDirCmd := "mkdir -p /root/.kube"
|
||||
if _, err := runtime.GetRunner().SudoCmd(createConfigDirCmd, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "create .kube dir failed")
|
||||
}
|
||||
|
||||
oldServer := "server: https://127.0.0.1:6443"
|
||||
newServer := fmt.Sprintf("server: https://%s:%d",
|
||||
s.KubeConf.Cluster.ControlPlaneEndpoint.Domain,
|
||||
s.KubeConf.Cluster.ControlPlaneEndpoint.Port)
|
||||
newKubeConfig := strings.Replace(cluster.KubeConfig, oldServer, newServer, -1)
|
||||
|
||||
syncKubeConfigForRootCmd := fmt.Sprintf("echo '%s' > %s", newKubeConfig, "/root/.kube/config")
|
||||
if _, err := runtime.GetRunner().SudoCmd(syncKubeConfigForRootCmd, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "sync kube config for root failed")
|
||||
}
|
||||
|
||||
if _, err := runtime.GetRunner().SudoCmd("chmod 0600 /root/.kube/config", false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "chmod k3s $HOME/.kube/config failed")
|
||||
}
|
||||
|
||||
userConfigDirCmd := "mkdir -p $HOME/.kube"
|
||||
if _, err := runtime.GetRunner().Cmd(userConfigDirCmd, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "user mkdir $HOME/.kube failed")
|
||||
}
|
||||
|
||||
syncKubeConfigForUserCmd := fmt.Sprintf("echo '%s' > %s", newKubeConfig, "$HOME/.kube/config")
|
||||
if _, err := runtime.GetRunner().Cmd(syncKubeConfigForUserCmd, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "sync kube config for normal user failed")
|
||||
}
|
||||
|
||||
// userId, err := runtime.GetRunner().Cmd("echo $(id -u)", false, false)
|
||||
// if err != nil {
|
||||
// return errors.Wrap(errors.WithStack(err), "get user id failed")
|
||||
// }
|
||||
|
||||
// userGroupId, err := runtime.GetRunner().Cmd("echo $(id -g)", false, false)
|
||||
// if err != nil {
|
||||
// return errors.Wrap(errors.WithStack(err), "get user group id failed")
|
||||
// }
|
||||
|
||||
userId, err := runtime.GetRunner().Cmd("echo $SUDO_UID", false, false)
|
||||
targetHome, targetUID, targetGID, err := utils.ResolveSudoUserHomeAndIDs(runtime)
|
||||
if err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "get user id failed")
|
||||
return err
|
||||
}
|
||||
targetKubeConfigPath := filepath.Join(targetHome, ".kube", "config")
|
||||
|
||||
userGroupId, err := runtime.GetRunner().Cmd("echo $SUDO_GID", false, false)
|
||||
if err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "get user group id failed")
|
||||
cmds := []string{
|
||||
"mkdir -p /root/.kube",
|
||||
fmt.Sprintf("echo '%s' > %s", newKubeConfig, "/root/.kube/config"),
|
||||
"chmod 0600 /root/.kube/config",
|
||||
fmt.Sprintf("mkdir -p %s", filepath.Join(targetHome, ".kube")),
|
||||
fmt.Sprintf("echo '%s' > %s", newKubeConfig, targetKubeConfigPath),
|
||||
fmt.Sprintf("chmod 0600 %s", targetKubeConfigPath),
|
||||
fmt.Sprintf("chown -R %s:%s %s", targetUID, targetGID, filepath.Join(targetHome, ".kube")),
|
||||
}
|
||||
|
||||
chownKubeConfig := fmt.Sprintf("chown -R %s:%s -R $HOME/.kube", userId, userGroupId)
|
||||
if _, err := runtime.GetRunner().SudoCmd(chownKubeConfig, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "chown user kube config failed")
|
||||
if _, err := runtime.GetRunner().SudoCmd(strings.Join(cmds, " && "), false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "sync kube config failed")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/beclab/Olares/cli/pkg/core/prepare"
|
||||
"github.com/beclab/Olares/cli/pkg/core/task"
|
||||
"github.com/beclab/Olares/cli/pkg/manifest"
|
||||
"github.com/beclab/Olares/cli/pkg/storage"
|
||||
)
|
||||
|
||||
type StatusModule struct {
|
||||
@@ -243,6 +244,18 @@ func (j *JoinNodesModule) Init() {
|
||||
Retry: 5,
|
||||
}
|
||||
|
||||
createSharedLibDirForWorker := &task.RemoteTask{
|
||||
Name: "CreateSharedLibDir(k8s)",
|
||||
Desc: "Create shared lib directory on worker",
|
||||
Hosts: j.Runtime.GetHostsByRole(common.Worker),
|
||||
Prepare: &prepare.PrepareCollection{
|
||||
&NodeInCluster{Not: true},
|
||||
new(common.OnlyWorker),
|
||||
},
|
||||
Action: new(storage.CreateSharedLibDir),
|
||||
Parallel: true,
|
||||
}
|
||||
|
||||
joinWorkerNode := &task.RemoteTask{
|
||||
Name: "JoinWorkerNode(k8s)",
|
||||
Desc: "Join worker node",
|
||||
@@ -323,6 +336,7 @@ func (j *JoinNodesModule) Init() {
|
||||
j.Tasks = []task.Interface{
|
||||
generateKubeadmConfig,
|
||||
joinMasterNode,
|
||||
createSharedLibDirForWorker,
|
||||
joinWorkerNode,
|
||||
copyKubeConfig,
|
||||
removeMasterTaint,
|
||||
|
||||
@@ -417,51 +417,23 @@ type CopyKubeConfigForControlPlane struct {
|
||||
}
|
||||
|
||||
func (c *CopyKubeConfigForControlPlane) Execute(runtime connector.Runtime) error {
|
||||
createConfigDirCmd := "mkdir -p /root/.kube"
|
||||
getKubeConfigCmd := "cp -f /etc/kubernetes/admin.conf /root/.kube/config"
|
||||
cmd := strings.Join([]string{createConfigDirCmd, getKubeConfigCmd}, " && ")
|
||||
if _, err := runtime.GetRunner().SudoCmd(cmd, false, false); err != nil {
|
||||
targetHome, targetUID, targetGID, err := utils.ResolveSudoUserHomeAndIDs(runtime)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmds := []string{
|
||||
"mkdir -p /root/.kube",
|
||||
"cp -f /etc/kubernetes/admin.conf /root/.kube/config",
|
||||
"chmod 0600 /root/.kube/config",
|
||||
fmt.Sprintf("mkdir -p %s", filepath.Join(targetHome, ".kube")),
|
||||
fmt.Sprintf("cp -f /etc/kubernetes/admin.conf %s", filepath.Join(targetHome, ".kube", "config")),
|
||||
fmt.Sprintf("chmod 0600 %s", filepath.Join(targetHome, ".kube", "config")),
|
||||
fmt.Sprintf("chown -R %s:%s %s", targetUID, targetGID, filepath.Join(targetHome, ".kube")),
|
||||
}
|
||||
if _, err := runtime.GetRunner().SudoCmd(strings.Join(cmds, " && "), false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "copy kube config failed")
|
||||
}
|
||||
|
||||
userMkdir := "mkdir -p $HOME/.kube"
|
||||
if _, err := runtime.GetRunner().Cmd(userMkdir, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "user mkdir $HOME/.kube failed")
|
||||
}
|
||||
|
||||
userCopyKubeConfig := "cp -f /etc/kubernetes/admin.conf $HOME/.kube/config"
|
||||
if _, err := runtime.GetRunner().SudoCmd(userCopyKubeConfig, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "user copy /etc/kubernetes/admin.conf to $HOME/.kube/config failed")
|
||||
}
|
||||
|
||||
if _, err := runtime.GetRunner().SudoCmd("chmod 0600 $HOME/.kube/config", false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "chmod $HOME/.kube/config failed")
|
||||
}
|
||||
|
||||
// userId, err := runtime.GetRunner().Cmd("echo $(id -u)", false, false)
|
||||
// if err != nil {
|
||||
// return errors.Wrap(errors.WithStack(err), "get user id failed")
|
||||
// }
|
||||
|
||||
// userGroupId, err := runtime.GetRunner().Cmd("echo $(id -g)", false, false)
|
||||
// if err != nil {
|
||||
// return errors.Wrap(errors.WithStack(err), "get user group id failed")
|
||||
// }
|
||||
|
||||
userId, err := runtime.GetRunner().Cmd("echo $SUDO_UID", false, false)
|
||||
if err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "get user id failed")
|
||||
}
|
||||
|
||||
userGroupId, err := runtime.GetRunner().Cmd("echo $SUDO_GID", false, false)
|
||||
if err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "get user group id failed")
|
||||
}
|
||||
|
||||
chownKubeConfig := fmt.Sprintf("chown -R %s:%s $HOME/.kube", userId, userGroupId)
|
||||
if _, err := runtime.GetRunner().SudoCmd(chownKubeConfig, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "chown user kube config failed")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -521,53 +493,23 @@ func (s *SyncKubeConfigToWorker) Execute(runtime connector.Runtime) error {
|
||||
if v, ok := s.PipelineCache.Get(common.ClusterStatus); ok {
|
||||
cluster := v.(*KubernetesStatus)
|
||||
|
||||
createConfigDirCmd := "mkdir -p /root/.kube"
|
||||
if _, err := runtime.GetRunner().SudoCmd(createConfigDirCmd, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "create .kube dir failed")
|
||||
}
|
||||
|
||||
syncKubeConfigForRootCmd := fmt.Sprintf("echo '%s' > %s", cluster.KubeConfig, "/root/.kube/config")
|
||||
if _, err := runtime.GetRunner().SudoCmd(syncKubeConfigForRootCmd, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "sync kube config for root failed")
|
||||
}
|
||||
|
||||
if _, err := runtime.GetRunner().SudoCmd("chmod 0600 /root/.kube/config", false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "chmod $HOME/.kube/config failed")
|
||||
}
|
||||
|
||||
userConfigDirCmd := "mkdir -p $HOME/.kube"
|
||||
if _, err := runtime.GetRunner().Cmd(userConfigDirCmd, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "user mkdir $HOME/.kube failed")
|
||||
}
|
||||
|
||||
syncKubeConfigForUserCmd := fmt.Sprintf("echo '%s' > %s", cluster.KubeConfig, "$HOME/.kube/config")
|
||||
if _, err := runtime.GetRunner().Cmd(syncKubeConfigForUserCmd, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "sync kube config for normal user failed")
|
||||
}
|
||||
|
||||
// userId, err := runtime.GetRunner().Cmd("echo $(id -u)", false, false)
|
||||
// if err != nil {
|
||||
// return errors.Wrap(errors.WithStack(err), "get user id failed")
|
||||
// }
|
||||
|
||||
// userGroupId, err := runtime.GetRunner().Cmd("echo $(id -g)", false, false)
|
||||
// if err != nil {
|
||||
// return errors.Wrap(errors.WithStack(err), "get user group id failed")
|
||||
// }
|
||||
|
||||
userId, err := runtime.GetRunner().Cmd("echo $SUDO_UID", false, false)
|
||||
targetHome, targetUID, targetGID, err := utils.ResolveSudoUserHomeAndIDs(runtime)
|
||||
if err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "get user id failed")
|
||||
return err
|
||||
}
|
||||
targetKubeConfigPath := filepath.Join(targetHome, ".kube", "config")
|
||||
|
||||
userGroupId, err := runtime.GetRunner().Cmd("echo $SUDO_GID", false, false)
|
||||
if err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "get user group id failed")
|
||||
cmds := []string{
|
||||
"mkdir -p /root/.kube",
|
||||
fmt.Sprintf("echo '%s' > %s", cluster.KubeConfig, "/root/.kube/config"),
|
||||
"chmod 0600 /root/.kube/config",
|
||||
fmt.Sprintf("mkdir -p %s", filepath.Join(targetHome, ".kube")),
|
||||
fmt.Sprintf("echo '%s' > %s", cluster.KubeConfig, targetKubeConfigPath),
|
||||
fmt.Sprintf("chmod 0600 %s", targetKubeConfigPath),
|
||||
fmt.Sprintf("chown -R %s:%s %s", targetUID, targetGID, filepath.Join(targetHome, ".kube")),
|
||||
}
|
||||
|
||||
chownKubeConfig := fmt.Sprintf("chown -R %s:%s -R $HOME/.kube", userId, userGroupId)
|
||||
if _, err := runtime.GetRunner().SudoCmd(chownKubeConfig, false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "chown user kube config failed")
|
||||
if _, err := runtime.GetRunner().SudoCmd(strings.Join(cmds, " && "), false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "sync kube config failed")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -396,3 +396,17 @@ func (t *DeleteTerminusData) Execute(runtime connector.Runtime) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type CreateSharedLibDir struct {
|
||||
common.KubeAction
|
||||
}
|
||||
|
||||
func (t *CreateSharedLibDir) Execute(runtime connector.Runtime) error {
|
||||
if runtime.GetSystemInfo().IsDarwin() {
|
||||
return nil
|
||||
}
|
||||
if _, err := runtime.GetRunner().SudoCmd(fmt.Sprintf("mkdir -p %s && chown 1000:1000 %s", OlaresSharedLibDir, OlaresSharedLibDir), false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "failed to create shared lib dir")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -38,12 +38,6 @@ type InstallOsSystem struct {
|
||||
}
|
||||
|
||||
func (t *InstallOsSystem) Execute(runtime connector.Runtime) error {
|
||||
if !runtime.GetSystemInfo().IsDarwin() {
|
||||
if _, err := runtime.GetRunner().SudoCmd(fmt.Sprintf("mkdir -p %s && chown 1000:1000 %s", storage.OlaresSharedLibDir, storage.OlaresSharedLibDir), false, false); err != nil {
|
||||
return errors.Wrap(errors.WithStack(err), "failed to create shared lib dir")
|
||||
}
|
||||
}
|
||||
|
||||
config, err := ctrl.GetConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -367,6 +361,11 @@ func (m *InstallOsSystemModule) Init() {
|
||||
Action: &CreateUserEnvConfigMap{},
|
||||
}
|
||||
|
||||
createSharedLibDir := &task.LocalTask{
|
||||
Name: "CreateSharedLibDir",
|
||||
Action: &storage.CreateSharedLibDir{},
|
||||
}
|
||||
|
||||
installOsSystem := &task.LocalTask{
|
||||
Name: "InstallOsSystem",
|
||||
Action: &InstallOsSystem{},
|
||||
@@ -399,6 +398,7 @@ func (m *InstallOsSystemModule) Init() {
|
||||
m.Tasks = []task.Interface{
|
||||
applySystemEnv,
|
||||
createUserEnvConfigMap,
|
||||
createSharedLibDir,
|
||||
installOsSystem,
|
||||
createBackupConfigMap,
|
||||
checkSystemService,
|
||||
|
||||
@@ -321,3 +321,54 @@ func GetBufIOReaderOfTerminalInput() (*bufio.Reader, error) {
|
||||
}
|
||||
return bufio.NewReader(tty), nil
|
||||
}
|
||||
|
||||
// ResolveSudoUserHomeAndIDs resolves the home directory, uid, and gid for the user
|
||||
// who invoked sudo. If not running under sudo, it falls back to the current user.
|
||||
// This is useful for commands that need to operate on the invoking user's home
|
||||
// directory rather than /root when running with sudo.
|
||||
func ResolveSudoUserHomeAndIDs(runtime connector.Runtime) (home, uid, gid string, err error) {
|
||||
uid, err = runtime.GetRunner().Cmd("echo ${SUDO_UID:-}", false, false)
|
||||
if err != nil {
|
||||
return "", "", "", errors.Wrap(errors.WithStack(err), "get SUDO_UID failed")
|
||||
}
|
||||
gid, err = runtime.GetRunner().Cmd("echo ${SUDO_GID:-}", false, false)
|
||||
if err != nil {
|
||||
return "", "", "", errors.Wrap(errors.WithStack(err), "get SUDO_GID failed")
|
||||
}
|
||||
uid = strings.TrimSpace(uid)
|
||||
gid = strings.TrimSpace(gid)
|
||||
|
||||
if uid == "" {
|
||||
uid, err = runtime.GetRunner().Cmd("id -u", false, false)
|
||||
if err != nil {
|
||||
return "", "", "", errors.Wrap(errors.WithStack(err), "get current uid failed")
|
||||
}
|
||||
gid, err = runtime.GetRunner().Cmd("id -g", false, false)
|
||||
if err != nil {
|
||||
return "", "", "", errors.Wrap(errors.WithStack(err), "get current gid failed")
|
||||
}
|
||||
uid = strings.TrimSpace(uid)
|
||||
gid = strings.TrimSpace(gid)
|
||||
}
|
||||
|
||||
home, err = runtime.GetRunner().Cmd(fmt.Sprintf(`getent passwd %s | awk -F: 'NR==1{print $6; exit}'`, uid), false, false)
|
||||
if err != nil {
|
||||
home = ""
|
||||
}
|
||||
home = strings.TrimSpace(home)
|
||||
if home == "" {
|
||||
home, _ = runtime.GetRunner().Cmd(fmt.Sprintf(`awk -F: -v uid=%s '$3==uid {print $6; exit}' /etc/passwd 2>/dev/null`, uid), false, false)
|
||||
home = strings.TrimSpace(home)
|
||||
}
|
||||
if home == "" {
|
||||
home, err = runtime.GetRunner().Cmd("echo $HOME", false, false)
|
||||
if err != nil {
|
||||
return "", "", "", errors.Wrap(errors.WithStack(err), "get HOME failed")
|
||||
}
|
||||
home = strings.TrimSpace(home)
|
||||
}
|
||||
if home == "" {
|
||||
return "", "", "", errors.New("resolve user home failed")
|
||||
}
|
||||
return home, uid, gid, nil
|
||||
}
|
||||
|
||||
@@ -84,8 +84,15 @@ func (p *proxyServer) Start() error {
|
||||
clientIp = h
|
||||
}
|
||||
}
|
||||
|
||||
if c.IsWebSocket() {
|
||||
ctx = context.WithValue(ctx, WSKey, true)
|
||||
swp := c.Request().Header.Get("Sec-WebSocket-Protocol")
|
||||
authToken := c.Request().Header.Get("X-Authorization")
|
||||
if len(authToken) == 0 && len(swp) > 0 {
|
||||
// handle missing auth token for websocket
|
||||
c.Request().Header.Set("X-Authorization", swp)
|
||||
}
|
||||
}
|
||||
r := c.Request().WithContext(ctx)
|
||||
if clientIp != "" {
|
||||
@@ -243,7 +250,7 @@ func (p *proxyServer) customDialContext(d *net.Dialer) func(ctx context.Context,
|
||||
}
|
||||
|
||||
if isWs {
|
||||
klog.Info("WebSocket connection detected, using upgraded dialer")
|
||||
klog.Info("WebSocket connection detected, using upgraded dialer, ", addr)
|
||||
return tlsDial(ctx, d, func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
return proxyDial(ctx, d, network, newAddr)
|
||||
}, network, addr, &tls.Config{InsecureSkipVerify: true})
|
||||
|
||||
@@ -554,6 +554,18 @@ const side = {
|
||||
text: "ACE-Step",
|
||||
link: "/use-cases/ace-step",
|
||||
},
|
||||
{
|
||||
text: "Stirling PDF",
|
||||
link: "/use-cases/stirling-pdf",
|
||||
},
|
||||
{
|
||||
text: "PDFMathTranslate",
|
||||
link: "/use-cases/pdfmathtranslate",
|
||||
},
|
||||
{
|
||||
text: "LobeChat",
|
||||
link: "/use-cases/lobechat",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -626,65 +638,46 @@ const side = {
|
||||
link: "/developer/install/cli/olares-cli",
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: "gpu", link: "/developer/install/cli/gpu" },
|
||||
{ text: "osinfo", link: "/developer/install/cli/osinfo" },
|
||||
{ text: "node", link: "/developer/install/cli/node" },
|
||||
{
|
||||
text: "backups",
|
||||
link: "/developer/install/cli/backups",
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: "backup", link: "/developer/install/cli/backups-backup" },
|
||||
{ text: "download", link: "/developer/install/cli/backups-download" },
|
||||
{ text: "region", link: "/developer/install/cli/backups-region" },
|
||||
{ text: "backup", link: "/developer/install/cli/backups-backup" },
|
||||
{ text: "restore", link: "/developer/install/cli/backups-restore" },
|
||||
{ text: "snapshots", link: "/developer/install/cli/backups-snapshots" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{ text: "change-ip", link: "/developer/install/cli/change-ip" },
|
||||
{ text: "disk", link: "/developer/install/cli/disk" },
|
||||
{ text: "download", link: "/developer/install/cli/download" },
|
||||
{ text: "gpu", link: "/developer/install/cli/gpu" },
|
||||
{ text: "info", link: "/developer/install/cli/info" },
|
||||
{ text: "install", link: "/developer/install/cli/install" },
|
||||
{ text: "logs", link: "/developer/install/cli/logs" },
|
||||
{ text: "node", link: "/developer/install/cli/node" },
|
||||
{ text: "osinfo", link: "/developer/install/cli/osinfo" },
|
||||
{ text: "precheck", link: "/developer/install/cli/precheck" },
|
||||
{ text: "prepare", link: "/developer/install/cli/prepare" },
|
||||
{ text: "release", link: "/developer/install/cli/release" },
|
||||
{ text: "start", link: "/developer/install/cli/start" },
|
||||
{ text: "stop", link: "/developer/install/cli/stop" },
|
||||
{ text: "uninstall", link: "/developer/install/cli/uninstall" },
|
||||
{ text: "upgrade", link: "/developer/install/cli/upgrade" },
|
||||
{
|
||||
text: "change-ip",
|
||||
link: "/developer/install/cli/change-ip",
|
||||
},
|
||||
{
|
||||
text: "download",
|
||||
link: "/developer/install/cli/download",
|
||||
},
|
||||
{ text: "info", link: "/developer/install/cli/info" },
|
||||
{
|
||||
text: "install",
|
||||
link: "/developer/install/cli/install",
|
||||
},
|
||||
{
|
||||
text: "user activate",
|
||||
link: "/developer/install/cli/user-activate",
|
||||
},
|
||||
{
|
||||
text: "logs",
|
||||
link: "/developer/install/cli/logs",
|
||||
},
|
||||
{
|
||||
text: "precheck",
|
||||
link: "/developer/install/cli/precheck",
|
||||
},
|
||||
{
|
||||
text: "prepare",
|
||||
link: "/developer/install/cli/prepare",
|
||||
},
|
||||
{
|
||||
text: "release",
|
||||
link: "/developer/install/cli/release",
|
||||
},
|
||||
{
|
||||
text: "start",
|
||||
link: "/developer/install/cli/start",
|
||||
},
|
||||
{
|
||||
text: "stop",
|
||||
link: "/developer/install/cli/stop",
|
||||
},
|
||||
{
|
||||
text: "uninstall",
|
||||
link: "/developer/install/cli/uninstall",
|
||||
text: "user",
|
||||
link: "/developer/install/cli/user",
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: "activate", link: "/developer/install/cli/user-activate" },
|
||||
{ text: "create", link: "/developer/install/cli/user-create" },
|
||||
{ text: "delete", link: "/developer/install/cli/user-delete" },
|
||||
{ text: "get", link: "/developer/install/cli/user-get" },
|
||||
{ text: "list", link: "/developer/install/cli/user-list" },
|
||||
{ text: "reset-password", link: "/developer/install/cli/user-reset-password" },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -608,72 +608,52 @@ const side = {
|
||||
},
|
||||
{
|
||||
text: "Olares CLI",
|
||||
collapsed: true,
|
||||
link: "/zh/developer/install/cli/olares-cli",
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: "gpu", link: "/zh/developer/install/cli/gpu" },
|
||||
{ text: "osinfo", link: "/zh/developer/install/cli/osinfo" },
|
||||
{ text: "node", link: "/zh/developer/install/cli/node" },
|
||||
{
|
||||
text: "backups",
|
||||
link: "/zh/developer/install/cli/backups",
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: "backup", link: "/zh/developer/install/cli/backups-backup" },
|
||||
{ text: "download", link: "/zh/developer/install/cli/backups-download" },
|
||||
{ text: "region", link: "/zh/developer/install/cli/backups-region" },
|
||||
{ text: "backup", link: "/zh/developer/install/cli/backups-backup" },
|
||||
{ text: "restore", link: "/zh/developer/install/cli/backups-restore" },
|
||||
{ text: "snapshots", link: "/zh/developer/install/cli/backups-snapshots" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{ text: "change-ip", link: "/zh/developer/install/cli/change-ip" },
|
||||
{ text: "disk", link: "/zh/developer/install/cli/disk" },
|
||||
{ text: "download", link: "/zh/developer/install/cli/download" },
|
||||
{ text: "gpu", link: "/zh/developer/install/cli/gpu" },
|
||||
{ text: "info", link: "/zh/developer/install/cli/info" },
|
||||
{ text: "install", link: "/zh/developer/install/cli/install" },
|
||||
{ text: "logs", link: "/zh/developer/install/cli/logs" },
|
||||
{ text: "node", link: "/zh/developer/install/cli/node" },
|
||||
{ text: "osinfo", link: "/zh/developer/install/cli/osinfo" },
|
||||
{ text: "precheck", link: "/zh/developer/install/cli/precheck" },
|
||||
{ text: "prepare", link: "/zh/developer/install/cli/prepare" },
|
||||
{ text: "release", link: "/zh/developer/install/cli/release" },
|
||||
{ text: "start", link: "/zh/developer/install/cli/start" },
|
||||
{ text: "stop", link: "/zh/developer/install/cli/stop" },
|
||||
{ text: "uninstall", link: "/zh/developer/install/cli/uninstall" },
|
||||
{ text: "upgrade", link: "/zh/developer/install/cli/upgrade" },
|
||||
{
|
||||
text: "change-ip",
|
||||
link: "/zh/developer/install/cli/change-ip",
|
||||
},
|
||||
{
|
||||
text: "download",
|
||||
link: "/zh/developer/install/cli/download",
|
||||
},
|
||||
{ text: "info", link: "/zh/developer/install/cli/info" },
|
||||
{
|
||||
text: "install",
|
||||
link: "/zh/developer/install/cli/install",
|
||||
},
|
||||
{
|
||||
text: "user activate",
|
||||
link: "/zh/developer/install/cli/user-activate",
|
||||
},
|
||||
{
|
||||
text: "logs",
|
||||
link: "/zh/developer/install/cli/logs",
|
||||
},
|
||||
{
|
||||
text: "precheck",
|
||||
link: "/zh/developer/install/cli/precheck",
|
||||
},
|
||||
{
|
||||
text: "prepare",
|
||||
link: "/zh/developer/install/cli/prepare",
|
||||
},
|
||||
{
|
||||
text: "release",
|
||||
link: "/zh/developer/install/cli/release",
|
||||
},
|
||||
{
|
||||
text: "start",
|
||||
link: "/zh/developer/install/cli/start",
|
||||
},
|
||||
{
|
||||
text: "stop",
|
||||
link: "/zh/developer/install/cli/stop",
|
||||
},
|
||||
{
|
||||
text: "uninstall",
|
||||
link: "/zh/developer/install/cli/uninstall",
|
||||
text: "user",
|
||||
link: "/zh/developer/install/cli/user",
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: "activate", link: "/zh/developer/install/cli/user-activate" },
|
||||
{ text: "create", link: "/zh/developer/install/cli/user-create" },
|
||||
{ text: "delete", link: "/zh/developer/install/cli/user-delete" },
|
||||
{ text: "get", link: "/zh/developer/install/cli/user-get" },
|
||||
{ text: "list", link: "/zh/developer/install/cli/user-list" },
|
||||
{ text: "reset-password", link: "/zh/developer/install/cli/user-reset-password" },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
text: "版本说明",
|
||||
link: "/zh/developer/install/versioning",
|
||||
@@ -719,7 +699,7 @@ const side = {
|
||||
text: "OlaresManifest",
|
||||
link: "/zh/developer/develop/package/manifest",
|
||||
},
|
||||
/*/{
|
||||
/*{
|
||||
text: "推荐算法",
|
||||
link: "/zh/developer/develop/package/recommend",
|
||||
},*/
|
||||
|
||||
@@ -65,7 +65,7 @@ These options apply to all backends:
|
||||
kubectl get terminus -o jsonpath='{.items[*].metadata.labels.bytetrade\.io/cluster-id}'
|
||||
```
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
```bash
|
||||
# Backup to Tencent COS
|
||||
olares-cli backups backup cos --path /data --repo-name my_repo \
|
||||
|
||||
@@ -12,7 +12,7 @@ olares-cli backups download [options]
|
||||
|--------------------|-----------|--------------------------------------------------------|-------------------------|--------------------|
|
||||
| `--download-cdn-url`| | Specifies the CDN URL for downloading the Restic tool. | No | System default URL |
|
||||
| `--help` | `-h` | Displays help information. | No | N/A |
|
||||
## Example
|
||||
## Examples
|
||||
```bash d
|
||||
# Download Restic using a custom CDN URL
|
||||
olares-cli backups download --download-cdn-url https://custom-cdn.example.com/restic
|
||||
|
||||
@@ -17,7 +17,7 @@ olares-cli backups region space [options]
|
||||
|
||||
1. To retrieve the access token and Olares DID, inspect the payload of the network requests made by the Olares Space web interface after logging in. The `token` field corresponds to the access token, and the `userid` field corresponds to the Olares DID.
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
```bash
|
||||
# Query cloud name and region ID
|
||||
olares-cli backups region space \
|
||||
|
||||
@@ -69,7 +69,7 @@ These options apply to all backends:
|
||||
kubectl get terminus -o jsonpath='{.items[*].metadata.labels.bytetrade\.io/cluster-id}'
|
||||
```
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
```bash
|
||||
# Restore the data from Tencent COS
|
||||
olares-cli backups restore cos --path /data_restore --repo-name my_repo \
|
||||
|
||||
@@ -61,7 +61,7 @@ These options apply to all backends:
|
||||
kubectl get terminus -o jsonpath='{.items[*].metadata.labels.bytetrade\.io/cluster-id}'
|
||||
```
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
```bash
|
||||
# List snapshots for Tencent COS
|
||||
olares-cli backups snapshots cos --repo-name my_repo \
|
||||
|
||||
33
docs/developer/install/cli/disk.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# `disk`
|
||||
|
||||
## Synopsis
|
||||
|
||||
The `disk` command provides a set of tools to manage storage resources in the Olares system. It is specifically used for managing LVM-based storage configurations.
|
||||
|
||||
|
||||
```bash
|
||||
olares-cli disk <subcommand>
|
||||
```
|
||||
|
||||
## Subcommands
|
||||
|
||||
| Subcommand | Description |
|
||||
|--|--|
|
||||
| `extend` | Extends Olares storage capacity on LVM-based installations. |
|
||||
| `list-unmounted` | Lists unmounted disks. |
|
||||
|
||||
## Options
|
||||
|
||||
| Name | Shorthand | Usage |
|
||||
|--|--|--|
|
||||
| `--help` | `-h` | Displays help information.|
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# List all disks that are connected but not mounted
|
||||
olares-cli disk list-unmounted
|
||||
|
||||
# Extend Olares storage by adding newly detected unmounted disks
|
||||
olares-cli disk extend
|
||||
```
|
||||
@@ -32,7 +32,7 @@ olares-cli gpu <subcommand> [options]
|
||||
| `--version`| `-v` | Specifies the Olares version for GPU drivers and components. <br>Version values follow the format `x.y.z` (e.g., `1.10.0`) or include a build date (e.g., `1.10.0-20241109`).<br> Refer to the [GitHub Releases page](https://github.com/beclab/Olares/releases) for available versions. | No | Current version |
|
||||
| `--help` | `-h` | Displays help information. | No | N/A |
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# Install GPU drivers and dependencies to a specific directory
|
||||
|
||||
@@ -7,7 +7,7 @@ The `info` command displays general information about the installed Olares versi
|
||||
olares-cli info
|
||||
```
|
||||
|
||||
## Flag
|
||||
## Options
|
||||
|
||||
| Name | Shorthand | Usage |
|
||||
|----------|-----------|---------------------------|
|
||||
|
||||
@@ -28,7 +28,7 @@ olares-cli logs [option]
|
||||
| `--output-dir` | | Saves logs to the specified directory. Creates the directory if it does not exist. | No | `./olares-logs` |
|
||||
| `--since` | | Fetches logs newer than a specified relative duration (e.g., `5s`, `2m`, `3h`). | No | `7d` |
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
```bash
|
||||
# Collect all logs with default settings
|
||||
olares-cli logs
|
||||
|
||||
@@ -29,7 +29,7 @@ olares-cli node <subcommand> [options]
|
||||
| `--version` | `-v` | Specifies the Olares version. <br>Version values follow the format `x.y.z` (e.g., `1.10.0`) or include a build date (e.g., `1.10.0-20241109`).<br> Refer to the [GitHub Releases page](https://github.com/beclab/Olares/releases) for available versions. | No | Current version |
|
||||
| `--help` | `-h` | Displays help information. | No | N/A | |
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# Retrieve system information from a master node at IP 192.168.1.15
|
||||
|
||||
@@ -28,12 +28,13 @@ wsl -d Ubuntu
|
||||
## Syntax
|
||||
The Olares CLI uses the following syntax:
|
||||
|
||||
> `olares-cli command [subcommand] [option]`
|
||||
> `olares-cli command [subcommand] [argument] [options] `
|
||||
|
||||
where
|
||||
- `command`: Specifies the main operation you want to perform. For example, `olares-cli install`.
|
||||
- `subcommand`: Further specifies the task for commands that support additional operations. For example, `wizard` or `component`.
|
||||
- `option`: Optional arguments that modify the behavior of the `command`. Options include flags and options with arguments.
|
||||
- `argument`: Specifies the target resource or input data for the command, typically an ID, name, or file path. For example, in `olares-cli user activate <Olares ID> [options]`, `<Olares ID>` is the argument.
|
||||
- `options`: Optional arguments that modify the behavior of the `command`. Options include flags and options with arguments.
|
||||
|
||||
Olares CLI allows you to temporarily override certain Olares default settings. Each option applies only to the command in which it is used.
|
||||
|
||||
@@ -43,21 +44,23 @@ To get detailed help for any command, run `olares-cli help`.
|
||||
|
||||
## Available CLI commands
|
||||
|
||||
| Operation | Syntax | Description |
|
||||
|--------------------|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `gpu` | `olares-cli gpu <subcommand> [option]` | Manages GPU-related operations. |
|
||||
| `info` | `olares-cli info <subcommand> [option]` | Displays general information about the operating system of the current device. |
|
||||
| `node` | `olares-cli node <subcommand> [option]` | Manages node-related operations. |
|
||||
| `backups` | `olares-cli backups <subcommand> [option]` | Manages backup-related operations. |
|
||||
| `change-ip` | `olares-cli change-ip [option]` | Changes the IP address of the Olares OS. |
|
||||
| `download` | `olares-cli download <subcommand> [option]` | Downloads specific resources. |
|
||||
| `info` | `olares-cli info [option]` | Displays general information about the downloaded Olares OS. |
|
||||
| `install` | `olares-cli install [option]` | Deploys system-level and user-level components of Olares. |
|
||||
| `logs` | `olares-cli logs [option]` | Collects logs from Olares system components for debugging and troubleshooting. |
|
||||
| `precheck` | `olares-cli precheck [option]` | Verifies whether the system environment meets all requirements for Olares installation. |
|
||||
| `prepare` | `olares-cli prepare [option]` | Prepares the environment for the installation process, including setting up essential services and configurations of Olares. |
|
||||
| `release` | `olares-cli release [option]` | Packages Olares installation resources for distribution or deployment. |
|
||||
| `start` | `olares-cli start [option]` | Starts Olares services and components. |
|
||||
| `stop` | `olares-cli stop [option]` | Stops Olares services and components. |
|
||||
| `uninstall` | `olares-cli uninstall [option]` | Uninstalls Olares completely, or roll back the installation to a specific phase. |
|
||||
|
||||
| Operation | Syntax | Description |
|
||||
|--|--|--|
|
||||
| `backups` | `olares-cli backups <subcommand> [options]` | Manages backup-related operations. |
|
||||
| `change-ip` | `olares-cli change-ip [options]` | Changes the IP address of the Olares OS. |
|
||||
| `disk` | `olares-cli disk <subcommand>` | Manages storage resources in the Olares system. |
|
||||
| `download` | `olares-cli download <subcommand> [options]` | Downloads specific resources. |
|
||||
| `gpu` | `olares-cli gpu <subcommand> [options]` | Manages GPU-related operations. |
|
||||
| `info` | `olares-cli info [options]` | Displays general information about the downloaded Olares OS. |
|
||||
| `install` | `olares-cli install [options]` | Deploys system-level and user-level components of Olares. |
|
||||
| `logs` | `olares-cli logs [options]` | Collects logs from Olares system components for debugging and troubleshooting. |
|
||||
| `node` | `olares-cli node <subcommand> [options]` | Manages node-related operations. |
|
||||
| `osinfo` | `olares-cli osinfo <subcommand> [options]` | Displays general information about the operating system of the current device. |
|
||||
| `precheck` | `olares-cli precheck [options]` | Verifies whether the system environment meets all requirements for Olares installation. |
|
||||
| `prepare` | `olares-cli prepare [options]` | Prepares the environment for the installation process, including setting up essential services and configurations of Olares. |
|
||||
| `release` | `olares-cli release [options]` | Packages Olares installation resources for distribution or deployment. |
|
||||
| `start` | `olares-cli start [options]` | Starts Olares services and components. |
|
||||
| `stop` | `olares-cli stop [options]` | Stops Olares services and components. |
|
||||
| `uninstall` | `olares-cli uninstall [options]` | Uninstalls Olares completely, or roll back the installation to a specific phase. |
|
||||
| `upgrade` | `olares-cli upgrade <subcommand> [options]` | Upgrades Olares and checks upgrade readiness and compatibility.|
|
||||
| `user` | `olares-cli user <subcommand> [options]`| Manages users in the Olares system |
|
||||
@@ -8,13 +8,13 @@ The `osinfo` command provides detailed information about the operating system of
|
||||
olares-cli osinfo <subcommand> [options]
|
||||
```
|
||||
|
||||
## Subcommand
|
||||
## Subcommands
|
||||
|
||||
| Subcommand | Description |
|
||||
|------------|----------------------------------------------------------------------|
|
||||
| `show` | Prints information about the operating system of the current device. |
|
||||
|
||||
## Flag
|
||||
## Options
|
||||
|
||||
| Name | Short | Description |
|
||||
|--------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
|
||||
@@ -18,7 +18,7 @@ olares-cli prepare [option]
|
||||
| `--version` | `-v` | Specifies the Olares version. <br>Version values follow the format `x.y.z` (e.g., `1.10.0`) or include a build date (e.g., `1.10.0-20241109`).<br> Refer to the [GitHub Releases page](https://github.com/beclab/Olares/releases) for available versions. | No | Current version |
|
||||
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
```bash
|
||||
# Uses JuiceFS as the root filesystem
|
||||
olares-cli prepare --with-juicefs=true
|
||||
|
||||
@@ -12,7 +12,7 @@ olares-cli start [option]
|
||||
After executing this command, allow 5-8 minutes for all Olares components to restart. You can verify the status of all pods by running `kubectl get pods -A` or by simply trying to access your Olares desktop.
|
||||
:::
|
||||
|
||||
## Option
|
||||
## Options
|
||||
|
||||
| Name | Shorthand | Usage |
|
||||
|------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
|
||||
@@ -15,7 +15,7 @@ olares-cli stop [option]
|
||||
| `--help` | `-h` | Displays help information. | No | N/A |
|
||||
| `--timeout` | | Sets the maximum time to wait for a graceful shutdown before using SIGKILL (e.g., `5s`, `2m`, `3h`). | No | `1m` |
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
```bash
|
||||
# Stop the Olares system
|
||||
olares-cli stop
|
||||
|
||||
53
docs/developer/install/cli/upgrade.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# `upgrade`
|
||||
|
||||
## Synopsis
|
||||
|
||||
The `upgrade` command provides a set of tools for upgrading Olares and checking upgrade readiness and compatibility.
|
||||
|
||||
```bash
|
||||
olares-cli upgrade <subcommand> [options]
|
||||
```
|
||||
|
||||
## Subcommands
|
||||
|
||||
| Subcommand | Aliases | Description |
|
||||
|--|--|--|
|
||||
| `precheck` | | Prechecks Olares for upgrade. |
|
||||
| `spec` | `current-spec` | Gets the upgrade spec of the current CLI version. |
|
||||
| `viable` | | Determines whether upgrade can be directly performed upon a base version. |
|
||||
|
||||
## Global options
|
||||
|
||||
These options apply to the main `upgrade` command and are inherited by its subcommands where applicable.
|
||||
|
||||
| Option | Shorthand | Usage | Required | Default |
|
||||
|--|--|--|--|--|
|
||||
| `--base-dir` | `-b` | Sets the base directory for Olares packages. | No | `$HOME/.olares` |
|
||||
| `--help` | `-h` | Displays help information. | No | N/A |
|
||||
| `--version` | `-v` | Sets the target Olares version to upgrade to. For example, `1.10.0`, `1.10.0-20241109`. | No | N/A |
|
||||
|
||||
## Options for `viable`
|
||||
|
||||
| Option | Shorthand | Usage | Required | Default |
|
||||
|--|--|--|--|--|
|
||||
| `--base` | `-b` | Base version to check. | No | Current Olares system version |
|
||||
|
||||
:::warning Option conflict
|
||||
The `-b` shorthand is used by the parent command for `--base-dir`. However, when running `upgrade viable`, `-b` specifically refers to `--base`.
|
||||
:::
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# Check whether the current system can be upgraded directly
|
||||
olares-cli upgrade viable
|
||||
|
||||
# Check upgrade viability from a specific base version
|
||||
olares-cli upgrade viable --base 1.9.0
|
||||
|
||||
# Run pre-upgrade checks
|
||||
olares-cli upgrade precheck
|
||||
|
||||
# View the upgrade spec of the current CLI
|
||||
olares-cli upgrade spec
|
||||
```
|
||||
@@ -1,8 +1,9 @@
|
||||
# `user activate`
|
||||
# `activate`
|
||||
|
||||
## Synopsis
|
||||
|
||||
The `user activate` command activates an existing Olares account. It requires the user's Olares ID, password, and 12-word mnemonic phrase to complete the activation. This command typically requires administrator privileges (`sudo`).
|
||||
The `activate` subcommand activates an existing Olares account. It requires the user's Olares ID, password, and 12-word mnemonic phrase to complete the activation.
|
||||
|
||||
|
||||
```bash
|
||||
olares-cli user activate <Olares ID> [options]
|
||||
@@ -12,31 +13,32 @@ olares-cli user activate <Olares ID> [options]
|
||||
|
||||
| Argument | Description | Required|
|
||||
|--|--|--|
|
||||
| `<Olares ID>` | Specifies the unique identifier for the Olares user account to be activated. <br>Similar to an email address(e.g., `alice123@olares.com`).| **Yes** |
|
||||
| `<Olares ID>` | Specifies the unique identifier for the Olares user account <br>to be activated. <br>Similar to an email address like `alice123@olares.com`.| Yes |
|
||||
|
||||
## Options
|
||||
| Option | Shorthand | Usage | Required | Default |
|
||||
| Option | Short| Usage | Required | Default |
|
||||
|--|--|--|--|--|
|
||||
| `--bfl` | | Specifies the Backend For Launcher (BFL) service URL (e.g., `https://example.com`). | No | `http://127.0.0.1:30180` |
|
||||
| `--bfl` | | Specifies the Backend For Launcher (BFL) service URL, such as `https://example.com`. | No | `http://127.0.0.1:30180` |
|
||||
| `--enable-tunnel` | | Enables or disables tunnel mode for activation. | No | `false` |
|
||||
| `--help` | `-h` | Displays help information. | No | N/A |
|
||||
| `--host` | | Specifies the Fast Reverse Proxy (FRP) host. <br>Only used when the `--enable-tunnel` option is set to `true`. | No | N/A |
|
||||
| `--jws` | | Specifies the FRP JWS token.<br>Only used when the `--enable-tunnel` option is set to `true`.| No | N/A |
|
||||
| `--host` | | Specifies the Fast Reverse Proxy (FRP) host. Only used when `--enable-tunnel` option is set to `true`. | No | N/A |
|
||||
| `--jws` | | Specifies the FRP JWS token. Only used when `--enable-tunnel` option is set to `true`.| No | N/A |
|
||||
| `--language` | | Sets the system language. | No | `en-US` |
|
||||
| `--location` | | Sets the timezone location. | No | `Asia/Shanghai` |
|
||||
| `--mnemonic` | | Specifies the 12-word mnemonic phrase required for activation. | **Yes** | N/A |
|
||||
| `--password` | `-p` | Specifies the Olares login password for authentication. | **Yes** | N/A |
|
||||
| `--vault` | | Specifies the Vault service URL (e.g., `https://example.com`). | No | `http://127.0.0.1:30181` |
|
||||
| `--mnemonic` | | Specifies the 12-word mnemonic phrase required for activation. | Yes | N/A |
|
||||
| `--password` | `-p` | Specifies the Olares login password for authentication. | Yes | N/A |
|
||||
| `--reset-password` | | Specifies the new password to set during password reset. This option is required only when performing a password reset. | No | N/A |
|
||||
| `--vault` | | Specifies the Vault service URL, such as `https://example.com`. | No | `http://127.0.0.1:30180` |
|
||||
|
||||
## Example
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# Activate an Olares user account
|
||||
sudo olares-cli user activate alice@olares.com -p "HerPassWord" --mnemonic "apple banana cherry door eagle forest grape house island jacket kite lemon"
|
||||
olares-cli user activate alic123e@olares.com -p "HerPassWord" --mnemonic "apple banana cherry door eagle forest grape house island jacket kite lemon"
|
||||
|
||||
# Activate an Olares user account with tunnel mode enabled
|
||||
sudo olares-cli user activate david@olares.com -p "HisPassWord" --enable-tunnel --host "frp-gateway.olares.com" --jws "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.demo.signature" --bfl http://127.0.0.1:30180 --vault http://127.0.0.1:30180/server --mnemonic "apple banana cherry door eagle forest grape house island jacket kite lemon"
|
||||
olares-cli user activate david456@olares.com -p "HisPassWord" --enable-tunnel --host "frp-gateway.olares.com" --jws "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.demo.signature" --bfl http://127.0.0.1:30180 --vault http://127.0.0.1:30180/server --mnemonic "apple banana cherry door eagle forest grape house island jacket kite lemon"
|
||||
|
||||
# Activate an Olares user account with specific language and timezone settings
|
||||
sudo olares-cli user activate carol@olares.com -p "AnotherPassWord" --mnemonic "alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu" --language "en-US" --location "America/New_York"
|
||||
olares-cli user activate carol789@olares.com -p "AnotherPassWord" --mnemonic "alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu" --language "en-US" --location "America/New_York"
|
||||
```
|
||||
46
docs/developer/install/cli/user-create.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# `create`
|
||||
|
||||
## Synopsis
|
||||
|
||||
The `create` subcommand creates a new user account in the Olares system. It allows administrators to define initial settings such as the username, password, role permissions, and resource limits.
|
||||
|
||||
**Aliases**: `create`, `add`, `new`
|
||||
|
||||
```bash
|
||||
olares-cli user create <name> [options]
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
| Argument | Description | Required|
|
||||
|--|--|--|
|
||||
| `<name>` | Specifies the username for the new account. <br>It is typically the part before the `@` symbol in an Olares ID. <br>For example, `alice123` for `alice123@olares.com`.| Yes |
|
||||
|
||||
## Options
|
||||
| Option | Shorthand | Usage | Required | Default |
|
||||
|--|--|--|--|--|
|
||||
| `--cpu-limit` | `-c` | Sets the CPU limit for the user environment. | No | `1` |
|
||||
| `--description` | | Adds a description for the user account. | No | N/A |
|
||||
| `--display-name` | | Sets the display name for the user. | No | N/A |
|
||||
| `--domain` | | Specifies the domain for the Olares ID. | No | Olares system's domain |
|
||||
| `--help` | `-h` | Displays help information. | No | N/A |
|
||||
| `--kubeconfig` | | Specifies the path to a kubeconfig file. | No | N/A |
|
||||
| `--memory-limit` | `-m` | Sets the memory limit for the user environment. | No | `3G` |
|
||||
| `--password` | `-p` | Sets the initial login password for the user. | No | N/A |
|
||||
| `--role` | `-r` | Sets the user role.<br>Valid values: `owner`, `admin`, `normal`. | No | `normal` |
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# Create a basic user with default settings
|
||||
olares-cli user create alice123
|
||||
|
||||
# Create a user with a specified password and role
|
||||
olares-cli user create blake123 -p "StrongPassword123" -r admin
|
||||
|
||||
# Create a user with custom resource limits (2 CPU cores, 4 GB memory)
|
||||
olares-cli user create carol123 --cpu-limit 2 --memory-limit 4G
|
||||
|
||||
# Create a user with display name and description
|
||||
olares-cli user create david123 --display-name "David Smith" --description "Data platform administrator"
|
||||
```
|
||||
30
docs/developer/install/cli/user-delete.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# `delete`
|
||||
|
||||
## Synopsis
|
||||
|
||||
The `delete` subcommand permanently removes an existing user account from the Olares system.
|
||||
|
||||
**Aliases**: `delete`, `d`, `del`, `rm`, `remove`
|
||||
|
||||
```bash
|
||||
olares-cli user delete <name> [options]
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
| Argument | Description | Required|
|
||||
|--|--|--|
|
||||
| `<name>` | Specifies the username of the account to be deleted. <br>It is typically the part before the `@` symbol in an Olares ID. <br>For example, `alice123` for `alice123@olares.com`.| Yes |
|
||||
|
||||
## Options
|
||||
| Option | Shorthand | Usage | Required | Default |
|
||||
|--|--|--|--|--|
|
||||
| `--help` | `-h` | Displays help information. | No | N/A |
|
||||
| `--kubeconfig` | | Specifies the path to a kubeconfig file. | No | N/A |
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# Delete a user named alice123
|
||||
olares-cli user delete alice123
|
||||
```
|
||||
33
docs/developer/install/cli/user-get.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# `get`
|
||||
|
||||
## Synopsis
|
||||
|
||||
The `get` subcommand retrieves detailed information about a specific Olares user account. The output can be formatted as a table or JSON.
|
||||
|
||||
```bash
|
||||
olares-cli user get <name> [options]
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
| Argument | Description | Required|
|
||||
|--|--|--|
|
||||
| `<name>` | Specifies the username of the account to retrieve. <br>It is typically the part before the `@` symbol in an Olares ID. <br>For example, `alice123` for `alice123@olares.com`.| Yes |
|
||||
|
||||
## Options
|
||||
| Option | Shorthand | Usage | Required | Default |
|
||||
|--|--|--|--|--|
|
||||
| `--help` | `-h` | Displays help information. | No | N/A |
|
||||
| `--kubeconfig` | | Specifies the path to a kubeconfig file. | No | N/A |
|
||||
| `--no-headers` | | Disables the header row in the output. | No | N/A |
|
||||
| `--output` | `-o` | Specifies the output format. Valid values: `table`, `json`. | No | `table` |
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# Get details for user named alice123 in default table format
|
||||
olares-cli user get alice123
|
||||
|
||||
# Get details for user named blake123 in JSON format
|
||||
olares-cli user get blake123 -o json
|
||||
```
|
||||
34
docs/developer/install/cli/user-list.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# `list`
|
||||
|
||||
## Synopsis
|
||||
|
||||
The `list` subcommand displays a list of all registered users in the Olares system. You can sort, filter, and format the output to suit your needs.
|
||||
|
||||
**Aliases**: `list`, `ls`, `l`
|
||||
|
||||
```bash
|
||||
olares-cli user list [options]
|
||||
```
|
||||
|
||||
## Options
|
||||
| Option | Shorthand | Usage | Required | Default |
|
||||
|--|--|--|--|--|
|
||||
| `--help` | `-h` | Displays help information. | No | N/A |
|
||||
| `--kubeconfig` | | Specifies the path to a kubeconfig file. | No | N/A |
|
||||
| `--no-headers` | | Disables the header row in the output. | No | N/A |
|
||||
| `--output` | `-o`| Specifies the output format. Valid values: `table`, `json`.| No | `table` |
|
||||
| `--reverse` | `-r` | Reverses the sort order of the output. | No | N/A |
|
||||
| `--sort` | | Sorts the output by a specific field.<br> Valid values: `name`, `role`, `create-time`, `memory`, `cpu` | No | N/A |
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# List all users in a table format
|
||||
olares-cli user list
|
||||
|
||||
# List all users in JSON format
|
||||
olares-cli user list -o json
|
||||
|
||||
# List users sorted by role
|
||||
olares-cli user list --sort role
|
||||
```
|
||||
29
docs/developer/install/cli/user-reset-password.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# `reset-password`
|
||||
|
||||
## Synopsis
|
||||
|
||||
The `reset-password` subcommand forcefully resets the login password for a specific user via the authentication provider.
|
||||
|
||||
```bash
|
||||
olares-cli user reset-password <username> [options]
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
| Argument | Description | Required|
|
||||
|--|--|--|
|
||||
| `<username>` | Specifies the username of the account to reset. <br>It is typically the part before the `@` symbol in an Olares ID. <br>For example, `alice123` for `alice123@olares.com`.| Yes |
|
||||
|
||||
## Options
|
||||
| Option | Shorthand | Usage | Required | Default |
|
||||
|--|--|--|--|--|
|
||||
`--help` | `-h` | Displays help information. | No | N/A |
|
||||
| `--kubeconfig` | | Specifies the path to a kubeconfig file. | No | N/A |
|
||||
| `--password` | `-p` | Specifies the new password for the user. | Yes | N/A |
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
# Reset password for user named alice123
|
||||
olares-cli user reset-password alice123 -p "NewSecurePassword456!"
|
||||
```
|
||||
13
docs/developer/install/cli/user.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# `user`
|
||||
The `user` command provides a set of tools to manage users in the Olares system. It allows administrators to create, activate, query, and remove users, as well as reset user passwords.
|
||||
|
||||
## Subcommands
|
||||
|
||||
| Subcommand | Description |
|
||||
|--|--|
|
||||
| `activate` | Activates an existing Olares account. |
|
||||
| `create` | Creates a new user. |
|
||||
| `delete` | Deletes an existing user. |
|
||||
| `get` | Retrieves details of a specific user. |
|
||||
| `list` | Lists all users within the Olares cluster. |
|
||||
| `reset-password` | Forcefully resets a user's password via the authentication provider. |
|
||||
BIN
docs/public/images/manual/use-cases/access-translated-files.png
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
docs/public/images/manual/use-cases/add-pdf.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
docs/public/images/manual/use-cases/batch-rotate.png
Normal file
|
After Width: | Height: | Size: 239 KiB |
BIN
docs/public/images/manual/use-cases/box-draw-redaction.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
docs/public/images/manual/use-cases/color-picker-icon.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
docs/public/images/manual/use-cases/copy-localhost-address.png
Normal file
|
After Width: | Height: | Size: 165 KiB |
BIN
docs/public/images/manual/use-cases/delete-single-page.png
Normal file
|
After Width: | Height: | Size: 270 KiB |
BIN
docs/public/images/manual/use-cases/dev-bot-result.png
Normal file
|
After Width: | Height: | Size: 192 KiB |
BIN
docs/public/images/manual/use-cases/download-in-files.png
Normal file
|
After Width: | Height: | Size: 647 KiB |
BIN
docs/public/images/manual/use-cases/download-in-lobechat.png
Normal file
|
After Width: | Height: | Size: 197 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
BIN
docs/public/images/manual/use-cases/draw-line.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
docs/public/images/manual/use-cases/export-all-page.png
Normal file
|
After Width: | Height: | Size: 390 KiB |
BIN
docs/public/images/manual/use-cases/export-pdf.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
docs/public/images/manual/use-cases/export-selected-page.png
Normal file
|
After Width: | Height: | Size: 314 KiB |
BIN
docs/public/images/manual/use-cases/find-lobechat.png
Normal file
|
After Width: | Height: | Size: 218 KiB |
BIN
docs/public/images/manual/use-cases/green-check-icon.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
docs/public/images/manual/use-cases/install-pdfmathtranslate.png
Normal file
|
After Width: | Height: | Size: 206 KiB |
|
After Width: | Height: | Size: 221 KiB |
BIN
docs/public/images/manual/use-cases/install-stirling-pdf.png
Normal file
|
After Width: | Height: | Size: 195 KiB |
BIN
docs/public/images/manual/use-cases/install-website-crawler.png
Normal file
|
After Width: | Height: | Size: 208 KiB |
|
After Width: | Height: | Size: 216 KiB |
|
After Width: | Height: | Size: 244 KiB |
BIN
docs/public/images/manual/use-cases/lobechat-pin.png
Normal file
|
After Width: | Height: | Size: 213 KiB |
BIN
docs/public/images/manual/use-cases/lobechat-plugin-enable.png
Normal file
|
After Width: | Height: | Size: 250 KiB |
BIN
docs/public/images/manual/use-cases/lobechat-plugin-install.png
Normal file
|
After Width: | Height: | Size: 167 KiB |
|
After Width: | Height: | Size: 160 KiB |
BIN
docs/public/images/manual/use-cases/lobechat-settings-menu.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
docs/public/images/manual/use-cases/local-model-setup.png
Normal file
|
After Width: | Height: | Size: 718 KiB |
BIN
docs/public/images/manual/use-cases/manual-redaction.png
Normal file
|
After Width: | Height: | Size: 316 KiB |
BIN
docs/public/images/manual/use-cases/merge-pdf.png
Normal file
|
After Width: | Height: | Size: 154 KiB |
BIN
docs/public/images/manual/use-cases/obtain-ollama-hosturl.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
docs/public/images/manual/use-cases/ollama-model-checkpass.png
Normal file
|
After Width: | Height: | Size: 244 KiB |
BIN
docs/public/images/manual/use-cases/open-chat-settings.png
Normal file
|
After Width: | Height: | Size: 153 KiB |
BIN
docs/public/images/manual/use-cases/open-file.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
docs/public/images/manual/use-cases/open-pdfmathtranslate.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
docs/public/images/manual/use-cases/page-based-redaction.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
docs/public/images/manual/use-cases/page-select.png
Normal file
|
After Width: | Height: | Size: 239 KiB |
BIN
docs/public/images/manual/use-cases/pdf-multi-tool.png
Normal file
|
After Width: | Height: | Size: 314 KiB |
BIN
docs/public/images/manual/use-cases/pin-daily-tech-digest.png
Normal file
|
After Width: | Height: | Size: 412 KiB |
BIN
docs/public/images/manual/use-cases/pin-dev-bot.png
Normal file
|
After Width: | Height: | Size: 414 KiB |
BIN
docs/public/images/manual/use-cases/pin-writing-bot.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
docs/public/images/manual/use-cases/pipeline-menu.png
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
docs/public/images/manual/use-cases/pipeline.png
Normal file
|
After Width: | Height: | Size: 314 KiB |
BIN
docs/public/images/manual/use-cases/rotate-single-page.png
Normal file
|
After Width: | Height: | Size: 263 KiB |
BIN
docs/public/images/manual/use-cases/save-edits.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
docs/public/images/manual/use-cases/select-conversion.png
Normal file
|
After Width: | Height: | Size: 297 KiB |
BIN
docs/public/images/manual/use-cases/select-pipeline.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
docs/public/images/manual/use-cases/select-plugin.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
BIN
docs/public/images/manual/use-cases/select-qwen.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
BIN
docs/public/images/manual/use-cases/set-translation-scope.png
Normal file
|
After Width: | Height: | Size: 718 KiB |
BIN
docs/public/images/manual/use-cases/split-all-page.png
Normal file
|
After Width: | Height: | Size: 239 KiB |
BIN
docs/public/images/manual/use-cases/split-single-page.png
Normal file
|
After Width: | Height: | Size: 290 KiB |
BIN
docs/public/images/manual/use-cases/stirlingpdf-landing.png
Normal file
|
After Width: | Height: | Size: 328 KiB |
BIN
docs/public/images/manual/use-cases/text-annotation.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 35 KiB |
BIN
docs/public/images/manual/use-cases/text-redact-example.png
Normal file
|
After Width: | Height: | Size: 376 KiB |
|
After Width: | Height: | Size: 261 KiB |
BIN
docs/public/images/manual/use-cases/view-edit-pdf.png
Normal file
|
After Width: | Height: | Size: 282 KiB |
BIN
docs/public/images/manual/use-cases/website-crawler-enabled.png
Normal file
|
After Width: | Height: | Size: 229 KiB |
@@ -22,5 +22,8 @@ From running AI models to building seamless workflows across your self-hosted se
|
||||
{ title: 'DeerFlow', link: './host-cloud-android.html', tags: ['AI']},
|
||||
{ title: 'ACE-Step', link: './ace-step.html', tags: ['AI']},
|
||||
{ title: 'Duix.Avatar', link: './duix-avatar.html', tags: ['AI']},
|
||||
{ title: 'LobeChat', link: './lobechat.html', tags: ['AI']},
|
||||
{ title: 'Stirling PDF', link: './stirling-pdf.html', tags: ['Productivity']},
|
||||
{ title: 'PDFMathTranslate', link: './pdfmathtranslate.html', tags: ['AI']},
|
||||
]"
|
||||
/>
|
||||
272
docs/use-cases/lobechat.md
Normal file
@@ -0,0 +1,272 @@
|
||||
---
|
||||
outline: [2, 4]
|
||||
description: Learn how to install LobeChat on Olares and integrate it with Ollama to build and enhance your local custom AI assistants.
|
||||
---
|
||||
|
||||
# Build your local AI assistant with LobeChat
|
||||
|
||||
LobeChat is an open‑source framework for building secure, local AI chat experiences. It supports file handling, knowledge bases, and multimodal inputs, and it supports Ollama to run and switch local LLMs.
|
||||
|
||||
Olares streamlines and simplifies the deployment of both, allowing you to skip complex manual environment configurations.
|
||||
|
||||
This guide covers the installation, configuration, and practical usage of these tools to create your personalized AI assistants.
|
||||
|
||||
## Learning objectives
|
||||
|
||||
By the end of this guide, you are able to:
|
||||
- Configure LobeChat to communicate with your local Ollama instance.
|
||||
- Use LobeChat for specific scenarios such as content writing and coding.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you begin, make sure:
|
||||
|
||||
- Ollama is installed and running in your Olares environment.
|
||||
- At least one model is installed using Ollama. For more information, see [Ollama](ollama.md).
|
||||
|
||||
## Install LobeChat
|
||||
|
||||
1. From the Olares Market, search for "LobeChat".
|
||||
|
||||

|
||||
|
||||
2. Click **Get**, and then click **Install**. Wait for the installation to finish.
|
||||
|
||||
## Configure the connection
|
||||
|
||||
After the installation is completed, you must connect LobeChat to Ollama to make the chat interface work.
|
||||
|
||||
1. Open **LobeChat** from Launchpad.
|
||||
2. Click the LobeChat icon in the upper-left corner, and then go to **Settings** > **Language Model**.
|
||||
|
||||
{width=75%}
|
||||
|
||||
3. (Optional) To obtain your local Ollama host address, go to Olares **Settings** > **Application** > **Ollama** > **Ollama API** > **Set up endpoint**, and then copy the endpoint address.
|
||||
|
||||
{width=60%}
|
||||
|
||||
4. In the **Ollama** section, find the **Interface proxy address** field, and then enter your local Ollama address.
|
||||
|
||||

|
||||
|
||||
5. Click **Check** under the Ollama model list to verify the connection. A **Check Passed** message indicates that the proxy address is correct.
|
||||
|
||||

|
||||
|
||||
## Install language models
|
||||
|
||||
By default, LobeChat lists supported models, including models that are not installed yet.
|
||||
|
||||
You can click **Get Model List** to fetch available models from Ollama.
|
||||
|
||||
To download additional models, use one of the following options:
|
||||
- Download via LobeChat UI
|
||||
|
||||
When you are chatting with a selected language model, if the language model is not installed, you are prompted right in the chat to download and install it.
|
||||
|
||||

|
||||
|
||||
- Download using the Ollama CLI. For more information, see [Download a model](ollama.md#download-a-model).
|
||||
|
||||
## Create an assistant
|
||||
|
||||
LobeChat allows you to create specialized assistants to handle specific tasks by leveraging various language models and combining them with functional plug-ins.
|
||||
|
||||
- **Flexible model switching**: You can switch language models instantly within the same chat to achieve the best results. For example, if you are not satisfied with a response, you can select a different model from the list to leverage their unique strengths.
|
||||
- **Plug-in extensions**: You can also install plug-ins to extend and enhance the capabilities of your assistant.
|
||||
|
||||
:::info
|
||||
To install plug-ins, ensure that you select a model compatible with Function Calling. Look for <i class="material-symbols-outlined">brick</i> next to the model name, which indicates the model supports function calls.
|
||||
:::
|
||||
|
||||
The following steps outline the standard workflow for creating and configuring any assistant in LobeChat. You can apply this procedure using specific settings provided in the [use scenarios](#use-scenarios) section.
|
||||
|
||||
1. Create a new assistant:
|
||||
- From the left navigation pane, click **New Assistant**.
|
||||
- If you already have active chats, click <i class="material-symbols-outlined">add_comment</i> to create a new one.
|
||||
2. Configure the assistant such as identity and role:
|
||||
|
||||
a. Click **Open Chat Settings**.
|
||||
|
||||

|
||||
|
||||
b. On the **Assistant Info** tab, set the avatar, name, and description, and then click **Update Assistant Information**.
|
||||
|
||||

|
||||
|
||||
c. On the **Role Configuration** tab, enter your prompt for this specific role to define its behavior, and then click **OK**.
|
||||
|
||||
d. Close the **Session Settings** page to return to the chat window.
|
||||
|
||||
3. Select the language model from the basic interaction area.
|
||||
|
||||

|
||||
|
||||
4. (Optional) Install LobeChat plug-ins to enhance the assistant's capabilities:
|
||||
|
||||
a. In the basic interaction area, hover over the plug-in icon and click **Plugin Store**.
|
||||
|
||||

|
||||
|
||||
b. On the **LobeHub Plugins** tab, search for the target plug-in, and then click **Install**.
|
||||
|
||||
5. Interact with the assistant.
|
||||
6. (Optional) Pin for quick access:
|
||||
|
||||
If you are satisfied with the assistant's performance, hover over the assistant in the sidebar, click <i class="material-symbols-outlined">more_vert</i>, and then click **Pin** to keep it accessible at the top of your list.
|
||||
|
||||
## Use scenarios
|
||||
|
||||
The following scenarios provide some practical examples for your daily tasks. Apply these specific settings during the [general creation procedure](#create-an-assistant) to build specialized assistants tailored to your workflow.
|
||||
|
||||
### Polish content and visualize ideas
|
||||
|
||||
Create a specialized assistant to help you refine text and generate images based on descriptions.
|
||||
|
||||
#### Configurations
|
||||
|
||||
- **Name**: `Writing Bot`
|
||||
- **Role prompt**:
|
||||
|
||||
```
|
||||
You are a creative editor. When I provide text, review it for clarity
|
||||
and tone. When I describe a scene, use the drawing plug-in to generate
|
||||
an image based on my description.
|
||||
```
|
||||
|
||||
- **Language model**: `qwen2.5:7b`
|
||||
|
||||
:::info
|
||||
`qwen2.5:7b` excels at various NLP tasks such as contextual understanding and content writing. It is also compatible with functional calling, so you can install LobeChat plug-ins for enhanced capabilities.
|
||||
:::
|
||||
|
||||
- **LobeChat plug-in**: "Pollinate drawing", which is used to create images based on description
|
||||
|
||||

|
||||
|
||||
#### Interaction
|
||||
|
||||
1. Enter and send your draft content to get a refined version.
|
||||
2. Hover over the plug-in icon to ensure that **Pollinate drawing** is enabled, and then ask the assistant to create a cover image for the content.
|
||||
3. Brainstorm and iterate with the language model to get your ideal content textually and visually.
|
||||
|
||||
### Coding assistant
|
||||
|
||||
Create a specialized assistant to help you write efficient code and act as a dedicated pair programmer.
|
||||
|
||||
#### Configurations
|
||||
|
||||
- **Name**: `Dev Bot`
|
||||
- **Role prompt**:
|
||||
```
|
||||
You are an expert developer. When I describe a task or requirement,
|
||||
generate clean, efficient, and well-commented code to solve it.
|
||||
```
|
||||
- **Language model**: `deepseek-coder-v2`
|
||||
|
||||
:::info
|
||||
`deepseek-coder-v2` is good at coding use cases such as code generation and long text understanding.
|
||||
:::
|
||||
|
||||
#### Interaction
|
||||
|
||||
1. Describe a data generation task and send to the chat.
|
||||
```
|
||||
Write a Python script to generate a CSV file named employees.csv with
|
||||
20 rows of mock data. Columns should include: ID, Name, Department,
|
||||
and Salary. Use the random library to generate varied data.
|
||||
```
|
||||
2. The assistant processes your request and generates a standalone Python script with explanation.
|
||||
|
||||
```python
|
||||
import csv
|
||||
import random
|
||||
|
||||
def generate_mock_data():
|
||||
departments = ['HR', 'Engineering', 'Marketing', 'Sales', 'Finance']
|
||||
filename = "employees.csv"
|
||||
|
||||
print(f"Generating {filename}...")
|
||||
|
||||
with open(filename, 'w', newline='', encoding='utf-8') as csvfile:
|
||||
fieldnames = ['ID', 'Name', 'Department', 'Salary']
|
||||
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
|
||||
writer.writeheader()
|
||||
|
||||
for i in range(1, 21):
|
||||
writer.writerow({
|
||||
'ID': f'EMP{i:03d}',
|
||||
'Name': f'Employee {i}',
|
||||
'Department': random.choice(departments),
|
||||
'Salary': random.randint(50000, 120000)
|
||||
})
|
||||
|
||||
print(f"Successfully created {filename} with 20 records.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
generate_mock_data()
|
||||
```
|
||||
3. Run the generated code to verify.
|
||||
|
||||
a. Copy the generated Python code block and save it as `generate_data.py`.
|
||||
|
||||
b. Open the Terminal, navigate to the folder, and run the following command:
|
||||
|
||||
```python
|
||||
python3 generate_data.py
|
||||
```
|
||||
|
||||
c. Check your current folder. You should see a new file named `employees.csv`. Open it to verify the generated mock data.
|
||||
|
||||

|
||||
|
||||
### Real-time news analyst
|
||||
|
||||
Build an assistant that keeps you updated with the latest technology trends. By using the Website Crawler plug-in, this assistant can read live news sites and provide instant summaries of what's happening right now.
|
||||
|
||||
#### Configurations
|
||||
|
||||
- **Name**: `Daily Tech Digest`
|
||||
- **Role prompt**:
|
||||
|
||||
```
|
||||
You are a tech news reporter. When I send you a news site URL,
|
||||
read the headlines and summarize the latest top five stories for me.
|
||||
Limit the list to five.
|
||||
```
|
||||
- **Language model**: `qwen2.5:7b`
|
||||
|
||||
:::info
|
||||
`qwen2.5:7b` excels at various NLP tasks such as contextual understanding and content writing. It is also compatible with functional calling, so you can install LobeChat plug-ins for enhanced capabilities.
|
||||
:::
|
||||
- **LobeChat plug-in**: "Website Crawler", which is used to access live web pages and analyze real-time content from provided URLs
|
||||
|
||||
:::info How Website Crawler works (Real-time vs. Offline)
|
||||
Standard local AI models are offline and rely on pre-trained data from the past. The Website Crawler plug-in, specifically the getWebsiteContent function, acts as a bridge to the live internet.
|
||||
|
||||
When you provide a URL, the plug-in instantly accesses the web page in real time via an API, fetches the current content, and feeds it to the AI. This ensures that the AI model is accessing the latest live web content rather than using the old memory.
|
||||
:::
|
||||
|
||||

|
||||
|
||||
#### Interaction
|
||||
|
||||
1. In the basic interaction area, hover over the plug-in icon to ensure that the **Website Crawler** plug-in is enabled.
|
||||
2. Send the URL address to the chat. For example, `https://github.com/trending`.
|
||||
3. Paste and send the URL to the chat. The assistant lists specific news stories with summaries.
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why did the connection check fail when I connected to Ollama?
|
||||
|
||||
This usually happens due to network or authentication settings. Follow these steps to resolve it:
|
||||
|
||||
1. Open Settings, and ensure that the **Authentication level** for Ollama is set to **Internal**.
|
||||
2. Turn on the VPN in the LarePass desktop client, and confirm that the status changes to **Intranet** or **P2P**.
|
||||
3. Run the connection check again.
|
||||
|
||||
:::tip
|
||||
If you are on the same local network as your device and the **Authentication level** for Ollama is set to **None**, you do not need to enable the LarePass VPN.
|
||||
:::
|
||||
|
||||
For more information, see [Ensure network connectivity](ollama.md#ensure-network-connectivity).
|
||||
144
docs/use-cases/pdfmathtranslate.md
Normal file
@@ -0,0 +1,144 @@
|
||||
---
|
||||
outline: [2, 4]
|
||||
description: Learn how to install and configure PDFMathTranslate on Olares. This tutorial guides you through using the local AI model Ollama to translate scientific PDFs, preserving original layouts and mathematical formulas.
|
||||
---
|
||||
|
||||
# Translate scientific PDFs while preserving layout
|
||||
|
||||
PDFMathTranslate is an application designed to translate scientific PDF documents while retaining the original layout and mathematical formulas.
|
||||
|
||||
This tutorial provides instructions on how to install and use PDFMathTranslate on Olares, using the local AI model Ollama for translation.
|
||||
|
||||
## Learning objectives
|
||||
|
||||
By the end of this tutorial, you are able to:
|
||||
- Configure the local AI model for PDF translation.
|
||||
- Translate a scientific PDF and manage the output files.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you begin, make sure:
|
||||
- Ollama is installed and running in your Olares environment.
|
||||
- At least one model is installed using Ollama. For more information, see [Ollama](ollama.md).
|
||||
|
||||
## Install PDFMathTranslate
|
||||
|
||||
1. Open the Olares Market and search for "PDFMathTranslate".
|
||||
2. Click **Get**, and then click **Install**.
|
||||
|
||||

|
||||
|
||||
3. When the installation finishes, click **Open**. The PDFMathTranslate workspace is displayed.
|
||||
|
||||

|
||||
|
||||
## Translate
|
||||
|
||||
### Upload your PDF document
|
||||
|
||||
:::warning PDF format requirements
|
||||
Ensure that the PDF file is a standard PDF document that is not password-protected or corrupted. The application cannot process invalid PDF files.
|
||||
:::
|
||||
|
||||
In the **File** area, select your input **Type**:
|
||||
- If you select **File**, drag and drop your PDF document into the upload area, or click the area to browse your local storage.
|
||||
|
||||
When the document is uploaded, a preview of it appears in the **Preview** pane on the right.
|
||||
|
||||
- If you select **Link**, enter the link address of the PDF document.
|
||||
|
||||
The **Preview** pane remains blank during this step. The document content only appears in this area after the translation is completed.
|
||||
|
||||
### Configure the translation service
|
||||
|
||||
To use the local AI service Ollama for translation, configure the following settings:
|
||||
|
||||
1. From the **Service** list, select **Ollama**.
|
||||
2. (Optional) To obtain the Ollama host address:
|
||||
|
||||
a. Go to Olares **Settings** > **Application** > **Ollama**.
|
||||
|
||||
b. In the **Entrances** section, click **Ollama API**.
|
||||
|
||||
c. Click **Set up endpoint**, and then click <i class="material-symbols-outlined">content_copy</i> to copy the endpoint address.
|
||||
|
||||
{width=60%}
|
||||
|
||||
3. In the **OLLAMA_HOST** field, enter the Ollama host address.
|
||||
4. In the **OLLAMA_MODEL** field, enter the exact identifier of the Ollama model you have downloaded. For example, `gemma3:4b`.
|
||||
|
||||

|
||||
|
||||
### Select languages and scope
|
||||
|
||||
1. Select the source and target languages:
|
||||
|
||||
a. **Translate from** indicates the original document's language.
|
||||
|
||||
b. **Translate to** indicates the language you want to read.
|
||||
|
||||
:::info
|
||||
PDFMathTranslate does not auto-detect the languages. You must select them manually. Supported languages include English, Simplified Chinese, Traditional Chinese, French, German, Japanese, Korean, Russian, Spanish, and Italian.
|
||||
:::
|
||||
|
||||
2. Specify which pages to translate:
|
||||
* **All**: Translates the entire document.
|
||||
* **First**: Translates only the first page.
|
||||
* **First 5 pages**: Translates the first five pages.
|
||||
* **Others**: Translates a custom range of pages.
|
||||
|
||||

|
||||
|
||||
3. Click **Translate**. The translation starts immediately.
|
||||
|
||||
:::warning
|
||||
Do not click the **Cancel** button during translation. This might cause the process to report an error.
|
||||
:::
|
||||
|
||||
### Download your files
|
||||
|
||||
When the translation is completed, the translated file is displayed in the **Preview** pane, and the application generates three files:
|
||||
|
||||
- Original source file
|
||||
- Translated file
|
||||
- Bilingual version
|
||||
|
||||
You can find these files in the Files app. To download them to your local computer, download them directly from the PDFMathTranslate workspace, or use the Files app.
|
||||
|
||||
#### In PDFMathTranslate workspace
|
||||
|
||||
On the left side of the pdfmathtranslate workspace, in the **Translated** section, click the download button next to the file.
|
||||
|
||||

|
||||
|
||||
#### From Olares Files app
|
||||
|
||||
1. Open the Files app, and then go to **Data** > **pdfmathtranslate** > **pdfmathtranslate**.
|
||||
|
||||

|
||||
|
||||
2. Double-click a file, and then click the download icon in the upper-right corner.
|
||||
|
||||

|
||||
|
||||
## FAQ
|
||||
|
||||
### Why did the translation progress bar disappear?
|
||||
|
||||
If you refresh the page while a translation is running, the progress bar might disappear from the screen. This is a display issue only, and the translation is still processing in the background.
|
||||
|
||||
Wait for it to finish or check the output folder.
|
||||
|
||||
### Will the app keep multiple versions of the same file?
|
||||
|
||||
If you translate the same file name multiple times, the system replaces the previous version with the new one. It does not create numbered copies such as `file_1.pdf`. To keep multiple versions, rename your source file before translating it again.
|
||||
|
||||
### What should I do if the app becomes unresponsive or takes unusually long?
|
||||
|
||||
If the translation takes significantly longer than usual or the application stops responding, the background process might have stalled. To resolve this issue, uninstall and then re-install pdfmathtranslate.
|
||||
|
||||
### How do I perform a clean uninstallation of PDFMathTranslate?
|
||||
|
||||
To completely remove the application and its data:
|
||||
1. Uninstall the app from Market or Desktop. For more information, see [Uninstall applications](../manual/olares/market/market.md#uninstall-applications).
|
||||
2. Open the Files app, go to **Application** > **Data**, and then delete the `pdfmathtranslate` folder.
|
||||
237
docs/use-cases/stirling-pdf.md
Normal file
@@ -0,0 +1,237 @@
|
||||
---
|
||||
outline: [2, 5]
|
||||
description: A step-by-step guide to installing and using Stirling PDF on Olares. Learn how to securely manage PDF documents, covering essential tasks such as merging, editing, format conversion, and creating automated workflow pipelines.
|
||||
---
|
||||
|
||||
# Manage PDF documents with Stirling PDF
|
||||
|
||||
Stirling PDF is a robust, locally hosted tool designed to manage PDF documents securely and efficiently.
|
||||
|
||||
## Learning objectives
|
||||
|
||||
By the end of this tutorial, you are able to:
|
||||
|
||||
* Redact (black out) sensitive information securely.
|
||||
* Organize documents by merging, rotating, splitting, and re-ordering pages.
|
||||
* Convert documents between PDF and other formats.
|
||||
* Create automated workflows to batch process PDF documents.
|
||||
|
||||
## Install Stirling PDF
|
||||
|
||||
1. Open the Olares Market and search for "Stirling-PDF".
|
||||
|
||||

|
||||
|
||||
2. Click **Get**, and then click **Install**.
|
||||
3. After the installation is completed, open Stirling-PDF from Launchpad. The Stirling PDF homepage automatically launches in your default web browser.
|
||||
|
||||

|
||||
|
||||
## Redact sensitive information
|
||||
|
||||
The **Manual Redaction** tool allows you to hide or black out sensitive information from your documents. You can scrub specific text, visual areas, or entire pages.
|
||||
|
||||
1. From the homepage, click **Manual Redaction**.
|
||||
|
||||

|
||||
|
||||
2. Upload your PDF file.
|
||||
3. To redact specific text:
|
||||
|
||||
a. Click the **Text-based Redaction** icon on the toolbar.
|
||||
|
||||
{width=65%}
|
||||
|
||||
b. Select the text you want to hide.
|
||||
|
||||
c. (Optional) Click the **Colour Picker** icon to change the redaction color. By default, it is black.
|
||||
|
||||
{width=65%}
|
||||
|
||||
d. Click the **Apply changes** icon to confirm your selection.
|
||||
|
||||
{width=65%}
|
||||
|
||||
4. To redact images or areas:
|
||||
|
||||
a. Click the **Box draw redaction** icon on the toolbar.
|
||||
|
||||
{width=65%}
|
||||
|
||||
b. Drag to draw a box around the sensitive area. When you release your mouse, the box turns from red to green, which indicates the area is selected successfully.
|
||||
|
||||
c. (Optional) Click the **Colour Picker** icon to change the redaction color. By default, it is black.
|
||||
|
||||
{width=65%}
|
||||
|
||||
5. To redact entire pages:
|
||||
|
||||
a. Click the **Page-based Redaction** icon on the toolbar.
|
||||
|
||||
{width=25%}
|
||||
|
||||
b. Enter the specific page numbers or ranges.
|
||||
|
||||
c. Select the redaction color.
|
||||
|
||||
d. Click **Apply**.
|
||||
|
||||
6. Export the redacted file.
|
||||
|
||||
a. Click the **Export** icon to download the sanitized PDF.
|
||||
|
||||
{width=25%}
|
||||
|
||||
b. Review your file to ensure that the redaction is correctly implemented.
|
||||
|
||||
The following image shows an example of a paragraph redacted in orange:
|
||||
|
||||
{width=55%}
|
||||
|
||||
## Organize pages
|
||||
|
||||
The **Multi Tool** allows you to adjust the structure of the PDF documents, including merging, splitting, rotating, and re-ordering pages.
|
||||
|
||||
1. From the homepage, click **PDF Multi Tool**.
|
||||
|
||||

|
||||
|
||||
2. Click the **Add File** icon to add one or multiple PDF files.
|
||||
|
||||
{width=65%}
|
||||
|
||||
3. To rotate pages:
|
||||
|
||||
- To rotate a single page, hover over the specific page thumbnail and click the **Rotate Left** icon or the **Rotate Right** icon.
|
||||
|
||||
{width=65%}
|
||||
|
||||
- To rotate all pages at once, click the **Rotate Left** icon or the **Rotate Right** icon in the **File Name** area.
|
||||
|
||||
{width=65%}
|
||||
|
||||
4. To re-order pages, drag the page to its new position in the grid.
|
||||
5. To delete pages:
|
||||
|
||||
- To delete a single page, hover over the page, and then click the **Delete** icon on the thumbnail.
|
||||
|
||||
{width=65%}
|
||||
|
||||
- To delete multiple pages, click the **Page Select** icon in the **File Name** area, select the checkboxes for all target pages, and then click **Delete Selected**.
|
||||
|
||||
{width=65%}
|
||||
|
||||
6. To split pages:
|
||||
|
||||
- To split a specific page into a new file, click the **Scissors** icon on the left of that page's thumbnail.
|
||||
|
||||
{width=65%}
|
||||
|
||||
- To split every page into its own separate file, click the **Scissors** icon in the **File Name** area.
|
||||
|
||||
{width=65%}
|
||||
|
||||
7. To export pages:
|
||||
|
||||
- To download the re-organized file as a single PDF, click **Export**.
|
||||
|
||||
{width=65%}
|
||||
|
||||
- To export specific pages, select the pages, and then click **Export Selected**.
|
||||
|
||||
{width=65%}
|
||||
|
||||
## Convert file formats
|
||||
|
||||
Stirling PDF supports conversion for over 50 file types, which allows you to turn images into PDFs or PDFs into other formats.
|
||||
|
||||
1. Find the convert section on the homepage, and click your specific convertion task.
|
||||
|
||||

|
||||
|
||||
2. Upload your source file.
|
||||
3. Configure the available settings, such as color mode or layout preferences. The settings might vary by file type.
|
||||
4. Click **Convert**. Wait for the process to finish. The converted file is downloaded automatically.
|
||||
|
||||
## Read and annotate
|
||||
|
||||
Use this feature to review documents and add notes or highlights.
|
||||
|
||||
1. From the homepage, click **View/Edit PDF**.
|
||||
|
||||

|
||||
|
||||
2. Click the **Open File** icon in the top right corner to load your document.
|
||||
|
||||
{width=38%}
|
||||
|
||||
3. To add text annotations:
|
||||
|
||||
a. Click the **Text** icon and select your preferred font color and size.
|
||||
|
||||
{width=38%}
|
||||
|
||||
b. Click on the document where you want the note to appear, and then type your comment.
|
||||
|
||||
c. To delete a note, click the text box and click <i class="material-symbols-outlined">delete</i>.
|
||||
|
||||
4. To highlight or draw freehand:
|
||||
|
||||
a. Click Draw and adjust the brush color, thickness, and opacity.
|
||||
|
||||
{width=38%}
|
||||
|
||||
b. Click and drag on the document to apply your markings.
|
||||
|
||||
5. To finalize your edits, click the **Save** icon. The document containing your annotations is automatically downloaded.
|
||||
|
||||
{width=38%}
|
||||
|
||||
## Automate multi-step workflows
|
||||
|
||||
The Pipeline feature functions like a batch processing workflow for PDFs.
|
||||
Instead of performing tasks one by one, you can create a custom pipeline to execute multiple actions in a single sequence. This scenario demonstrates the feature by merging documents and adding a password.
|
||||
|
||||
:::info
|
||||
The Pipeline feature is currently in Beta. You might encounter occasional instability or interface changes. It is recommended to verify the final output when processing critical documents.
|
||||
:::
|
||||
|
||||
### Create a pipeline
|
||||
|
||||
1. From the homepage, in the **Advanced** section, click **Pipeline**.
|
||||
|
||||

|
||||
|
||||
2. Click **Configure**.
|
||||
|
||||
{width=65%}
|
||||
|
||||
3. In the **Pipeline Name** box, enter a unique name for your workflow. For example, `Monthly invoice combination`.
|
||||
4. Add and configure the merge operation:
|
||||
|
||||
a. From the **Select Operation** list, select **merge-pdfs**, and then click **Add operation**. The operation is added in the **Pipeline** area and related settings are displayed under it.
|
||||
|
||||
b. Define the specific parameters for the **merge-pdfs** operation, and then click **Save Operation Settings**.
|
||||
|
||||
{width=45%}
|
||||
|
||||
5. Add and configure the adding password operation:
|
||||
|
||||
a. From the **Select Operation** list, select **add-password**, and then click **Add operation**.
|
||||
|
||||
b. Define the specific parameters for the **add-password** operation, and then click **Save Operation Settings**.
|
||||
|
||||
6. Click **Save to Browser** to save your pipeline.
|
||||
7. Close the **Pipeline Configuration** window, and then refresh the **Pipeline Menu** page.
|
||||
|
||||
### Run the pipeline
|
||||
|
||||
1. On the **Pipeline Menu** page, select the newly created pipeline "Monthly invoice combination".
|
||||
|
||||
{width=65%}
|
||||
|
||||
2. Upload your PDF files, and then click **Submit**.
|
||||
|
||||
Stirling PDF automatically merges the files and secures the final document in one step. When the batch processing is completed, the file is downloaded automatically.
|
||||
3. Double-click the downloaded file and enter the password you specified during the pipeline configuration to open it.
|
||||
4. Verify that the files are merged and secured as expected.
|
||||
32
docs/zh/developer/install/cli/disk.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# `disk`
|
||||
|
||||
## 命令说明
|
||||
|
||||
`disk`命令提供了一组用于管理 Olares 系统存储资源的工具,主要用于基于 LVM 的存储配置管理。
|
||||
|
||||
```bash
|
||||
olares-cli disk <subcommand>
|
||||
```
|
||||
|
||||
## 子命令
|
||||
|
||||
| 子命令 | 描述 |
|
||||
|--|--|
|
||||
| `extend` | 在基于 LVM 的安装环境中扩展 Olares 的存储容量。 |
|
||||
| `list-unmounted` | 列出未挂载的磁盘。 |
|
||||
|
||||
## 参数标记
|
||||
|
||||
| 名称 | 简写 | 说明 |
|
||||
|--|--|--|
|
||||
| `--help` | `-h` | 显示帮助信息。 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
```bash
|
||||
# 列出未挂载的磁盘
|
||||
olares-cli disk list-unmounted
|
||||
|
||||
# 添加新检测到的未挂载磁盘来扩展 Olares 存储
|
||||
olares-cli disk extend
|
||||
```
|
||||
@@ -28,11 +28,12 @@ wsl -d Ubuntu
|
||||
## 语法
|
||||
Olares 命令行工具使用如下语法:
|
||||
|
||||
> `olares-cli 命令 [子命令] [选项]`
|
||||
> `olares-cli 命令 [子命令] [参数] [选项]`
|
||||
|
||||
其中:
|
||||
- `命令`:指定要执行的主要操作,例如 `olares-cli install`。
|
||||
- `子命令`:进一步指定命令的具体任务,适用于支持子操作的命令。例如 `wizard` 或 `component`。
|
||||
- `参数`:指定命令的目标资源或输入数据,通常是 ID、名称或文件路径。例如,在 `olares-cli user activate <Olares ID> [选项]` 中,`<Olares ID>` 就是该命令的参数。
|
||||
- `选项`:可选参数,用于修改命令的行为。包括标志(flags)和带参数的选项。
|
||||
|
||||
通过 Olares 命令行工具,你可以临时覆盖某些 Olares 默认设置。每个选项仅对当前执行的命令生效。
|
||||
@@ -43,21 +44,23 @@ Olares 命令行工具使用如下语法:
|
||||
|
||||
## 可用命令列表
|
||||
|
||||
| 操作 | 语法 | 说明 |
|
||||
|--------------------|-----------------------------------------|--------------------------------|
|
||||
| `gpu` | `olares-cli gpu <子命令> [选项]` | 管理 GPU 相关的操作。 |
|
||||
| `info` | `olares-cli info <子命令> [选项]` | 显示当前设备的操作系统信息。 |
|
||||
| `node` | `olares-cli node <子命令> [选项]` | 管理节点相关的操作。 |
|
||||
| `backups` | `olares-cli backups <子命令> [选项]` | 管理备份相关操作。 |
|
||||
| `change-ip` | `olares-cli change-ip [选项]` | 修改 Olares OS 的 IP 地址。 |
|
||||
| `download` | `olares-cli download <子命令> [选项]` | 下载指定资源。 |
|
||||
| `info` | `olares-cli info [选项]` | 显示已下载的 Olares OS 的常规信息。 |
|
||||
| `install` | `olares-cli install [选项]` | 部署 Olares 的系统级和用户级组件。 |
|
||||
| `logs` | `olares-cli logs [选项]` | 收集 Olares 系统组件的日志,用于调试和故障排查。 |
|
||||
| `precheck` | `olares-cli precheck [选项]` | 检查系统环境是否满足 Olares 安装要求。 |
|
||||
| `prepare` | `olares-cli prepare [选项]` | 为安装过程准备环境,包括设置 Olares 的基础服务和配置 |
|
||||
| `release` | `olares-cli release [选项]` | 打包 Olares 安装资源以供分发或部署。 |
|
||||
| `start` | `olares-cli start [选项]` | 启动 Olares 服务和组件。 |
|
||||
| `stop` | `olares-cli stop [选项]` | 停止 Olares 服务和组件。 |
|
||||
| `uninstall` | `olares-cli uninstall [选项]` | 完全卸载 Olares,或将安装回滚到特定阶段。 |
|
||||
|
||||
| 操作 | 语法 | 说明 |
|
||||
|--|--|--|
|
||||
| `backups` | `olares-cli backups <子命令> [选项]` | 管理备份相关操作。 |
|
||||
| `change-ip` | `olares-cli change-ip [选项]` | 修改 Olares OS 的 IP 地址。 |
|
||||
| `disk` | `olares-cli disk <子命令>` | 管理 Olares 系统存储资源。 |
|
||||
| `download` | `olares-cli download <子命令> [选项]` | 下载指定资源。 |
|
||||
| `gpu` | `olares-cli gpu <子命令> [选项]` | 管理 GPU 相关的操作。 |
|
||||
| `info` | `olares-cli info [选项]` | 显示已下载的 Olares OS 的常规信息。|
|
||||
| `install` | `olares-cli install [选项]` | 部署 Olares 的系统级和用户级组件。|
|
||||
| `logs` | `olares-cli logs [选项]` | 收集 Olares 系统组件的日志,用于调试和故障排查。 |
|
||||
| `node` | `olares-cli node <子命令> [选项]` | 管理节点相关的操作。 |
|
||||
| `osinfo` | `olares-cli osinfo <子命令> [选项]` | 显示当前设备的操作系统信息。 |
|
||||
| `precheck`| `olares-cli precheck [选项]` | 检查系统环境是否满足 Olares 安装要求。|
|
||||
| `prepare` | `olares-cli prepare [选项]` | 为安装过程准备环境,包括设置 Olares 的基础服务和配置。 |
|
||||
| `release` | `olares-cli release [选项]` | 打包 Olares 安装资源以供分发或部署。|
|
||||
| `start` | `olares-cli start [选项]` | 启动 Olares 服务和组件。 |
|
||||
| `stop` | `olares-cli stop [选项]` | 停止 Olares 服务和组件。 |
|
||||
| `uninstall` | `olares-cli uninstall [选项]` | 完全卸载 Olares,或将安装回滚到特定阶段。 |
|
||||
| `upgrade` | `olares-cli upgrade <子命令> [选项]` | 升级 Olares,检查升级准备情况与兼容性。 |
|
||||
| `user` | `olares-cli user <子命令> [选项]`| 管理 Olares 用户。 |
|
||||