English | 简体中文
A CLI tool for managing Sub-Store backend service. Because of this tool based on docker, you should install docker first.
You can install this tool by running the following command:
curl -sSL https://sub-store-org.github.io/resource/ssm/install.sh | bashOr you can download release binary and configure your environment variable manually.
If you are using a script installation, you can directly execute the following commands. However, if you are doing a manual installation, please make sure to modify the program name in each command to match the executable file name.
Create a new sub-store docker container and run it. If the Image does not exist, it will be build automatically.
ssm newthis command support the following flags:
-
--interfaceor-i: When you use the-iflag, a sub-store front-end container is created instead of a backend container. The default behavior is to create a backend container. -
--nameor-n: A unique name for the container, default name isssm-backend, If you create a frontend container with the-iflag, the default name will bessm-frontend. This name will be used to manage persistent data. As long as the persistent data with this name is not manually deleted, or executessm deletewith-cflag, it will be accessible whenever the container is rebuilt or when the image is deleted and then launched using this name. -
--versionor-v: A Sub-Store release version string, default is latest. If you pass-ito create a front-end container,-vwill be ignored, it always uses the latest version of the front-end. -
--portor-p: To successfully create a new Docker container, you need to specify the port mapping. The default port is3000, and it must be available. If you pass-ito create a front-end container, the default port will be80. If you want to access the container using a domain name, you will need to manually proxy this port with a reverse proxy tool such as Nginx or Caddy. -
--network: Specify a docker network, which has the same effect as--networkindocker run. If not specified, use Host mode. If specified, use Bridge mode. If the network exists, join it; if not, create it and then join. -
--private: The default is to create a container with a HostIP of127.0.0.1. If--private=falseis used, then it is0.0.0.0.
⚠️ NoticeFor security reasons, starting from version
0.0.12, ssm will automatically create a random hash prefix for the backend service container to prevent scanning and leakage of subscriptions. After the creation is complete, please use thessm lscommand to view the hash prefix corresponding to the container interface.As shown in the figure above, when adding a service on port 3000, use
http://localhost:3000/4424703b2bae575f0861bf07eafato add it to the Sub-Store backend list.For containers created before version
0.0.12, please delete the container and use thessm newcommand to create it again to enable the random hash, and be sure to keep the original container name to maintain the old data.
To update a sub-store docker container, ensure that the image already exists and is running.
ssm updatethis command support the following flags:
-
--nameor-n: A name of running container, default name isssm-backend. -
--versionor-v: A Sub-Store release version string, default is latest. If you update a front-end container,-vwill be ignored, it always uses the latest version of the front-end.
Start a non-running sub-store Docker container by name, default name set as ssm-backend.
Equivalent to
docker start <name>.
ssm new <name>Stop a running sub-store Docker container by name, default name set as ssm-backend.
Equivalent to
docker stop <name>.
ssm stop <name>Delete a sub-store Docker container by name, default name set as ssm-backend.
Equivalent to
docker rm -f <name>.
ssm delete <name>this command support the following flags:
--clearor-c: Delete the persistent data of the container at the same time. If you delete a front-end container,-cwill be ignored, because the front-end container does not have persistent data.
List all sub-store Docker containers.
Equivalent to
docker ps -a, filter which container started byssmimage.
ssm lsPrint the version number of ssm.
ssm versionIf you are using a script installation, you can directly execute the following command. If you are doing a manual installation, please manually remove your executable file.
rm -rf /usr/local/bin/ssmIf you want to delete the persistent data of the container at the same time, you can execute the following command:
rm -rf ~/.ssmGPL-3.0 License