├── core └── change-name-server.py ├── install.sh └── readme.md /core/change-name-server.py: -------------------------------------------------------------------------------- 1 | import re 2 | import subprocess 3 | 4 | def read_sources_list(filepath): 5 | with open(filepath, 'r') as file: 6 | lines = file.readlines() 7 | return lines 8 | 9 | def replace_subdomains(lines): 10 | updated_lines = [] 11 | for line in lines: 12 | updated_line = re.sub(r'(\w+)\.([\w.-]+\.\w+)', r'ir.\2', line) 13 | updated_lines.append(updated_line) 14 | return updated_lines 15 | 16 | def write_sources_list(filepath, lines): 17 | with open(filepath, 'w') as file: 18 | file.writelines(lines) 19 | 20 | def update_apt(): 21 | subprocess.run(['sudo', 'apt', 'update'], check=True) 22 | 23 | def main(): 24 | filepath = '/etc/apt/sources.list' 25 | lines = read_sources_list(filepath) 26 | 27 | updated_lines = replace_subdomains(lines) 28 | 29 | write_sources_list(filepath, updated_lines) 30 | 31 | update_apt() 32 | 33 | if __name__ == "__main__": 34 | main() 35 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RED='\033[0;31m' 4 | GREEN='\033[0;32m' 5 | YELLOW='\033[0;33m' 6 | plain='\033[0m' 7 | NC='\033[0m' 8 | 9 | # [[ $EUID -ne 0 ]] && echo -e "${RED}Fatal error: ${plain} Please run this script with root privilege \n " && exit 1 10 | 11 | install_jq() { 12 | if ! command -v jq &> /dev/null; then 13 | # Check if the system is using apt package manager 14 | if command -v apt-get &> /dev/null; then 15 | echo -e "${RED}jq is not installed. Installing...${NC}" 16 | sleep 1 17 | sudo apt-get update 18 | sudo apt-get install -y jq 19 | else 20 | echo -e "${RED}Error: Unsupported package manager. Please install jq manually.${NC}\n" 21 | read -p "Press any key to continue..." 22 | exit 1 23 | fi 24 | fi 25 | } 26 | 27 | loader(){ 28 | install_jq 29 | # Get server IP 30 | SERVER_IP=$(hostname -I | awk '{print $1}') 31 | # Fetch server country using ip-api.com 32 | SERVER_COUNTRY=$(curl -sS "http://ip-api.com/json/$SERVER_IP" | jq -r '.country') 33 | # Fetch server isp using ip-api.com 34 | SERVER_ISP=$(curl -sS "http://ip-api.com/json/$SERVER_IP" | jq -r '.isp') 35 | } 36 | 37 | install_speedtest(){ 38 | sudo apt-get update && sudo apt-get install 39 | wget "https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-x86_64.tgz" 40 | tar -zxvf ookla-speedtest-1.2.0-linux-x86_64.tgz 41 | cp speedtest /usr/bin 42 | sleep .5 43 | speedtest 44 | } 45 | 46 | change_ssh_port(){ 47 | echo "" 48 | echo -n "Please enter the port you would like SSH to run on > " 49 | while read SSHPORT; do 50 | if [[ "$SSHPORT" =~ ^[0-9]{2,5}$ || "$SSHPORT" = 22 ]]; then 51 | if [[ "$SSHPORT" -ge 1024 && "$SSHPORT" -le 65535 || "$SSHPORT" = 22 ]]; then 52 | # Create backup of current SSH config 53 | NOW=$(date +"%m_%d_%Y-%H_%M_%S") 54 | cp /etc/ssh/sshd_config /etc/ssh/sshd_config.inst.bckup.$NOW 55 | # Apply changes to sshd_config 56 | sed -i -e "/Port /c\Port $SSHPORT" /etc/ssh/sshd_config 57 | echo -e "Restarting SSH in 5 seconds. Please wait.\n" 58 | sleep 5 59 | # Restart SSH service 60 | service sshd restart 61 | echo "" 62 | echo -e "The SSH port has been changed to $SSHPORT. Please login using that port to test BEFORE ending this session.\n" 63 | exit 0 64 | else 65 | echo -e "Invalid port: must be 22, or between 1024 and 65535." 66 | echo -n "Please enter the port you would like SSH to run on > " 67 | fi 68 | else 69 | echo -e "Invalid port: must be numeric!" 70 | echo -n "Please enter the port you would like SSH to run on > " 71 | fi 72 | done 73 | 74 | echo "" 75 | } 76 | setupFakeWebSite(){ 77 | sudo apt-get update 78 | sudo apt-get install unzip -y 79 | 80 | if ! command -v nginx &> /dev/null; then 81 | echo "The Nginx software is not installed; the installation process has started." 82 | if sudo apt-get install -y nginx; then 83 | echo "Nginx was successfully installed." 84 | else 85 | echo "An error occurred during the Nginx installation process." >&2 86 | exit 1 87 | fi 88 | else 89 | echo "The Nginx software was already installed." 90 | fi 91 | 92 | cd /root || { echo "Failed to change directory to /root"; exit 1; } 93 | 94 | if [[ -d "website-templates-master" ]]; then 95 | echo "Removing existing 'website-templates-master' directory..." 96 | rm -rf website-templates-master 97 | fi 98 | 99 | wget https://github.com/learning-zone/website-templates/archive/refs/heads/master.zip 100 | unzip master.zip 101 | rm master.zip 102 | cd website-templates-master || { echo "Failed to change directory to randomfakehtml-master"; exit 1; } 103 | rm -rf assets 104 | rm ".gitattributes" "README.md" "_config.yml" 105 | 106 | randomTemplate=$(a=(*); echo ${a[$((RANDOM % ${#a[@]}))]} 2>&1) 107 | if [[ -n "$randomTemplate" ]]; then 108 | echo "Random template name: ${randomTemplate}" 109 | else 110 | echo "No directories found to choose from." 111 | exit 1 112 | fi 113 | 114 | if [[ -d "${randomTemplate}" && -d "/var/www/html/" ]]; then 115 | sudo rm -rf /var/www/html/* 116 | sudo cp -a "${randomTemplate}/." /var/www/html/ 117 | echo "Template extracted successfully!" 118 | else 119 | echo "Extraction error!" 120 | fi 121 | } 122 | 123 | 124 | menu(){ 125 | 126 | clear 127 | echo "+--------------------------------------------------------------------------------------------------------------+" 128 | echo "| ## #### #### #### #### ###### ## ## ## ###### ## ## ##### #### |" 129 | echo "| #### ## ## ## ## ## ## ## ## #### ### ## ## ## ## ## ## ## ## |" 130 | echo "| ## ## ## ## ## ## ## ## ## ###### ## ## ## ## ## ## |" 131 | echo "| ###### #### #### ## #### ## ###### ###### ## ##### ## ## ##### #### |" 132 | echo "| ## ## ## ## ## ## ## ## ## ## ### ## ## ## ## ## |" 133 | echo "| ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #### ## ## ## (2.5) |" 134 | echo "| ## ## #### #### #### #### ## ## ## ## ## ## ## ## #### |" 135 | echo "+--------------------------------------------------------------------------------------------------------------+" 136 | echo -e "| Telegram Channel : ${YELLOW}@DVHOST_CLOUD ${NC} | YouTube : ${RED}youtube.com/@dvhost_cloud${NC} | Version : ${GREEN} 2.5${NC} " 137 | echo "+--------------------------------------------------------------------------------------------------------------+" 138 | echo -e "${GREEN}|Server Location:${NC} $SERVER_COUNTRY" 139 | echo -e "${GREEN}|Server IP:${NC} $SERVER_IP" 140 | echo -e "${GREEN}|Server ISP:${NC} $SERVER_ISP" 141 | echo "+---------------------------------------------------------------------------------------------------------------+" 142 | echo -e "${YELLOW}" 143 | echo -e " ------- ${GREEN}Tools${YELLOW} ------- " 144 | echo "|" 145 | echo -e "| 1 - SpeedTest ookla" 146 | echo -e "| 2 - Speedtest bench.io" 147 | echo -e "| 3 - Speedtest ArvanCloud" 148 | echo -e "| 4 - System Monitors" 149 | echo "|" 150 | echo -e " ------- ${GREEN}DNS Management${YELLOW} ------- " 151 | echo "|" 152 | echo -e "| 5 - Set DNS Shecan" 153 | echo -e "| 6 - Set DNS Google" 154 | echo "|" 155 | echo -e " ------- ${GREEN}VPN Panels${YELLOW} ------- " 156 | echo "|" 157 | echo -e "| 7 - Install X-UI Panels" 158 | echo -e "| 8 - Install Marzban Panel" 159 | echo -e "| 9 - Auto SSL Marzban/X-UI (by @ErfJab)" 160 | echo -e "| 10 - Auto Backup Marzban/X-UI (by @AC_Lover)" 161 | echo -e "| 11 - Make Telegram Proxy (MTProto)" 162 | echo "|" 163 | 164 | echo -e " ------- ${GREEN}Networking${YELLOW} ------- " 165 | echo "|" 166 | echo -e "| 12 - Disable IPv6" 167 | echo -e "| 13 - Disable/Enable Ping Response" 168 | echo -e "| 14 - Change source list IRAN" 169 | echo "|" 170 | echo -e " ------- ${GREEN}System Management${YELLOW} ------- " 171 | echo "|" 172 | echo -e "| 15 - Fix WhatsApp datetime" 173 | echo -e "| 16 - Remove IPtables Rules" 174 | echo -e "| 17 - Change SSH port" 175 | echo -e "| 18 - Change Password SSH" 176 | echo -e "| 19 - Update server and install dependences" 177 | echo "|" 178 | echo -e " ------- ${GREEN}Optimizations${YELLOW} ------- " 179 | echo "|" 180 | echo -e "| 20 - Install BBR v3" 181 | echo -e "| 21 - Install WARP+" 182 | echo "|" 183 | echo -e " ------- ${GREEN}Web Server${YELLOW} ------- " 184 | echo "|" 185 | echo -e "| 22 - Install Nginx + Fake-WebSite Template [HTML]" 186 | echo "|" 187 | echo -e " ------- ${GREEN}Exit${YELLOW} ------- " 188 | echo "|" 189 | echo -e "| 0 - Exit" 190 | echo "" 191 | echo -e "${NC}+-------------------------------------------------------------------------------------------------------------+${NC}" 192 | 193 | read -p "Please choose an option: " choice 194 | 195 | case $choice in 196 | 1) install_speedtest ;; 197 | 2) wget -qO- bench.sh | bash ;; 198 | 3) bash <(curl -s https://raw.githubusercontent.com/arvancloud/support/main/bench.sh);; 199 | 4) sudo apt-get install snapd && sudo snap install btop ;; 200 | 5) 201 | cp /etc/resolv.conf /etc/resolv-backup.conf 202 | rm -rf /etc/resolv.conf && touch /etc/resolv.conf && echo 'nameserver 178.22.122.100' >> /etc/resolv.conf && echo 'nameserver 185.51.200.2' >> /etc/resolv.conf 203 | echo "Shecan DNS Set." 204 | ;; 205 | 6) 206 | cp /etc/resolv.conf /etc/resolv-backup.conf 207 | rm -rf /etc/resolv.conf && touch /etc/resolv.conf && echo 'nameserver 8.8.8.8' >> /etc/resolv.conf && echo 'nameserver 1.1.1.1' >> /etc/resolv.conf 208 | echo "Google DNS Set." 209 | ;; 210 | 7) 211 | rm x-ui_installer.sh 212 | wget https://gist.githubusercontent.com/dev-ir/aef266871ca3945a662bd92bbf49b3ae/raw/d7b9ba940ac338c0e5816a84062de343c3eab742/x-ui_installer.sh 213 | bash x-ui_installer.sh 214 | ;; 215 | 8) 216 | sudo bash -c "$(curl -sL https://github.com/Gozargah/Marzban-scripts/raw/master/marzban.sh)" @ install 217 | marzban cli admin create --sudo 218 | ;; 219 | 9) sudo bash -c "$(curl -sL https://github.com/erfjab/ESSL/raw/main/essl.sh)";; 220 | 10) bash <(curl -Ls https://github.com/AC-Lover/backup/raw/main/backup.sh) ;; 221 | 222 | 11) 223 | echo "Please enter the following information:" 224 | read -p "Port number (default is 443): " port 225 | echo "for secret you you can use http://seriyps.ru/mtpgen.html " 226 | read -p "Secret key (should be a string of 32 hexadecimal characters): " secret_key 227 | echo "to get the server tag you should use telegram bot https://t.me/MTProxybot " 228 | read -p "Server tag (should be a string of 32 hexadecimal characters): " server_tag 229 | read -p "List of authentication methods - place empty for default - (should be a comma-separated list): " auth_methods 230 | read -p "MTProto domain (should be a valid domain name): " mtproto_domain 231 | port=${port:-443} 232 | auth_methods=${auth_methods:-"dd,-a tls"} 233 | curl -L -o mtp_install.sh https://git.io/fj5ru && \ 234 | bash mtp_install.sh -p $port -s $secret_key -t $server_tag -a $auth_methods -d $mtproto_domain 235 | echo -e "Press ${RED}ENTER${NC} to continue" 236 | read -s -n 1 237 | ;; 238 | 239 | 12) 240 | sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 241 | sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 242 | sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 243 | 244 | echo "IPv6 has been disabled" 245 | ;; 246 | 247 | 13) bash <(curl -Ls https://gist.githubusercontent.com/dev-ir/4ec5873cbff302d3b1e0d9e85a6e95c5/raw/282f8c89fcd259b3adb88f089c3a833c32e66932/icmp-manager.sh) ;; 248 | 249 | 14) 250 | if ! command -v python3 &> /dev/null 251 | then 252 | echo "Python 3 not installed." 253 | sudo apt update 254 | sudo apt install -y python3 255 | fi 256 | wget https://raw.githubusercontent.com/dev-ir/assistant-vps/master/core/change-name-server.py 257 | python3 change-name-server.py 258 | ;; 259 | 15) 260 | sudo timedatectl set-timezone Asia/Tehran 261 | echo "Time & Date Updated." 262 | ;; 263 | 16) 264 | 265 | iptables -F 266 | iptables -X 267 | iptables -P INPUT ACCEPT 268 | iptables -P FORWARD ACCEPT 269 | iptables -P OUTPUT ACCEPT 270 | 271 | echo "Rules iptable Removed." 272 | ;; 273 | 17) change_ssh_port ;; 274 | 18) sudo passwd ;; 275 | 19) 276 | tput setaf 4 277 | echo "🟦 Updating the server..." 278 | apt update 279 | while [ $(pgrep apt-get) -gt 0 ]; do 280 | sleep 1 281 | done 282 | 283 | echo "🟦 Upgrading all packages..." 284 | apt upgrade -y 285 | 286 | apt install zenity tput 287 | clear 288 | 289 | packages=$(dpkg -l | grep "^i ." | awk '{print $2}') 290 | 291 | tput setaf 2 292 | 293 | echo "🟦 Packages to install:" 294 | echo 295 | for package in $packages; do 296 | echo " $package" 297 | done 298 | 299 | tput setaf 4 300 | 301 | echo "🟦 Installing packages..." 302 | 303 | for package in $packages; do 304 | apt install -y $package 305 | done 306 | 307 | tput setaf 2 308 | 309 | echo "🟩 Server update completed." 310 | 311 | echo "🟦 Returning to main menu..." 312 | 313 | clear 314 | ;; 315 | 316 | 20) curl -O https://raw.githubusercontent.com/jinwyp/one_click_script/master/install_kernel.sh && chmod +x ./install_kernel.sh && ./install_kernel.sh ;; 317 | 21) wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh ;; 318 | 22) 319 | setupFakeWebSite 320 | ;; 321 | 0) 322 | echo -e "${GREEN}Exiting program...${NC}" 323 | exit 0 324 | ;; 325 | *) 326 | echo "Not valid" 327 | ;; 328 | esac 329 | 330 | } 331 | 332 | loader 333 | menu 334 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |
⚡️ Welcome to Assistant VPS ⚡️ 2 | 3 |4 | 🍟 Easy to sell with assistant-vps easy install with few clicks 5 |
6 | 7 | ## Support project 8 | 9 | **We don't need financial support, only Star (⭐) is enough, thank you.** 10 | 11 | ## Install & Upgrade 12 | 13 | ``` 14 | bash <(curl -Ls https://raw.githubusercontent.com/dev-ir/assistant-vps/master/install.sh) 15 | ``` 16 | 17 | ## 💫 Features 18 | 19 | - System Status Monitoring 20 | - Install Speedtest.Net in IRAN VPS 21 | - Block All SPEEDTEST Sites in X-UI 22 | - Set DNS Google / Shecan 23 | - Fix WhatsApp datetime 24 | - Disable IPv6 25 | - Speedtest by bench.io 26 | - Remove iptables 27 | - Install BBR v3 28 | - Install Warp PLUS 29 | - Change Password SSH 30 | - Change Password VPS 31 | - Speedtest by ArvanCloud 32 | - Auto SSL Marzban/X-UI 33 | - Auto Backup Marzban/X-UI 34 | - Install any version of X-UI Panel 35 | - Install Marzban Panel 36 | - Install MTProto 37 | - Update server and install dependences 38 | - Change source list to IRAN 39 | - List Port By SiZE 40 | - Run Fake-WebSite Template 41 | 42 | ## 💻 Recommended OS 43 | 44 | - Ubuntu 20.04+ 45 | - Debian 11+ 46 | - CentOS 8+ 47 | - Fedora 36+ 48 | - Armbian 49 | 50 | 51 | ## 🪚 Preview 52 |  53 | 54 | ## Languages 55 | 56 | - English 57 | 58 | **If this project is helpful to you, you may wish to give it a**:star2: 59 | 60 | 61 | 62 | - USDT (TRC20): `TVUqVMoCEe5DVUoxmPg8MwmgcHvZLqLjr4` 63 | 64 | ## Stargazers over time 65 | [](https://starchart.cc/dev-ir/assistant-vps) 66 | 67 | ## 📧 Join Telegram Channel 68 | 69 | TG : https://t.me/+EpErnDsDPhw3ZThk 70 | --------------------------------------------------------------------------------