From 249bae4afe99c926ccde4ba315aaa5fa620ad4d4 Mon Sep 17 00:00:00 2001 From: Jared Date: Thu, 24 Sep 2020 17:45:25 -0700 Subject: [PATCH] Remove unused files. --- Remotely.sln | 4 +- Utilities/Remotely_CentOS_Install.sh | 139 ------------------------ Utilities/Remotely_Server_Install.sh | 151 --------------------------- 3 files changed, 2 insertions(+), 292 deletions(-) delete mode 100644 Utilities/Remotely_CentOS_Install.sh delete mode 100644 Utilities/Remotely_Server_Install.sh diff --git a/Remotely.sln b/Remotely.sln index 363f1de1..3950c69a 100644 --- a/Remotely.sln +++ b/Remotely.sln @@ -7,14 +7,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Agent", "Agent\Agent.csproj EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{2CAC9A2B-1402-465F-83F8-958B4E081CA3}" ProjectSection(SolutionItems) = preProject + Utilities\CentOS_Server_Install.sh = Utilities\CentOS_Server_Install.sh Utilities\Example_Apache_Config.txt = Utilities\Example_Apache_Config.txt Utilities\Get-PSCommands.ps1 = Utilities\Get-PSCommands.ps1 Utilities\Get-WindowsCommands.ps1 = Utilities\Get-WindowsCommands.ps1 Utilities\Install-RemotelyServer.ps1 = Utilities\Install-RemotelyServer.ps1 Utilities\Publish.ps1 = Utilities\Publish.ps1 - Utilities\Remotely_CentOS_Install.sh = Utilities\Remotely_CentOS_Install.sh - Utilities\Remotely_Server_Install.sh = Utilities\Remotely_Server_Install.sh Utilities\signtool.exe = Utilities\signtool.exe + Utilities\Ubuntu_Server_Install.sh = Utilities\Ubuntu_Server_Install.sh EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{D96B47F6-EF3E-4AF6-A1BE-006D531DDBA4}" diff --git a/Utilities/Remotely_CentOS_Install.sh b/Utilities/Remotely_CentOS_Install.sh deleted file mode 100644 index 2bb00004..00000000 --- a/Utilities/Remotely_CentOS_Install.sh +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/bash -echo "Thanks for trying Remotely!" -echo - -read -p "Enter path where the Remotely server files should be installed (typically /var/www/remotely): " appRoot -if [ -z "$appRoot" ]; then - appRoot="/var/www/remotely" -fi - -read -p "Enter server host (e.g. remotely.yourdomainname.com): " serverHost - -yum update - -# Install .NET Core Runtime. -sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm - -yum -y install apt-transport-https -yum -y update -yum -y install aspnetcore-runtime-3.1 - - - # Install other prerequisites. -yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -yum -y install yum-utils -yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional -yum -y install unzip -yum -y install acl -yum -y install libc6-dev -yum -y install libgdiplus - - -# Download and install Remotely files. -mkdir -p $appRoot -wget "https://github.com/lucent-sea/Remotely/releases/latest/download/Remotely_Server_Linux-x64.zip" -unzip -o Remotely_Server_Linux-x64.zip -d $appRoot -rm Remotely_Server_Linux-x64.zip -setfacl -R -m u:apache:rwx $appRoot -chown -R apache:apache $appRoot - - -# Install Nginx -yum -y install nginx - -systemctl start nginx - - -# Configure Nginx -nginxConfig="server { - listen 80; - server_name $serverHost *.$serverHost; - location / { - proxy_pass http://localhost:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection keep-alive; - proxy_set_header Host \$host; - proxy_cache_bypass \$http_upgrade; - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto \$scheme; - } - - location /BrowserHub { - proxy_pass http://localhost:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection \"upgrade\"; - proxy_set_header Host \$host; - proxy_cache_bypass \$http_upgrade; - } - location /AgentHub { - proxy_pass http://localhost:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection \"upgrade\"; - proxy_set_header Host \$host; - proxy_cache_bypass \$http_upgrade; - } - - location /ViewerHub { - proxy_pass http://localhost:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection \"upgrade\"; - proxy_set_header Host \$host; - proxy_cache_bypass \$http_upgrade; - } - location /CasterHub { - proxy_pass http://localhost:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection \"upgrade\"; - proxy_set_header Host \$host; - proxy_cache_bypass \$http_upgrade; - } -}" - -echo "$nginxConfig" > /etc/nginx/conf.d/remotely.conf - -# Test config. -nginx -t - -# Reload. -nginx -s reload - - -# Create service. - -serviceConfig="[Unit] -Description=Remotely Server - -[Service] -WorkingDirectory=$appRoot -ExecStart=/usr/bin/dotnet $appRoot/Remotely_Server.dll -Restart=always -# Restart service after 10 seconds if the dotnet service crashes: -RestartSec=10 -SyslogIdentifier=remotely -Environment=ASPNETCORE_ENVIRONMENT=Production -Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false - -[Install] -WantedBy=multi-user.target" - -echo "$serviceConfig" > /etc/systemd/system/remotely.service - - -# Enable service. -systemctl enable remotely.service -# Start service. -systemctl start remotely.service - -firewall-cmd --permanent --zone=public --add-service=http -firewall-cmd --permanent --zone=public --add-service=https -firewall-cmd --reload - -# Install Certbot and get SSL cert. -yum -y install certbot python3-certbot-nginx - -certbot --nginx \ No newline at end of file diff --git a/Utilities/Remotely_Server_Install.sh b/Utilities/Remotely_Server_Install.sh deleted file mode 100644 index ea0b9f3e..00000000 --- a/Utilities/Remotely_Server_Install.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/bash -echo "Thanks for trying Remotely!" -echo - -read -p "Enter path where the Remotely server files should be installed (typically /var/www/remotely): " appRoot -if [ -z "$appRoot" ]; then - appRoot="/var/www/remotely" -fi - -read -p "Enter server host (e.g. remotely.yourdomainname.com): " serverHost - -UbuntuVersion=$(lsb_release -r -s) - -apt-get update - -# Install .NET Core Runtime. -wget -q https://packages.microsoft.com/config/ubuntu/$UbuntuVersion/packages-microsoft-prod.deb -dpkg -i packages-microsoft-prod.deb -add-apt-repository universe -apt-get -y install apt-transport-https -apt-get update -apt-get -y install aspnetcore-runtime-3.1 -rm packages-microsoft-prod.deb - - - # Install other prerequisites. -apt-get -y install unzip -apt-get -y install acl -apt-get -y install libc6-dev -apt-get -y install libgdiplus - - -# Download and install Remotely files. -mkdir -p $appRoot -wget "https://github.com/lucent-sea/Remotely/releases/latest/download/Remotely_Server_Linux-x64.zip" -unzip -o Remotely_Server_Linux-x64.zip -d $appRoot -rm Remotely_Server_Linux-x64.zip -setfacl -R -m u:www-data:rwx $appRoot -chown -R www-data:www-data $appRoot - - -# Install Nginx -apt-get update -apt-get -y install nginx - -systemctl start nginx - - -# Configure Nginx -nginxConfig="server { - listen 80; - server_name $serverHost *.$serverHost; - location / { - proxy_pass http://localhost:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection keep-alive; - proxy_set_header Host \$host; - proxy_cache_bypass \$http_upgrade; - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto \$scheme; - } - - location /BrowserHub { - proxy_pass http://localhost:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection \"upgrade\"; - proxy_set_header Host \$host; - proxy_cache_bypass \$http_upgrade; - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto \$scheme; - } - location /AgentHub { - proxy_pass http://localhost:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection \"upgrade\"; - proxy_set_header Host \$host; - proxy_cache_bypass \$http_upgrade; - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto \$scheme; - } - - location /ViewerHub { - proxy_pass http://localhost:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection \"upgrade\"; - proxy_set_header Host \$host; - proxy_cache_bypass \$http_upgrade; - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto \$scheme; - } - location /CasterHub { - proxy_pass http://localhost:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade \$http_upgrade; - proxy_set_header Connection \"upgrade\"; - proxy_set_header Host \$host; - proxy_cache_bypass \$http_upgrade; - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto \$scheme; - } -}" - -echo "$nginxConfig" > /etc/nginx/sites-available/remotely - -ln -s /etc/nginx/sites-available/remotely /etc/nginx/sites-enabled/remotely - -# Test config. -nginx -t - -# Reload. -nginx -s reload - - - - -# Create service. - -serviceConfig="[Unit] -Description=Remotely Server - -[Service] -WorkingDirectory=$appRoot -ExecStart=/usr/bin/dotnet $appRoot/Remotely_Server.dll -Restart=always -# Restart service after 10 seconds if the dotnet service crashes: -RestartSec=10 -SyslogIdentifier=remotely -User=www-data -Environment=ASPNETCORE_ENVIRONMENT=Production -Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false - -[Install] -WantedBy=multi-user.target" - -echo "$serviceConfig" > /etc/systemd/system/remotely.service - - -# Enable service. -systemctl enable remotely.service -# Start service. -systemctl restart remotely.service - - -# Install Certbot and get SSL cert. -apt-get -y install certbot python3-certbot-nginx - -certbot --nginx \ No newline at end of file