├── .MyServer.py ├── .gitignore ├── .setup.aex ├── LICENSE ├── MyServer.py ├── README.md ├── Scr ├── Screenshot_2018-05-31-16-03-16-1.png └── Screenshot_2018-08-03-20-16-17-1.png ├── core ├── LiNgrok.sh ├── apache.py ├── host.py ├── index.sh ├── logo.py ├── myserver ├── mysql.py ├── ng.py ├── nginx.py ├── php.py ├── pyweb.py ├── s.py ├── server.py ├── system.py ├── un.py └── upd.py ├── install └── modules ├── .srvr.aex ├── apache.py ├── default_h.py ├── default_s.py ├── h_menu.py ├── load.py ├── local.py ├── logo.py ├── menu.py ├── mysql.py ├── nginx.py ├── open.py ├── php.py ├── pyweb.py ├── s_menu.py ├── setting.py ├── update.py └── ux.py /.MyServer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # Tool Name :- MyServer 3 | # Author :- Rajkumar Dusad 4 | # Date :- 2021/26/7 5 | 6 | import sys, os 7 | from time import sleep 8 | from core.system import * 9 | from modules.logo import * 10 | from modules.menu import * 11 | 12 | class inst: 13 | def chk_sys(self): 14 | if "linux" in sys.platform or "linux2" in sys.platform: 15 | self.chk_inst() 16 | elif "darwin" in sys.platform: 17 | print("Sorry, MyServer is not available for mac right now !!") 18 | sys.exit() 19 | elif "win" in sys.platform: 20 | print("Sorry, MyServer is not available for windows right now !!") 21 | sys.exit() 22 | else: 23 | print("MyServer is not available for \'%s\' right now !!!" %sys.platform) 24 | sys.exit() 25 | 26 | def chk_inst(self): 27 | if os.path.exists(bpath+"myserver") and os.path.exists(spath+"MyServer"): 28 | menu() 29 | else: 30 | self.inst() 31 | 32 | def inst(self): 33 | if system=="ubuntu": 34 | noti() 35 | opt=raw_input("\033[01;33m Do you want to install MyServer [\033[01;32mY/n\033[01;33m] >> \033[00m") 36 | if opt=="Y" or opt=="y": 37 | os.system("sh install") 38 | elif opt=="N" or opt=="n": 39 | sys.exit() 40 | else: 41 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+opt+"\'") 42 | sleep(1) 43 | self.inst() 44 | else: 45 | noti() 46 | opt=raw_input("\033[01;33m Do you want to install MyServer [\033[01;32mY/n\033[01;33m] >> \033[00m") 47 | if opt=="Y" or opt=="y": 48 | os.system("sh install") 49 | elif opt=="N" or opt=="n": 50 | sys.exit() 51 | else: 52 | print("\n \033[01;31m\007Command not found :\033[01;32m \'"+opt+"\'") 53 | sleep(1) 54 | self.inst() 55 | 56 | def MyServer(): 57 | try: 58 | inst().chk_sys() 59 | except KeyboardInterrupt: 60 | exit() 61 | MyServer() 62 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /.setup.aex: -------------------------------------------------------------------------------- 1 | # Tool Name :- MyServer 2 | # Author :- Rajkumar Dusad 3 | # Date :- 29/7/2018 4 | 5 | import sys 6 | import os 7 | from time import sleep 8 | from core.system import * 9 | from modules.logo import * 10 | 11 | class setu(object): 12 | def rem(self): 13 | if os.path.exists(bpath+"myserver") or os.path.exists(spath+"MyServer"): 14 | if system=="ubuntu": 15 | os.system("sudo rm -rf "+spath+"MyServer && rm -rf "+bpath+"myserver") 16 | os.system("cd "+spath+" && sudo rm -rf .path.aex .port.aex .host.aex .serv.lock .h.lock") 17 | else: 18 | os.system("rm -rf "+spath+"MyServer && rm -rf "+bpath+"myserver") 19 | os.system("cd "+spath+" && rm -rf .path.aex .port.aex .host.aex .serv.lock .h.lock") 20 | 21 | def setup(self): 22 | self.rem() 23 | if system=="ubuntu": 24 | Mylogo() 25 | print("\n\033[01;33m\007Installing MyServer .....\n") 26 | os.system("sudo mkdir "+spath+"MyServer") 27 | os.system("sudo mv -v core/myserver "+bpath) 28 | os.system("sudo mv -v core modules MyServer.py .MyServer.py LICENSE "+spath+"MyServer") 29 | os.system("sudo chmod +x "+bpath+"myserver") 30 | os.system("sudo chmod +x "+spath+"MyServer/MyServer.py .MyServer.py") 31 | os.system("sudo chmod +x "+spath+"MyServer/modules/* *.* .* .*.*") 32 | os.system("sudo chmod +x "+spath+"MyServer/core/* *.* .* .*.*") 33 | os.system("cd .. && sudo rm -rf MyServer") 34 | sleep(1) 35 | Mylogo() 36 | print("\n\033[01;33m\007 [\033[01;31m+\033[01;33m] \033[01;32mInstalled MyServer.") 37 | print("\033[01;33m [\033[01;31m+\033[01;33m] \033[01;32mType :- \033[01;33mmyserver help \033[01;32mfor more information.\033[00m\n") 38 | 39 | else: 40 | Mylogo() 41 | print("\n\033[01;33m\007Installing MyServer .....\n") 42 | os.system("mkdir "+spath+"MyServer") 43 | os.system("mv -v core/myserver "+bpath) 44 | os.system("mv -v core modules MyServer.py .MyServer.py LICENSE "+spath+"MyServer") 45 | os.system("chmod +x "+bpath+"myserver") 46 | os.system("chmod +x "+spath+"MyServer/MyServer.py .MyServer.py") 47 | os.system("chmod +x "+spath+"MyServer/modules/* .* .*.* *.*") 48 | os.system("chmod +x "+spath+"MyServer/core/* .* .*.* *.*") 49 | os.system("cd .. && rm -rf MyServer") 50 | sleep(1) 51 | Mylogo() 52 | print("\n\033[01;33m\007 [\033[01;31m+\033[01;33m] \033[01;32mInstalled MyServer.") 53 | print("\033[01;33m [\033[01;31m+\033[01;33m] \033[01;32mType :- \033[01;33mmyserver help \033[01;32mfor more information.\033[00m\n") 54 | 55 | 56 | def MyServer(): 57 | try: 58 | setu().setup() 59 | except KeyboardInterrupt: 60 | exit() 61 | MyServer() 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /MyServer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # Tool Name :- MyServer 3 | # Author :- Rajkumar Dusad 4 | # Date :- 2021/26/7 5 | 6 | import sys 7 | import os 8 | from time import sleep 9 | from core.system import * 10 | 11 | if os.getuid() == 0 or system=="termux": 12 | pass 13 | else: 14 | print("\nerror: Please, Run This programm as Root!\n") 15 | sys.exit() 16 | if len(sys.argv)>1: 17 | pass 18 | else: 19 | print ("error : invalid arguments !!") 20 | print ("use : myserver --help for more information") 21 | sys.exit() 22 | 23 | if sys.argv[1]=="-s": 24 | 25 | if len(sys.argv)==2: 26 | if system=="ubuntu": 27 | os.system("sudo python3 core/s.py "+sys.argv[1]) 28 | else: 29 | os.system("python3 core/s.py "+sys.argv[1]) 30 | 31 | elif len(sys.argv)==3: 32 | if sys.argv[2]=="apache": 33 | if system=="ubuntu": 34 | os.system("python3 core/server.py -apa") 35 | else: 36 | os.system("python3 core/server.py -apa") 37 | else: 38 | print ("error : invalid arguments !!") 39 | print ("use : myserver --help for more information") 40 | 41 | elif len(sys.argv)==6: 42 | if sys.argv[2]=="-php": 43 | if system=="ubuntu": 44 | os.system("python3 core/server.py -php "+sys.argv[3]+" "+sys.argv[4]+" "+sys.argv[5]) 45 | else: 46 | os.system("python3 core/server.py -php "+sys.argv[3]+" "+sys.argv[4]+" "+sys.argv[5]) 47 | elif sys.argv[2]=="-py": 48 | if system=="ubuntu": 49 | os.system("sudo python3 core/server.py -py "+sys.argv[3]+" "+sys.argv[4]+" "+sys.argv[5]) 50 | else: 51 | os.system("python3 core/server.py -py "+sys.argv[3]+" "+sys.argv[4]+" "+sys.argv[5]) 52 | elif sys.argv[2]=="-ng": 53 | if system=="ubuntu": 54 | os.system("python3 core/server.py -ng "+sys.argv[3]+" "+sys.argv[4]+" "+sys.argv[5]) 55 | else: 56 | os.system("python3 core/server.py -ng "+sys.argv[3]+" "+sys.argv[4]+" "+sys.argv[5]) 57 | else: 58 | print ("error : invalid arguments !!") 59 | print ("use : myserver --help for more information") 60 | 61 | elif len(sys.argv)==5: 62 | if system=="ubuntu": 63 | os.system("python3 core/server.py -d "+sys.argv[2]+" "+sys.argv[3]+" "+sys.argv[4]) 64 | else: 65 | os.system("python3 core/server.py -d "+sys.argv[2]+" "+sys.argv[3]+" "+sys.argv[4]) 66 | else: 67 | print ("error : invalid arguments !!") 68 | print ("use : myserver --help for more information") 69 | 70 | elif sys.argv[1]=="-h": 71 | if len(sys.argv)==2: 72 | if system=="ubuntu": 73 | os.system("python3 core/s.py "+sys.argv[1]) 74 | else: 75 | os.system("python3 core/s.py "+sys.argv[1]) 76 | 77 | elif len(sys.argv)==5: 78 | if system=="ubuntu": 79 | os.system("python3 core/host.py "+sys.argv[2]+" "+sys.argv[3]+" "+sys.argv[4]) 80 | else: 81 | os.system("python3 core/host.py "+sys.argv[2]+" "+sys.argv[3]+" "+sys.argv[4]) 82 | 83 | else: 84 | print ("error : invalid arguments") 85 | print ("use : myserver --help for more information") 86 | 87 | elif sys.argv[1]=="-db": 88 | if len(sys.argv)==3: 89 | if sys.argv[2]=="start": 90 | if system=="ubuntu": 91 | os.system("python3 core/mysql.py "+sys.argv[2]) 92 | else: 93 | os.system("python3 core/mysql.py "+sys.argv[2]) 94 | elif sys.argv[2]=="stop": 95 | if system=="ubuntu": 96 | os.system("python3 core/mysql.py "+sys.argv[2]) 97 | else: 98 | os.system("python3 core/mysql.py "+sys.argv[2]) 99 | else: 100 | print ("error : invalid arguments !!") 101 | print ("use : myserver --help for more information") 102 | else: 103 | print ("error : invalid arguments !!") 104 | print ("use : myserver --help for more information") 105 | 106 | elif sys.argv[1]=="rm": 107 | if len(sys.argv)==3: 108 | if sys.argv[2]=="-T" or sys.argv[2]=="-t": 109 | if system=="ubuntu": 110 | os.system("sudo python3 core/un.py") 111 | else: 112 | os.system("python3 core/un.py") 113 | else: 114 | print ("error : invalid arguments") 115 | print ("use : myserver --help for more information") 116 | else: 117 | print ("error : invalid arguments") 118 | print ("use : myserver --help for more information") 119 | 120 | elif sys.argv[1]=="update": 121 | if system=="ubuntu": 122 | os.system("python3 core/upd.py") 123 | else: 124 | os.system("python3 core/upd.py") 125 | 126 | elif sys.argv[1]=="start": 127 | if system=="ubuntu": 128 | os.system("python3 .MyServer.py") 129 | else: 130 | os.system("python3 .MyServer.py") 131 | 132 | elif sys.argv[1]=="--help" or sys.argv[1]=="-help" or sys.argv[1]=="help": 133 | print ("") 134 | print ("Usage: myserver [command]... [arguments]...") 135 | print ("") 136 | print (" Commands:") 137 | print (" -s to start default localhost server.") 138 | print (" -s -ng to start php localhost server.") 139 | print (" -s -php to start php localhost server.") 140 | print (" -s -py to start python localhost server.") 141 | print (" -h to access localhost server on internet.") 142 | print (" -db [start/stop] to start/stop MySQL database server.") 143 | print (" -s apache to start apache web server.") 144 | print (" update update MyServer.") 145 | print (" rm -t uninstall MyServer.") 146 | print (" start start MyServer menu.") 147 | print ("") 148 | 149 | else: 150 | print ("error : invalid arguments !!") 151 | print ("use : myserver --help for more information") 152 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MyServer 2 | 3 | MyServer is your own localhost server. you can setup PHP, Apache and MySQL servers on your android devices or linux like Ubuntu etc. MyServer is Developed for android terminal like Termux or GNURoot Debian terminal. You can setup your localhost server and access from internet. you can host your website and test your website. 4 |


