Automatic configuration generation based on vue-cli and tindy2013/subconverter backend implementation.
20200730
docker run -d -p 58080:80 --restart always --name subweb careywong/subweb:latest
If you need to modify the code, you need to build the image locally and run it. Note: Every time you modify the code, you need to re-execute docker build to perform the packaging operation.
docker -v
Docker version 23.0.4, build f480fb1
docker build -t subweb-local:latest .
docker run -d -p 58080:80 --restart always --name subweb subweb-local:latest
You need to install Node and Yarn to install dependencies and package releases. You can check whether the installation is successful through the following command. Note: The following steps are the corresponding commands under Ubuntu. Please modify other systems yourself. In order to facilitate later generations to solve the problem, please send an issue if you have any questions.
node -v
v16.20.0
yarn -v
1.22.19
yarn install
yarn serve
Browser access http://localhost:8080/
To publish to an online environment, you need to install the dependencies and execute the following packaging commands. The generated dist directory is the publishing directory. If you need to modify the default backend, please modify the defaultBackend configuration item in src/views/Subconverter.vue.
yarn build
You need to install nginx (or other web server) and configure it correctly. The following is an example configuration. You need to modify example.com to your domain name and configure the correct project root path (https yourself configure).
server {
listen 80 ;
server_name example.com ;
root /var/www/http/sub-web/dist ;
index index.html index.htm ;
error_page 404 /index.html ;
gzip on ; #开启gzip压缩
gzip_min_length 1k ; #设置对数据启用压缩的最少字节数
gzip_buffers 4 16k ;
gzip_http_version 1.0 ;
gzip_comp_level 6 ; #设置数据的压缩等级,等级为1-9,压缩比从小到大
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml ; #设置需要压缩的数据格式
gzip_vary on ;
location ~ * . (css | js | png | jpg | jpeg | gif | gz | svg | mp4 | ogg | ogv | webm | htc | xml | woff)$ {
access_log off ;
add_header Cache-Control " public,max-age=30*24*3600 " ;
}
}
PRs accepted.
Small note: If editing the README, please conform to the standard-readme specification.
MIT © 2020 CareyWang