├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md ├── bin ├── build.ps1 ├── build.sh ├── renew_cert.sh ├── run.ps1 ├── run.sh ├── stop.ps1 ├── stop.sh ├── terminal.ps1 └── terminal.sh ├── cert └── .keep ├── docker-compose.yml ├── index.html ├── nginx ├── Dockerfile ├── etc │ └── camouflage_site.conf └── html │ ├── css │ └── page.css │ ├── imgs │ └── trojan.png │ └── index.html └── trojan ├── Dockerfile ├── etc └── config.json └── script ├── quick_install.sh ├── trojan └── trojan.service /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: lyy289065406 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: exppoc 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: [ 'https://lyy289065406.github.io/sponsor/' ] 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | cert/fullchain.pem 2 | cert/privkey.pem 3 | html 4 | -------------------------------------------------------------------------------- /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 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 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 | {project} Copyright (C) {year} {fullname} 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 | 676 | In addition, as a special exception, the copyright holders give 677 | permission to link the code of portions of this program with the 678 | OpenSSL library under certain conditions as described in each 679 | individual source file, and distribute linked combinations 680 | including the two. 681 | 682 | You must obey the GNU General Public License in all respects 683 | for all of the code used other than OpenSSL. If you modify 684 | file(s) with this exception, you may extend this exception to your 685 | version of the file(s), but you are not obligated to do so. If you 686 | do not wish to do so, delete this exception statement from your 687 | version. If you delete this exception statement from all source 688 | files in the program, then also delete it here. 689 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # trojan-docker 2 | 3 | > docker 一键部署 trojan 服务端 :自建 VPS 科学上网 4 | 5 | ------ 6 | 7 | ## 0x00 概要 8 | 9 | ![](nginx/html/imgs/trojan.png) 10 | 11 | 如图所示为 trojan 服务端架构,其中有两个关键组件 trojan 和 nginx 。 12 | 13 | 因为从零开始部署这个架构对新手不够友好,故本项目将其封装成 docker 以实现一键部署。 14 | 15 | 另外强调下,本项目使用 certbot 为伪装站点签发 HTTPS 证书。 但由于 certbot 对各个组件的侵入性太强、而且首次安装有交互,所以该组件没有做成 docker 容器,而是将其直接安装到宿主机使用。 16 | 17 | > 本项目主要目的是简化 trojan 服务端的搭建流程,默认你已对 trojan 的原理有一定的熟悉,例如为什么要申请域名、为什么要申请证书等等,所以不会对这些内容做过多解释,若希望了解可参考这篇 [教程](https://exp-blog.com/net/trojan-zheng-yan-kan-shi-jie-jiao-cheng/) 18 | 19 | - 👉 VPS 服务器注册传送门: [vultr](https://www.vultr.com/?ref=9626595) 20 | - 👉 vultr 注册首充 $35 送 $100 优惠[点我](https://www.vultr.com/?ref=9626596-8H) 21 | 22 | ## 0x10 环境要求 23 | 24 | ![](https://img.shields.io/badge/Platform-Linux%20amd64-brightgreen.svg) ![](https://img.shields.io/badge/OS-CentOS%207%2B-brightgreen.svg) ![](https://img.shields.io/badge/OS-Ubuntu%2016.04%2B-brightgreen.svg) ![](https://img.shields.io/badge/OS-Debian%209%2B-brightgreen.svg) 25 | 26 | 27 | ## 0x20 事前准备 28 | 29 | - 宿主机安装 docker、docker-compose 30 | - 宿主机安装 python3 31 | - 已申请可用域名(如 demo_domain.com),并解析到宿主机的公网 IP 32 | 33 | 34 | ## 0x30 部署步骤 35 | 36 | ### 0x31 安装 certbot 37 | 38 | 为了可以使用 Let's Encrypt 生成 HTTPS 证书,需要在宿主机上安装 certbot 客户端,安装方法略。 39 | 40 | > 之所以不把 certbot 也做成 docker 容器,是因为它的入侵性太强,做成容器反而不方便 41 | 42 | 43 | ### 0x32 用 certbot 为域名申请免费 HTTPS 证书 44 | 45 | ```shell 46 | /usr/bin/certbot certonly --standalone -d demo_domain.com -d www.demo_domain.com 47 | ``` 48 | 49 | 注: 50 | 51 | - 若找不到 certbot 脚本路径,请自行检查其安装位置是不是 `/usr/bin/` 52 | - 该命令需要先把 DNS 解析到当前服务器才能成功生成证书(临时域名购买和解析可以到 [namesilo](https://www.namesilo.com)) 53 | - 若是第一次执行该命令,需要根据交互步骤先注册邮箱,以后不再需要。 54 | - 若是更换过域名,需要先删除 `/etc/letsencrypt/live/旧域名` 和 `/etc/letsencrypt/renewal/旧域名.conf`,否则无法生成新域名的证书。 55 | - 生成证书时会使用 80 端口,若有服务占用了 80 端口(例如此工程的 nginx),需要先关停服务,待证书创建完之后再重启 80 服务。 56 | 57 | 58 | 59 | ### 0x33 安装 trojan 服务 60 | 61 | ```shell 62 | # 下载本工程 63 | git clone https://github.com/EXP-Tools/trojan-docker /usr/local/trojan-docker 64 | cd /usr/local/trojan-docker 65 | 66 | # 构建 docker 镜像 67 | # -p 为之后客户端连接 trojan 的密码 68 | # -d 为前面准备好的域名 69 | bin/build.sh -p "demo_password" -d "demo_domain.com" 70 | 71 | # 刷新证书有效期,并复制宿主机的 HTTPS 证书到 docker 容器 72 | # /usr/local/trojan-docker 为安装目录,根据实际情况变更即可 73 | bin/renew_cert.sh "/usr/local/trojan-docker" 74 | 75 | # 在后台启动 trojan 服务 76 | bin/run.sh 77 | 78 | # 停止 trojan 服务(仅需要时) 79 | bin/stop.sh 80 | ``` 81 | 82 | 83 | ### 0x34 自定义伪装站点内容 84 | 85 | 把 [html](./html) 下的内容替换为你站点的内容。 86 | 87 | 88 | 89 | ## 0x40 自动刷新证书 90 | 91 | certbot 申请的证书有效期为 90 天,在到期前的 30 天可以重新执行以下命令更新证书有效期: 92 | 93 | ``` 94 | /usr/bin/certbot renew 95 | ``` 96 | 97 | > 该命令会占用 80 端口,执行前要停止相关进程 98 | 99 | 但是每次都手动更新会比较麻烦,可以把 [renew_cert.sh](renew_cert.sh) 脚本设置到 crontab 自动更新证书: 100 | 101 | 102 | ```shell 103 | 104 | # 编辑定时任务 105 | crontab -e 106 | 107 | # 每两个月更新一次证书 108 | 0 0 1 */2 0 /bin/sh -c "cd /usr/local/trojan-docker && bin/renew_cert.sh /usr/local/trojan-docker" 109 | ``` 110 | 111 | 112 | ## 0x50 各开放端口用途一览 113 | 114 | | 端口 | 进程 | 用途 | 备注 | 115 | |:---:|:---:|:---:|:---| 116 | | 443 | trojan | trojan 代理服务 | - | 117 | | 8443 | nginx | 伪装 HTTPS 服务 | - | 118 | | 80 | nginx | 伪装 HTTP 服务 | - | 119 | | 80 | certbot | HTTPS 证书申请服务 | 与 nginx 服务端口冲突,
故申请/续期证书时需要先停止 nginx | 120 | 121 | -------------------------------------------------------------------------------- /bin/build.ps1: -------------------------------------------------------------------------------- 1 | # PowerShell 2 | # ------------------------ 3 | # 构建镜像 4 | # bin/build.ps1 5 | # [-p ${password}] 设置 trojan 密码 6 | # [-d ${domain}] 设置 trojan 域名 7 | # ------------------------ 8 | 9 | param( 10 | [string]$p="demo_password", 11 | [string]$d="demo_domain.com" 12 | ) 13 | 14 | $PASSWORD = $p 15 | $DOMAIN = $d 16 | 17 | $ENV:password=${PASSWORD}; ` 18 | $ENV:domain=${DOMAIN}; ` 19 | docker-compose build 20 | 21 | Write-Host "finish ." -------------------------------------------------------------------------------- /bin/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ------------------------ 3 | # 构建镜像 4 | # bin/build.sh 5 | # [-p ${password}] 设置 trojan 密码 6 | # [-d ${domain}] 设置 trojan 域名 7 | # ------------------------ 8 | 9 | PASSWORD="demo_password" 10 | DOMAIN="demo_domain.com" 11 | 12 | set -- `getopt p:d: "$@"` 13 | while [ -n "$1" ] 14 | do 15 | case "$1" in 16 | -p) PASSWORD="$2" 17 | shift ;; 18 | -d) DOMAIN="$2" 19 | shift ;; 20 | esac 21 | shift 22 | done 23 | 24 | 25 | password=${PASSWORD} \ 26 | domain=${DOMAIN} \ 27 | docker-compose build 28 | 29 | echo "finish ." -------------------------------------------------------------------------------- /bin/renew_cert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #------------------------------------------------ 3 | # 刷新 HTTPS 证书 4 | # bin/renew_cert.sh "trojan-docker的安装目录" 5 | #------------------------------------------------ 6 | 7 | WORKDIR=$1 8 | if [ -z "${WORKDIR}" ] ; then 9 | WORKDIR="/usr/local/trojan-docker" 10 | fi 11 | 12 | docker-compose down 13 | 14 | /usr/bin/certbot renew 15 | cat /etc/letsencrypt/live/*/fullchain.pem > ${WORKDIR}/cert/fullchain.pem 16 | cat /etc/letsencrypt/live/*/privkey.pem > ${WORKDIR}/cert/privkey.pem 17 | 18 | docker-compose up -d -------------------------------------------------------------------------------- /bin/run.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EXP-Tools/trojan-docker/c9fa1a934d6d0b195242e2a34054316c553510d4/bin/run.ps1 -------------------------------------------------------------------------------- /bin/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #------------------------------------------------ 3 | # 运行 docker 服务 4 | # bin/run.sh 5 | #------------------------------------------------ 6 | 7 | docker-compose up -d 8 | -------------------------------------------------------------------------------- /bin/stop.ps1: -------------------------------------------------------------------------------- 1 | # PowerShell 2 | #------------------------------------------------ 3 | # 停止 docker 服务 4 | # bin/stop.ps1 5 | #------------------------------------------------ 6 | 7 | docker-compose down -------------------------------------------------------------------------------- /bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #------------------------------------------------ 3 | # 停止 docker 服务 4 | # bin/stop.sh 5 | #------------------------------------------------ 6 | 7 | docker-compose down -------------------------------------------------------------------------------- /bin/terminal.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EXP-Tools/trojan-docker/c9fa1a934d6d0b195242e2a34054316c553510d4/bin/terminal.ps1 -------------------------------------------------------------------------------- /bin/terminal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #------------------------------------------------ 3 | # 进入容器的交互终端 4 | # bin/terminal.sh 5 | #------------------------------------------------ 6 | 7 | 8 | CONTAINER_NAME="trojan" 9 | CONTAINER_ID=`docker ps -aq --filter name="$CONTAINER_NAME"` 10 | if [[ "${CONTAINER_ID}x" = "x" ]] ; then 11 | echo "[$CONTAINER_NAME] 容器没有运行 ..." 12 | else 13 | docker exec -it -u root $CONTAINER_ID bash 14 | fi 15 | -------------------------------------------------------------------------------- /cert/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EXP-Tools/trojan-docker/c9fa1a934d6d0b195242e2a34054316c553510d4/cert/.keep -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | nginx: 4 | hostname: NGINX 5 | container_name: nginx 6 | build: 7 | context: ./nginx 8 | dockerfile: ./Dockerfile 9 | args: 10 | - domain=${domain} 11 | volumes: 12 | - ./cert/:/etc/nginx/cert/ 13 | - ./nginx/html:/usr/share/nginx/html 14 | ports: 15 | - "80:80" 16 | - "8443:8443" 17 | networks: 18 | vpn: 19 | ipv4_address: 172.168.22.2 20 | restart: on-failure 21 | 22 | trojan: 23 | hostname: TROJAN 24 | container_name: trojan 25 | build: 26 | context: ./trojan 27 | dockerfile: ./Dockerfile 28 | args: 29 | - password=${password} 30 | volumes: 31 | - ./cert/:/usr/local/etc/trojan/cert/ 32 | ports: 33 | - "443:443" 34 | networks: 35 | vpn: 36 | ipv4_address: 172.168.22.3 37 | depends_on: 38 | - nginx 39 | restart: on-failure 40 | 41 | 42 | networks: 43 | vpn: 44 | driver: bridge 45 | ipam: 46 | driver: default 47 | config: 48 | - subnet: 172.168.22.0/24 49 | gateway: 172.168.22.1 50 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | EXP-BLOG 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:mainline 2 | ARG domain="demo_domain.com" 3 | 4 | # RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list 5 | RUN apt-get clean && \ 6 | apt-get update -y && \ 7 | apt-get install -y procps build-essential libpq-dev nodejs 8 | 9 | ADD ./html /usr/share/nginx/html 10 | ADD ./etc/camouflage_site.conf /etc/nginx/conf.d/camouflage_site.conf 11 | RUN mkdir -p /etc/nginx/cert/ && \ 12 | mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak && \ 13 | sed -i "s/YOUR_DOMAIN/${domain}/g" /etc/nginx/conf.d/camouflage_site.conf 14 | 15 | RUN echo "alias ll='ls -alF'" >> /root/.bashrc 16 | EXPOSE 80 8443 17 | WORKDIR /etc/nginx/ 18 | 19 | -------------------------------------------------------------------------------- /nginx/etc/camouflage_site.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name YOUR_DOMAIN www.YOUR_DOMAIN; 4 | 5 | # rewrite ^(.*) https://$server_name$1 permanent; 6 | return 302 https://$server_name:8443$request_uri; 7 | } 8 | 9 | server { 10 | listen 8443 ssl; 11 | server_name YOUR_DOMAIN www.YOUR_DOMAIN; 12 | 13 | charset utf-8; 14 | ssl_certificate /etc/nginx/cert/fullchain.pem; 15 | ssl_certificate_key /etc/nginx/cert/privkey.pem; 16 | 17 | # TLSv1.3需要nginx 1.13.0以上版本 18 | ssl_protocols TLSv1.2 TLSv1.3; 19 | 20 | # 如果nginx版本低,建议使用这种加密算法配置 21 | # ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; 22 | 23 | ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384; 24 | ssl_ecdh_curve secp384r1; 25 | ssl_prefer_server_ciphers on; 26 | ssl_session_cache shared:SSL:10m; 27 | ssl_session_timeout 10m; 28 | ssl_session_tickets off; 29 | keepalive_timeout 70; 30 | 31 | location / { 32 | root /usr/share/nginx/html; 33 | index index.html index.htm; 34 | } 35 | 36 | error_page 500 502 503 504 /50x.html; 37 | 38 | location = /50x.html { 39 | root /usr/share/nginx/html; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /nginx/html/css/page.css: -------------------------------------------------------------------------------- 1 | * 2 | { 3 | margin:0; 4 | padding:0; 5 | border:0; 6 | } 7 | 8 | body 9 | { 10 | font-family:PingFangSC-Regular, Verdana, Arial, '微软雅黑','宋体'; 11 | font-size:14px; 12 | } 13 | 14 | strong 15 | { 16 | font-family:'微软雅黑'; 17 | font-size:18px; 18 | color:#3f3f3f; 19 | font-weight:800; 20 | } 21 | 22 | div#maincontent h2 23 | { 24 | font-size: 18px; 25 | color:#3f3f3f; 26 | } 27 | 28 | body#homefirst div#maincontent, div#maincontent h1, div#maincontent h2, div#sidebar div#ad h2 29 | { 30 | font-family:'微软雅黑'; 31 | } 32 | 33 | pre, pre code, div#maincontent input, div#maincontent select, div#maincontent textarea 34 | { 35 | font-family:Consolas, "Courier New", Courier, monospace; 36 | } 37 | 38 | h2, h3, h4, h5, h6, em 39 | { 40 | font-weight: bold; 41 | } 42 | 43 | p.note span, p.important span, p.tip span, p.inherited, p.inherited span, p.gototop, .html5_new_note span 44 | { 45 | font-weight: bold; 46 | } 47 | 48 | p.tip span { 49 | color:#ff9955; 50 | } 51 | 52 | p.tip2 { 53 | background: #BBEDB8 url(/ui2017/tip.png) top left no-repeat; 54 | display:block; 55 | padding:15px 15px 15px 50px; 56 | color:#000; 57 | border-radius:5px; 58 | background-position:15px 15px; 59 | } 60 | 61 | body#homesecond div#navsecond li 62 | { 63 | font-weight:bold; 64 | } 65 | 66 | div#sidebar div#ad h2, body#homefirst div#maincontent h3 67 | { 68 | font-size: 14px; 69 | } 70 | 71 | div#maincontent h3 72 | { 73 | font-size: 16px; 74 | } 75 | 76 | div#maincontent h4 77 | { 78 | font-size: 14px; 79 | } 80 | 81 | div#maincontent button, div#maincontent input, div#maincontent select, div#maincontent textarea 82 | { 83 | font-size:12px; 84 | } 85 | 86 | body#homefirst div#maincontent div#w3 h2 87 | { 88 | font-size:20px; 89 | } 90 | 91 | em 92 | { 93 | font-style:normal; 94 | } 95 | 96 | pre code 97 | { 98 | color:#0000dd; 99 | } 100 | 101 | .html5_new_note 102 | { 103 | background: #ffffff url(/i/html5_new_note.png) top left no-repeat; 104 | padding-left:20px; 105 | } 106 | 107 | .html5_new_note span 108 | { 109 | color:blue; 110 | } 111 | 112 | p.gototop 113 | { 114 | text-align:right; 115 | } 116 | 117 | div#maincontent button 118 | { 119 | margin-top:15px; 120 | } 121 | 122 | 123 | 124 | 125 | /* ----------------------------------- layout ----------------------------------- */ 126 | html { 127 | min-width: 1210px; 128 | background-color: #fdfcf8; 129 | overflow:scroll; 130 | overflow-x:hidden; 131 | } 132 | 133 | body 134 | { 135 | text-align: center; 136 | margin: 0; 137 | padding: 0; 138 | border: 0; 139 | background: #fdfcf8; 140 | } 141 | 142 | div#wrapper 143 | { 144 | margin: 0 auto; 145 | padding: 0; 146 | border: 0; 147 | width: 1239px; 148 | text-align: left; 149 | background: transparent url(/ui2017/wrapper.png) top left repeat-y; 150 | } 151 | 152 | div#navsecond 153 | { 154 | float: left; 155 | margin: 0 0 0 6px; 156 | padding: 0; 157 | border: 0; 158 | width: 180px; 159 | background : transparent; 160 | } 161 | 162 | html>body div#navsecond 163 | { 164 | margin-left: 12px; 165 | } 166 | 167 | div#maincontent 168 | { 169 | float: left; 170 | margin: 0; 171 | padding: 30px 0 0 0; 172 | border: 0; 173 | width: 850px; 174 | background: transparent; 175 | } 176 | 177 | div#maincontent div{ 178 | width: 810px; 179 | margin: 0 0 0 25px; 180 | padding: 30px 0 30px 0; 181 | border:0; 182 | border-bottom: 1px solid #aaa; 183 | } 184 | 185 | div#sidebar 186 | { 187 | float: left; 188 | margin: 0; 189 | padding: 0; 190 | border: 0; 191 | width: 180px; 192 | background: transparent; 193 | } 194 | 195 | div#footer 196 | { 197 | clear: both; 198 | margin: 0; 199 | padding-top: 16px; 200 | margin-left: 12px; 201 | width: 1210px; 202 | line-height:24px; 203 | background: #f0f0f0; 204 | border-top: 0px solid #fff; 205 | background: #fdfcf8 url(/ui2017/footer.png) top left repeat-x; 206 | font-family:PingFangSC-Regular, '微软雅黑', Verdana, Arial, '宋体'; 207 | } 208 | 209 | div#footer #p1 210 | { 211 | font-size:12px; 212 | color:#777777; 213 | text-align:center; 214 | background: transparent url(/ui2017/alert.png) no-repeat; 215 | background-position:235px 2px; 216 | } 217 | 218 | div#footer #p2 219 | { 220 | margin: 30px 0 30px 0; 221 | font-size:14px; 222 | text-align:center; 223 | color:#777777; 224 | } 225 | 226 | div#footer #p1, div#footer #p2, div#footer #p2 a { 227 | max-height: 999999px; 228 | } 229 | 230 | 231 | /* ----------------------------------- header ----------------------------------- */ 232 | div#header, div#header_index 233 | { 234 | margin: 0 0 0 12px; 235 | padding: 0; 236 | border: 0; 237 | width: 1210px; 238 | height: 100px; 239 | background-color:#fdfcf8; 240 | } 241 | 242 | div#header a, div#header_index a, div#header_index h1 243 | { 244 | text-indent: -9999px; 245 | margin: 0; 246 | padding: 0; 247 | border: 0; 248 | overflow:hidden; 249 | float:left; 250 | } 251 | 252 | div#header a:link, div#header a:visited 253 | { 254 | display: block; 255 | width: 372px; 256 | height: 90px; 257 | background : transparent url(/ui2017/bg.png) 0 -150px no-repeat; 258 | margin: 0; 259 | padding: 0; 260 | border: 0; 261 | } 262 | 263 | div#header a:hover 264 | { 265 | background: transparent url(/ui2017/bg.png) 0 -250px no-repeat; 266 | } 267 | 268 | div#header div#ad_head 269 | { 270 | float:right; 271 | width:728px; 272 | height:90px; 273 | background-color:#efefef; 274 | margin-top:5px; 275 | } 276 | 277 | div#header_index a:link, div#header_index a:visited, div#header_index h1 278 | { 279 | display: block; 280 | width: 500px; 281 | height: 100px; 282 | background : transparent url(/ui2017/bg.png) 0 -150px no-repeat; 283 | margin: 0; 284 | padding: 0; 285 | border: 0; 286 | } 287 | 288 | div#header_index h1 289 | { 290 | display: block; 291 | } 292 | 293 | div#header_index a:hover 294 | { 295 | background: transparent url(/ui2017/bg.png) 0 -250px no-repeat; 296 | } 297 | 298 | 299 | 300 | /* ----------------------------------- search form ----------------------------------- */ 301 | div#searchui 302 | { 303 | margin:0; 304 | padding:0; 305 | width:306px; 306 | height:100px; 307 | background-color: transparent; 308 | float:right; 309 | } 310 | 311 | #searchui input.button 312 | { 313 | padding:0; 314 | margin:0; 315 | background:#AE4141; 316 | font:12px Verdana, Arial, Helvetica, sans-serif; 317 | color:#FFFFFF; 318 | width:30px; 319 | height:30px; 320 | } 321 | 322 | #searchui input.box 323 | { 324 | margin:0; 325 | margin-top:35px; 326 | width:256px; 327 | height:28px; 328 | background:#fdfdfd; 329 | font:12px Verdana, Arial, Helvetica, sans-serif; 330 | border:1px solid #ddd; 331 | } 332 | 333 | 334 | 335 | /* ----------------------------------- index -----------------------------------*/ 336 | 337 | 338 | body#homefirst div#maincontent div 339 | { 340 | padding-top:0; 341 | padding-bottom:30px; 342 | width:810px; 343 | } 344 | 345 | body#homefirst div#maincontent div#d1 346 | { 347 | text-align:center; 348 | } 349 | 350 | body#homefirst div#maincontent div#partner 351 | { 352 | width: 307px; 353 | float: left; 354 | } 355 | 356 | body#homefirst div#maincontent div#update 357 | { 358 | width: 300px; 359 | float: left; 360 | margin:0; 361 | } 362 | 363 | body#homefirst div#maincontent div#d1 h2 364 | { 365 | margin-top:35px; 366 | font-size:24px; 367 | } 368 | 369 | body#homefirst div#maincontent div#d1 p 370 | { 371 | margin-left:0; 372 | font-size:18px; 373 | } 374 | 375 | body#homefirst div#maincontent p 376 | { 377 | font-size:16px; 378 | margin-left:110px; 379 | } 380 | 381 | body#homefirst div#maincontent h3 382 | { 383 | margin-top:35px; 384 | margin-left:110px; 385 | font-size:24px; 386 | } 387 | 388 | body#homefirst div#maincontent div.idea 389 | { 390 | padding: 0; 391 | padding-bottom:30px; 392 | min-height: 118px; 393 | } 394 | 395 | body#homefirst div#maincontent div#d2 396 | { 397 | background : transparent url(/ui2017/icon2.png) 0 0 no-repeat; 398 | } 399 | 400 | body#homefirst div#maincontent div#d3 401 | { 402 | background : transparent url(/ui2017/icon3.png) 0 0 no-repeat; 403 | } 404 | 405 | body#homefirst div#maincontent div#d4 406 | { 407 | background : transparent url(/ui2017/icon4.png) 0 0 no-repeat; 408 | } 409 | 410 | body#homefirst div#maincontent div#d5 411 | { 412 | background : transparent url(/ui2017/icon5.png) 0 0 no-repeat; 413 | } 414 | 415 | body#homefirst div#maincontent div#d6 416 | { 417 | background : transparent url(/ui2017/icon6.png) 0 0 no-repeat; 418 | } 419 | 420 | body#homefirst div#maincontent div#d7 421 | { 422 | background : transparent url(/ui2017/icon7.png) 0 0 no-repeat; 423 | } 424 | 425 | body#homefirst div#maincontent div#d8 426 | { 427 | background : transparent url(/ui2017/icon8.png) 0 0 no-repeat; 428 | border:0px; 429 | } 430 | 431 | body#homefirst div#maincontent div#d9 { 432 | background: transparent url(/ui2017/icon9.png) top left no-repeat; 433 | } 434 | 435 | body#homefirst div#maincontent div#d10 { 436 | background: transparent url(/ui2017/icon10.png) top left no-repeat; 437 | } 438 | 439 | body#homefirst div#maincontent div.idea img 440 | { 441 | margin:0; 442 | float:left; 443 | } 444 | 445 | body#homefirst div#maincontent div#d9, body#homefirst div#maincontent div#d10 { 446 | margin-left:75px; 447 | margin-top:10px; 448 | width:290px; 449 | float:left; 450 | border:0; 451 | } 452 | 453 | body#homefirst div#maincontent div#d9, body#homefirst div#maincontent div#d10 { 454 | margin-left:75px; 455 | margin-top:15px; 456 | float:left; 457 | border:0; 458 | min-height:87px; 459 | } 460 | 461 | body#homefirst div#maincontent div#d9, body#homefirst div#maincontent div#d10 { 462 | width:290px; 463 | } 464 | 465 | body#homefirst div#maincontent div#d10 { 466 | width:299px; 467 | } 468 | 469 | body#homefirst div#maincontent div#d9 h3, body#homefirst div#maincontent div#d10 h3 { 470 | font-size:14px; 471 | margin:23px 0 0 58px; 472 | color:#777; 473 | font-weight:400; 474 | } 475 | 476 | body#homefirst div#maincontent div#d9 p, body#homefirst div#maincontent div#d10 p { 477 | font-size:14px; 478 | margin:0 0 0 58px; 479 | line-height:normal; 480 | } 481 | 482 | div#d9 p a { 483 | color:#000; 484 | } 485 | 486 | 487 | /* ----------------------------------- navfirst -----------------------------------*/ 488 | div#navfirst 489 | { 490 | height: 48px; 491 | width: 1210px; 492 | margin: 0 0 0 12px; 493 | padding: 0; 494 | border: 0; 495 | background: #E8E7E3; 496 | } 497 | 498 | div#navfirst ul#menu 499 | { 500 | height: 48px; 501 | width: 1210px; 502 | background: transparent url(/ui2017/bg.png) top left no-repeat; 503 | margin: 0; 504 | padding: 0; 505 | position: relative; 506 | } 507 | 508 | div#navfirst ul#menu li 509 | { 510 | margin:0; 511 | padding:0; 512 | list-style:none; 513 | position:absolute; 514 | top:0; 515 | } 516 | 517 | ul#menu li,ul#menu a 518 | { 519 | display: block; 520 | height: 48px; 521 | border-bottom:0; 522 | } 523 | 524 | div#navfirst ul#menu li a 525 | { 526 | text-indent: -9999px; 527 | overflow:hidden; 528 | text-decoration: none; 529 | } 530 | 531 | #h {left:0;width:155px;} 532 | #b {left:155px;width:157px;} 533 | #s {left:312px;width:167px;} 534 | #d {left:479px;width:158px;} 535 | #x {left:637px;width:101px;} 536 | #ws {left:738px;width:185px;} 537 | #w {left:923px;width:177px;} 538 | 539 | #h a:hover {background: transparent url(/ui2017/bg.png) 0 -48px no-repeat;} 540 | #b a:hover {background: transparent url(/ui2017/bg.png) -155px -48px no-repeat;} 541 | #s a:hover {background: transparent url(/ui2017/bg.png) -312px -48px no-repeat;} 542 | #d a:hover {background: transparent url(/ui2017/bg.png) -479px -48px no-repeat;} 543 | #x a:hover {background: transparent url(/ui2017/bg.png) -637px -48px no-repeat;} 544 | #ws a:hover {background: transparent url(/ui2017/bg.png) -738px -48px no-repeat;} 545 | #w a:hover {background: transparent url(/ui2017/bg.png) -923px -48px no-repeat;} 546 | 547 | body.html #h {background: transparent url(/ui2017/bg.png) 0 -48px no-repeat;} 548 | body.browserscripting #b {background: transparent url(/ui2017/bg.png) -155px -48px no-repeat;} 549 | body.serverscripting #s {background: transparent url(/ui2017/bg.png) -312px -48px no-repeat;} 550 | body.dotnet #d {background: transparent url(/ui2017/bg.png) -479px -48px no-repeat;} 551 | body.xml #x {background: transparent url(/ui2017/bg.png) -637px -48px no-repeat;} 552 | body.webservices #ws {background: transparent url(/ui2017/bg.png) -738px -48px no-repeat;} 553 | body.webbuilding #w {background: transparent url(/ui2017/bg.png) -923px -48px no-repeat;} 554 | 555 | 556 | 557 | 558 | 559 | /* Default links */ 560 | a:link, a:visited { 561 | text-decoration : none; 562 | color : #900b09; 563 | background : transparent; 564 | border-bottom:1px solid #900b09; 565 | } 566 | 567 | a:hover { 568 | text-decoration : none; 569 | color: #ff0000; 570 | background : transparent; 571 | border-bottom:1px solid #ff0000; 572 | } 573 | 574 | a:active { 575 | text-decoration : none; 576 | color : #ff0000; 577 | background : transparent; 578 | } 579 | 580 | div#navsecond li.currentLink a:link, div#navsecond li.currentLink a:visited { 581 | text-decoration : none; 582 | color:#ff0000; 583 | background : transparent; 584 | } 585 | 586 | div#navsecond li.currentLink a:hover { 587 | text-decoration : underline; 588 | color : #ff0000; 589 | background : transparent; 590 | } 591 | 592 | div#navsecond a:link, div#navsecond a:visited { 593 | text-decoration : none; 594 | color:#000; 595 | background : transparent; 596 | } 597 | 598 | div#navsecond a:hover { 599 | text-decoration : underline; 600 | color : #000; 601 | background : transparent; 602 | } 603 | 604 | div#navsecond a:active { 605 | text-decoration : underline; 606 | color : #000; 607 | background : transparent; 608 | } 609 | 610 | div#navsecond a#link_help { 611 | color:#0479A7; 612 | } 613 | 614 | div#navsecond a#link_about { 615 | color:#0479A7; 616 | } 617 | 618 | div#maincontent .partner a { 619 | color:#000; 620 | } 621 | 622 | div#footer a { 623 | border-bottom:none; 624 | } 625 | 626 | div#footer a:link, div#footer a:visited { 627 | text-decoration : none; 628 | color:#777777; 629 | background : transparent; 630 | } 631 | 632 | div#footer a:hover { 633 | text-decoration : underline; 634 | color : #000; 635 | background : transparent; 636 | } 637 | 638 | div#footer a:active { 639 | text-decoration : underline; 640 | color : #000; 641 | background : transparent; 642 | } 643 | 644 | 645 | /* ----------------------------------- Typography ----------------------------------- */ 646 | 647 | div#maincontent p 648 | { 649 | margin: 12px 0 0 0; 650 | line-height: 150%; 651 | } 652 | 653 | div#maincontent h1 { 654 | margin:0 0 0 25px; 655 | font-size: 28px; 656 | font-weight:400; 657 | } 658 | 659 | div#maincontent h3, div#maincontent h4{ 660 | margin:25px 0 0 0; 661 | } 662 | 663 | #homefirst div#navsecond h2:first-child, #homefirst div#sidebar h2:first-child { 664 | margin:10px 0 0 0; 665 | } 666 | 667 | body#homesecond div#navsecond li { 668 | margin:5px 0 0 0; 669 | } 670 | 671 | div.backtoreference p{ 672 | margin:0; 673 | } 674 | 675 | div#w3school p { 676 | margin-left:15px; 677 | } 678 | 679 | div#maincontent div p:first-child { 680 | margin: 0; 681 | } 682 | 683 | p.important span { 684 | color:#dd0000; 685 | } 686 | 687 | p.inherited { 688 | color:#ff0000; 689 | } 690 | 691 | p.inherited span { 692 | color:#999; 693 | } 694 | 695 | p.chinese span { 696 | color:#0000ff; 697 | } 698 | 699 | pre { 700 | width:765px; 701 | margin: 15px 0 0 0; 702 | padding: 20px; 703 | border: 0; 704 | border: 1px dotted #785; 705 | background: #f5f5f5; 706 | line-height:1.4; 707 | font-family:Consolas; 708 | } 709 | 710 | pre code { 711 | color:#0000dd; 712 | } 713 | 714 | pre span { 715 | color:#999; 716 | } 717 | 718 | pre span.code_comment { 719 | color:#999; 720 | } 721 | 722 | blockquote 723 | { 724 | margin:15px; 725 | } 726 | 727 | div#maincontent ul, div#maincontent ol { 728 | margin-top:10px; 729 | margin-left:35px; 730 | margin-bottom:0; 731 | } 732 | 733 | div#maincontent li { 734 | margin-top:3px; 735 | } 736 | 737 | div#navsecond ul, div#navsecond li, div#sidebar ul, div#sidebar li { 738 | margin: 0; 739 | padding: 0; 740 | } 741 | 742 | div#navsecond ul, div#sidebar ul { 743 | margin-left: 12px; 744 | } 745 | 746 | div#navsecond li, div#sidebar li { 747 | list-style: none; 748 | } 749 | 750 | div#navsecond li.list_apart { 751 | margin-top:10px; 752 | } 753 | 754 | img { 755 | border:0; 756 | } 757 | 758 | div#maincontent img { 759 | margin:25px 0 0 25px; 760 | } 761 | 762 | body#homesecond dl { 763 | margin:0; 764 | padding:0; 765 | } 766 | 767 | body#homesecond dt 768 | { 769 | font-weight: bold; 770 | font-size: 14px; 771 | margin:0; 772 | padding:0; 773 | } 774 | 775 | body#homesecond dd { 776 | color:#000088; 777 | margin:10px 0 0 0; 778 | padding:0; 779 | } 780 | 781 | body#homesecond dd p { 782 | margin:0; 783 | padding:0; 784 | } 785 | 786 | 787 | div#maincontent div#toc div { 788 | margin:0; 789 | margin-top:15px; 790 | margin-bottom:35px; 791 | padding:0; 792 | border:0; 793 | } 794 | 795 | div#toc img { 796 | float:left; 797 | margin:0; 798 | margin-right:10px; 799 | } 800 | 801 | div#toc div dt, div#toc div dl { 802 | margin-top:0; 803 | } 804 | 805 | div#example dl, div.example dl, div#moreexamples dl, div#toc dl, div#referencelist dl { 806 | margin: 10px 0 0 0; 807 | } 808 | 809 | div#example dt, div.example dt, div#moreexamples dt, div#toc dt, div#referencelist dt { 810 | margin:15px 0 5px 0; 811 | } 812 | 813 | div#example dd, div.example dd, div#moreexamples dd, div#toc dd, div#referencelist dd { 814 | margin:0; 815 | } 816 | 817 | dl.define 818 | { 819 | margin: 10px 0 0 0; 820 | } 821 | 822 | dl.define dt 823 | { 824 | margin:15px 0 3px 0; 825 | font-weight:bold; 826 | color:#0479A7; 827 | } 828 | 829 | dl.define dd 830 | { 831 | margin:10px 0 0 10px; 832 | line-height: 150%; 833 | } 834 | 835 | span.deprecated { 836 | color:#e80000; 837 | } 838 | 839 | .marked, pre code span.marked { 840 | color:#dd0000; 841 | } 842 | 843 | p.gototop { 844 | text-align:right; 845 | } 846 | 847 | div#maincontent canvas.canvas_example { 848 | border:1px solid #d3d3d3; 849 | background:#ffffff; 850 | width:300px; 851 | height:150px; 852 | margin-top:15px; 853 | } 854 | 855 | div#maincontent div.panel,p.flip { 856 | width:400px; 857 | margin:0; 858 | padding:5px; 859 | text-align:center; 860 | background:#e5eecc; 861 | border:solid 1px #c3c3c3; 862 | } 863 | 864 | div#maincontent p.flip { 865 | margin-top:15px; 866 | } 867 | 868 | div.panel { 869 | display:none; 870 | } 871 | 872 | div#maincontent input[type=text] 873 | { 874 | border:1px #bebebe solid; 875 | height:30px; 876 | padding-left:10px; 877 | margin:15px 0 0 0; 878 | } 879 | 880 | div#maincontent input[type=submit], button 881 | { 882 | border:1px #bebebe solid; 883 | height:30px; 884 | padding-left:5px; 885 | padding-right:5px; 886 | } 887 | 888 | div#maincontent input[type=submit]:hover, button:hover 889 | { 890 | border:1px #999 solid; 891 | } 892 | 893 | div#maincontent select 894 | { 895 | border:1px #bebebe solid; 896 | height:25px; 897 | margin:15px 0 0 0; 898 | } 899 | 900 | 901 | /* ----------------------------------- 表格 ----------------------------------- */ 902 | 903 | table.dataintable { 904 | margin-top:15px; 905 | border-collapse:collapse; 906 | border:1px solid #aaa; 907 | width:100%; 908 | } 909 | 910 | table.dataintable th { 911 | vertical-align:baseline; 912 | padding:5px 15px 5px 6px; 913 | background-color:#3F3F3F; 914 | border:1px solid #3F3F3F; 915 | text-align:left; 916 | color:#fff; 917 | } 918 | 919 | table.dataintable td { 920 | vertical-align:text-top; 921 | padding:6px 15px 6px 6px; 922 | border:1px solid #aaa; 923 | } 924 | 925 | table.dataintable tr:nth-child(odd) { 926 | background-color:#F5F5F5; 927 | } 928 | 929 | table.dataintable tr:nth-child(even) { 930 | background-color:#fff; 931 | } 932 | 933 | table.dataintable pre { 934 | width:auto; 935 | margin:0; 936 | padding:0; 937 | border:0; 938 | background-color:transparent; 939 | } 940 | 941 | table.dataintable p {margin:0 0 2px 0;} 942 | 943 | div#maincontent table.dataintable ul, div#maincontent table.dataintable li { 944 | list-style-type:none; 945 | margin:0; 946 | padding:0; 947 | } 948 | 949 | table.dataintable td em 950 | { 951 | color:#0000ff; 952 | font-weight:normal; 953 | } 954 | 955 | table.dataintable .table_value {color:#0F93D2;} 956 | 957 | .no_wrap {white-space:nowrap;} 958 | 959 | div#maincontent table.dataintable ul.listintable { 960 | margin:20px; 961 | padding:0; 962 | } 963 | 964 | div#maincontent table.dataintable ul.listintable li{ 965 | list-style-type:disc; 966 | } 967 | 968 | 969 | table.dataintable td.html5_new { 970 | background: transparent url(/ui2017/table_bg_html5.png) top right no-repeat; 971 | } 972 | 973 | tr.notsupported { 974 | color:#999999; 975 | } 976 | 977 | 978 | 979 | /* ----------------------------------- browsersupport ----------------------------------- */ 980 | table.browsersupport td 981 | { 982 | text-align:center; 983 | } 984 | 985 | #jsref table.browsersupport td, #tags table.browsersupport td, #cssref table.browsersupport td 986 | { 987 | width:20%; 988 | } 989 | 990 | #jsref table.browsersupport th, #tags table.browsersupport th, #cssref table.browsersupport th 991 | { 992 | color:#333333; 993 | font-weight:400; 994 | } 995 | 996 | #jsref table.browsersupport, #tags table.browsersupport, #cssref table.browsersupport 997 | { 998 | width:70%; 999 | } 1000 | 1001 | table.browsersupport .bsIE { 1002 | background-image: url('/ui2017/compatible_ie.png'); 1003 | } 1004 | 1005 | table.browsersupport .bsFirefox { 1006 | background-image: url('/ui2017/compatible_firefox.png'); 1007 | } 1008 | 1009 | table.browsersupport .bsChrome { 1010 | background-image: url('/ui2017/compatible_chrome.png'); 1011 | } 1012 | 1013 | table.browsersupport .bsSafari { 1014 | background-image: url('/ui2017/compatible_safari.png'); 1015 | } 1016 | 1017 | table.browsersupport .bsOpera { 1018 | background-image: url('/ui2017/compatible_opera.png'); 1019 | } 1020 | 1021 | table.browsersupport .bsNoIE { 1022 | background-image: url('/ui2017/incompatible_ie.png'); 1023 | } 1024 | 1025 | table.browsersupport .bsNoFirefox { 1026 | background-image: url('/ui2017/incompatible_firefox.png'); 1027 | } 1028 | 1029 | table.browsersupport .bsNoChrome { 1030 | background-image: url('/ui2017/incompatible_chrome.png'); 1031 | } 1032 | 1033 | table.browsersupport .bsNoSafari { 1034 | background-image: url('/ui2017/incompatible_safari.png'); 1035 | } 1036 | 1037 | table.browsersupport .bsNoOpera { 1038 | background-image: url('/ui2017/incompatible_opera.png'); 1039 | } 1040 | 1041 | table.browsersupport .bsPreIE { 1042 | background-image: url('/i/precompatible_ie.gif'); 1043 | } 1044 | 1045 | table.browsersupport .bsPreFirefox { 1046 | background-image: url('/i/precompatible_firefox.gif'); 1047 | } 1048 | 1049 | table.browsersupport .bsPreChrome { 1050 | background-image: url('/i/precompatible_chrome.gif'); 1051 | } 1052 | 1053 | table.browsersupport .bsPreSafari { 1054 | background-image: url('/i/precompatible_safari.gif'); 1055 | } 1056 | 1057 | table.browsersupport .bsPreOpera { 1058 | background-image: url('/i/precompatible_opera.gif'); 1059 | } 1060 | 1061 | table.browsersupport { 1062 | margin-top:15px; 1063 | border-collapse:collapse; 1064 | } 1065 | 1066 | table.browsersupport td { 1067 | padding: 0; 1068 | height: 86px; 1069 | width:86px; 1070 | vertical-align: middle; 1071 | background:#fdfcf8 no-repeat center; 1072 | border:1px solid #ddd; 1073 | } 1074 | 1075 | table.browsersupport .browser_version td { 1076 | padding: 0; 1077 | height: 36px; 1078 | vertical-align: middle; 1079 | text-align: center; 1080 | background-color:#F5F5F5; 1081 | border:1px solid #ddd; 1082 | } 1083 | 1084 | table.browsersupport td.bsProperty 1085 | { 1086 | font-family: courier new; 1087 | white-space: nowrap; 1088 | width:20%; 1089 | } 1090 | 1091 | table.browsersupport th { 1092 | padding: 0; 1093 | height: 36px; 1094 | vertical-align: middle; 1095 | text-align: center; 1096 | background-color:#F5F5F5; 1097 | border:1px solid #ddd; 1098 | } 1099 | 1100 | 1101 | 1102 | /* ----------------------------------- prenextnav ----------------------------------- */ 1103 | 1104 | div#tpn, div#bpn { 1105 | height:29px; 1106 | width:230px; 1107 | margin: 0; 1108 | padding: 0; 1109 | border: 0; 1110 | background: transparent; 1111 | } 1112 | 1113 | div#tpn ul.prenext, div#bpn ul.prenext { 1114 | height:29px; 1115 | width:230px; 1116 | background: transparent url(/ui2017/bg.png) 0 -580px no-repeat; 1117 | margin:0; 1118 | padding:0; 1119 | border:0; 1120 | position:relative; 1121 | } 1122 | 1123 | div#tpn ul.prenext li, div#bpn ul.prenext li { 1124 | margin:0; 1125 | padding:0; 1126 | list-style:none; 1127 | position:absolute; 1128 | top:0px; 1129 | overflow:hidden; 1130 | } 1131 | 1132 | ul.prenext li, ul.prenext a { 1133 | display:block; 1134 | height:29px; 1135 | } 1136 | 1137 | div#tpn ul.prenext a, div#bpn ul.prenext a { 1138 | text-indent: -9999px; 1139 | text-decoration: none; 1140 | } 1141 | 1142 | .pre {left:0; width:105px;} 1143 | .next {left:125px; width:105px;} 1144 | 1145 | .pre a:hover {background: transparent url(/ui2017/bg.png) 0px -629px no-repeat;} 1146 | .next a:hover {background: transparent url(/ui2017/bg.png) -125px -629px no-repeat;} 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | /* ----------------------------------- navsecond ----------------------------------- */ 1153 | div#course { 1154 | background:transparent url(/ui2017/bg.png) 0 -700px no-repeat; 1155 | padding:66px 0 10px 0; 1156 | } 1157 | 1158 | div#afterschool { 1159 | background:transparent url(/ui2017/afterschool.png) 0 0 no-repeat; 1160 | padding:45px 0 10px 0; 1161 | } 1162 | 1163 | div#selected { 1164 | background:transparent url(/ui2017/bg.png) -200px -700px no-repeat; 1165 | padding:45px 0 10px 0; 1166 | } 1167 | 1168 | 1169 | 1170 | 1171 | /* ----------------------------------- sidebar ----------------------------------- */ 1172 | div#tools { 1173 | background:transparent url(/ui2017/bg.png) -400px -700px no-repeat; 1174 | padding:79px 0 10px 22px; 1175 | margin:0; 1176 | } 1177 | 1178 | body#homesecond div#tools { 1179 | background:transparent url(/ui2017/bg.png) -400px -700px no-repeat; 1180 | padding:66px 0 10px 0; 1181 | margin:0; 1182 | } 1183 | 1184 | div#books { 1185 | background:transparent url(/ui/bg.gif) -450px -326px no-repeat; 1186 | padding:45px 0 0 15px; 1187 | margin:0; 1188 | } 1189 | 1190 | div#ad { 1191 | background:transparent url(/ui2017/bg.png) -600px -700px no-repeat; 1192 | padding:66px 0 10px 10px; 1193 | margin:0; 1194 | } 1195 | 1196 | div#sidebar div#ad:first-child { 1197 | background:transparent url(/ui2017/bg.png) -800px -700px no-repeat; 1198 | padding:66px 0 10px 10px; 1199 | margin:0; 1200 | } 1201 | 1202 | 1203 | div#sidebar div#ad h2 { 1204 | color:#000000; 1205 | margin:0 0 25px 25px; 1206 | } 1207 | 1208 | div#ad span { 1209 | margin:0 0 15px 0; 1210 | } 1211 | 1212 | 1213 | /* ----------------------------------- sidebar banner ----------------------------------- */ 1214 | 1215 | div#tools h5 { 1216 | margin: 0 0 12px 0; 1217 | padding: 0; 1218 | overflow:hidden; 1219 | } 1220 | 1221 | div#tools h5#tools_reference, div#tools h5#tools_example, div#tools h5#tools_quiz, div#tools h5#tools_search { 1222 | text-indent: -9999px; 1223 | width: 136px; 1224 | height: 64px; 1225 | } 1226 | 1227 | div#tools h5#tools_reference a, div#tools h5#tools_example a, div#tools h5#tools_quiz a, div#tools h5#tools_search a { 1228 | display: block; 1229 | margin: 0; 1230 | padding: 0; 1231 | width: 100%; 1232 | height: 100%; 1233 | text-decoration: none; 1234 | } 1235 | 1236 | div#tools h5#tools_reference a { 1237 | background: transparent url(/ui2017/bg.png) 0 -400px no-repeat; 1238 | } 1239 | 1240 | div#tools h5#tools_reference a:hover { 1241 | background: transparent url(/ui2017/bg.png) 0 -464px no-repeat; 1242 | } 1243 | 1244 | div#tools h5#tools_example a { 1245 | background: transparent url(/ui2017/bg.png) -150px -400px no-repeat; 1246 | } 1247 | 1248 | div#tools h5#tools_example a:hover { 1249 | background: transparent url(/ui2017/bg.png) -150px -464px no-repeat; 1250 | } 1251 | 1252 | div#tools h5#tools_quiz a { 1253 | background: transparent url(/ui2017/bg.png) -300px -400px no-repeat; 1254 | } 1255 | 1256 | div#tools h5#tools_quiz a:hover { 1257 | background: transparent url(/ui2017/bg.png) -300px -464px no-repeat; 1258 | } 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | 1265 | div#maincontent p.tiy{ 1266 | border:none; 1267 | display:inline-block; 1268 | outline:0; 1269 | padding:8px 18px; 1270 | margin-top:15px; 1271 | margin-bottom:10px; 1272 | vertical-align:middle; 1273 | overflow:hidden; 1274 | text-decoration:none; 1275 | color:#fff; 1276 | background-color:#e9686b; 1277 | text-align:center; 1278 | transition:.2s ease-out; 1279 | cursor:pointer; 1280 | white-space:nowrap; 1281 | box-shadow:0px 2px 6px rgba(0,0,0,0.12), 0px 1px 2px rgba(0,0,0,0.24); 1282 | font-family:'微软雅黑'; 1283 | border-radius:2px; 1284 | } 1285 | 1286 | div#maincontent p.tiy:last-child{ 1287 | margin-bottom:0px; 1288 | } 1289 | 1290 | div#maincontent p.tiy a { 1291 | border:0px; 1292 | } 1293 | 1294 | div#maincontent p.tiy a:link, div#maincontent p.tiy a:visited { 1295 | color:#fff; 1296 | text-decoration:none; 1297 | } 1298 | 1299 | div#maincontent p.tiy:hover{ 1300 | background-color:#ba3537; 1301 | color:#fff; 1302 | text-decoration:none; 1303 | } 1304 | 1305 | div#maincontent p.tiy a:active { 1306 | color:#fff; 1307 | text-decoration:none; 1308 | } 1309 | 1310 | div#navsecond h2, div#sidebar h2 { 1311 | font-size: 14px; 1312 | margin:0; 1313 | padding:10px 0 5px 10px; 1314 | color:#000; 1315 | display:block; 1316 | border-bottom:0px solid #ddd; 1317 | font-family:'微软雅黑'; 1318 | } 1319 | 1320 | div#navsecond h2#link_about, div#navsecond h2#link_help { 1321 | font-size: 14px; 1322 | margin:0; 1323 | margin-left:10px; 1324 | padding:0; 1325 | color:#000; 1326 | display:block; 1327 | } 1328 | 1329 | div#navsecond h2#link_about { 1330 | margin-top:20px; 1331 | margin-bottom:15px; 1332 | } 1333 | 1334 | div#navsecond h2#link_help { 1335 | margin-bottom:20px; 1336 | } 1337 | 1338 | div#navsecond h2#link_about a, div#navsecond h2#link_help a { 1339 | display:inline; 1340 | padding:0; 1341 | font-size:14px; 1342 | border-bottom:0px solid #ddd; 1343 | text-decoration:none; 1344 | color:#0479A7; 1345 | } 1346 | 1347 | div#navsecond h2#link_about a:hover, div#navsecond h2#link_help a:hover { 1348 | border-bottom:1px solid #0479A7; 1349 | color:#0479A7; 1350 | background-color:transparent; 1351 | } 1352 | 1353 | div#navsecond ul, div#navsecond li, div#sidebar ul, div#sidebar li { 1354 | margin: 0; 1355 | padding: 0; 1356 | font-family:'微软雅黑'; 1357 | } 1358 | 1359 | 1360 | div#navsecond li, div#sidebar li { 1361 | list-style: none; 1362 | } 1363 | 1364 | div#navsecond a, div#sidebar a { 1365 | display:block; 1366 | padding:5px 0 5px 15px; 1367 | font-size:12px; 1368 | border-bottom:0px solid #ddd; 1369 | text-decoration:none; 1370 | } 1371 | 1372 | div#navsecond ul a.active { 1373 | background : #f5f5f5; 1374 | color:#990000; 1375 | } 1376 | 1377 | 1378 | div#navsecond a:link, div#navsecond a:visited { 1379 | text-decoration : none; 1380 | color:#000000; 1381 | background : transparent; 1382 | } 1383 | 1384 | div#navsecond a:hover { 1385 | text-decoration : none; 1386 | color : #fff; 1387 | background : #aaa; 1388 | } 1389 | 1390 | div#sidebar a:hover { 1391 | text-decoration : none; 1392 | color : #fff; 1393 | background : #BD2D30; 1394 | } 1395 | 1396 | div#navsecond a:active { 1397 | text-decoration : none; 1398 | color : #fff; 1399 | background : #BD2D30; 1400 | } 1401 | 1402 | div#navsecond li.currentLink a:link, div#navsecond li.currentLink a:visited { 1403 | text-decoration : none; 1404 | color:#ffffff; 1405 | background-color: #BD2D30; 1406 | } -------------------------------------------------------------------------------- /nginx/html/imgs/trojan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EXP-Tools/trojan-docker/c9fa1a934d6d0b195242e2a34054316c553510d4/nginx/html/imgs/trojan.png -------------------------------------------------------------------------------- /nginx/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | trojan-docker 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |
ENTRYDETAILS
REPOtrojan-docker
MAINTAINEREXP
ENVIRONMENTLinux amd64
STEP 01python3 -m pip install certbot --default-timeout=600 -i https://pypi.tuna.tsinghua.edu.cn/simple
STEP 02/usr/local/bin/certbot certonly --standalone -d demo_domain.com -d www.demo_domain.com
STEP 03git clone https://github.com/lyy289065406/trojan-docker /usr/local/trojan-docker
STEP 04cd /usr/local/trojan-docker
STEP 05password=demo_password domain=demo_domain.com docker-compose build
STEP 06./renew_cert.sh
STEP 07nginx/html 下的内容替换为你的站点内容
STEP 08docker-compose up -d
STEP 09docker-compose down
STEP 10crontab -e
STEP 110 0 1 */2 0 /bin/sh /usr/local/trojan-docker/renew_cert.sh
79 | 80 |
81 | 82 | 83 | 84 |
85 | 86 | -------------------------------------------------------------------------------- /trojan/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | ARG password="demo_password" 3 | 4 | RUN yum update -y && \ 5 | yum install -y epel-release gnutls-bin gnutls-doc 6 | RUN mkdir -p /usr/local/bin && \ 7 | mkdir -p /usr/local/etc/trojan/cert/ 8 | 9 | ADD ./script/trojan /usr/local/bin/trojan 10 | ADD ./etc/config.json /usr/local/etc/trojan/config.json 11 | RUN sed -i "s/YOUR_PASSWORD/${password}/g" /usr/local/etc/trojan/config.json 12 | 13 | RUN echo "alias ll='ls -alF'" >> /root/.bashrc 14 | EXPOSE 443 15 | WORKDIR /usr/local/etc/trojan/ 16 | CMD [ "/usr/local/bin/trojan", "/usr/local/etc/trojan/config.json" ] 17 | -------------------------------------------------------------------------------- /trojan/etc/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "run_type": "server", 3 | "local_addr": "0.0.0.0", 4 | "local_port": 443, 5 | "remote_addr": "172.168.22.2", 6 | "remote_port": 80, 7 | "password": [ 8 | "YOUR_PASSWORD" 9 | ], 10 | "log_level": 1, 11 | "ssl": { 12 | "cert": "/usr/local/etc/trojan/cert/fullchain.pem", 13 | "key": "/usr/local/etc/trojan/cert/privkey.pem", 14 | "key_password": "", 15 | "cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384", 16 | "cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384", 17 | "prefer_server_cipher": true, 18 | "alpn": [ 19 | "http/1.1", "h2" 20 | ], 21 | "alpn_port_override": { 22 | "h2": 81 23 | }, 24 | "reuse_session": true, 25 | "session_ticket": false, 26 | "session_timeout": 600, 27 | "plain_http_response": "", 28 | "curves": "", 29 | "dhparam": "" 30 | }, 31 | "tcp": { 32 | "prefer_ipv4": false, 33 | "no_delay": true, 34 | "keep_alive": true, 35 | "reuse_port": false, 36 | "fast_open": false, 37 | "fast_open_qlen": 20 38 | }, 39 | "mysql": { 40 | "enabled": false, 41 | "server_addr": "127.0.0.1", 42 | "server_port": 3306, 43 | "database": "trojan", 44 | "username": "trojan", 45 | "password": "", 46 | "cafile": "" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /trojan/script/quick_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | bash -c "$(curl -fsSL https://raw.githubusercontent.com/trojan-gfw/trojan-quickstart/master/trojan-quickstart.sh)" 4 | -------------------------------------------------------------------------------- /trojan/script/trojan: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EXP-Tools/trojan-docker/c9fa1a934d6d0b195242e2a34054316c553510d4/trojan/script/trojan -------------------------------------------------------------------------------- /trojan/script/trojan.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=trojan 3 | Documentation=https://trojan-gfw.github.io/trojan/config https://trojan-gfw.github.io/trojan/ 4 | After=network.target network-online.target nss-lookup.target mysql.service mariadb.service mysqld.service 5 | 6 | [Service] 7 | Type=simple 8 | StandardError=journal 9 | ExecStart="/usr/local/bin/trojan" "/usr/local/etc/trojan/config.json" 10 | ExecReload=/bin/kill -HUP $MAINPID 11 | LimitNOFILE=51200 12 | Restart=on-failure 13 | RestartSec=1s 14 | 15 | [Install] 16 | WantedBy=multi-user.target --------------------------------------------------------------------------------