Skip to content

Commit

Permalink
Merge pull request #2044 from xiagw/fix-document
Browse files Browse the repository at this point in the history
fix documents and add comment
  • Loading branch information
star7th committed Aug 31, 2023
2 parents be7615f + 66edca8 commit b65fc34
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 63 deletions.
37 changes: 19 additions & 18 deletions documentation/en/AutoInstall.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
### Foreword

The automatic script uses Docker to install the runtime environment for Linux servers. If your server does't have a Docker service, the script will try to install it. The process of installing Docker maybe a bit slow. If you have already installed Docker, the script will omit some of the steps to speed up the ShowDoc installation.

When the script fails to install Docker, you should manually install Docker before executing the script. If you still have problem in installing Docker, you can (un/re-)install and debug it step by step according to this tutorial: [ByDocker.md](https://github.com/star7th/showdoc/blob/master/documentation/en/ByDocker.md)

If the server does't support Docker, you can only run ShowDoc by manually installing the PHP environment: [DeployManual.md](https://github.com/star7th/showdoc/blob/master/documentation/en/DeployManual.md)

### Instructions
```bash
# Download the script and give permission
wget https://www.showdoc.cc/script/showdoc;chmod +x showdoc;
# Default installation is the Chinese version. If you want to install the English version, please add the en parameter, such as ./showdoc en
./showdoc en
```

```bash
# Download the script and run
curl -fL https://www.showdoc.cc/script/showdoc | bash

# Default is the Chinese version. If you want to install the English version, please add the en parameter
curl -fL https://www.showdoc.cc/script/showdoc | bash -s en
```


### Post-installation instructions

Once installed, the ShowDoc data will be stored in the /showdoc_data/html directory. The ./showdoc script can be placed in any directory for later use. You can also re-download it from the official address.
Once installed, the ShowDoc data will be stored in the /showdoc_data/html directory.

You can open ShowDoc by opening http://your-domain.com:4999 (replace your-domain.com with your server domain name or IP-address).
You can open ShowDoc by opening http://your-domain.com:4999 (replace your-domain.com with your server domain name or IP-address).

The default admin account is Username: showdoc Password: 123456.
The default admin account is: `showdoc`.
The default admin password is: `123456`.

After logging in, you can see the management background entry in the upper right. It is recommended to change the password.

Expand All @@ -47,7 +48,7 @@ Upgrade method:

```bash
chmod 777 -R /showdoc_data/html
./showdoc update
curl -fL https://www.showdoc.cc/script/showdoc | bash -s update
```


Expand All @@ -56,14 +57,14 @@ chmod 777 -R /showdoc_data/html
```bash
# Attach the script to other commands, so you can use it when managing ShowDoc.
# Stop ShowDoc
./showdoc stop
curl -fL https://www.showdoc.cc/script/showdoc | bash -s stop

# Restart ShowDoc
./showdoc restart
curl -fL https://www.showdoc.cc/script/showdoc | bash -s restart

# Update ShowDoc to the latest version
./showdoc update
curl -fL https://www.showdoc.cc/script/showdoc | bash -s update

# Uninstall ShowDoc
./showdoc uninstall
curl -fL https://www.showdoc.cc/script/showdoc | bash -s uninstall
```
87 changes: 42 additions & 45 deletions documentation/en/ByDocker.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,69 @@
### Basic installation
## Basic installation

Make sure your environment has Docker installed before installation. The Docker installation tutorial is more online, you can search for it. Here is a highlight of ShowDoc.

```
```bash
# The original official image installation command (Chinese mainland users do not recommend direct use of the original image, you can use the following accelerated image)
Docker pull star7th/showdoc
docker pull star7th/showdoc

# Chinese Image Installation Command (Remember to execute the Docker tag command after installation to rename)
Docker pull registry.docker-cn.com/star7th/showdoc
Docker tag registry.docker-cn.com/star7th/showdoc:latest star7th/showdoc:latest
docker pull registry.docker-cn.com/star7th/showdoc
docker tag registry.docker-cn.com/star7th/showdoc:latest star7th/showdoc:latest

## Follow-up commands need to be executed whether you use official image or accelerated image

# New directory to store ShowDoc data
Mkdir /showdoc_data
Mkdir /showdoc_data/html
Chmod 777 -R /showdoc_data
mkdir -m 777 -p /showdoc_data/html

# Start the ShowDoc container. Don't forget to follow the steps to transfer data after booting.
docker run -d --name showdoc -p 4999:80 -v /showdoc_data/html:/var/www/html/ star7th/showdoc

# Move data When you execute here, pay attention to the error message that the command line interface has permission to prohibit.
# If there is, check the permissions, or security restrictions (for example, selinux may prohibit the Docker process from writing files)
docker exec showdoc \cp -fr /showdoc_data/html/ /var/www/
docker exec showdoc cp -fr /showdoc_data/html /var/www/
# permission
Chmod 777 -R /showdoc_data
chmod 777 -R /showdoc_data

```

According to the above command, the data of ShowDoc will be stored in the /showdoc_data/html directory.
You can access ShowDoc by opening http://localhost:4999 (localhost can be changed to your server domain name or IP). The default admin account is Username: showdoc Password: 123456 . After logging in, you can see the management background entry in the upper right. It is recommended to change the password after login.
For issues or suggestions on ShowDoc, please go to https://github.com/star7th/showdoc to issue an issue. If you think that ShowDoc is easy to use, please star it.

### How to upgrade
## How to upgrade
The upgrade here is an upgrade to the above Docker installation. If you used a non-Docker installation (such as PHP installation), please skip this section and go directly to the next section.
```
/ / Stop the container

```bash
## Stop the container
docker stop showdoc

/ / Download the latest code package
Wget https://github.com/star7th/showdoc/archive/master.tar.gz
//Unzip
Tar -zxvf master.tar.gz -C /showdoc_data/
## Download the latest code package
curl -fL https://github.com/star7th/showdoc/archive/master.tar.gz | tar -C /showdoc_data/ -zxv

Rm -rf /showdoc_data/html_bak
//Backup. If possible, the html_bak in the command can also be date-suffixed to keep multiple backups of different dates.
Mv /showdoc_data/html /showdoc_data/html_bak
Mv /showdoc_data/showdoc-master /showdoc_data/html ##// */
rm -rf /showdoc_data/html_bak
## Backup. If possible, the html_bak in the command can also be date-suffixed to keep multiple backups of different dates.
mv /showdoc_data/html /showdoc_data/html_bak
mv /showdoc_data/showdoc-master /showdoc_data/html

/ / Grant permissions
Chmod 777 -R /showdoc_data/html
## Grant permissions
chmod 777 -R /showdoc_data/html

/ / Start the container
## Start the container
docker start showdoc

// Perform the installation. The Chinese version is installed by default. If you want to install the English version, change the zh in the following parameters to en
Curl http://localhost:4999/install/non_interactive.php?lang=en
## Perform the installation. The Chinese version is installed by default. If you want to install the English version, change the zh in the following parameters to en
curl http://localhost:4999/install/non_interactive.php?lang=en

/ / Transfer the old database
## Transfer the old database
\cp -f /showdoc_data/html_bak/Sqlite/showdoc.db.php /showdoc_data/html/Sqlite/showdoc.db.php

/ / Transfer old attachment data
## Transfer old attachment data
\cp -r -f /showdoc_data/html_bak/Public/Uploads /showdoc_data/html/Public/Uploads

/ / Perform a database upgrade, see the word "OK" to prove success
Curl http://localhost:4999?s=/home/update/db
## Perform a database upgrade, see the word "OK" to prove success
curl http://localhost:4999?s=/home/update/db

//If there is an error in the middle, please rename the original /showdoc_data/html_bak file to /showdoc_data/html and restart the container to recover.
## If there is an error in the middle, please rename the original /showdoc_data/html_bak file to /showdoc_data/html and restart the container to recover.

```

Expand All @@ -75,28 +72,28 @@ Curl http://localhost:4999?s=/home/update/db

First refer to the previous article, use Docker way to install a new ShowDoc, and do data persistence.
Next, assuming that the old ShowDoc you originally installed has been uploaded to the /tmp/showdoc directory of the server, then
```
/ / Transfer the old database
```bash
## Transfer the old database
\cp -r -f /tmp/showdoc/Sqlite/showdoc.db.php /showdoc_data/html/Sqlite/showdoc.db.php

/ / Transfer old attachment data
## Transfer old attachment data
\cp -r -f /tmp/showdoc/Public/Uploads /showdoc_data/html/Public/Uploads

/ / Perform a database upgrade, see the word "OK" to prove success
Curl http://localhost:4999?s=/home/update/db
## Perform a database upgrade, see the word "OK" to prove success
curl http://localhost:4999?s=/home/update/db
```

### data backup
Just back up the /showdoc_data/html directory. For example, execute the following command to compress and store
```
Zip -r /showdoc_data/showdoc_bak.zip /showdoc_data/html
//where showdoc_bak.zip can be named with a date suffix for multiple backups. You can also use timed tasks to implement scheduled backups.
```bash
zip -r /showdoc_data/showdoc_bak.zip /showdoc_data/html
## where showdoc_bak.zip can be named with a date suffix for multiple backups. You can also use timed tasks to implement scheduled backups.
```
### Other reference commands
```
docker stop showdoc //stop the container
docker restart showdoc // restart the showdoc container
docker rm showdoc //delete showdoc container
docker rmi star7th/showdoc //delete showdoc image
docker stop $(docker ps -a -q) ;docker rm $(docker ps -a -q) ;//Stop and delete all containers. Dangerous orders, do not know how to use.
```bash
docker stop showdoc ## stop the container
docker restart showdoc ## restart the showdoc container
docker rm showdoc ## delete showdoc container
docker rmi star7th/showdoc ## delete showdoc image
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q) ## Stop and delete all containers. Dangerous orders, do not know how to use.
```

0 comments on commit b65fc34

Please sign in to comment.