63 |
1. Your localhost web server is running.
64 |
2. Test your website on your localhost server.
65 |
3. Go to document root and replace your web file with index.html file.
66 |
67 |
68 |
69 | EOM
--------------------------------------------------------------------------------
/core/logo.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import os
7 | import sys
8 | from time import sleep
9 | from system import *
10 |
11 | def Slogo():
12 | if system=="termux":
13 | sleep(0.2)
14 | Mylogo()
15 | print('''
16 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mView Server setting.
17 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mChange Server setting.
18 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
19 | else:
20 | sleep(0.2)
21 | Mylogo()
22 | print('''
23 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mView Server setting.
24 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mChange Server setting.
25 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
26 |
27 |
28 | def mslogo():
29 | if system=="termux":
30 | sleep(0.2)
31 | Mylogo()
32 | print('''
33 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart default server.
34 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mStart PHP web server.
35 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mStart Python web server.
36 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mStart Apache web server.
37 | \033[1;32m [\033[1;31m 5 \033[1;32m] \033[1;33mStart Nginx web server.
38 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
39 | else:
40 | sleep(0.2)
41 | Mylogo()
42 | print('''
43 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart default server.
44 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mStart PHP web server.
45 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mStart Python web server.
46 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mStart Apache web server.
47 | \033[1;32m [\033[1;31m 5 \033[1;32m] \033[1;33mStart Nginx web server.
48 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
49 |
50 | def mhlogo():
51 | if system=="termux":
52 | sleep(0.2)
53 | Mylogo()
54 | print('''
55 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart default host.
56 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mUse SSH tunnel.
57 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mUse Ngrok.
58 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mUse localtunnel.
59 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
60 | else:
61 | sleep(0.2)
62 | Mylogo()
63 | print('''
64 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart default host.
65 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mUse SSH tunnel.
66 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mUse Ngrok.
67 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mUse localtunnel.
68 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
69 |
70 | def Mylogo():
71 | if system=="termux":
72 | os.system("clear")
73 | print ('''\007
74 |
75 |
76 | \033[01;32m
77 | __ __ ____
78 | | \/ |_ _/ ___| ___ _ \033[01;31m____ _____ \033[01;32m_ __
79 | | |\/| | | | \___ \ / _ \ '__\033[01;31m\ \ / / \033[01;32m_ \ '__|
80 | | | | | |_| |___) | __/ | \033[01;31m\ V / \033[01;32m __/ |
81 | |_| |_|\__, |____/ \___|_| \033[01;31m\_/ \033[01;32m\___|_|
82 | |___/
83 | \033[00m
84 |
85 | }\033[01;31m---------------------------------------\033[00m{
86 | }\033[01;31m--------------> \033[01;32mYOUR OWN SERVER \033[01;31m<--------------\033[00m{
87 | }\033[01;31m---------------------------------------\033[00m{''')
88 | else:
89 | os.system("clear")
90 | print ('''\007
91 |
92 |
93 | \033[01;32m
94 | __ __ ____
95 | | \/ |_ _/ ___| ___ _ \033[01;31m____ _____ \033[01;32m_ __
96 | | |\/| | | | \___ \ / _ \ '__\033[01;31m\ \ / / \033[01;32m_ \ '__|
97 | | | | | |_| |___) | __/ | \033[01;31m\ V / \033[01;32m __/ |
98 | |_| |_|\__, |____/ \___|_| \033[01;31m\_/ \033[01;32m\___|_|
99 | |___/
100 | \033[00m
101 | }\033[01;31m-------------------------------------------\033[00m{
102 | }\033[01;31m----------------> \033[01;32mYOUR OWN SERVER \033[01;31m<----------------\033[00m{
103 | }\033[01;31m-------------------------------------------\033[00m{''')
104 |
105 |
106 | def logo():
107 | if system=="termux":
108 | os.system("clear")
109 | Mylogo()
110 | print('''
111 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart Server.
112 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mAccess from internet.
113 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mStart Database server.
114 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mManually start server.
115 | \033[1;32m [\033[1;31m 5 \033[1;32m] \033[1;33mManually host server.
116 | \033[1;32m [\033[1;31m 6 \033[1;32m] \033[1;33mUpdate MyServer.
117 | \033[1;32m [\033[1;31m 7 \033[1;32m] \033[1;33mServer setting.
118 | \033[1;32m [\033[1;31m 8 \033[1;32m] \033[1;33mAbout us.
119 | \033[1;32m [\033[1;31m x \033[1;32m] \033[1;33mExit.\n''')
120 | else:
121 | os.system("clear")
122 | Mylogo()
123 | print('''
124 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart Server.
125 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mAccess from internet.
126 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mStart Database server.
127 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mManually start server.
128 | \033[1;32m [\033[1;31m 5 \033[1;32m] \033[1;33mManually host server.
129 | \033[1;32m [\033[1;31m 6 \033[1;32m] \033[1;33mUpdate MyServer.
130 | \033[1;32m [\033[1;31m 7 \033[1;32m] \033[1;33mServer setting.
131 | \033[1;32m [\033[1;31m 8 \033[1;32m] \033[1;33mAbout us.
132 | \033[1;32m [\033[1;31m x \033[1;32m] \033[1;33mExit.\n''')
133 |
134 | def ab():
135 | if system=="termux":
136 | Mylogo()
137 | print('''
138 | \033[1;36m Tool Name :- \033[0;33mMyServer
139 | \033[1;36m Author :- \033[0;33mRajkumar Dusad
140 | \033[1;36m Powered By :- \033[0;33mAex Software's
141 |
142 | \033[1;33m MyServer :- \033[0;32mMyServer is your own localhost
143 | server. you can setup PHP, Apache web servers
144 | on your android or linux like Ubuntu etc.
145 | it is Developed for android Termux or GNURoot.
146 | You can setup your localhost server and access
147 | from internet. you can host your website.\033[1;m
148 | ''')
149 | else:
150 | Mylogo()
151 | print('''
152 | \033[1;36m Tool Name :- \033[0;33mMyServer
153 | \033[1;36m Author :- \033[0;33mRajkumar Dusad
154 | \033[1;36m Powered By :- \033[0;33mAex Software's
155 |
156 | \033[1;33m MyServer :- \033[0;32mMyServer is your own localhost server.
157 | you can setup PHP, Apache web servers on your android
158 | or linux like Ubuntu etc. it is Developed for android
159 | Termux or GNURoot. You can setup your localhost server
160 | and access from internet. you can host your website.\033[1;m
161 | ''')
162 |
163 | def notin():
164 | if system=="termux":
165 | Mylogo()
166 | print('''\n\033[01;33m [\033[1;31m + \033[1;33m] \033[1;31mSorry MyServer is not installed.
167 | \033[1;33m [\033[1;31m + \033[1;33m] \033[1;31mPress Y to install MyServer.
168 | ''')
169 | else:
170 | Mylogo()
171 | print('''\n\033[01;33m [\033[1;31m + \033[1;33m] \033[1;31mSorry MyServer is not installed.
172 | \033[1;33m [\033[1;31m + \033[1;33m] \033[1;31mPress Y to install MyServer.
173 | ''')
174 |
--------------------------------------------------------------------------------
/core/myserver:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 13/11/2018
4 | # Powered By :- Aex Software's
5 | if [ -d /data/data/com.termux/files/usr/share/MyServer ];then
6 | cd /data/data/com.termux/files/usr/share/MyServer
7 | exec python3 MyServer.py $@
8 | else
9 | cd /usr/share/MyServer
10 | exec python3 MyServer.py $@
11 | fi
12 |
--------------------------------------------------------------------------------
/core/mysql.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from system import *
10 | from logo import *
11 |
12 | class MySQL(object):
13 | def chmys(self):
14 | if os.path.exists(bpath+"mysql") or os.path.exists("/usr/sbin/mysql"):
15 | self.mysqls()
16 | else:
17 | Mylogo()
18 | print("\n\n\033[01;31m Sorry we can't install \033[01;32mMySQL \033[01;31min your "+system+".\033[00m")
19 | sleep(3)
20 |
21 | def mysqls(self):
22 | if system=="termux":
23 | os.system("python modules/.srvr.aex")
24 | Mylogo()
25 | print("\n\033[01;33mStarting Server ......\033[00m\n")
26 | os.system("mysqld")
27 | print("\n\033[01;31m unfortunately server stopped\n\033[00m")
28 | sys.exit()
29 | else:
30 | os.system("python modules/.srvr.aex")
31 | Mylogo()
32 | print("\n\033[01;33mStarting Server ......\033[00m\n")
33 | if os.path.exists("/usr/lib/sudo"):
34 | os.system("sudo service mysql start")
35 | print("\n\033[01;32mMySQL Server is running..\n\033[00m")
36 | elif system=="ubuntu":
37 | os.system("sudo systemctl mysql start")
38 | print("\n\033[01;32mMySQL Server is running..\n\033[00m")
39 | else:
40 | os.system("service mysql start")
41 | print("\n\033[01;32mMySQL Server is running..\n\033[00m")
42 | sys.exit()
43 |
44 | def mysqlst(self):
45 | if system=="termux":
46 | os.system("python modules/.srvr.aex")
47 | Mylogo()
48 | print("\n\033[01;33mStopping MySQL Server ......\033[00m\n")
49 | os.system("pkill mysql")
50 | print("\n\033[01;31mMySQL server stopped\n\033[00m")
51 | sys.exit()
52 | else:
53 | os.system("python modules/.srvr.aex")
54 | Mylogo()
55 | print("\n\033[01;33mStopping MySQL Server ......\033[00m\n")
56 | if os.path.exists("/usr/lib/sudo"):
57 | os.system("sudo service mysql stop")
58 | elif system=="ubuntu":
59 | os.system("sudo systemctl mysql stop")
60 | else:
61 | os.system("service mysql stop")
62 | print("\n\033[01;31mMySQL server stopped\n\033[00m")
63 | sys.exit()
64 |
65 | def inmys(self):
66 | if os.path.exists(bpath+"mysql"):
67 | self.mysqls()
68 | else:
69 | Mylogo()
70 | print("\n\n\033[01;31m [\033[01;33m+\033[01;31m] \033[01;36mMySQL \033[01;31mis not installed in your "+system+".")
71 | opt=input("\n\033[01;33m Do you want to install MySQL [\033[01;32mY/n\033[01;33m] >>\033[01;36m ")
72 | if opt=="Y" or opt=="y":
73 | Mylogo()
74 | print("\n\033[01;33mInstalling MySQL Server......\n\033[00m")
75 | if system=="termux":
76 | os.system(pac+" update")
77 | os.system(pac+" install mariadb -y")
78 | if system=="ubuntu":
79 | os.system(pac+" update")
80 | os.system(pac+" install mysql-server -y")
81 | else:
82 | os.system(pac+" update")
83 | os.system(pac+" install mysql-server -y")
84 | self.chmys()
85 | elif opt=="N" or opt=="n":
86 | pass
87 | else:
88 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+opt+"\'")
89 | sleep(1)
90 | self.inmys()
91 |
92 | def Mys():
93 | MySQL().inmys()
94 |
95 | def Myst():
96 | MySQL().mysqlst()
97 |
98 | if sys.argv[1]=="start":
99 | Mys()
100 | elif sys.argv[1]=="stop":
101 | Myst()
102 |
--------------------------------------------------------------------------------
/core/ng.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 4/1/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from system import *
10 | from logo import *
11 | from nginx import *
12 |
13 | class nginx_server(object):
14 | def ng(self):
15 | os.system("python modules/.srvr.aex")
16 | Mylogo()
17 | gp=sys.argv[4]
18 | port=sys.argv[3]
19 | host=sys.argv[2]
20 | if os.path.exists(gp+"/index.html"):
21 | pass
22 | elif os.path.exists(gp+"index.html"):
23 | pass
24 | elif os.path.exists(gp+"/index.py"):
25 | pass
26 | elif os.path.exists(gp+"index.py"):
27 | pass
28 | elif os.path.exists(gp+"/index.php"):
29 | pass
30 | elif os.path.exists(gp+"index.php"):
31 | pass
32 | elif os.path.exists(gp+"/index.pl"):
33 | pass
34 | elif os.path.exists(gp+"index.pl"):
35 | pass
36 | elif os.path.exists(gp+"/index.jsp"):
37 | pass
38 | elif os.path.exists(gp+"index.jsp"):
39 | pass
40 | else:
41 | if system=="ubuntu":
42 | os.system("sudo cp modules/index.sh "+gp)
43 | os.system("cd "+gp+" && sudo sh index.sh")
44 | os.system("cd "+gp+" && sudo rm index.sh")
45 | else:
46 | os.system("cp modules/index.sh "+gp)
47 | os.system("cd "+gp+" && sh index.sh")
48 | os.system("cd "+gp+" && rm index.sh")
49 | if os.path.exists(bpath+"nginx"):
50 | ngi(port,gp,host)
51 | if os.path.exists("nginx.conf") and os.path.exists("/data/data/com.termux/files/usr/etc/nginx/nginx.conf"):
52 | os.system("rm -rf /data/data/com.termux/files/usr/etc/nginx/nginx.conf")
53 | os.system("cp nginx.conf /data/data/com.termux/files/usr/etc/nginx")
54 | os.system("nginx")
55 | print("\n\n\007\033[01;33mNginx web server\033[01;32m is running .....")
56 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://"+host+":"+port+"/ \033[00m\n")
57 | stop=input("\033[01;33mPress \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
58 | if stop=="0":
59 | os.system("nginx -s stop")
60 | sleep(2)
61 | print("\n\007\033[01;33mNginx web server\033[01;31m stopped !! \033[00m")
62 | sys.exit()
63 |
64 | elif os.path.exists("/usr/sbin/nginx"):
65 | if system=="ubuntu":
66 | default(port,gp)
67 | if os.path.exists("default") and os.path.exists("/etc/nginx/sites-available/default"):
68 | os.system("sudo rm -rf /etc/nginx/sites-available/default")
69 | os.system("sudo cp default /etc/nginx/sites-available")
70 | os.system("sudo systemctl start nginx")
71 | print("\n\n\007\033[01;33mNginx web server\033[01;32m is running .....")
72 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://localhost:"+port+"/ \033[00m\n")
73 | stop=input("\033[01;33mPress \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
74 | if stop=="0":
75 | os.system("sudo systemctl stop nginx")
76 | sleep(2)
77 | print("\n\007\033[01;33mNginx web server\033[01;31m stopped !! \033[00m")
78 | sys.exit()
79 |
80 | else:
81 | default(port,gp)
82 | if os.path.exists("default") and os.path.exists("/etc/nginx/sites-available/default"):
83 | os.system("rm -rf /etc/nginx/sites-available/default")
84 | os.system("cp default /etc/nginx/sites-available")
85 | os.system("service nginx start")
86 | print("\n\n\007\033[01;33mNginx web server\033[01;32m is running .....")
87 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://localhost:"+port+"/ \033[00m\n")
88 | stop=input("\033[01;33mPress \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
89 | if stop=="0":
90 | os.system("service nginx stop")
91 | sleep(2)
92 | print("\n\007\033[01;33mNginx web server\033[01;31m stopped !! \033[00m")
93 | sys.exit()
94 |
95 | def nginx():
96 | if os.path.exists(bpath+"nginx") or os.path.exists("/usr/sbin/nginx"):
97 | nginx_server().ng()
98 | else:
99 | Mylogo()
100 | print("\n\n\033[01;31m [\033[01;33m+\033[01;31m] \033[01;36mNginx Server \033[01;31mis not installed in your "+system+".")
101 | opt=input("\n\033[01;33m Do you want to install Nginx Server [\033[01;32mY/n\033[01;33m] >>\033[00m ")
102 | if opt=="y" or opt=="Y":
103 | Mylogo()
104 | print("\n\033[01;33minstalling Nginx Server ......\033[00m\n")
105 | sleep(1)
106 | os.system(pac+" update")
107 | os.system(pac+" install nginx -y")
108 | if os.path.exists(bpath+"nginx") or os.path.exists("/usr/sbin/nginx"):
109 | nginx_server().ng()
110 | else:
111 | Mylogo()
112 | print("\n\n\033[01;31m Sorry we can't install \033[01;33mNginx Server\033[01;31m in your "+system+".\033[00m")
113 | sleep(3)
--------------------------------------------------------------------------------
/core/nginx.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 |
4 | def ngi(por,path,host):
5 | port=por
6 | droot=path
7 | hostname=host
8 | scr="""
9 | #user nobody;
10 | worker_processes 1;
11 |
12 | #error_log logs/error.log;
13 | #error_log logs/error.log notice;
14 | #error_log logs/error.log info;
15 |
16 | #pid logs/nginx.pid;
17 |
18 |
19 | events {
20 | worker_connections 1024;
21 | }
22 |
23 |
24 | http {
25 | include mime.types;
26 | default_type application/octet-stream;
27 |
28 | #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
29 | # '$status $body_bytes_sent "$http_referer" '
30 | # '"$http_user_agent" "$http_x_forwarded_for"';
31 |
32 | #access_log logs/access.log main;
33 |
34 | sendfile on;
35 | #tcp_nopush on;
36 |
37 | #keepalive_timeout 0;
38 | keepalive_timeout 65;
39 |
40 | #gzip on;
41 |
42 | server {
43 | listen """+port+""";
44 | server_name """+hostname+""";
45 |
46 | #charset koi8-r;
47 |
48 | #access_log logs/host.access.log main;
49 |
50 | location / {
51 | root """+droot+""";
52 | index index.html index.htm;
53 | }
54 |
55 | #error_page 404 /404.html;
56 |
57 | # redirect server error pages to the static page /50x.html
58 | #
59 | error_page 500 502 503 504 /50x.html;
60 | location = /50x.html {
61 | root """+droot+""";
62 | }
63 |
64 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80
65 | #
66 | #location ~ \.php$ {
67 | # proxy_pass http://127.0.0.1;
68 | #}
69 |
70 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
71 | #
72 | #location ~ \.php$ {
73 | # root html;
74 | # fastcgi_pass 127.0.0.1:9000;
75 | # fastcgi_index index.php;
76 | # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
77 | # include fastcgi_params;
78 | #}
79 |
80 | # deny access to .htaccess files, if Apache's document root
81 | # concurs with nginx's one
82 | #
83 | #location ~ /\.ht {
84 | # deny all;
85 | #}
86 | }
87 |
88 |
89 | # another virtual host using mix of IP-, name-, and port-based configuration
90 | #
91 | #server {
92 | # listen 8000;
93 | # listen somename:8080;
94 | # server_name somename alias another.alias;
95 |
96 | # location / {
97 | # root html;
98 | # index index.html index.htm;
99 | # }
100 | #}
101 |
102 |
103 | # HTTPS server
104 | #
105 | #server {
106 | # listen 443 ssl;
107 | # server_name localhost;
108 |
109 | # ssl_certificate cert.pem;
110 | # ssl_certificate_key cert.key;
111 |
112 | # ssl_session_cache shared:SSL:1m;
113 | # ssl_session_timeout 5m;
114 |
115 | # ssl_ciphers HIGH:!aNULL:!MD5;
116 | # ssl_prefer_server_ciphers on;
117 |
118 | # location / {
119 | # root html;
120 | # index index.html index.htm;
121 | # }
122 | #}
123 |
124 | }
125 | """
126 | srw=open("nginx.conf","w")
127 | srw.write(scr)
128 | srw.close()
129 |
130 |
131 | def default(por,path):
132 | port=por
133 | droot=path
134 | scr="""
135 | ##
136 | # You should look at the following URL's in order to grasp a solid understanding
137 | # of Nginx configuration files in order to fully unleash the power of Nginx.
138 | # https://www.nginx.com/resources/wiki/start/
139 | # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
140 | # https://wiki.debian.org/Nginx/DirectoryStructure
141 | #
142 | # In most cases, administrators will remove this file from sites-enabled/ and
143 | # leave it as reference inside of sites-available where it will continue to be
144 | # updated by the nginx packaging team.
145 | #
146 | # This file will automatically load configuration files provided by other
147 | # applications, such as Drupal or Wordpress. These applications will be made
148 | # available underneath a path with that package name, such as /drupal8.
149 | #
150 | # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
151 | ##
152 |
153 | # Default server configuration
154 | #
155 | server {
156 | listen """+port+""" default_server;
157 | listen [::]:"""+port+""" default_server;
158 |
159 | # SSL configuration
160 | #
161 | # listen 443 ssl default_server;
162 | # listen [::]:443 ssl default_server;
163 | #
164 | # Note: You should disable gzip for SSL traffic.
165 | # See: https://bugs.debian.org/773332
166 | #
167 | # Read up on ssl_ciphers to ensure a secure configuration.
168 | # See: https://bugs.debian.org/765782
169 | #
170 | # Self signed certs generated by the ssl-cert package
171 | # Don't use them in a production server!
172 | #
173 | # include snippets/snakeoil.conf;
174 |
175 | root """+droot+""";
176 |
177 | # Add index.php to the list if you are using PHP
178 | index index.html index.htm index.nginx-debian.html;
179 |
180 | server_name _;
181 |
182 | location / {
183 | # First attempt to serve request as file, then
184 | # as directory, then fall back to displaying a 404.
185 | try_files $uri $uri/ =404;
186 | }
187 |
188 | # pass PHP scripts to FastCGI server
189 | #
190 | #location ~ \.php$ {
191 | # include snippets/fastcgi-php.conf;
192 | #
193 | # # With php-fpm (or other unix sockets):
194 | # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
195 | # # With php-cgi (or other tcp sockets):
196 | # fastcgi_pass 127.0.0.1:9000;
197 | #}
198 |
199 | # deny access to .htaccess files, if Apache's document root
200 | # concurs with nginx's one
201 | #
202 | #location ~ /\.ht {
203 | # deny all;
204 | #}
205 | }
206 |
207 |
208 | # Virtual Host configuration for example.com
209 | #
210 | # You can move that to a different file under sites-available/ and symlink that
211 | # to sites-enabled/ to enable it.
212 | #
213 | #server {
214 | # listen 80;
215 | # listen [::]:80;
216 | #
217 | # server_name example.com;
218 | #
219 | # root /var/www/example.com;
220 | # index index.html;
221 | #
222 | # location / {
223 | # try_files $uri $uri/ =404;
224 | # }
225 | #}
226 | """
227 | srw=open("default","w")
228 | srw.write(scr)
229 | srw.close()
--------------------------------------------------------------------------------
/core/php.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018 - 22/July/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from system import *
10 | from logo import *
11 |
12 | class phpserver(object):
13 | def chphp(self):
14 | if os.path.exists(bpath+"php"):
15 | self.chkp()
16 | else:
17 | Mylogo()
18 | print("\n\n\033[01;31m Sorry we can't install \033[01;33mPHP\033[01;31m in your "+system+".\033[00m")
19 | sleep(3)
20 |
21 | def chkp(self):
22 | getpat=sys.argv[4]
23 | getp=sys.argv[3]
24 | host=sys.argv[2]
25 | os.system("python modules/.srvr.aex")
26 | Mylogo()
27 | print("\n\033[01;33mStarting Server ......\033[00m\n")
28 | if os.path.exists(getpat+"/index.html") or os.path.exists(getpat+"index.html") or os.path.exists(getpat+"/index.php") or os.path.exists(getpat+"index.php"):
29 | pass
30 | else:
31 | if system=="ubuntu":
32 | os.system("sudo cp core/index.sh "+getpat)
33 | os.system("cd "+getpat+" && sudo sh index.sh")
34 | os.system("cd "+getpat+" && sudo rm index.sh")
35 | else:
36 | os.system("cp core/index.sh "+getpat)
37 | os.system("cd "+getpat+" && sh index.sh")
38 | os.system("cd "+getpat+" && rm index.sh")
39 | os.system("php -S "+host+":"+getp+" -t "+getpat)
40 | print("\n\007\033[01;31m unfortunately server stopped\n\033[00m")
41 | sys.exit()
42 |
43 | def inphp():
44 | if system=="termux":
45 | os.system(pac+" update")
46 | os.system(pac+" install php -y")
47 | os.system(pac+" install php-mysqli -y")
48 | else:
49 | os.system(pac+" update")
50 | os.system(pac+" install php -y")
51 | os.system(pac+" install php5 -y")
52 | os.system(pac+" install php5-mysql -y")
53 | os.system(pac+" install php5-mysqli -y")
54 |
55 | def php():
56 | if os.path.exists(bpath+"php"):
57 | phpserver().chkp()
58 | else:
59 | Mylogo()
60 | print("\n\n\033[01;31m [\033[01;33m+\033[01;31m] \033[01;36mPHP \033[01;31mis not installed in your "+system+".")
61 | opt=input("\n\033[01;33m Do you want to install PHP [\033[01;32mY/n\033[01;33m] >>\033[00m")
62 | if opt=="y" or opt=="Y":
63 | Mylogo()
64 | print("\n\033[01;33minstalling PHP ......\033[00m\n")
65 | sleep(1)
66 | inphp()
67 | phpserver().chphp()
--------------------------------------------------------------------------------
/core/pyweb.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018 - 22/July/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from system import *
10 | from logo import *
11 |
12 | class py_web(object):
13 | def chkpy(self):
14 | os.system("python modules/.srvr.aex")
15 | gp=sys.argv[4]
16 | port=sys.argv[3]
17 | host=sys.argv[2]
18 | if os.path.exists(gp+"/index.html") or os.path.exists(gp+"index.html") or os.path.exists(gp+"/index.php") or os.path.exists(gp+"index.php"):
19 | pass
20 | else:
21 | if system=="ubuntu":
22 | os.system("sudo cp core/index.sh "+gp)
23 | os.system("cd "+gp+" && sudo sh index.sh")
24 | os.system("cd "+gp+" && sudo rm index.sh")
25 | else:
26 | os.system("cp core/index.sh "+gp)
27 | os.system("cd "+gp+" && sh index.sh")
28 | os.system("cd "+gp+" && rm index.sh")
29 | Mylogo()
30 | print("\n\033[01;33mStarting Server ......\033[00m\n")
31 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://"+host+":"+port+"/\033[00m\n")
32 | os.system("cd "+gp+" && python3 -m http.server "+port+" --bind "+host)
33 | print("\n\007\033[01;31munfortunately server stopped\n\033[00m")
34 | sys.exit()
35 |
36 | def pyweb():
37 | py_web().chkpy()
38 |
--------------------------------------------------------------------------------
/core/s.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from system import *
10 | from logo import *
11 |
12 | if sys.argv[1]=="-s":
13 | if os.path.exists(spath+".serv.lock"):
14 | s=open(spath+".serv.lock","r")
15 | sr=s.read()
16 | s.close()
17 | if system=="ubuntu":
18 | os.system("sudo python core/server.py "+sr)
19 | else:
20 | os.system("python core/server.py "+sr)
21 | else:
22 | pass
23 | elif sys.argv[1]=="-h":
24 | if os.path.exists(spath+".h.lock"):
25 | s=open(spath+".h.lock","r")
26 | sr=s.read()
27 | s.close()
28 | if system=="ubuntu":
29 | os.system("sudo python core/host.py "+sr)
30 | else:
31 | os.system("python core/host.py "+sr)
32 | else:
33 | pass
34 |
--------------------------------------------------------------------------------
/core/server.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from system import *
10 | from logo import *
11 | from pyweb import *
12 | from php import *
13 | from apache import *
14 | from ng import *
15 |
16 | if sys.argv[1]=="-php":
17 | s=open(spath+".serv.lock","w")
18 | s.write(sys.argv[1]+" "+sys.argv[2]+" "+sys.argv[3]+" "+sys.argv[4])
19 | s.close()
20 | php()
21 | elif sys.argv[1]=="-apa":
22 | s=open(spath+".serv.lock","w")
23 | s.write(sys.argv[1])
24 | s.close()
25 | apache()
26 | elif sys.argv[1]=="-py":
27 | s=open(spath+".serv.lock","w")
28 | s.write(sys.argv[1]+" "+sys.argv[2]+" "+sys.argv[3]+" "+sys.argv[4])
29 | s.close()
30 | pyweb()
31 | elif sys.argv[1]=="-ng":
32 | s=open(spath+".serv.lock","w")
33 | s.write(sys.argv[1]+" "+sys.argv[2]+" "+sys.argv[3]+" "+sys.argv[4])
34 | s.close()
35 | nginx()
36 | elif sys.argv[1]=="-d":
37 | s=open(spath+".serv.lock","w")
38 | s.write(sys.argv[1]+" "+sys.argv[2]+" "+sys.argv[3]+" "+sys.argv[4])
39 | s.close()
40 | if os.path.exists(bpath+"php"):
41 | php()
42 | else:
43 | pyweb()
--------------------------------------------------------------------------------
/core/system.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 23/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 |
10 | if os.path.exists("/data/data/com.termux/files/usr/bin/pkg"):
11 | pac="pkg"
12 | home=os.getenv("HOME")+"/"
13 | bpath="/data/data/com.termux/files/usr/bin/"
14 | spath="/data/data/com.termux/files/usr/share/"
15 | system="termux"
16 | elif os.path.exists("/usr/bin/apt") or os.path.exists("/usr/bin/apt-get") or os.path.exists("/bin/apt") or os.path.exists("/bin/apt"):
17 | if os.path.exists("/usr/lib/sudo") or os.path.exists("/usr/bin/sudo") or os.path.exists("/usr/sbin/sudo"):
18 | home=os.getenv("HOME")+"/"
19 | pac="sudo apt-get"
20 | bpath="/usr/bin/"
21 | spath="/usr/share/"
22 | system="ubuntu"
23 | else:
24 | home=os.getenv("HOME")+"/"
25 | pac="apt-get"
26 | bpath="/usr/bin/"
27 | spath="/usr/share/"
28 | system="debian"
29 |
30 | def exit():
31 | sleep(1)
32 | print("\n \007\033[01;31mExiting .........")
33 | sleep(1)
34 | print(" \007\033[01;32mG00D By .......... :)")
35 | sleep(1)
36 | print("\033[00m")
37 | sys.exit()
--------------------------------------------------------------------------------
/core/un.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from system import *
10 | from logo import *
11 |
12 | class Un(object):
13 | def Uni(self):
14 | while True:
15 | Mylogo()
16 | ask = input("\n\n\033[1;33m Do you want to uninstall MyServer [\033[01;32mY/n\033[01;33m] >> \033[00m")
17 | if ask == "n" or ask == "N":
18 | break
19 | elif ask == "Y" or ask == "y":
20 | if system=="ubuntu":
21 | os.system("cd "+spath+" && sudo rm -rf MyServer")
22 | os.system("sudo rm -rf "+bpath+"myserver")
23 | os.system("cd "+spath+" && sudo rm -rf .host.aex .port.aex .path.aex .serv.lock .h.lock")
24 | else:
25 | os.system("rm -rf "+bpath+"myserver")
26 | os.system("cd "+spath+" && rm -rf MyServer")
27 | os.system("cd "+spath+" && rm -rf .host.aex .port.aex .path.aex .serv.lock .h.lock")
28 | exit()
29 | else:
30 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+ask+"\'")
31 | sleep(1)
32 |
33 | Un().Uni()
--------------------------------------------------------------------------------
/core/upd.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from system import *
10 | from logo import *
11 |
12 | class upd(object):
13 | def chk_upd(self):
14 | while True:
15 | Mylogo()
16 | askv = input("\n\033[1;33m Do you want to Update MyServer [\033[01;32mY/n\033[01;33m] >> \033[00m")
17 | if askv == "n" or askv == "N":
18 | break
19 | elif askv == "Y" or askv == "y":
20 | Mylogo()
21 | print("\n\033[01;32mUpdating MyServer .........\033[01;36m")
22 | if os.path.exists(bpath+"git"):
23 | print("\033[01;32mDone ....\033[01;36m")
24 | else:
25 | os.system(pac+" update")
26 | os.system(pac+" install git -y")
27 | if system=="ubuntu":
28 | os.system("cd "+home+" && sudo git clone https://github.com/Rajkumrdusad/MyServer.git")
29 | else:
30 | os.system("cd "+home+" && git clone https://github.com/Rajkumrdusad/MyServer.git")
31 | if os.path.exists(home+"MyServer"):
32 | os.system("cd "+home+"MyServer && sh install")
33 | os.system("clear")
34 | os.system("myserver start")
35 | sys.exit()
36 | else:
37 | Mylogo()
38 | print("\n\n\033[01;37m [+] \033[01;31mSorry We can't update MyServer !!\033[00m")
39 | print("\033[01;37m [+] \033[01;31mYou are \033[01;33moffline \033[01;31m!!!\033[00m")
40 | print("\033[01;37m [+] \033[01;31mCheck your \033[01;33mnetwork \033[01;31mconnection !!!\033[00m")
41 | print("\033[01;37m [+] \033[01;31mTry again after sometime.\033[00m\n\n")
42 | sleep(4)
43 | break
44 | else:
45 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+askv+"\'")
46 | sleep(1)
47 |
48 | def update():
49 | upd().chk_upd()
50 | update()
--------------------------------------------------------------------------------
/install:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Tool Name :- MyServer
3 | # Date :- 23/5/2018 - 22/July/2019
4 |
5 | main() {
6 | if [ -e /usr/lib/sudo ];then
7 | if [ ! -e /usr/bin/python3 ];then
8 | apt-get update
9 | apt-get install python -y
10 | sudo apt-get install python3 -y
11 | fi
12 | else
13 | if [ -d /usr/bin ];then
14 | if [ ! -e /usr/bin/python3 ];then
15 | apt-get update
16 | apt-get install python -y
17 | apt-get install python3 -y
18 | fi
19 | fi
20 | fi
21 | if [ ! -d /usr/bin ];then
22 | if [ ! -e /data/data/com.termux/files/usr/bin/python3 ];then
23 | pkg update
24 | pkg install python -y
25 | pkg install python3 -y
26 | fi
27 | fi
28 | python3 .setup.aex
29 | exit
30 | }
31 | main
32 |
--------------------------------------------------------------------------------
/modules/.srvr.aex:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 23/5/2018
4 |
5 | import os
6 | import sys
7 | from time import sleep
8 |
9 | def loading():
10 | while True:
11 | os.system("clear")
12 | print ('''\n\n\n''')
13 | print ('''\033[1;32m\007 Starting Server ..........\033[1;33m\ \033[00m \n\n\n''')
14 | sleep(0.1)
15 |
16 | os.system("clear")
17 | print ('''\n\n\n''')
18 | print ('''\033[1;32m Starting Server ..........\033[1;33m-\033[00m \n\n\n''')
19 | sleep(0.1)
20 |
21 | os.system("clear")
22 | print ('''\n\n\n''')
23 | print ('''\033[1;32m Starting Server ..........\033[1;33m/\033[00m \n\n\n''')
24 | sleep(0.1)
25 |
26 | os.system("clear")
27 | print ('''\n\n\n''')
28 | print ('''\033[1;32m Starting Server ..........\033[1;33m-\033[00m \n\n\n''')
29 | sleep(0.1)
30 |
31 | os.system("clear")
32 | print ('''\n\n\n''')
33 | print ('''\033[1;32m Starting Server ..........\033[1;33m\ \033[00m \n\n\n''')
34 | sleep(0.1)
35 |
36 | os.system("clear")
37 | print ('''\n\n\n''')
38 | print ('''\033[1;32m Starting Server ..........\033[1;33m-\033[00m \n\n\n''')
39 | sleep(0.1)
40 |
41 | os.system("clear")
42 | print ('''\n\n\n''')
43 | print ('''\033[1;32m Starting Server ..........\033[1;33m/\033[00m \n\n\n''')
44 | sleep(0.1)
45 |
46 | os.system("clear")
47 | print ('''\n\n\n''')
48 | print ('''\033[1;32m Starting Server ..........\033[1;33m-\033[00m \n\n\n''')
49 | sleep(0.1)
50 |
51 |
52 |
53 | os.system("clear")
54 | print ('''\n\n\n''')
55 | print ('''\033[1;32m Starting Server ..........\033[1;33m\ \033[00m \n\n\n''')
56 | sleep(0.1)
57 |
58 | os.system("clear")
59 | print ('''\n\n\n''')
60 | print ('''\033[1;32m Starting Server ..........\033[1;33m-\033[00m \n\n\n''')
61 | sleep(0.1)
62 |
63 | os.system("clear")
64 | print ('''\n\n\n''')
65 | print ('''\033[1;32m Starting Server ..........\033[1;33m/\033[00m \n\n\n''')
66 | sleep(0.1)
67 |
68 | os.system("clear")
69 | print ('''\n\n\n''')
70 | print ('''\033[1;32m Starting Server ..........\033[1;33m-\033[00m \n\n\n''')
71 | sleep(0.1)
72 |
73 | os.system("clear")
74 | print ('''\n\n\n''')
75 | print ('''\033[1;32m Starting Server ..........\033[1;33m\ \033[00m \n\n\n''')
76 | sleep(0.1)
77 |
78 | os.system("clear")
79 | print ('''\n\n\n''')
80 | print ('''\033[1;32m Starting Server ..........\033[1;33m-\033[00m \n\n\n''')
81 | sleep(0.1)
82 |
83 | os.system("clear")
84 | print ('''\n\n\n''')
85 | print ('''\033[1;32m Starting Server ..........\033[1;33m/\033[00m \n\n\n''')
86 | sleep(0.1)
87 |
88 | os.system("clear")
89 | print ('''\n\n\n''')
90 | print ('''\033[1;32m Starting Server ..........\033[1;33m-\033[00m \n\n\n''')
91 | sleep(0.1)
92 | sys.exit()
93 |
94 | def Server():
95 | try:
96 | loading()
97 | except KeyboardInterrupt:
98 | os.system("clear")
99 | sys.exit()
100 | Server()
--------------------------------------------------------------------------------
/modules/apache.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018 - 22/July/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 |
12 | class apache_server(object):
13 | def asr(self):
14 | if os.path.exists(bpath+"apachectl"):
15 | os.system("apachectl")
16 | sleep(0.1)
17 | self.apa()
18 | elif os.path.exists("/usr/sbin/apachectl"):
19 | os.system("apachectl start")
20 | sleep(0.1)
21 | self.apa()
22 | elif os.path.exists("/usr/sbin/apache2"):
23 | os.system("apache2 start")
24 | sleep(0.1)
25 | self.apa()
26 | else:
27 | Mylogo()
28 | print("\n\n\033[01;31m Sorry we can't install \033[01;33mApache Server\033[01;31m in your "+system+".")
29 | sleep(3)
30 |
31 | def apa(self):
32 | os.system("python modules/.srvr.aex")
33 | Mylogo()
34 | if os.path.exists(bpath+"apachectl"):
35 | print("\n\n \007\033[01;33m Apache web server\033[01;32m is running .....")
36 | stop=input(" \033[01;33m Press \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
37 | if stop=="0":
38 | os.system("apachectl stop")
39 | sleep(2)
40 | print("\n\007\033[01;33mApache web server\033[01;31m stopped !! \033[00m")
41 | sys.exit()
42 | else:
43 | self.apa()
44 | elif os.path.exists("/usr/sbin/apachectl"):
45 | print("\n\n \007\033[01;33m Apache web server\033[01;32m is running .....")
46 | stop=input(" \033[01;33m Press \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
47 | if stop=="0":
48 | os.system("apachectl stop")
49 | sleep(2)
50 | print("\n\007\033[01;33mApache web server\033[01;31m stopped !! \033[00m")
51 | sys.exit()
52 | else:
53 | self.apa()
54 | elif os.path.exists("/usr/sbin/apache2"):
55 | print("\n\n \007\033[01;33m Apache web server\033[01;32m is running .....")
56 | stop=input(" \033[01;33m Press \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
57 | if stop=="0":
58 | os.system("apache2 stop")
59 | sleep(2)
60 | print("\n\007\033[01;33mApache web server\033[01;31m stopped !! \033[00m")
61 | sys.exit()
62 | else:
63 | self.apa()
64 |
65 | def apache():
66 | if os.path.exists(bpath+"apachectl") or os.path.exists("/usr/sbin/apache2") or os.path.exists("/usr/sbin/apachectl"):
67 | apache_server().asr()
68 | else:
69 | Mylogo()
70 | print("\n\n\033[01;31m [\033[01;33m+\033[01;31m] \033[01;36mApache Server \033[01;31mis not installed in your "+system+".")
71 | opt=input("\n\033[01;33m Do you want to install Apache Server [\033[01;32mY/n\033[01;33m] >>\033[01;36m ")
72 | if opt=="y" or opt=="Y":
73 | Mylogo()
74 | print("\n\033[01;33minstalling Apache Server ......\033[00m\n")
75 | sleep(1)
76 | os.system(pac+" update")
77 | os.system(pac+" install apache2 -y")
78 | apache_server().asr()
--------------------------------------------------------------------------------
/modules/default_h.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/July/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.open import *
11 | from modules.local import *
12 |
13 | def default_h():
14 | open()
--------------------------------------------------------------------------------
/modules/default_s.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/July/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.php import *
11 | from modules.pyweb import *
12 |
13 | def default_s():
14 | if os.path.exists(bpath+"php"):
15 | php()
16 | else:
17 | pyweb()
--------------------------------------------------------------------------------
/modules/h_menu.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.default_h import *
11 | from modules.logo import *
12 | from modules.local import *
13 | from modules.open import *
14 |
15 | class ngrok(object):
16 | def insng(self):
17 | Mylogo()
18 | if os.path.exists(bpath+"ngrok"):
19 | self.chsng()
20 | else:
21 | print("\n\n\033[01;32mInstalling ngrok ....\n")
22 | os.system("sh core/LiNgrok.sh")
23 | self.chsng()
24 |
25 | def chsng(self):
26 | Mylogo()
27 | if os.path.exists(bpath+"ngrok"):
28 | self.token()
29 | else:
30 | Mylogo()
31 | print("\n\n\033[01;31m Sorry we can not install ngrok in your "+system+".")
32 | print("\n\033[01;32m Please download ngrok and extract zip or tar file into \033[01;33m/usr/bin\033[01;32m directory.\033[00m")
33 | sleep(3)
34 | h_menu()
35 |
36 | def token(self):
37 | os.system("python modules/.srvr.aex")
38 | Mylogo()
39 | auth=input("\n\n\033[01;33m You have ngrok authtoken [Y/n] :- \033[01;36m")
40 | if auth=="y" or auth=="Y":
41 | getauth=input("\033[01;33m Enter your ngrok authtoken :- \033[01;36m")
42 | os.system("ngrok authtoken "+getauth)
43 | self.ngrk()
44 | else:
45 | self.ngrk()
46 |
47 | def ngrk(self):
48 | acp=input("\033[01;33m You have paid ngrok account [Y/n] :- \033[01;36m")
49 | if acp=="Y" or acp=="y":
50 | self.paid()
51 | else:
52 | self.free()
53 |
54 | def free(self):
55 | getp=input("\033[01;33m Enter your port (\033[01;32mex 8080\033[01;33m) :- \033[01;36m")
56 | port=getp
57 | os.system("ngrok http "+port)
58 | print("\033[01;31m unfortunately server stopped\n\033[00m")
59 | sys.exit()
60 |
61 | def paid(self):
62 | getsub=input("\033[01;33m Enter your subdomain name (\033[01;32mex myweb\033[01;33m) :- \033[01;36m")
63 | getp=input("\n\033[01;33m Enter your port (\033[01;32mex 8080\033[01;33m) :- \033[01;36m")
64 | port=getp
65 | os.system("ngrok http -subdomain="+getsub+" "+port)
66 | print("\n\033[01;31munfortunately server stopped\n\033[00m")
67 | sys.exit()
68 |
69 | class mh(object):
70 | def mn(self):
71 | while True:
72 | mhlogo()
73 | Tool = input(" \033[0;33m\033[4;mMyServer\033[00m\033[01;31m > \033[1;36m")
74 | if Tool == "1":
75 | default_h()
76 | elif Tool == "2":
77 | open()
78 | elif Tool == "3":
79 | ngrok().insng()
80 | break
81 | elif Tool == "4":
82 | local()
83 | elif Tool == "0" or Tool=="back":
84 | break
85 | else:
86 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+Tool+"\'")
87 | sleep(0.7)
88 |
89 | def h_menu():
90 | mh().mn()
--------------------------------------------------------------------------------
/modules/load.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 25/8/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 |
12 | def Ux():
13 | os.system("clear")
14 |
15 | class strtr():
16 | def st(self):
17 | while True:
18 | if system=="termux":
19 | Ux()
20 | print ('''\007\n\n\n\n\n\n\n\n\n\033[01;32m __ __ ____
21 | | \/ |_ _/ ___| ___ _ \033[01;31m____ _____ \033[01;32m_ __
22 | | |\/| | | | \___ \ / _ \ '__\033[01;31m\ \ / / \033[01;32m_ \ '__|
23 | | | | | |_| |___) | __/ | \033[01;31m\ V / \033[01;32m __/ |
24 | |_| |_|\__, |____/ \___|_| \033[01;31m\_/ \033[01;32m\___|_|
25 | |___/
26 | \033[00m\n\n\n''')
27 | sleep(0.7)
28 | Ux()
29 | print ('''\007\n\n\n\n\n\n\n\n\n\033[01;33m __ __ ____
30 | | \/ |_ _/ ___| ___ _ \033[01;31m____ _____ \033[01;33m_ __
31 | | |\/| | | | \___ \ / _ \ '__\033[01;31m\ \ / / \033[01;33m_ \ '__|
32 | | | | | |_| |___) | __/ | \033[01;31m\ V / \033[01;33m __/ |
33 | |_| |_|\__, |____/ \___|_| \033[01;31m\_/ \033[01;33m\___|_|
34 | |___/
35 | \033[00m\n\n\n''')
36 | sleep(0.1)
37 | Ux()
38 | print ('''\007\n\n\n\n\n\n\n\n\n\033[01;32m __ __ ____
39 | | \/ |_ _/ ___| ___ _ \033[01;31m____ _____ \033[01;32m_ __
40 | | |\/| | | | \___ \ / _ \ '__\033[01;31m\ \ / / \033[01;32m_ \ '__|
41 | | | | | |_| |___) | __/ | \033[01;31m\ V / \033[01;32m __/ |
42 | |_| |_|\__, |____/ \___|_| \033[01;31m\_/ \033[01;32m\___|_|
43 | |___/
44 | \033[00m\n\n\n''')
45 | sleep(0.5)
46 | break
47 | else:
48 | Ux()
49 | print ('''\007\n\n\n\n\n\n\n\033[01;32m __ __ ____
50 | | \/ |_ _/ ___| ___ _ \033[01;31m____ _____ \033[01;32m_ __
51 | | |\/| | | | \___ \ / _ \ '__\033[01;31m\ \ / / \033[01;32m_ \ '__|
52 | | | | | |_| |___) | __/ | \033[01;31m\ V / \033[01;32m __/ |
53 | |_| |_|\__, |____/ \___|_| \033[01;31m\_/ \033[01;32m\___|_|
54 | |___/
55 | \033[00m\n\n\n''')
56 | sleep(0.7)
57 | Ux()
58 | print ('''\007\n\n\n\n\n\n\n\033[01;33m __ __ ____
59 | | \/ |_ _/ ___| ___ _ \033[01;31m____ _____ \033[01;33m_ __
60 | | |\/| | | | \___ \ / _ \ '__\033[01;31m\ \ / / \033[01;33m_ \ '__|
61 | | | | | |_| |___) | __/ | \033[01;31m\ V / \033[01;33m __/ |
62 | |_| |_|\__, |____/ \___|_| \033[01;31m\_/ \033[01;33m\___|_|
63 | |___/
64 | \033[00m\n\n\n''')
65 | sleep(0.1)
66 | Ux()
67 | print ('''\007\n\n\n\n\n\n\n\033[01;32m __ __ ____
68 | | \/ |_ _/ ___| ___ _ \033[01;31m____ _____ \033[01;32m_ __
69 | | |\/| | | | \___ \ / _ \ '__\033[01;31m\ \ / / \033[01;32m_ \ '__|
70 | | | | | |_| |___) | __/ | \033[01;31m\ V / \033[01;32m __/ |
71 | |_| |_|\__, |____/ \___|_| \033[01;31m\_/ \033[01;32m\___|_|
72 | |___/
73 | \033[00m\n\n\n''')
74 | sleep(0.5)
75 | break
76 |
77 | def Tlogo():
78 | if system=="termux":
79 | print ('''\n\n\n\n\n\n\n\n\n\n\n\t\t\033[01;33m Loading.....''')
80 | else:
81 | print ('''\n\n\n\n\n\n\n\n\n\n\n\t\t\033[01;33m Loading.....''')
82 |
83 | def lodi1():
84 | while True:
85 |
86 | os.system("clear")
87 |
88 | print ('''\n\n\n''')
89 | Tlogo()
90 | print ('''\033[1;32m
91 | [..........................................] 0%
92 |
93 |
94 |
95 | \033[1;m''')
96 | sleep(1)
97 | os.system("clear")
98 |
99 | print ('''\n\n\n''')
100 | Tlogo()
101 | print ('''\033[1;32m
102 | [#.........................................] 1%
103 |
104 |
105 |
106 | \033[1;m''')
107 | sleep(0.1)
108 | os.system("clear")
109 |
110 | print ('''\n\n\n''')
111 | Tlogo()
112 | print ('''\033[1;32m
113 | [##........................................] 2%
114 |
115 |
116 |
117 | \033[1;m''')
118 | sleep(0.1)
119 | os.system("clear")
120 |
121 | print ('''\n\n\n''')
122 | Tlogo()
123 | print ('''\033[1;32m
124 | [###.......................................] 3%
125 |
126 |
127 |
128 | \033[1;m''')
129 | sleep(0.1)
130 | os.system("clear")
131 |
132 | print ('''\n\n\n''')
133 | Tlogo()
134 | print ('''\033[1;32m
135 | [####......................................] 4%
136 |
137 |
138 |
139 | \033[1;m''')
140 | sleep(0.01)
141 | os.system("clear")
142 |
143 | print ('''\n\n\n''')
144 | Tlogo()
145 | print ('''\033[1;32m
146 | [#####.....................................] 5%
147 |
148 |
149 |
150 | \033[1;m''')
151 | sleep(0.1)
152 | os.system("clear")
153 |
154 | print ('''\n\n\n''')
155 | Tlogo()
156 | print ('''\033[1;32m
157 | [######....................................] 7%
158 |
159 |
160 |
161 | \033[1;m''')
162 | sleep(0.1)
163 | os.system("clear")
164 |
165 | print ('''\n\n\n''')
166 | Tlogo()
167 | print ('''\033[1;32m
168 | [#######...................................] 8%
169 |
170 |
171 |
172 | \033[1;m''')
173 | sleep(0.1)
174 | os.system("clear")
175 |
176 | print ('''\n\n\n''')
177 | Tlogo()
178 | print ('''\033[1;32m
179 | [########..................................] 9%
180 |
181 |
182 |
183 | \033[1;m''')
184 | sleep(0.01)
185 | os.system("clear")
186 |
187 | print ('''\n\n\n''')
188 | Tlogo()
189 | print ('''\033[1;32m
190 | [#########................................] 10%
191 |
192 |
193 |
194 | \033[1;m''')
195 | sleep(0.8)
196 | os.system("clear")
197 |
198 | print ('''\n\n\n''')
199 | Tlogo()
200 | print ('''\033[1;32m
201 | [###########..............................] 15%
202 |
203 |
204 |
205 | \033[1;m''')
206 | sleep(0.05)
207 | os.system("clear")
208 |
209 | print ('''\n\n\n''')
210 | Tlogo()
211 | print ('''\033[1;32m
212 | [############.............................] 16%
213 |
214 |
215 |
216 | \033[1;m''')
217 | sleep(0.01)
218 | os.system("clear")
219 |
220 | print ('''\n\n\n''')
221 | Tlogo()
222 | print ('''\033[1;32m
223 | [#############............................] 17%
224 |
225 |
226 |
227 | \033[1;m''')
228 | sleep(0.01)
229 | os.system("clear")
230 |
231 | print ('''\n\n\n''')
232 | Tlogo()
233 | print ('''\033[1;32m
234 | [##############...........................] 18%
235 |
236 |
237 |
238 | \033[1;m''')
239 | sleep(0.01)
240 | os.system("clear")
241 |
242 | print ('''\n\n\n''')
243 | Tlogo()
244 | print ('''\033[1;32m
245 | [###############..........................] 20%
246 |
247 |
248 |
249 | \033[1;m''')
250 | sleep(0.01)
251 | os.system("clear")
252 |
253 | print ('''\n\n\n''')
254 | Tlogo()
255 | print ('''\033[1;32m
256 | [#################........................] 25%
257 |
258 |
259 |
260 | \033[1;m''')
261 | sleep(0.08)
262 | os.system("clear")
263 |
264 | print ('''\n\n\n''')
265 | Tlogo()
266 | print ('''\033[1;32m
267 | [##################.......................] 27%
268 |
269 |
270 |
271 | \033[1;m''')
272 | sleep(0.01)
273 | os.system("clear")
274 |
275 | print ('''\n\n\n''')
276 | Tlogo()
277 | print ('''\033[1;32m
278 | [###################......................] 28%
279 |
280 |
281 |
282 | \033[1;m''')
283 | sleep(0.01)
284 | os.system("clear")
285 |
286 | print ('''\n\n\n''')
287 | Tlogo()
288 | print ('''\033[1;32m
289 | [#####################....................] 30%
290 |
291 |
292 |
293 | \033[1;m''')
294 | sleep(0.01)
295 | os.system("clear")
296 |
297 | print ('''\n\n\n''')
298 | Tlogo()
299 | print ('''\033[1;32m
300 | [######################...................] 35%
301 |
302 |
303 |
304 | \033[1;m''')
305 | sleep(0.01)
306 | os.system("clear")
307 |
308 |
309 | print ('''\n\n\n''')
310 | Tlogo()
311 | print ('''\033[1;32m
312 | [###########################..............] 54%
313 |
314 |
315 |
316 | \033[1;m''')
317 | sleep(0.01)
318 | os.system("clear")
319 |
320 | print ('''\n\n\n''')
321 | Tlogo()
322 | print ('''\033[1;32m
323 | [############################.............] 55%
324 |
325 |
326 |
327 | \033[1;m''')
328 | sleep(0.01)
329 | os.system("clear")
330 |
331 | print ('''\n\n\n''')
332 | Tlogo()
333 | print ('''\033[1;32m
334 | [##############################...........] 70%
335 |
336 |
337 |
338 | \033[1;m''')
339 | sleep(0.2)
340 | os.system("clear")
341 |
342 | print ('''\n\n\n''')
343 | Tlogo()
344 | print ('''\033[1;32m
345 | [###############################..........] 71%
346 |
347 |
348 |
349 | \033[1;m''')
350 | sleep(0.01)
351 | os.system("clear")
352 |
353 | print ('''\n\n\n''')
354 | Tlogo()
355 | print ('''\033[1;32m
356 | [################################.........] 75%
357 |
358 |
359 |
360 | \033[1;m''')
361 | sleep(0.01)
362 | os.system("clear")
363 |
364 | print ('''\n\n\n''')
365 | Tlogo()
366 | print ('''\033[1;32m
367 | [#################################........] 90%
368 |
369 |
370 |
371 | \033[1;m''')
372 | sleep(0.8)
373 | os.system("clear")
374 |
375 | print ('''\n\n\n''')
376 | Tlogo()
377 | print ('''\033[1;32m
378 | [##################################.......] 91%
379 |
380 |
381 |
382 | \033[1;m''')
383 | sleep(0.01)
384 | os.system("clear")
385 |
386 | print ('''\n\n\n''')
387 | Tlogo()
388 | print ('''\033[1;32m
389 | [###################################......] 92%
390 |
391 |
392 |
393 | \033[1;m''')
394 | sleep(0.01)
395 | os.system("clear")
396 |
397 | print ('''\n\n\n''')
398 | Tlogo()
399 | print ('''\033[1;32m
400 | [####################################.....] 95%
401 |
402 |
403 |
404 | \033[1;m''')
405 | sleep(0.01)
406 | os.system("clear")
407 |
408 |
409 | print ('''\n\n\n''')
410 | Tlogo()
411 | print ('''\033[1;32m
412 | [#######################################..] 98%
413 |
414 |
415 |
416 | \033[1;m''')
417 | sleep(0.01)
418 | os.system("clear")
419 |
420 | print ('''\n\n\n''')
421 | Tlogo()
422 | print ('''\033[1;32m
423 | [########################################.] 99%
424 |
425 |
426 |
427 | \033[1;m''')
428 | sleep(0.01)
429 | os.system("clear")
430 |
431 | print ('''\n\n\n''')
432 | Tlogo()
433 | print ('''\033[1;32m
434 | [########################################] 100%
435 |
436 |
437 |
438 | \033[1;m''')
439 | sleep(1)
440 | Ux()
441 | break
442 |
443 | def lodi2():
444 | while True:
445 |
446 | os.system("clear")
447 |
448 | print ('''\n\n\n''')
449 | Tlogo()
450 | print ('''
451 | \033[1;32m [.....................................................]
452 |
453 |
454 |
455 | \033[1;m''')
456 | sleep(1)
457 | os.system("clear")
458 |
459 | print ('''\n\n\n''')
460 | Tlogo()
461 | print ('''
462 | \033[1;32m [#....................................................]
463 |
464 |
465 |
466 | \033[1;m''')
467 | sleep(0.2)
468 | os.system("clear")
469 |
470 | print ('''\n\n\n''')
471 | Tlogo()
472 | print ('''
473 | \033[1;32m [##...................................................]
474 |
475 |
476 |
477 | \033[1;m''')
478 | sleep(0.2)
479 | os.system("clear")
480 |
481 | print ('''\n\n\n''')
482 | Tlogo()
483 | print ('''
484 | \033[1;32m [###..................................................]
485 |
486 |
487 |
488 | \033[1;m''')
489 | sleep(0.2)
490 | os.system("clear")
491 |
492 | print ('''\n\n\n''')
493 | Tlogo()
494 | print ('''
495 | \033[1;32m [####.................................................]
496 |
497 |
498 |
499 | \033[1;m''')
500 | sleep(0.1)
501 | os.system("clear")
502 |
503 | print ('''\n\n\n''')
504 | Tlogo()
505 | print ('''
506 | \033[1;32m [#####................................................]
507 |
508 |
509 |
510 | \033[1;m''')
511 | sleep(0.2)
512 | os.system("clear")
513 |
514 | print ('''\n\n\n''')
515 | Tlogo()
516 | print ('''
517 | \033[1;32m [######...............................................]
518 |
519 |
520 |
521 | \033[1;m''')
522 | sleep(0.2)
523 | os.system("clear")
524 |
525 | print ('''\n\n\n''')
526 | Tlogo()
527 | print ('''
528 | \033[1;32m [##########...........................................]
529 |
530 |
531 |
532 | \033[1;m''')
533 | sleep(0.2)
534 | os.system("clear")
535 |
536 | print ('''\n\n\n''')
537 | Tlogo()
538 | print ('''
539 | \033[1;32m [###############......................................]
540 |
541 |
542 |
543 | \033[1;m''')
544 | sleep(0.2)
545 | os.system("clear")
546 |
547 | print ('''\n\n\n''')
548 | Tlogo()
549 | print ('''
550 | \033[1;32m [##################...................................]
551 |
552 |
553 |
554 | \033[1;m''')
555 | sleep(0.4)
556 | os.system("clear")
557 |
558 | print ('''\n\n\n''')
559 | Tlogo()
560 | print ('''
561 | \033[1;32m [#########################............................]
562 |
563 |
564 |
565 | \033[1;m''')
566 | sleep(0.3)
567 | os.system("clear")
568 |
569 | print ('''\n\n\n''')
570 | Tlogo()
571 | print ('''
572 | \033[1;32m [###################################..................]
573 |
574 |
575 |
576 | \033[1;m''')
577 | sleep(0.2)
578 | os.system("clear")
579 |
580 | print ('''\n\n\n''')
581 | Tlogo()
582 | print ('''
583 | \033[1;32m [########################################.............]
584 |
585 |
586 |
587 | \033[1;m''')
588 | sleep(0.2)
589 | os.system("clear")
590 |
591 | print ('''\n\n\n''')
592 | Tlogo()
593 | print ('''
594 | \033[1;32m [#############################################........]
595 |
596 |
597 |
598 | \033[1;m''')
599 | sleep(0.1)
600 | os.system("clear")
601 |
602 | print ('''\n\n\n''')
603 | Tlogo()
604 | print ('''
605 | \033[1;32m [################################################.....]
606 |
607 |
608 |
609 | \033[1;m''')
610 | sleep(0.1)
611 | os.system("clear")
612 |
613 | print ('''\n\n\n''')
614 | Tlogo()
615 | print ('''
616 | \033[1;32m [#################################################....]
617 |
618 |
619 |
620 | \033[1;m''')
621 | sleep(0.2)
622 | os.system("clear")
623 |
624 | print ('''\n\n\n''')
625 | Tlogo()
626 | print ('''
627 | \033[1;32m [##################################################...]
628 |
629 |
630 |
631 | \033[1;m''')
632 | sleep(0.1)
633 | os.system("clear")
634 |
635 | print ('''\n\n\n''')
636 | Tlogo()
637 | print ('''
638 | \033[1;32m [###################################################..]
639 |
640 |
641 |
642 | \033[1;m''')
643 | sleep(0.1)
644 | os.system("clear")
645 |
646 | print ('''\n\n\n''')
647 | Tlogo()
648 | print ('''
649 | \033[1;32m [####################################################.]
650 |
651 |
652 |
653 | \033[1;m''')
654 | sleep(0.1)
655 | os.system("clear")
656 |
657 | print ('''\n\n\n''')
658 | Tlogo()
659 | print ('''
660 | \033[1;32m [#####################################################]
661 |
662 |
663 |
664 | \033[1;m''')
665 | sleep(1)
666 | Ux()
667 | break
668 |
669 | def Loading():
670 | if system=="termux":
671 | lodi1()
672 | else:
673 | lodi2()
674 |
675 | def load():
676 | strtr().st()
677 | Loading()
--------------------------------------------------------------------------------
/modules/local.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 |
12 | class lt(object):
13 | def notinl(self):
14 | Mylogo()
15 | print("\n\n\033[1;31m Error \033[01;33m\'localtunnel\' \033[01;31mis not installed in "+system+".\033[00m")
16 | sleep(2)
17 |
18 | def locals(self):
19 | while True:
20 | os.system("python modules/.srvr.aex")
21 | Mylogo()
22 | dn = input("\n\n\033[1;33m Enter your subdomain name (\033[01;32mex Myweb\033[01;33m) :- \033[1;36m")
23 |
24 | port = input("\033[1;33m Enter your port (\033[01;32mex 8080\033[01;33m) :- \033[1;36m")
25 | os.system("python modules/.srvr.aex")
26 | Mylogo()
27 | print("\n\033[01;33mStarting Server ......\033[00m\n")
28 | if os.path.exists(bpath+"lt"):
29 | os.system("lt --port "+port+" --subdomain "+dn)
30 | print("\n\033[01;31m unfortunately server stopped\n\033[00m")
31 | sys.exit()
32 | elif os.path.exists("/usr/local/bin/lt"):
33 | os.system("lt --port "+port+" --subdomain "+dn)
34 | print("\033[01;31m unfortunately server stopped\n\033[00m")
35 | sys.exit()
36 | elif os.path.exists("/usr/sbin/lt"):
37 | os.system("lt --port "+port+" --subdomain "+dn)
38 | print("\n\033[01;31m unfortunately server stopped\n\033[00m")
39 | sys.exit()
40 | else:
41 | ins().localin()
42 | if os.path.exists("/data/data/com.termux/files/usr/bin/lt") or os.path.exists("/usr/bin/lt") or os.path.exists("/usr/local/bin/lt") or os.path.exists("/usr/sbin/lt"):
43 | self.locals()
44 | else:
45 | self.notinl()
46 | break
47 |
48 | class ins(object):
49 | def localin(self):
50 | Mylogo()
51 | print("\n\033[01;32mInstalling Localtunnel .......\033[00m\n")
52 | if system=="termux":
53 | lt().notinl()
54 | elif system=="ubuntu":
55 | os.system(pac+" update")
56 | os.system(pac+" upgrade -y")
57 | os.system(pac+" install nodejs -y")
58 | os.system(pac+" install npm -y")
59 | os.system("sudo npm install -g localtunnel")
60 | if os.path.exists("/data/data/com.termux/files/usr/bin/lt") or os.path.exists("/usr/bin/lt") or os.path.exists("/usr/local/bin/lt") or os.path.exists("/usr/sbin/lt"):
61 | lt().locals()
62 | else:
63 | lt().notinl()
64 |
65 | else:
66 | os.system(pac+" install sudo -y")
67 | os.system(pac+" update")
68 | os.system(pac+" upgrade -y")
69 | os.system(pac+" install curl python-software-properties -y")
70 | os.system("curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -")
71 | os.system(pac+" install nodejs -y")
72 | os.system(pac+" install npm -y")
73 | os.system("npm install -g localtunnel")
74 | if os.path.exists("/data/data/com.termux/files/usr/bin/lt") or os.path.exists("/usr/bin/lt") or os.path.exists("/usr/local/bin/lt") or os.path.exists("/usr/sbin/lt"):
75 | lt().locals()
76 | else:
77 | lt().notinl()
78 |
79 | def chklt():
80 | if os.path.exists("/data/data/com.termux/files/usr/bin/lt") or os.path.exists("/usr/bin/lt") or os.path.exists("/usr/local/bin/lt") or os.path.exists("/usr/sbin/lt"):
81 | lt().locals()
82 | else:
83 | Mylogo()
84 | print("\n\n\033[01;31m [\033[01;33m+\033[01;31m] \033[01;36mLocaltunnel \033[01;31mis not installed in your "+system+".")
85 | opt=input("\n\033[01;33m Do you want to install Localtunnel [\033[01;32mY/n\033[01;33m] >>\033[01;36m ")
86 | if opt=="y" or opt=="Y":
87 | Mylogo()
88 | print("\n\033[01;33minstalling Localtunnel ......\033[00m\n")
89 | sleep(1)
90 | ins().localin()
91 |
92 | def local():
93 | chklt()
--------------------------------------------------------------------------------
/modules/logo.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import os
7 | import sys
8 | from time import sleep
9 | from core.system import *
10 |
11 | def Slogo():
12 | if system=="termux":
13 | sleep(0.2)
14 | Mylogo()
15 | print('''
16 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mView Server setting.
17 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mChange Server setting.
18 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
19 | else:
20 | sleep(0.2)
21 | Mylogo()
22 | print('''
23 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mView Server setting.
24 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mChange Server setting.
25 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
26 |
27 |
28 | def mslogo():
29 | if system=="termux":
30 | sleep(0.2)
31 | Mylogo()
32 | print('''
33 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart default server.
34 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mStart PHP web server.
35 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mStart Python web server.
36 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mStart Apache web server.
37 | \033[1;32m [\033[1;31m 5 \033[1;32m] \033[1;33mStart Nginx web server.
38 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
39 | else:
40 | sleep(0.2)
41 | Mylogo()
42 | print('''
43 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart default server.
44 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mStart PHP web server.
45 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mStart Python web server.
46 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mStart Apache web server.
47 | \033[1;32m [\033[1;31m 5 \033[1;32m] \033[1;33mStart Nginx web server.
48 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
49 |
50 | def mhlogo():
51 | if system=="termux":
52 | sleep(0.2)
53 | Mylogo()
54 | print('''
55 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart default host.
56 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mUse SSH tunnel.
57 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mUse Ngrok.
58 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mUse localtunnel.
59 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
60 | else:
61 | sleep(0.2)
62 | Mylogo()
63 | print('''
64 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart default host.
65 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mUse SSH tunnel.
66 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mUse Ngrok.
67 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mUse localtunnel.
68 | \033[1;32m [\033[1;31m 0 \033[1;32m] \033[1;33mBack.\n''')
69 |
70 | def Mylogo():
71 | if system=="termux":
72 | os.system("clear")
73 | print ('''\007
74 |
75 |
76 | \033[01;32m
77 | __ __ ____
78 | | \/ |_ _/ ___| ___ _ \033[01;31m____ _____ \033[01;32m_ __
79 | | |\/| | | | \___ \ / _ \ '__\033[01;31m\ \ / / \033[01;32m_ \ '__|
80 | | | | | |_| |___) | __/ | \033[01;31m\ V / \033[01;32m __/ |
81 | |_| |_|\__, |____/ \___|_| \033[01;31m\_/ \033[01;32m\___|_|
82 | |___/
83 | \033[00m
84 |
85 | }\033[01;31m---------------------------------------\033[00m{
86 | }\033[01;31m--------------> \033[01;32mYOUR OWN SERVER \033[01;31m<--------------\033[00m{
87 | }\033[01;31m---------------------------------------\033[00m{''')
88 | else:
89 | os.system("clear")
90 | print ('''\007
91 |
92 |
93 | \033[01;32m
94 | __ __ ____
95 | | \/ |_ _/ ___| ___ _ \033[01;31m____ _____ \033[01;32m_ __
96 | | |\/| | | | \___ \ / _ \ '__\033[01;31m\ \ / / \033[01;32m_ \ '__|
97 | | | | | |_| |___) | __/ | \033[01;31m\ V / \033[01;32m __/ |
98 | |_| |_|\__, |____/ \___|_| \033[01;31m\_/ \033[01;32m\___|_|
99 | |___/
100 | \033[00m
101 | }\033[01;31m-------------------------------------------\033[00m{
102 | }\033[01;31m----------------> \033[01;32mYOUR OWN SERVER \033[01;31m<----------------\033[00m{
103 | }\033[01;31m-------------------------------------------\033[00m{''')
104 |
105 |
106 | def logo():
107 | if system=="termux":
108 | os.system("clear")
109 | Mylogo()
110 | print('''
111 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart Server.
112 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mAccess from internet.
113 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mStart Database server.
114 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mManually start server.
115 | \033[1;32m [\033[1;31m 5 \033[1;32m] \033[1;33mManually host server.
116 | \033[1;32m [\033[1;31m 6 \033[1;32m] \033[1;33mUpdate MyServer.
117 | \033[1;32m [\033[1;31m 7 \033[1;32m] \033[1;33mServer setting.
118 | \033[1;32m [\033[1;31m 8 \033[1;32m] \033[1;33mAbout us.
119 | \033[1;32m [\033[1;31m x \033[1;32m] \033[1;33mExit.\n''')
120 | else:
121 | os.system("clear")
122 | Mylogo()
123 | print('''
124 | \033[1;32m [\033[1;31m 1 \033[1;32m] \033[1;33mStart Server.
125 | \033[1;32m [\033[1;31m 2 \033[1;32m] \033[1;33mAccess from internet.
126 | \033[1;32m [\033[1;31m 3 \033[1;32m] \033[1;33mStart Database server.
127 | \033[1;32m [\033[1;31m 4 \033[1;32m] \033[1;33mManually start server.
128 | \033[1;32m [\033[1;31m 5 \033[1;32m] \033[1;33mManually host server.
129 | \033[1;32m [\033[1;31m 6 \033[1;32m] \033[1;33mUpdate MyServer.
130 | \033[1;32m [\033[1;31m 7 \033[1;32m] \033[1;33mServer setting.
131 | \033[1;32m [\033[1;31m 8 \033[1;32m] \033[1;33mAbout us.
132 | \033[1;32m [\033[1;31m x \033[1;32m] \033[1;33mExit.\n''')
133 |
134 | def ab():
135 | if system=="termux":
136 | Mylogo()
137 | print('''
138 | \033[1;36m Tool Name :- \033[0;33mMyServer
139 | \033[1;36m Author :- \033[0;33mRajkumar Dusad
140 | \033[1;36m Powered By :- \033[0;33mAex Software's
141 |
142 | \033[1;33m MyServer :- \033[0;32mMyServer is your own localhost
143 | server. you can setup PHP, Apache web servers
144 | on your android or linux like Ubuntu etc.
145 | it is Developed for android Termux or GNURoot.
146 | You can setup your localhost server and access
147 | from internet. you can host your website.\033[1;m
148 | ''')
149 | else:
150 | Mylogo()
151 | print('''
152 | \033[1;36m Tool Name :- \033[0;33mMyServer
153 | \033[1;36m Author :- \033[0;33mRajkumar Dusad
154 | \033[1;36m Powered By :- \033[0;33mAex Software's
155 |
156 | \033[1;33m MyServer :- \033[0;32mMyServer is your own localhost server.
157 | you can setup PHP, Apache web servers on your android
158 | or linux like Ubuntu etc. it is Developed for android
159 | Termux or GNURoot. You can setup your localhost server
160 | and access from internet. you can host your website.\033[1;m
161 | ''')
162 |
163 | def notin():
164 | if system=="termux":
165 | Mylogo()
166 | print('''\n\033[01;33m [\033[1;31m + \033[1;33m] \033[1;31mSorry MyServer is not installed.
167 | \033[1;33m [\033[1;31m + \033[1;33m] \033[1;31mPress Y to install MyServer.
168 | ''')
169 | else:
170 | Mylogo()
171 | print('''\n\033[01;33m [\033[1;31m + \033[1;33m] \033[1;31mSorry MyServer is not installed.
172 | \033[1;33m [\033[1;31m + \033[1;33m] \033[1;31mPress Y to install MyServer.
173 | ''')
174 |
--------------------------------------------------------------------------------
/modules/menu.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018 - 22/July/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from modules.load import *
10 | from core.system import *
11 | from modules.logo import *
12 | from modules.setting import *
13 | from modules.update import *
14 | from modules.default_s import *
15 | from modules.s_menu import *
16 | from modules.h_menu import *
17 | from modules.mysql import *
18 |
19 | class main(object):
20 | def about(self):
21 | while True:
22 | ab()
23 | back = input(" \033[0;33m\033[4;mMyServer\033[00m\033[01;31m > \033[1;36m")
24 | if back == "" or back == "back" or back == "Back" or back == "0":
25 | self.menu()
26 | else:
27 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+back+"\'")
28 | sleep(1)
29 |
30 | def uninstall(self):
31 | while True:
32 | Mylogo()
33 | ask = input("\n\033[1;33m Do you want to uninstall MyServer [\033[01;32mY/n\033[01;33m] >> \033[1;36m")
34 | if ask == "n" or ask == "N":
35 | break
36 | elif ask == "Y" or ask == "y":
37 | if os.path.exists(bpath+"myserver") or os.path.exists(spath+"MyServer"):
38 | if system=="ubuntu":
39 | os.system("sudo rm -rf "+spath+"MyServer && rm -rf "+bpath+"myserver")
40 | os.system("cd "+spath+" && sudo rm -rf .path.aex .port.aex .host.aex .serv.lock .h.lock")
41 | else:
42 | os.system("rm -rf "+spath+"MyServer && rm -rf "+bpath+"myserver")
43 | os.system("cd "+spath+" && rm -rf .path.aex .port.aex .host.aex .serv.lock .h.lock")
44 | exit()
45 | else:
46 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+ask+"\'")
47 | sleep(1)
48 |
49 | def menu(self):
50 | while True:
51 | logo()
52 | Tool = input(" \033[0;33m\033[4;mMyServer\033[00m\033[01;31m > \033[1;36m")
53 | if Tool == "1":
54 | default_s()
55 | elif Tool == "2":
56 | default_h()
57 | elif Tool == "3":
58 | Mys()
59 | elif Tool == "4":
60 | s_menu()
61 | elif Tool == "5":
62 | h_menu()
63 | elif Tool == "6":
64 | update()
65 | elif Tool == "7":
66 | setting()
67 | elif Tool == "8":
68 | self.about()
69 | elif Tool == "Uninstall MyServer" or Tool == "uninstall myserver" or Tool == "rm -T":
70 | self.uninstall()
71 | elif Tool == "exit":
72 | exit()
73 | elif Tool == "x":
74 | Toolo = input("\n\033[1;32m Do you want to Exit ? [\033[01;33mY/n\033[01;32m] >> \033[01;36m")
75 | if Toolo == "N" or Toolo == "n":
76 | pass
77 | elif Toolo == "Y" or Toolo == "y":
78 | exit()
79 | else:
80 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+Toolo+"\'")
81 | sleep(1)
82 | else:
83 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+Tool+"\'")
84 | sleep(1)
85 |
86 | def menu():
87 | load()
88 | main().menu()
--------------------------------------------------------------------------------
/modules/mysql.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 |
12 | class MySQL(object):
13 | def chmys(self):
14 | if os.path.exists(bpath+"mysql") or os.path.exists("/usr/sbin/mysql"):
15 | self.mysqls()
16 | else:
17 | Mylogo()
18 | print("\n\n\033[01;31m Sorry we can't install \033[01;32mMySQL \033[01;31min your "+system+".")
19 | sleep(3)
20 |
21 | def mysqls(self):
22 | if system=="termux":
23 | os.system("python modules/.srvr.aex")
24 | Mylogo()
25 | print("\n\033[01;33mStarting Server ......\033[00m\n")
26 | os.system("mysqld")
27 | print("\n\033[01;31m unfortunately server stopped\n\033[00m")
28 | sys.exit()
29 | else:
30 | Mylogo()
31 | usrnm=input("\n\n\033[01;33m Enter your MySQL username :- \033[01;36m")
32 | if usrnm=="":
33 | print("\n\033[01;31m\007 Error Please enter your \033[01;33mMySQL username\033[01;31m !!\n")
34 | self.mysqls()
35 | os.system("python modules/.srvr.aex")
36 | Mylogo()
37 | print("\n\033[01;33mStarting Server ......\033[00m\n")
38 | if os.path.exists("/usr/lib/sudo"):
39 | os.system("sudo service mysql start")
40 | os.system("sudo mysql -u "+usrnm+" -p")
41 | print("\n\033[01;31munfortunately server stopped\n\033[00m")
42 | elif system=="ubuntu":
43 | os.system("sudo systemctl mysql start")
44 | os.system("sudo mysql -u "+usrnm+" -p")
45 | print("\n\033[01;31munfortunately server stopped\n\033[00m")
46 | else:
47 | os.system("service mysql start")
48 | os.system("mysql -u "+usrnm+" -p")
49 | print("\n\033[01;31munfortunately server stopped\n\033[00m")
50 | sys.exit()
51 |
52 | def inmys(self):
53 | if os.path.exists(bpath+"mysql"):
54 | self.mysqls()
55 | else:
56 | Mylogo()
57 | print("\n\n\033[01;31m [\033[01;33m+\033[01;31m] \033[01;36mMySQL \033[01;31mis not installed in your "+system+".")
58 | opt=input("\n\033[01;33m Do you want to install MySQL [\033[01;32mY/n\033[01;33m] >>\033[01;36m ")
59 | if opt=="Y" or opt=="y":
60 | Mylogo()
61 | print("\n\033[01;33mInstalling MySQL Server......\n\033[00m")
62 | if system=="termux":
63 | os.system(pac+" update")
64 | os.system(pac+" install mariadb -y")
65 | if system=="ubuntu":
66 | os.system(pac+" update")
67 | os.system(pac+" install mysql-server -y")
68 | else:
69 | os.system(pac+" update")
70 | os.system(pac+" install mysql-server -y")
71 | self.chmys()
72 | elif opt=="N" or opt=="n":
73 | pass
74 | else:
75 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+opt+"\'")
76 | sleep(1)
77 | self.inmys()
78 |
79 | def Mys():
80 | MySQL().inmys()
--------------------------------------------------------------------------------
/modules/nginx.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 4/1/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 | from core.nginx import *
12 |
13 | class nginx_server(object):
14 | def ng(self):
15 | os.system("python modules/.srvr.aex")
16 | Mylogo()
17 | if os.path.exists(spath+".path.aex"):
18 | g=open(spath+".path.aex","r")
19 | gp=g.read()
20 | g.close()
21 | p=open(spath+".port.aex","r")
22 | port=p.read()
23 | p.close()
24 | h=open(spath+".host.aex","r")
25 | host=h.read()
26 | h.close()
27 | if gp=="":
28 | self.srvr()
29 | if port=="":
30 | port="8080"
31 | if os.path.exists(gp+"/index.html"):
32 | pass
33 | elif os.path.exists(gp+"index.html"):
34 | pass
35 | elif os.path.exists(gp+"/index.py"):
36 | pass
37 | elif os.path.exists(gp+"index.py"):
38 | pass
39 | elif os.path.exists(gp+"/index.php"):
40 | pass
41 | elif os.path.exists(gp+"index.php"):
42 | pass
43 | elif os.path.exists(gp+"/index.pl"):
44 | pass
45 | elif os.path.exists(gp+"index.pl"):
46 | pass
47 | elif os.path.exists(gp+"/index.jsp"):
48 | pass
49 | elif os.path.exists(gp+"index.jsp"):
50 | pass
51 | else:
52 | if system=="ubuntu":
53 | os.system("sudo cp modules/index.sh "+gp)
54 | os.system("cd "+gp+" && sudo sh index.sh")
55 | os.system("cd "+gp+" && sudo rm index.sh")
56 | else:
57 | os.system("cp modules/index.sh "+gp)
58 | os.system("cd "+gp+" && sh index.sh")
59 | os.system("cd "+gp+" && rm index.sh")
60 | if os.path.exists(bpath+"nginx"):
61 | ngi(port,gp,host)
62 | if os.path.exists("nginx.conf") and os.path.exists("/data/data/com.termux/files/usr/etc/nginx/nginx.conf"):
63 | os.system("rm -rf /data/data/com.termux/files/usr/etc/nginx/nginx.conf")
64 | os.system("cp nginx.conf /data/data/com.termux/files/usr/etc/nginx")
65 | os.system("nginx")
66 | print("\n\n\007\033[01;33mNginx web server\033[01;32m is running .....")
67 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://"+host+":"+port+"/ \033[00m\n")
68 | stop=input("\033[01;33mPress \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
69 | if stop=="0":
70 | os.system("nginx -s stop")
71 | sleep(2)
72 | print("\n\007\033[01;33mNginx web server\033[01;31m stopped !! \033[00m")
73 | sys.exit()
74 |
75 | elif os.path.exists("/usr/sbin/nginx"):
76 | if system=="ubuntu":
77 | default(port,gp)
78 | if os.path.exists("default") and os.path.exists("/etc/nginx/sites-available/default"):
79 | os.system("sudo rm -rf /etc/nginx/sites-available/default")
80 | os.system("sudo cp default /etc/nginx/sites-available")
81 | os.system("sudo systemctl start nginx")
82 | print("\n\n\007\033[01;33mNginx web server\033[01;32m is running .....")
83 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://localhost:"+port+"/ \033[00m\n")
84 | stop=input("\033[01;33mPress \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
85 | if stop=="0":
86 | os.system("sudo systemctl stop nginx")
87 | sleep(2)
88 | print("\n\007\033[01;33mNginx web server\033[01;31m stopped !! \033[00m")
89 | sys.exit()
90 |
91 | else:
92 | default(port,gp)
93 | if os.path.exists("default") and os.path.exists("/etc/nginx/sites-available/default"):
94 | os.system("rm -rf /etc/nginx/sites-available/default")
95 | os.system("cp default /etc/nginx/sites-available")
96 | os.system("service nginx start")
97 | print("\n\n\007\033[01;33mNginx web server\033[01;32m is running .....")
98 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://localhost:"+port+"/ \033[00m\n")
99 | stop=input("\033[01;33mPress \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
100 | if stop=="0":
101 | os.system("service nginx stop")
102 | sleep(2)
103 | print("\n\007\033[01;33mNginx web server\033[01;31m stopped !! \033[00m")
104 | sys.exit()
105 | else:
106 | self.srvr()
107 |
108 | def srvr(self):
109 | if system=="termux":
110 | Mylogo()
111 | gp=input("\n\n\033[01;33m Enter your web path (\033[01;36mex: /sdcard/www\033[01;33m) :- \033[01;36m")
112 | if gp=="":
113 | print("\n\007\033[01;31m Error invalid Document Root please enter path for an \033[01;33mexample\033[01;32m /sdcard/www\n")
114 | sleep(4)
115 | self.srvr()
116 | else:
117 | Mylogo()
118 | gp=input("\n\n\033[01;33m Enter your web path (\033[01;36mex: /home/www\033[01;33m) :- \033[01;36m")
119 | if gp=="":
120 | print("\n\007\033[01;31m Error invalid Document Root please enter path for an \033[01;33mexample\033[01;32m /sdcard/www\n")
121 | sleep(4)
122 | self.srvr()
123 | Mylogo()
124 | port=raw_input("\n\n\033[01;33m Enter your port (\033[01;36mex: 8080\033[01;33m) :- \033[01;36m")
125 | if port=="":
126 | port="8080"
127 | Mylogo()
128 | host=input("\n\n\033[01;33m Enter your localhost ip (\033[01;36mex: localhost OR 127.0.0.1\033[01;33m) :- \033[01;36m")
129 | if host=="":
130 | host="localhost"
131 | Mylogo()
132 | sav=raw_input("\n\n\033[01;33m Do you wan to save this setting [\033[01;32mY/n\033[01;33m] >> \033[01;36m")
133 | if sav=="Y" or sav=="y":
134 | spat=open(spath+".path.aex","w")
135 | spat.write(gp)
136 | spat.close()
137 | sport=open(spath+".port.aex","w")
138 | sport.write(port)
139 | sport.close()
140 | shost=open(spath+".host.aex","w")
141 | shost.write(host)
142 | shost.close()
143 |
144 | os.system("python modules/.srvr.aex")
145 | Mylogo()
146 | if os.path.exists(gp+"/index.html"):
147 | pass
148 | elif os.path.exists(gp+"index.html"):
149 | pass
150 | elif os.path.exists(gp+"/index.py"):
151 | pass
152 | elif os.path.exists(gp+"index.py"):
153 | pass
154 | elif os.path.exists(gp+"/index.php"):
155 | pass
156 | elif os.path.exists(gp+"index.php"):
157 | pass
158 | elif os.path.exists(gp+"/index.pl"):
159 | pass
160 | elif os.path.exists(gp+"index.pl"):
161 | pass
162 | elif os.path.exists(gp+"/index.jsp"):
163 | pass
164 | elif os.path.exists(gp+"index.jsp"):
165 | pass
166 | else:
167 | if system=="ubuntu":
168 | os.system("sudo cp modules/index.sh "+gp)
169 | os.system("cd "+gp+" && sudo sh index.sh")
170 | os.system("cd "+gp+" && sudo rm index.sh")
171 | else:
172 | os.system("cp modules/index.sh "+gp)
173 | os.system("cd "+gp+" && sh index.sh")
174 | os.system("cd "+gp+" && rm index.sh")
175 | if os.path.exists(bpath+"nginx"):
176 | ngi(port,gp)
177 | if os.path.exists("nginx.conf") and os.path.exists("/data/data/com.termux/files/usr/etc/nginx/nginx.conf"):
178 | os.system("rm -rf /data/data/com.termux/files/usr/etc/nginx/nginx.conf")
179 | os.system("cp nginx.conf /data/data/com.termux/files/usr/etc/nginx")
180 | os.system("nginx")
181 | print("\n\n\007\033[01;33mNginx web server\033[01;32m is running .....")
182 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://"+host+":"+port+"/ \033[00m\n")
183 | stop=input("\033[01;33mPress \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
184 | if stop=="0":
185 | os.system("nginx -s stop")
186 | sleep(2)
187 | print("\n\007\033[01;33mNginx web server\033[01;31m stopped !! \033[00m")
188 | sys.exit()
189 |
190 | elif os.path.exists("/usr/sbin/nginx"):
191 | if system=="ubuntu":
192 | default(port,gp)
193 | if os.path.exists("default") and os.path.exists("/etc/nginx/sites-available/default"):
194 | os.system("sudo rm -rf /etc/nginx/sites-available/default")
195 | os.system("sudo cp default /etc/nginx/sites-available")
196 | os.system("sudo systemctl start nginx")
197 | print("\n\n\007\033[01;33mNginx web server\033[01;32m is running .....")
198 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://localhost:"+port+"/ \033[00m\n")
199 | stop=input("\033[01;33mPress \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
200 | if stop=="0":
201 | os.system("sudo systemctl stop nginx")
202 | sleep(2)
203 | print("\n\007\033[01;33mNginx web server\033[01;31m stopped !! \033[00m")
204 | sys.exit()
205 |
206 | else:
207 | default(port,gp)
208 | if os.path.exists("default") and os.path.exists("/etc/nginx/sites-available/default"):
209 | os.system("rm -rf /etc/nginx/sites-available/default")
210 | os.system("cp default /etc/nginx/sites-available")
211 | os.system("service nginx start")
212 | print("\n\n\007\033[01;33mNginx web server\033[01;32m is running .....")
213 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://localhost:"+port+"/ \033[00m\n")
214 | stop=input("\033[01;33mPress \033[01;36m0\033[01;33m to stop server >>\033[01;36m ");
215 | if stop=="0":
216 | os.system("service nginx stop")
217 | sleep(2)
218 | print("\n\007\033[01;33mNginx web server\033[01;31m stopped !! \033[00m")
219 | sys.exit()
220 |
221 | def nginx():
222 | if os.path.exists(bpath+"nginx") or os.path.exists("/usr/sbin/nginx"):
223 | nginx_server().ng()
224 | else:
225 | Mylogo()
226 | print("\n\n\033[01;31m [\033[01;33m+\033[01;31m] \033[01;36mNginx Server \033[01;31mis not installed in your "+system+".")
227 | opt=input("\n\033[01;33m Do you want to install Nginx Server [\033[01;32mY/n\033[01;33m] >>\033[01;36m ")
228 | if opt=="y" or opt=="Y":
229 | Mylogo()
230 | print("\n\033[01;33minstalling Nginx Server ......\033[00m\n")
231 | sleep(1)
232 | os.system(pac+" update")
233 | os.system(pac+" install nginx -y")
234 | if os.path.exists(bpath+"nginx") or os.path.exists("/usr/sbin/nginx"):
235 | nginx_server().ng()
236 | else:
237 | Mylogo()
238 | print("\n\n\033[01;31m Sorry we can't install \033[01;33mNginx Server\033[01;31m in your "+system+".")
239 | sleep(3)
--------------------------------------------------------------------------------
/modules/open.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 |
12 | class openssh(object):
13 | def notino(self):
14 | Mylogo()
15 | print("\n\n\033[1;31m Error \033[01;33m\'OpenSSH-server\' \033[01;31mis not installed in "+system+".\033[00m")
16 | sleep(2)
17 |
18 | def opens(self):
19 | while True:
20 | if os.path.exists(bpath+"ssh"):
21 | os.system("python modules/.srvr.aex")
22 | Mylogo()
23 | dn = input("\n\n\033[1;33m Enter your subdomain name (\033[01;32mex Myweb\033[01;33m) :- \033[01;36m")
24 | portl = input("\033[1;33m Enter your localhost port (\033[01;32mex 8080\033[01;33m) :- \033[01;36m")
25 | port = input("\033[1;33m Enter your port (\033[01;32mex 80\033[01;33m) :- \033[01;36m")
26 | os.system("python2 modules/.srvr.aex")
27 | Mylogo()
28 | print("\n\033[01;33mStarting Server ......\033[00m\n")
29 | os.system("ssh -R "+port+":localhost:"+portl+" "+dn+"@localhost.run")
30 | print("\n\007\033[01;31m unfortunately server stopped.\n\033[00m")
31 | sys.exit()
32 | else:
33 | ins().ssh()
34 | if os.path.exists(bpath+"ssh"):
35 | self.opens()
36 | else:
37 | self.notino()
38 | break
39 |
40 | class ins(object):
41 | def ssh(self):
42 | Mylogo()
43 | print("\n\n\033[01;31m [\033[01;33m+\033[01;31m] \033[01;36mOpenSSH \033[01;31mis not installed in your "+system+".")
44 | opt=input("\n\033[01;33m Do you want to install OpenSSH [\033[01;32mY/n\033[01;33m] >>\033[01;36m ")
45 | if opt=="y" or opt=="Y":
46 | Mylogo()
47 | print("\n\033[01;32mInstalling OpenSSH server......\033[00m\n")
48 | sleep(1)
49 | if system=="termux":
50 | os.system(pac+" update")
51 | os.system(pac+" install openssh -y")
52 | else:
53 | os.system(pac+" update")
54 | os.system(pac+" install openssh-server -y")
55 |
56 | def open():
57 | openssh().opens()
--------------------------------------------------------------------------------
/modules/php.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018 - 22/July/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 |
12 | class phpserver(object):
13 | def chphp(self):
14 | if os.path.exists(bpath+"php"):
15 | self.chkp()
16 | else:
17 | Mylogo()
18 | print("\n\n\033[01;31m Sorry we can't install \033[01;33mPHP\033[01;31m in your "+system+".")
19 | sleep(3)
20 |
21 | def chkp(self):
22 | if os.path.exists(spath+".path.aex"):
23 | g=open(spath+".path.aex","r")
24 | getpat=g.read()
25 | g.close()
26 | p=open(spath+".port.aex","r")
27 | getp=p.read()
28 | p.close()
29 | h=open(spath+".host.aex","r")
30 | host=h.read()
31 | h.close()
32 | if getpat=="":
33 | self.phps()
34 | if getp=="":
35 | getp="8080"
36 | if host=="":
37 | host="localhost"
38 | os.system("python modules/.srvr.aex")
39 | Mylogo()
40 | print("\n\033[01;33mStarting Server ......\033[00m\n")
41 | if os.path.exists(getpat+"/index.html") or os.path.exists(getpat+"index.html") or os.path.exists(getpat+"/index.php") or os.path.exists(getpat+"index.php"):
42 | pass
43 | else:
44 | if system=="ubuntu":
45 | os.system("sudo cp core/index.sh "+getpat)
46 | os.system("cd "+getpat+" && sudo sh index.sh")
47 | os.system("cd "+getpat+" && sudo rm index.sh")
48 | else:
49 | os.system("cp core/index.sh "+getpat)
50 | os.system("cd "+getpat+" && sh index.sh")
51 | os.system("cd "+getpat+" && rm index.sh")
52 | os.system("php -S "+host+":"+getp+" -t "+getpat)
53 | print("\n\007\033[01;31munfortunately server stopped\n\033[00m")
54 | sys.exit()
55 | else:
56 | self.phps()
57 |
58 | def phps(self):
59 | if system=="termux":
60 | Mylogo()
61 | getpat=input("\n\n\033[01;33m Enter your web path (\033[01;36mex: /sdcard/www\033[01;33m) :- \033[01;36m")
62 | if getpat=="":
63 | print("\n\007\033[01;31m Error invalid Document Root please enter path for an \033[01;33mexample :\033[01;32m /sdcard/www\n")
64 | sleep(4)
65 | self.phps()
66 | else:
67 | Mylogo()
68 | getpat=input("\n\n\033[01;33m Enter your web path (\033[01;36mex: /home/www\033[01;33m) :- \033[01;36m")
69 | if getpat=="":
70 | print("\n\007\033[01;31m Error invalid Document Root please enter path for an \033[01;33mexample :\033[01;32m /home/www\n")
71 | sleep(4)
72 | self.phps()
73 | Mylogo()
74 | getp=input("\n\n\033[01;33m Enter your port (\033[01;36mex: 8080\033[01;33m) :- \033[01;36m")
75 | if getp=="":
76 | getp="8080"
77 | Mylogo()
78 | host=input("\n\n\033[01;33m Enter your localhost ip (\033[01;36mex: localhost OR 127.0.0.1\033[01;33m) :- \033[01;36m")
79 | if host=="":
80 | host="localhost"
81 | Mylogo()
82 | hostn=host
83 | pat=getpat
84 | port=getp
85 | sav=input("\n\n\033[01;33m Do you wan to save this setting [\033[01;32mY/n\033[01;33m] >> \033[01;36m")
86 | if sav=="Y" or sav=="y":
87 | spat=open(spath+".path.aex","w")
88 | spat.write(pat)
89 | spat.close()
90 | sport=open(spath+".port.aex","w")
91 | sport.write(port)
92 | sport.close()
93 | shost=open(spath+".host.aex","w")
94 | shost.write(hostn)
95 | shost.close()
96 | os.system("python modules/.srvr.aex")
97 | Mylogo()
98 | print("\n\033[01;33mStarting Server ......\033[00m\n")
99 | if os.path.exists(getpat+"/index.html") or os.path.exists(getpat+"index.html") or os.path.exists(getpat+"/index.php") or os.path.exists(getpat+"index.php"):
100 | pass
101 | else:
102 | if system=="ubuntu":
103 | os.system("sudo cp core/index.sh "+pat)
104 | os.system("cd "+pat+" && sudo sh index.sh")
105 | os.system("cd "+pat+" && sudo rm index.sh")
106 | else:
107 | os.system("cp core/index.sh "+pat)
108 | os.system("cd "+pat+" && sh index.sh")
109 | os.system("cd "+pat+" && rm index.sh")
110 | os.system("php -S "+hostn+":"+port+" -t "+pat)
111 | print("\n\007\033[01;31munfortunately server stopped\n\033[00m")
112 | sys.exit()
113 |
114 | def inphp():
115 | if system=="termux":
116 | os.system(pac+" update")
117 | os.system(pac+" install php -y")
118 | os.system(pac+" install php-mysqli -y")
119 | else:
120 | os.system(pac+" update")
121 | os.system(pac+" install php -y")
122 | os.system(pac+" install php5 -y")
123 | os.system(pac+" install php5-mysql -y")
124 | os.system(pac+" install php5-mysqli -y")
125 |
126 | def php():
127 | if os.path.exists(bpath+"php"):
128 | phpserver().chkp()
129 | else:
130 | Mylogo()
131 | print("\n\n\033[01;31m [\033[01;33m+\033[01;31m] \033[01;36mPHP \033[01;31mis not installed in your "+system+".")
132 | opt=input("\n\033[01;33m Do you want to install PHP [\033[01;32mY/n\033[01;33m] >>\033[01;36m ")
133 | if opt=="y" or opt=="Y":
134 | Mylogo()
135 | print("\n\033[01;33minstalling PHP ......\033[00m\n")
136 | sleep(1)
137 | inphp()
138 | phpserver().chphp()
--------------------------------------------------------------------------------
/modules/pyweb.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018 - 22/July/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 |
12 | class py_web(object):
13 | def chkpy(self):
14 | os.system("python modules/.srvr.aex")
15 | if os.path.exists(spath+".path.aex"):
16 | g=open(spath+".path.aex","r")
17 | gp=g.read()
18 | g.close()
19 | p=open(spath+".port.aex","r")
20 | port=p.read()
21 | p.close()
22 | h=open(spath+".host.aex","r")
23 | host=h.read()
24 | h.close()
25 | if gp=="":
26 | self.srvr()
27 | if port=="":
28 | port="8080"
29 | if os.path.exists(gp+"/index.html") or os.path.exists(gp+"index.html") or os.path.exists(gp+"/index.php") or os.path.exists(gp+"index.php"):
30 | pass
31 | else:
32 | if system=="ubuntu":
33 | os.system("sudo cp core/index.sh "+gp)
34 | os.system("cd "+gp+" && sudo sh index.sh")
35 | os.system("cd "+gp+" && sudo rm index.sh")
36 | else:
37 | os.system("cp core/index.sh "+gp)
38 | os.system("cd "+gp+" && sh index.sh")
39 | os.system("cd "+gp+" && rm index.sh")
40 | Mylogo()
41 | print("\n\033[01;33mStarting Server ......\033[00m\n")
42 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://"+host+":"+port+"/\033[00m\n")
43 | os.system("cd "+gp+" && python3 -m http.server "+port+" --bind "+host)
44 | print("\n\007\033[01;31munfortunately server stopped\n\033[00m")
45 | sys.exit()
46 | else:
47 | self.srvr()
48 |
49 | def srvr(self):
50 | if system=="termux":
51 | Mylogo()
52 | gp=input("\n\n\033[01;33m Enter your web path (\033[01;36mex: /sdcard/www\033[01;33m) :- \033[01;36m")
53 | if gp=="":
54 | print("\n\007\033[01;31m Error Document Root path is invalid please enter path for an \033[01;33mexample\033[01;32m /sdcard/www\n")
55 | sleep(4)
56 | self.srvr()
57 | else:
58 | Mylogo()
59 | gp=input("\n\n\033[01;33m Enter your web path (\033[01;36mex: /home/www\033[01;33m) :- \033[01;36m")
60 | if gp=="":
61 | print("\n\007\033[01;31m Error Document Root path is invalid please enter path for an \033[01;33mexample\033[01;32m /home/www\n")
62 | sleep(4)
63 | self.srvr()
64 | Mylogo()
65 | port=input("\n\n\033[01;33m Enter your port (\033[01;36mex: 8080\033[01;33m) :- \033[01;36m")
66 | if port=="":
67 | port="8080"
68 | Mylogo()
69 | host=input("\n\n\033[01;33m Enter your localhost ip (\033[01;36mex: localhost OR 127.0.0.1\033[01;33m) :- \033[01;36m")
70 | if host=="":
71 | host="localhost"
72 | Mylogo()
73 | sav=input("\n\n\033[01;33m Do you wan to save this setting [\033[01;32mY/n\033[01;33m] >> \033[01;36m")
74 | if sav=="Y" or sav=="y":
75 | spat=open(spath+".path.aex","w")
76 | spat.write(gp)
77 | spat.close()
78 | sport=open(spath+".port.aex","w")
79 | sport.write(port)
80 | sport.close()
81 | shost=open(spath+".host.aex","w")
82 | shost.write(host)
83 | shost.close()
84 | os.system("python modules/.srvr.aex")
85 | Mylogo()
86 | print("\n\033[01;33mStarting Server ......\033[00m\n")
87 | if os.path.exists(gp+"/index.html") or os.path.exists(gp+"index.html") or os.path.exists(gp+"/index.php") or os.path.exists(gp+"index.php"):
88 | pass
89 | else:
90 | if system=="ubuntu":
91 | os.system("sudo cp core/index.sh "+gp)
92 | os.system("cd "+gp+" && sudo sh index.sh")
93 | os.system("cd "+gp+" && sudo rm index.sh")
94 | else:
95 | os.system("cp core/index.sh "+gp)
96 | os.system("cd "+gp+" && sh index.sh")
97 | os.system("cd "+gp+" && rm index.sh")
98 | print("\033[01;33mYour Server URL is :- \033[01;36mhttp://"+host+":"+port+"/\033[00m\n")
99 | os.system("cd "+gp+" && python3 -m http.server "+port+" --bind "+host)
100 | print("\n\007\033[01;31munfortunately server stopped\n\033[00m")
101 | sys.exit()
102 |
103 | def pyweb():
104 | py_web().chkpy()
105 |
--------------------------------------------------------------------------------
/modules/s_menu.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 | from modules.php import *
12 | from modules.pyweb import *
13 | from modules.default_s import *
14 | from modules.apache import *
15 | from modules.nginx import *
16 |
17 | class Manual(object):
18 | def MS(self):
19 | while True:
20 | mslogo()
21 | Tool = input(" \033[0;33m\033[4;mMyServer\033[00m\033[01;31m > \033[1;36m")
22 | if Tool == "1":
23 | default_s()
24 | elif Tool == "2":
25 | php()
26 | elif Tool == "3":
27 | pyweb()
28 | elif Tool == "4":
29 | apache()
30 | elif Tool == "5":
31 | nginx()
32 | elif Tool == "0" or Tool=="back":
33 | break
34 | else:
35 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+Tool+"\'")
36 | sleep(0.7)
37 |
38 | def s_menu():
39 | Manual().MS()
--------------------------------------------------------------------------------
/modules/setting.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2018
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 |
12 | class set(object):
13 | def srst(self):
14 | Mylogo()
15 | if os.path.exists(spath+".path.aex"):
16 | pat=open(spath+".path.aex","r")
17 | path=pat.read()
18 | pat.close()
19 | if path=="":
20 | path="Default"
21 | ho=open(spath+".host.aex","r")
22 | host=ho.read()
23 | ho.close()
24 | if host=="":
25 | host="Default"
26 | po=open(spath+".port.aex","r")
27 | port=po.read()
28 | po.close()
29 | if port=="":
30 | port="Default"
31 | if system=="termux":
32 | print("\n\033[1;33m Document Root : [ \033[01;36m"+path+" \033[01;33m]")
33 | print("\033[1;33m Server Host/IP : [ \033[01;36m"+host+" \033[01;33m]")
34 | print("\033[1;33m Server port : [ \033[01;36m"+port+" \033[01;33m]")
35 | else:
36 | print("\n\033[1;33m Document Root : [ \033[01;36m"+path+" \033[01;33m]")
37 | print("\033[1;33m Server Host/IP : [ \033[01;36m"+host+" \033[01;33m]")
38 | print("\033[1;33m Server port : [ \033[01;36m"+port+" \033[01;33m]")
39 | ch=input("\n\033[01;33m Do you want to change setting [\033[01;36mY/n\033[01;33m] >> \033[01;36m")
40 | if ch=="y" or ch=="Y":
41 | self.chen()
42 | elif ch=="N" or ch=="n":
43 | self.sett()
44 | else:
45 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+ch+"\'")
46 | sleep(1)
47 | self.srst()
48 | else:
49 | pat=open(spath+".path.aex","w")
50 | path=pat.write("")
51 | pat.close()
52 | ho=open(spath+".host.aex","w")
53 | host=ho.write("")
54 | ho.close()
55 | po=open(spath+".port.aex","w")
56 | port=po.write("")
57 | po.close()
58 | self.srst()
59 |
60 | def chen(self):
61 | Mylogo()
62 | pat=open(spath+".path.aex","r")
63 | path=pat.read()
64 | pat.close()
65 | if path=="":
66 | path="Default"
67 | if system=="termux":
68 | print("\n\033[1;33m Document Root : [ \033[01;36m"+path+" \033[01;33m]")
69 | else:
70 | print("\n\033[1;33m Document Root : [ \033[01;36m"+path+" \033[01;33m]")
71 | chp=input("\n\033[01;33m Do you want to change path [\033[01;36mY/n\033[01;33m] >>\033[01;36m ")
72 | if chp=="y" or chp=="Y":
73 | pathw=input("\n\033[01;36m Enter new path \033[01;33m>> \033[01;36m")
74 | pat=open(spath+".path.aex","w")
75 | patw=pat.write(pathw)
76 | pat.close()
77 | self.chho()
78 | elif chp=="" or chp=="n" or chp=="N":
79 | self.chho()
80 | else:
81 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+chp+"\'")
82 | sleep(1)
83 | self.chen()
84 |
85 | def chho(self):
86 | ho=open(spath+".host.aex","r")
87 | host=ho.read()
88 | ho.close()
89 | if host=="":
90 | host="Default"
91 | Mylogo()
92 | if system=="termux":
93 | print("\n\033[1;33m Server Host/IP : [ \033[01;36m"+host+" \033[01;33m]")
94 | else:
95 | print("\n\033[1;33m Server Host/IP : [ \033[01;36m"+host+" \033[01;33m]")
96 | chh=input("\n\033[01;33m Do you want to change host [\033[01;36mY/n\033[01;33m] >>\033[01;36m ")
97 | if chh=="y" or chh=="Y":
98 | hostw=input("\n\033[01;36m Enter new host \033[01;33m>> \033[01;36m")
99 | h=open(spath+".host.aex","w")
100 | how=h.write(hostw)
101 | h.close()
102 | self.chpor()
103 | elif chh=="" or chh=="n" or chh=="N":
104 | self.chpor()
105 | else:
106 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+chh+"\'")
107 | sleep(1)
108 | self.chho()
109 |
110 | def chpor(self):
111 | po=open(spath+".port.aex","r")
112 | port=po.read()
113 | po.close()
114 | if port=="":
115 | port="Default"
116 | Mylogo()
117 | if system=="termux":
118 | print("\n\033[1;33m Server port : [ \033[01;36m"+port+" \033[01;33m]")
119 | else:
120 | print("\n\033[1;33m Server port : [ \033[01;36m"+port+" \033[01;33m]")
121 | chpo=input("\n\033[01;33m Do you want to change port [\033[01;36mY/n\033[01;33m] >> \033[01;36m")
122 | if chpo=="y" or chpo=="Y":
123 | portw=input("\n\033[01;36m Enter new port \033[01;33m>> \033[01;36m")
124 | por=open(spath+".port.aex","w")
125 | porw=por.write(portw)
126 | por.close()
127 | self.chend()
128 | elif chpo=="" or chpo=="n" or chpo=="N":
129 | self.chend()
130 | else:
131 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+chpo+"\'")
132 | sleep(1)
133 | self.chpor()
134 |
135 | def chend(self):
136 | Mylogo()
137 | pat=open(spath+".path.aex","r")
138 | path=pat.read()
139 | pat.close()
140 | if path=="":
141 | path="Default"
142 | ho=open(spath+".host.aex","r")
143 | host=ho.read()
144 | ho.close()
145 | if host=="":
146 | host="Default"
147 | po=open(spath+".port.aex","r")
148 | port=po.read()
149 | po.close()
150 | if port=="":
151 | port="Default"
152 | if system=="termux":
153 | print("\n\033[1;33m Document Root : [ \033[01;36m"+path+" \033[01;33m]")
154 | print("\033[1;33m Server Host/IP : [ \033[01;36m"+host+" \033[01;33m]")
155 | print("\033[1;33m Server port : [ \033[01;36m"+port+" \033[01;33m]")
156 | else:
157 | print("\n\033[1;33m Document Root : [ \033[01;36m"+path+" \033[01;33m]")
158 | print("\033[1;33m Server Host/IP : [ \033[01;36m"+host+" \033[01;33m]")
159 | print("\033[1;33m Server port : [ \033[01;36m"+port+" \033[01;33m]")
160 | ch=input("\n\033[01;33m Server\033[01;32m Setting changed !!! \033[01;33mEnter to continue >> \033[01;36m")
161 | self.sett()
162 |
163 | def vew(self):
164 | Mylogo()
165 | if os.path.exists(spath+".path.aex"):
166 | pat=open(spath+".path.aex","r")
167 | path=pat.read()
168 | pat.close()
169 | ho=open(spath+".host.aex","r")
170 | host=ho.read()
171 | ho.close()
172 | po=open(spath+".port.aex","r")
173 | port=po.read()
174 | po.close()
175 | if path=="":
176 | path="Default"
177 | if host=="":
178 | host="Default"
179 | if port=="":
180 | port="Default"
181 | if system=="termux":
182 | print("\n\033[1;33m Document Root : [ \033[01;36m"+path+" \033[01;33m]")
183 | print("\033[1;33m Server Host/IP : [ \033[01;36m"+host+" \033[01;33m]")
184 | print("\033[1;33m Server port : [ \033[01;36m"+port+" \033[01;33m]")
185 | else:
186 | print("\n\033[1;33m Document Root : [ \033[01;36m"+path+" \033[01;33m]")
187 | print("\033[1;33m Server Host/IP : [ \033[01;36m"+host+" \033[01;33m]")
188 | print("\033[1;33m Server port : [ \033[01;36m"+port+" \033[01;33m]")
189 | ch=input("\n \033[0;33m\033[4;mMyServer\033[00m\033[01;31m > \033[1;36m")
190 | self.sett()
191 | else:
192 | pat=open(spath+".path.aex","w")
193 | path=pat.write("")
194 | pat.close()
195 | ho=open(spath+".host.aex","w")
196 | host=ho.write("")
197 | ho.close()
198 | po=open(spath+".port.aex","w")
199 | port=po.write("")
200 | po.close()
201 | self.vew()
202 |
203 | def sett(self):
204 | while True:
205 | Slogo()
206 | set=input(" \033[0;33m\033[4;mMyServer\033[00m\033[01;31m > \033[1;36m")
207 | if set=="1":
208 | self.vew()
209 | break
210 | elif set=="2":
211 | self.srst()
212 | break
213 | elif set=="0" or set=="back":
214 | break
215 | else:
216 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+set+"\'")
217 | sleep(1)
218 |
219 | def setting():
220 | set().sett()
--------------------------------------------------------------------------------
/modules/update.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/July/2019
4 | # Powered By :- Aex Software's
5 |
6 | import sys
7 | import os
8 | from time import sleep
9 | from core.system import *
10 | from modules.logo import *
11 |
12 | class upd(object):
13 | def chk_upd(self):
14 | while True:
15 | Mylogo()
16 | askv = input("\n\033[1;33m Do you want to Update MyServer [\033[01;32mY/n\033[01;33m] >> \033[1;36m")
17 | if askv == "n" or askv == "N":
18 | break
19 | elif askv == "Y" or askv == "y":
20 | Mylogo()
21 | print("\n\033[01;32mUpdating MyServer .........\033[01;36m")
22 | if os.path.exists(bpath+"git"):
23 | print("\033[01;32mDone ....\033[01;36m")
24 | else:
25 | os.system(pac+" update")
26 | os.system(pac+" install git -y")
27 | if system=="ubuntu":
28 | os.system("cd "+home+" && sudo git clone https://github.com/rajkumardusad/MyServer.git")
29 | else:
30 | os.system("cd "+home+" && git clone https://github.com/rajkumardusad/MyServer.git")
31 | if os.path.exists(home+"MyServer"):
32 | os.system("cd "+home+"MyServer && sh install")
33 | os.system("clear")
34 | os.system("myserver start")
35 | sys.exit()
36 | else:
37 | Mylogo()
38 | print("\n\n\033[01;37m [+] \033[01;31mSorry We can't update MyServer !!\033[00m")
39 | print("\033[01;37m [+] \033[01;31mYou are \033[01;33moffline \033[01;31m!!!\033[00m")
40 | print("\033[01;37m [+] \033[01;31mCheck your \033[01;33mnetwork \033[01;31mconnection !!!\033[00m")
41 | print("\033[01;37m [+] \033[01;31mTry again after sometime.\033[00m\n\n")
42 | sleep(4)
43 | break
44 | else:
45 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+askv+"\'")
46 | sleep(1)
47 |
48 | def update():
49 | upd().chk_upd()
50 |
--------------------------------------------------------------------------------
/modules/ux.py:
--------------------------------------------------------------------------------
1 | # Tool Name :- MyServer
2 | # Author :- Rajkumar Dusad
3 | # Date :- 22/5/2017
4 | # Powered By :- Aex Software's
5 |
6 | import os
7 | import sys
8 | from time import sleep
9 |
10 | def Ux():
11 | Ux = os.system("clear")
12 |
13 | def ex():
14 | ex = sys.exit()
15 |
16 | def exit():
17 | sleep(1)
18 | print("\n \007\033[01;31mExiting .........")
19 | sleep(1)
20 | print(" \007\033[01;32mG00D By .......... :)")
21 | sleep(1)
22 | print("\033[00m")
23 | sys.exit()
24 |
--------------------------------------------------------------------------------