case 4447
This commit is contained in:
@@ -42,7 +42,13 @@
|
|||||||
@input="fieldValueChanged('ipAddress')"
|
@input="fieldValueChanged('ipAddress')"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<gz-url
|
||||||
|
v-model="obj.name"
|
||||||
|
readonly
|
||||||
|
:label="$sock.t('SubServerName')"
|
||||||
|
></gz-url>
|
||||||
|
</v-col>
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<gz-pick-list
|
<gz-pick-list
|
||||||
ref="customerId"
|
ref="customerId"
|
||||||
@@ -190,9 +196,10 @@
|
|||||||
ref="lastHealthStatus"
|
ref="lastHealthStatus"
|
||||||
v-model="obj.lastHealthStatus"
|
v-model="obj.lastHealthStatus"
|
||||||
dense
|
dense
|
||||||
readonly
|
:readonly="formState.readOnly"
|
||||||
:label="$sock.t('SubServerLastHealthStatus')"
|
:label="$sock.t('SubServerLastHealthStatus')"
|
||||||
data-cy="lastHealthStatus"
|
data-cy="lastHealthStatus"
|
||||||
|
@input="fieldValueChanged('lastHealthStatus')"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
@@ -1198,6 +1205,12 @@ export default {
|
|||||||
loading: true
|
loading: true
|
||||||
});
|
});
|
||||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||||
|
if (vm.obj.operatingSystem == null) {
|
||||||
|
vm.obj.operatingSystem = "Ubuntu 22.10";
|
||||||
|
}
|
||||||
|
if (vm.obj.cost == 0) {
|
||||||
|
vm.obj.cost = 7.0;
|
||||||
|
}
|
||||||
const res = await window.$gz.api.upsert(API_BASE_URL, vm.obj);
|
const res = await window.$gz.api.upsert(API_BASE_URL, vm.obj);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
vm.formState.serverError = res.error;
|
vm.formState.serverError = res.error;
|
||||||
@@ -1324,26 +1337,147 @@ async function clickHandler(menuItem) {
|
|||||||
// case "terminal":
|
// case "terminal":
|
||||||
// alert("putty -agent -ssh sportseffect.onayanova.com");
|
// alert("putty -agent -ssh sportseffect.onayanova.com");
|
||||||
// break;
|
// break;
|
||||||
case "QuoteList":
|
case "script":
|
||||||
m.vm.$router.push({
|
window.$gz.util.copyToClipboard(
|
||||||
name: "svc-quotes",
|
`#!/bin/bash
|
||||||
params: {
|
|
||||||
aType: m.vm.sockType,
|
# 1) create new droplet **DO NOT PICK IPV6 just the monitoring option**
|
||||||
objectId: m.vm.obj.id,
|
# 2) immediately set subdomain name in networking
|
||||||
name: m.vm.obj.name
|
# 3) Add droplet into raven-server-standard-firewall
|
||||||
}
|
# 4) check DNS available using https://letsdebug.net/
|
||||||
});
|
# 5) Open putty, select X.onayanova.com, change ip to new droplet domain name and open it
|
||||||
break;
|
# 6) apt-get update && apt-get upgrade reboot, if necessary use apt --with-new-pkgs upgrade
|
||||||
case "PMList":
|
# 7) TRIAL: make calendar entry 8 days hence to decommision and blueberry color reminder 0 days 11am
|
||||||
m.vm.$router.push({
|
# 8) nano ayinit.sh paste in this
|
||||||
name: "svc-pms",
|
# 9) CHANGE the values at the top of the script to the desired time zone (see rfdocs for list) and subdomain, Save and exit nano
|
||||||
params: {
|
# 9) chmod a+x ayinit.sh
|
||||||
aType: m.vm.sockType,
|
# 10) ./ayinit.sh
|
||||||
objectId: m.vm.obj.id,
|
# Done. If trial use response email template from rfdocs and set server path
|
||||||
name: m.vm.obj.name
|
|
||||||
}
|
TIMEZONE='${m.vm.obj.timeZone}'
|
||||||
});
|
DOMAINNAME='${m.vm.obj.name}'
|
||||||
|
|
||||||
|
|
||||||
|
#############################
|
||||||
|
echo STARTING...
|
||||||
|
timedatectl set-timezone $TIMEZONE
|
||||||
|
apt-get update
|
||||||
|
apt-get dist-upgrade -y
|
||||||
|
echo SET SWAP FILE
|
||||||
|
fallocate -l 1G /swapfile
|
||||||
|
chmod 600 /swapfile
|
||||||
|
mkswap /swapfile
|
||||||
|
swapon /swapfile
|
||||||
|
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
|
||||||
|
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
|
||||||
|
echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf
|
||||||
|
echo INSTALL .NET CORE
|
||||||
|
apt-get install -y aspnetcore-runtime-6.0
|
||||||
|
echo INSTALL POSTGRESQL
|
||||||
|
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
|
||||||
|
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install postgresql
|
||||||
|
sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'YOUR_PASSWORD_HERE';"
|
||||||
|
echo INSTALL REPORTING LIBS
|
||||||
|
sudo apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
|
||||||
|
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
|
||||||
|
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
|
||||||
|
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libgbm1 \
|
||||||
|
ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
|
||||||
|
echo INSTALL AYANOVA
|
||||||
|
apt install zip unzip -y
|
||||||
|
mkdir /var/ayanova
|
||||||
|
mkdir /var/ayanova/data
|
||||||
|
mkdir /var/ayanova/.local-chromium
|
||||||
|
cd /var/ayanova
|
||||||
|
curl -O https://www.ayanova.com/download/ayanova-subscription-linux-x64-server.zip && \
|
||||||
|
unzip -o ayanova-subscription-linux-x64-server.zip
|
||||||
|
chown -vR :www-data /var/ayanova
|
||||||
|
chmod -R g+rw /var/ayanova/data
|
||||||
|
chmod -R g+rwx /var/ayanova/.local-chromium
|
||||||
|
echo '[Unit]' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'Description=AyaNova server' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo '' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo '[Service]' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'WorkingDirectory=/var/ayanova' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'ExecStart=/usr/bin/dotnet /var/ayanova/AyaNova.dll' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'Restart=always' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'RestartSec=10' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'KillSignal=SIGINT' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'SyslogIdentifier=ayanova-server' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'User=www-data' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'Environment=ASPNETCORE_ENVIRONMENT=Production' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo '' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo '[Install]' >> /etc/systemd/system/ayanova.service
|
||||||
|
echo 'WantedBy=multi-user.target' >> /etc/systemd/system/ayanova.service
|
||||||
|
systemctl enable ayanova.service
|
||||||
|
echo START AYANOVA SERVICE
|
||||||
|
systemctl start ayanova.service
|
||||||
|
echo INSTALL NGINX
|
||||||
|
apt install nginx -y
|
||||||
|
echo 'server {' > /etc/nginx/sites-available/default
|
||||||
|
echo ' listen 80;' >> /etc/nginx/sites-available/default
|
||||||
|
echo " server_name $DOMAINNAME;" >> /etc/nginx/sites-available/default
|
||||||
|
echo ' location / {' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' add_header X-XSS-Protection "1; mode=block" always;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' add_header X-Content-Type-Options "nosniff" always;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' add_header X-Frame-Options "SAMEORIGIN" always;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' add_header Referrer-Policy "strict-origin" always;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' gzip on;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' gzip_vary on;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' gzip_min_length 10240;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' gzip_proxied expired no-cache no-store private auth;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' gzip_http_version 1.1;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' gzip_types application/javascript text/css application/json text/plain;' >> /etc/nginx/sites-available/default
|
||||||
|
echo '' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_pass http://127.0.0.1:7575;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_http_version 1.1;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_set_header Upgrade $http_upgrade;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_set_header Connection keep-alive;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_set_header Host $host;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_cache_bypass $http_upgrade;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_set_header X-Forwarded-Proto $scheme;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_connect_timeout 3600;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_send_timeout 3600;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' proxy_read_timeout 3600;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' send_timeout 3600; ' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' client_max_body_size 25M;' >> /etc/nginx/sites-available/default
|
||||||
|
echo ' }' >> /etc/nginx/sites-available/default
|
||||||
|
echo '}' >> /etc/nginx/sites-available/default
|
||||||
|
systemctl restart nginx
|
||||||
|
echo INSTALL CERTBOT
|
||||||
|
apt install certbot python3-certbot-nginx -y
|
||||||
|
echo GET CERTIFICATE
|
||||||
|
certbot --nginx --noninteractive --agree-tos --email ops@onayanova.com --no-eff-email -d $DOMAINNAME
|
||||||
|
echo ...COMPLETED
|
||||||
|
`
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// case "QuoteList":
|
||||||
|
// m.vm.$router.push({
|
||||||
|
// name: "svc-quotes",
|
||||||
|
// params: {
|
||||||
|
// aType: m.vm.sockType,
|
||||||
|
// objectId: m.vm.obj.id,
|
||||||
|
// name: m.vm.obj.name
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// break;
|
||||||
|
// case "PMList":
|
||||||
|
// m.vm.$router.push({
|
||||||
|
// name: "svc-pms",
|
||||||
|
// params: {
|
||||||
|
// aType: m.vm.sockType,
|
||||||
|
// objectId: m.vm.obj.id,
|
||||||
|
// name: m.vm.obj.name
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// break;
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
"notify-warning",
|
"notify-warning",
|
||||||
@@ -1427,13 +1561,25 @@ function generateMenu(vm) {
|
|||||||
}
|
}
|
||||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||||
|
|
||||||
// menuOptions.menuItems.push({
|
menuOptions.menuItems.push({
|
||||||
// title: "OpenTerminal",
|
title: "Droplets",
|
||||||
// icon: "$sockiTerminal",
|
icon: "$sockiEgg",
|
||||||
// key: FORM_KEY + ":terminal",
|
notrans: true,
|
||||||
// vm: vm
|
href:
|
||||||
// });
|
"https://cloud.digitalocean.com/projects/7c57f24a-378b-40d1-ace0-79f73af89925/resources?i=ce622a",
|
||||||
|
target: "_blank",
|
||||||
|
key: "droplets"
|
||||||
|
});
|
||||||
|
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "Script",
|
||||||
|
notrans: true,
|
||||||
|
icon: "$sockiFileCode",
|
||||||
|
key: FORM_KEY + ":script",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
|
||||||
|
//
|
||||||
// menuOptions.menuItems.push({
|
// menuOptions.menuItems.push({
|
||||||
// title: "QuoteList",
|
// title: "QuoteList",
|
||||||
// icon: "$sockiPencilAlt",
|
// icon: "$sockiPencilAlt",
|
||||||
|
|||||||
Reference in New Issue
Block a user