diff --git a/App/FeatureSet/Docs/Static/Scripts/InfrastructureAgent/InstallLinux.sh b/App/FeatureSet/Docs/Static/Scripts/InfrastructureAgent/InstallLinux.sh new file mode 100644 index 0000000000..b92e9e84b1 --- /dev/null +++ b/App/FeatureSet/Docs/Static/Scripts/InfrastructureAgent/InstallLinux.sh @@ -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 diff --git a/App/Index.ts b/App/Index.ts index a405558db6..56c671d3a3 100755 --- a/App/Index.ts +++ b/App/Index.ts @@ -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'; diff --git a/Nginx/default.conf.template b/Nginx/default.conf.template index b9cdcf0fdd..5abe8ebaeb 100644 --- a/Nginx/default.conf.template +++ b/Nginx/default.conf.template @@ -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;