5 | 6 |

7 | 8 |

9 | 10 |


11 | 12 | # How to use ? 13 | 14 | **CLI Use :** 15 | 16 | ***Example : `myserver -s localhost 8080 /home/www`*** 17 | - `myserver -s ` to start default localhost server. 18 | - `myserver -s -ng ` to start Nginx web server. 19 | - `myserver -s -php ` to start php localhost server. 20 | - `myserver -s -py ` to start python localhost server. 21 | - `myserver -h ` to access localhost server on internet. 22 | - `myserver -db [start/stop]` to start/stop mysql database server. 23 | - `myserver -s apache` to start apache web server. 24 | - `myserver update` to update MyServer. 25 | - `myserver rm -t` uninstall MyServer. 26 | - `myserver start` start MyServer menu. 27 | - `myserver -s` to start Server that was previously running. 28 | - `myserver -h` to access from web that was previously accessed. 29 | 30 | 31 | **Manual Use :** 32 | - Type 1 : to start your localhost web server. 33 | - Type 2 : to access your website from internet. 34 | - Type 3 : to start MySQL Database server. 35 | - Type 4 : to start menual localhost server. 36 | - Type 5 : to menual host. 37 | - Type 6 : to update MyServer. 38 | - Type 7 : for server setting. 39 | - Type 8 : to about us. 40 | - Type x : to exit. 41 | 42 |
43 | 44 | ## Support : 45 | 46 | * **Apache2 server.** 47 | * **nginx server.** 48 | * **PHP server.** 49 | * **Python web server.** 50 | * **MySQL Database server.** 51 | 52 |
53 | 54 | ## MyServer is available for : 55 | 56 | * **Android** 57 | * **Ubuntu** 58 | * **Linux** 59 |
60 | 61 | # How to Install MyServer ? 62 | 63 | Open the termux app and type following commands. 64 | 65 | * `apt update` 66 | 67 | * `apt install git` 68 | 69 | * `git clone https://github.com/rajkumardusad/MyServer.git` 70 | 71 | * `cd MyServer` 72 | 73 | * `chmod +x install` 74 | 75 | * `sh install` if not work than type `./install` 76 | 77 |
78 | 79 | ## Now MyServer is installed successfully. 80 | 81 | **Now type `myserver start` to start MyServer.** 82 | 83 | -------------------------------------------------------------------------------- /Scr/Screenshot_2018-05-31-16-03-16-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rajkumardusad/MyServer/211b4219e72c6db3fb01443d72d376441d473a0b/Scr/Screenshot_2018-05-31-16-03-16-1.png -------------------------------------------------------------------------------- /Scr/Screenshot_2018-08-03-20-16-17-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rajkumardusad/MyServer/211b4219e72c6db3fb01443d72d376441d473a0b/Scr/Screenshot_2018-08-03-20-16-17-1.png -------------------------------------------------------------------------------- /core/LiNgrok.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Tool Name :- MyServer 3 | # Author :- Rajkumar Dusad 4 | # Date :- 22/5/2018 5 | # Powered By :- Aex Software's 6 | file="ngrok" 7 | pkg install tar -y 8 | pkg install curl -y 9 | apt-get install curl -y 10 | apt-get install tar -y 11 | sudo apt-get install curl -y 12 | sudo apt-get install tar -y 13 | if [ -f "/usr/bin/$file" ]; then 14 | first=1 15 | echo "skipping downloading" 16 | fi 17 | if [ -f "/data/data/com.termux/files/usr/bin/$file" ]; then 18 | first=1 19 | echo "skipping downloading" 20 | fi 21 | if [ "$first" != 1 ];then 22 | if [ ! -f "/usr/bin/sudo" ]; then 23 | echo "downloading Ngrok" 24 | if [ "$(dpkg --print-architecture)" = "aarch64" ];then 25 | cd ~/ && curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.tgz -o ngrok.tar.gz 26 | elif [ "$(dpkg --print-architecture)" = "arm" ];then 27 | cd ~/ && curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.tgz -o ngrok.tar.gz 28 | elif [ "$(dpkg --print-architecture)" = "i686" ];then 29 | cd ~/ && curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.tgz -o ngrok.tar.gz 30 | elif [ "$(dpkg --print-architecture)" = "i386" ];then 31 | cd ~/ && curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-386.tgz -o ngrok.tar.gz 32 | elif [ "$(dpkg --print-architecture)" = "armhf" ];then 33 | cd ~/ && curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.tgz -o ngrok.tar.gz 34 | elif [ "$(dpkg --print-architecture)" = "armv7" ];then 35 | cd ~/ && curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.tgz -o ngrok.tar.gz 36 | elif [ "$(dpkg --print-architecture)" = "arm64" ];then 37 | cd ~/ && curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.tgz -o ngrok.tar.gz 38 | elif [ "$(dpkg --print-architecture)" = "armv8" ];then 39 | cd ~/ && curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.tgz -o ngrok.tar.gz 40 | else 41 | echo "unknown architecture" 42 | exit 1 43 | fi 44 | fi 45 | if [ -f "/usr/bin/sudo" ]; then 46 | echo "downloading Ngrok" 47 | if [ "$(dpkg --print-architecture)" = "aarch64" ];then 48 | cd ~/ && sudo curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.tgz -o ngrok.tar.gz 49 | elif [ "$(dpkg --print-architecture)" = "arm" ];then 50 | cd ~/ && sudo curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.tgz -o ngrok.tar.gz 51 | elif [ "$(dpkg --print-architecture)" = "i686" ];then 52 | cd ~/ && sudo curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.tgz -o ngrok.tar.gz 53 | elif [ "$(dpkg --print-architecture)" = "i386" ];then 54 | cd ~/ && sudo curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-386.tgz -o ngrok.tar.gz 55 | elif [ "$(dpkg --print-architecture)" = "armhf" ];then 56 | cd ~/ && sudo curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.tgz -o ngrok.tar.gz 57 | elif [ "$(dpkg --print-architecture)" = "armv7" ];then 58 | cd ~/ && sudo curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.tgz -o ngrok.tar.gz 59 | elif [ "$(dpkg --print-architecture)" = "arm64" ];then 60 | cd ~/ && sudo curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.tgz -o ngrok.tar.gz 61 | elif [ "$(dpkg --print-architecture)" = "armv8" ];then 62 | cd ~/ && sudo curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.tgz -o ngrok.tar.gz 63 | else 64 | echo "unknown architecture" 65 | exit 1 66 | fi 67 | fi 68 | fi 69 | cd ~/ && tar -xvzf ngrok.tar.gz 70 | cd ~/ && rm -rf ngrok.tar.gz 71 | if [ -d "/bin/" ]; then 72 | mv -v ~/ngrok /usr/bin/ 73 | chmod +x /usr/bin/ngrok 74 | fi 75 | if [ -f "/usr/lib/sudo" ]; then 76 | sudo mv -v ~/ngrok /usr/bin/ 77 | sudo chmod +x /usr/bin/ngrok 78 | cd ~/ && sudo rm -rf ngrok.tar.gz 79 | fi 80 | if [ -d "/data/data/com.termux/files/usr/bin/" ]; then 81 | mv -v ~/ngrok /data/data/com.termux/files/usr/bin/ 82 | chmod +x /data/data/com.termux/files/usr/bin/ngrok 83 | fi 84 | -------------------------------------------------------------------------------- /core/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 system import * 10 | from 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+".\033[00m") 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[00m "); 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[00m "); 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[00m "); 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[00m ") 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() -------------------------------------------------------------------------------- /core/host.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 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 | dn = sys.argv[1] 22 | portl = sys.argv[2] 23 | port = sys.argv[3] 24 | os.system("python modules/.srvr.aex") 25 | Mylogo() 26 | print("\n\033[01;33mStarting Server ......\033[00m\n") 27 | os.system("ssh -R "+port+":localhost:"+portl+" "+dn+"@localhost.run") 28 | print("\n\007\033[01;31m unfortunately server stopped.\n\033[00m") 29 | sys.exit() 30 | else: 31 | ins().ssh() 32 | if os.path.exists(bpath+"ssh"): 33 | self.opens() 34 | else: 35 | self.notino() 36 | break 37 | 38 | class ins(object): 39 | def ssh(self): 40 | Mylogo() 41 | print("\n\n\033[01;31m [\033[01;33m+\033[01;31m] \033[01;36mOpenSSH \033[01;31mis not installed in your "+system+".") 42 | opt=input("\n\033[01;33m Do you want to install OpenSSH [\033[01;32mY/n\033[01;33m] >>\033[01;36m ") 43 | if opt=="y" or opt=="Y": 44 | Mylogo() 45 | print("\n\033[01;32mInstalling OpenSSH server......\033[00m\n") 46 | sleep(1) 47 | if system=="termux": 48 | os.system(pac+" update") 49 | os.system(pac+" install openssh -y") 50 | else: 51 | os.system(pac+" update") 52 | os.system(pac+" install openssh-server -y") 53 | 54 | def open(): 55 | openssh().opens() 56 | open() -------------------------------------------------------------------------------- /core/index.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | bin=index.html 3 | cat > $bin <<- EOM 4 | 5 | 6 | 7 | 8 | MyServer 9 | 10 | 11 | 12 | 13 | 53 | 54 | 55 | 56 | 57 |
58 |

MyServer

59 |

Your own localhost web server.

60 |
61 | 62 |
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 | --------------------------------------------------------------------------------