[O] Even more simplistic deployment guide

This commit is contained in:
Azalea Gui
2023-02-11 17:29:28 -05:00
parent 7b569bfa5b
commit 4db65f2c66
3 changed files with 11 additions and 44 deletions
+6 -41
View File
@@ -32,60 +32,25 @@ yarn build
To update, simply do `git pull` and `yarn build` in the same directory.
### 2. Setup File API in Nginx
### 2. Setup File Listing in Nginx
This module uses the json file listing api in nginx. If you already have an autoindex file server set up, you can make the following changes. If you're new to nginx, you can check out our [example configs](docs/examples).
The following example serves `/data/file-server` on http path `/`
```nginx.conf
```diff
server_name your.domain.com;
root /your/file/server/location;
- root /data/file-server;
+ set $dir_path /data/file-server;
+ include "/etc/nginx/MeowIndex/docs/nginx.conf";
# Serve an index file for your home page (if you want one)
location = / {
index index.html;
}
include "/etc/nginx/MeowIndex/docs/nginx.conf";
```
### 3. Setup File Listing UI
You can setup the file listing web UI in two different ways.
* If you want to deploy on a standalone domain (e.g. `https://files.example.com`), follow Option 1.
* If you want to deploy on a sub-path of an existing domain (e.g. `https://example.com/files`), follow Option 2.
#### Option 1: Deploying to a standalone domain
Add the following location block to the same server block as your file api.
```diff
- location / {
- fancyindex on;
- fancyindex_exact_size off;
- }
+ # If no file is found on any path, serve meowindex
+ location / {
+ try_files $uri /__meowindex__/index.html;
+ }
```
#### Option 2: Deploying to a path of an existing domain
Add the following location block to the same server block as your file api, and replace `/data` with the path you want to deploy to.
```diff
- location /data {
- fancyindex on;
- fancyindex_exact_size off;
- }
+ # If no file is found on any path, serve meowindex
+ location /data {
+ try_files $uri /__meowindex__/index.html;
+ try_files $uri $uri/index.html /__meowindex__/index.html;
+ }
```
+2 -2
View File
@@ -5,7 +5,7 @@ server
listen [::]:443 ssl;
server_name arch.hydev.org;
root /data/OS/ArchMirror/RISCV;
set $dirpath /data/OS/ArchMirror/RISCV;
# Serve a different file for your home page (if you want one)
location = / {
@@ -14,7 +14,7 @@ server
# If no file is found on any path, serve meowindex
location / {
try_files $uri /__meowindex__/index.html;
try_files $uri $uri/index.html /__meowindex__/index.html;
}
# The MeowIndex web app block
+3 -1
View File
@@ -1,3 +1,5 @@
root $dir_path;
# The MeowIndex web app block
location /__meowindex__ {
alias /etc/nginx/MeowIndex/dist;
@@ -15,7 +17,7 @@ location /__meowindex__ {
# The api block
location /api {
rewrite ^/api(/.*)$ $1 break;
alias $dir_path;
index DISABLE_INDEX_HTML_AUTO_MATCHING;
autoindex on;