mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Add Docs feature set and configure Nginx proxy for /docs endpoint
This commit is contained in:
parent
a20be2441e
commit
1dbfea9051
@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if this is debian based
|
||||
|
||||
# Check if system supports apt-get
|
||||
|
||||
if [ -x "$(command -v apt-get)" ]; then
|
||||
# Update apt-get
|
||||
sudo apt-get update
|
||||
# Install build-essential
|
||||
sudo apt-get install build-essential -y
|
||||
fi
|
||||
|
||||
# Check if system supports yum
|
||||
if [ -x "$(command -v yum)" ]; then
|
||||
# Update yum
|
||||
sudo yum update
|
||||
# Install build-essential
|
||||
sudo yum install gcc-c++ make -y
|
||||
fi
|
||||
|
||||
# Check if system supports apk
|
||||
if [ -x "$(command -v apk)" ]; then
|
||||
# Update apk
|
||||
sudo apk update
|
||||
# Install build-essential
|
||||
sudo apk add build-base
|
||||
fi
|
||||
|
||||
|
||||
# Install NVM
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
|
||||
# Export to path
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
|
||||
# Refresh bash
|
||||
source ~/.bashrc
|
||||
|
||||
# Install latest Node.js via NVM
|
||||
nvm install node
|
||||
|
||||
# Make this nodejs version the default
|
||||
nvm alias default node
|
||||
|
||||
# Use the default version
|
||||
nvm use default
|
||||
|
||||
# Now install
|
||||
npm install -g ts-node
|
||||
npm install -g @oneuptime/infrastructure-agent
|
@ -12,6 +12,7 @@ import Realtime from 'CommonServer/Utils/Realtime';
|
||||
// import featuresets.
|
||||
import './FeatureSet/Identity/Index';
|
||||
import './FeatureSet/Notification/Index';
|
||||
import './FeatureSet/Docs/Index';
|
||||
import './FeatureSet/BaseAPI/Index';
|
||||
import './FeatureSet/ApiReference/Index';
|
||||
import Workers from './FeatureSet/Workers/Index';
|
||||
|
@ -535,6 +535,19 @@ server {
|
||||
proxy_pass http://app/reference;
|
||||
}
|
||||
|
||||
location /docs {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_pass http://app/docs;
|
||||
}
|
||||
|
||||
location /file {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
Loading…
Reference in New Issue
Block a user