├── .gitattributes ├── .gitignore ├── LICENSE.md ├── README.md ├── bin ├── bin.js └── bin.js.map ├── index.html ├── src ├── base64.ts ├── github.ts └── main.tsx └── tsconfig.json /.gitattributes: -------------------------------------------------------------------------------- 1 | /bin/* linguist-vendored binary 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | bin/tmp.* 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | I like the concept of giving back, so I settled on the AGPL as the 2 | default license for all my personal projects. 3 | 4 | This isn't set in stone, so feel free to write me at 5 | `phireskyde+git@gmail.com` if you need something else. 6 | 7 | --- 8 | 9 | ### GNU AFFERO GENERAL PUBLIC LICENSE 10 | 11 | Version 3, 19 November 2007 12 | 13 | Copyright © 2007 Free Software Foundation, Inc. 14 | <> 15 | 16 | Everyone is permitted to copy and distribute verbatim copies of this 17 | license document, but changing it is not allowed. 18 | 19 | ### Preamble 20 | 21 | The GNU Affero General Public License is a free, copyleft license for 22 | software and other kinds of works, specifically designed to ensure 23 | cooperation with the community in the case of network server software. 24 | 25 | The licenses for most software and other practical works are designed to 26 | take away your freedom to share and change the works. By contrast, our 27 | General Public Licenses are intended to guarantee your freedom to share 28 | and change all versions of a program--to make sure it remains free 29 | software for all its users. 30 | 31 | When we speak of free software, we are referring to freedom, not price. 32 | Our General Public Licenses are designed to make sure that you have the 33 | freedom to distribute copies of free software (and charge for them if 34 | you wish), that you receive source code or can get it if you want it, 35 | that you can change the software or use pieces of it in new free 36 | programs, and that you know you can do these things. 37 | 38 | Developers that use our General Public Licenses protect your rights with 39 | two steps: (1) assert copyright on the software, and (2) offer you this 40 | License which gives you legal permission to copy, distribute and/or 41 | modify the software. 42 | 43 | A secondary benefit of defending all users' freedom is that improvements 44 | made in alternate versions of the program, if they receive widespread 45 | use, become available for other developers to incorporate. Many 46 | developers of free software are heartened and encouraged by the 47 | resulting cooperation. However, in the case of software used on network 48 | servers, this result may fail to come about. The GNU General Public 49 | License permits making a modified version and letting the public access 50 | it on a server without ever releasing its source code to the public. 51 | 52 | The GNU Affero General Public License is designed specifically to ensure 53 | that, in such cases, the modified source code becomes available to the 54 | community. It requires the operator of a network server to provide the 55 | source code of the modified version running there to the users of that 56 | server. Therefore, public use of a modified version, on a publicly 57 | accessible server, gives the public access to the source code of the 58 | modified version. 59 | 60 | An older license, called the Affero General Public License and published 61 | by Affero, was designed to accomplish similar goals. This is a different 62 | license, not a version of the Affero GPL, but Affero has released a new 63 | version of the Affero GPL which permits relicensing under this license. 64 | 65 | The precise terms and conditions for copying, distribution and 66 | modification follow. 67 | 68 | ### TERMS AND CONDITIONS 69 | 70 | #### 0. Definitions. 71 | 72 | "This License" refers to version 3 of the GNU Affero General Public 73 | License. 74 | 75 | "Copyright" also means copyright-like laws that apply to other kinds of 76 | works, such as semiconductor masks. 77 | 78 | "The Program" refers to any copyrightable work licensed under this 79 | License. Each licensee is addressed as "you". "Licensees" and 80 | "recipients" may be individuals or organizations. 81 | 82 | To "modify" a work means to copy from or adapt all or part of the work 83 | in a fashion requiring copyright permission, other than the making of an 84 | exact copy. The resulting work is called a "modified version" of the 85 | earlier work or a work "based on" the earlier work. 86 | 87 | A "covered work" means either the unmodified Program or a work based on 88 | the Program. 89 | 90 | To "propagate" a work means to do anything with it that, without 91 | permission, would make you directly or secondarily liable for 92 | infringement under applicable copyright law, except executing it on a 93 | computer or modifying a private copy. Propagation includes copying, 94 | distribution (with or without modification), making available to the 95 | public, and in some countries other activities as well. 96 | 97 | To "convey" a work means any kind of propagation that enables other 98 | parties to make or receive copies. Mere interaction with a user through 99 | a computer network, with no transfer of a copy, is not conveying. 100 | 101 | An interactive user interface displays "Appropriate Legal Notices" to 102 | the extent that it includes a convenient and prominently visible feature 103 | that (1) displays an appropriate copyright notice, and (2) tells the 104 | user that there is no warranty for the work (except to the extent that 105 | warranties are provided), that licensees may convey the work under this 106 | License, and how to view a copy of this License. If the interface 107 | presents a list of user commands or options, such as a menu, a prominent 108 | item in the list meets this criterion. 109 | 110 | #### 1. Source Code. 111 | 112 | The "source code" for a work means the preferred form of the work for 113 | making modifications to it. "Object code" means any non-source form of a 114 | work. 115 | 116 | A "Standard Interface" means an interface that either is an official 117 | standard defined by a recognized standards body, or, in the case of 118 | interfaces specified for a particular programming language, one that is 119 | widely used among developers working in that language. 120 | 121 | The "System Libraries" of an executable work include anything, other 122 | than the work as a whole, that (a) is included in the normal form of 123 | packaging a Major Component, but which is not part of that Major 124 | Component, and (b) serves only to enable use of the work with that Major 125 | Component, or to implement a Standard Interface for which an 126 | implementation is available to the public in source code form. A "Major 127 | Component", in this context, means a major essential component (kernel, 128 | window system, and so on) of the specific operating system (if any) on 129 | which the executable work runs, or a compiler used to produce the work, 130 | or an object code interpreter used to run it. 131 | 132 | The "Corresponding Source" for a work in object code form means all the 133 | source code needed to generate, install, and (for an executable work) 134 | run the object code and to modify the work, including scripts to control 135 | those activities. However, it does not include the work's System 136 | Libraries, or general-purpose tools or generally available free programs 137 | which are used unmodified in performing those activities but which are 138 | not part of the work. For example, Corresponding Source includes 139 | interface definition files associated with source files for the work, 140 | and the source code for shared libraries and dynamically linked 141 | subprograms that the work is specifically designed to require, such as 142 | by intimate data communication or control flow between those subprograms 143 | and other parts of the work. 144 | 145 | The Corresponding Source need not include anything that users can 146 | regenerate automatically from other parts of the Corresponding Source. 147 | 148 | The Corresponding Source for a work in source code form is that same 149 | work. 150 | 151 | #### 2. Basic Permissions. 152 | 153 | All rights granted under this License are granted for the term of 154 | copyright on the Program, and are irrevocable provided the stated 155 | conditions are met. This License explicitly affirms your unlimited 156 | permission to run the unmodified Program. The output from running a 157 | covered work is covered by this License only if the output, given its 158 | content, constitutes a covered work. This License acknowledges your 159 | rights of fair use or other equivalent, as provided by copyright law. 160 | 161 | You may make, run and propagate covered works that you do not convey, 162 | without conditions so long as your license otherwise remains in force. 163 | You may convey covered works to others for the sole purpose of having 164 | them make modifications exclusively for you, or provide you with 165 | facilities for running those works, provided that you comply with the 166 | terms of this License in conveying all material for which you do not 167 | control copyright. Those thus making or running the covered works for 168 | you must do so exclusively on your behalf, under your direction and 169 | control, on terms that prohibit them from making any copies of your 170 | copyrighted material outside their relationship with you. 171 | 172 | Conveying under any other circumstances is permitted solely under the 173 | conditions stated below. Sublicensing is not allowed; section 10 makes 174 | it unnecessary. 175 | 176 | #### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 177 | 178 | No covered work shall be deemed part of an effective technological 179 | measure under any applicable law fulfilling obligations under article 11 180 | of the WIPO copyright treaty adopted on 20 December 1996, or similar 181 | laws prohibiting or restricting circumvention of such measures. 182 | 183 | When you convey a covered work, you waive any legal power to forbid 184 | circumvention of technological measures to the extent such circumvention 185 | is effected by exercising rights under this License with respect to the 186 | covered work, and you disclaim any intention to limit operation or 187 | modification of the work as a means of enforcing, against the work's 188 | users, your or third parties' legal rights to forbid circumvention of 189 | technological measures. 190 | 191 | #### 4. Conveying Verbatim Copies. 192 | 193 | You may convey verbatim copies of the Program's source code as you 194 | receive it, in any medium, provided that you conspicuously and 195 | appropriately publish on each copy an appropriate copyright notice; keep 196 | intact all notices stating that this License and any non-permissive 197 | terms added in accord with section 7 apply to the code; keep intact all 198 | notices of the absence of any warranty; and give all recipients a copy 199 | of this License along with the Program. 200 | 201 | You may charge any price or no price for each copy that you convey, and 202 | you may offer support or warranty protection for a fee. 203 | 204 | #### 5. Conveying Modified Source Versions. 205 | 206 | You may convey a work based on the Program, or the modifications to 207 | produce it from the Program, in the form of source code under the terms 208 | of section 4, provided that you also meet all of these conditions: 209 | 210 | - a\) The work must carry prominent notices stating that you modified it, 211 | and giving a relevant date. 212 | - b\) The work must carry prominent notices stating that it is released 213 | under this License and any conditions added under section 7. This 214 | requirement modifies the requirement in section 4 to "keep intact 215 | all notices". 216 | - c\) You must license the entire work, as a whole, under this License to 217 | anyone who comes into possession of a copy. This License will therefore 218 | apply, along with any applicable section 7 additional terms, to the 219 | whole of the work, and all its parts, regardless of how they 220 | are packaged. This License gives no permission to license the work in 221 | any other way, but it does not invalidate such permission if you have 222 | separately received it. 223 | - d\) If the work has interactive user interfaces, each must display 224 | Appropriate Legal Notices; however, if the Program has interactive 225 | interfaces that do not display Appropriate Legal Notices, your work need 226 | not make them do so. 227 | 228 | A compilation of a covered work with other separate and independent 229 | works, which are not by their nature extensions of the covered work, and 230 | which are not combined with it such as to form a larger program, in or 231 | on a volume of a storage or distribution medium, is called an 232 | "aggregate" if the compilation and its resulting copyright are not used 233 | to limit the access or legal rights of the compilation's users beyond 234 | what the individual works permit. Inclusion of a covered work in an 235 | aggregate does not cause this License to apply to the other parts of the 236 | aggregate. 237 | 238 | #### 6. Conveying Non-Source Forms. 239 | 240 | You may convey a covered work in object code form under the terms of 241 | sections 4 and 5, provided that you also convey the machine-readable 242 | Corresponding Source under the terms of this License, in one of these 243 | ways: 244 | 245 | - a\) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by the 247 | Corresponding Source fixed on a durable physical medium customarily used 248 | for software interchange. 249 | - b\) Convey the object code in, or embodied in, a physical product 250 | (including a physical distribution medium), accompanied by a written 251 | offer, valid for at least three years and valid for as long as you offer 252 | spare parts or customer support for that product model, to give anyone 253 | who possesses the object code either (1) a copy of the Corresponding 254 | Source for all the software in the product that is covered by this 255 | License, on a durable physical medium customarily used for software 256 | interchange, for a price no more than your reasonable cost of physically 257 | performing this conveying of source, or (2) access to copy the 258 | Corresponding Source from a network server at no charge. 259 | - c\) Convey individual copies of the object code with a copy of the 260 | written offer to provide the Corresponding Source. This alternative is 261 | allowed only occasionally and noncommercially, and only if you received 262 | the object code with such an offer, in accord with subsection 6b. 263 | - d\) Convey the object code by offering access from a designated place 264 | (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to copy 268 | the object code is a network server, the Corresponding Source may be on 269 | a different server (operated by you or a third party) that supports 270 | equivalent copying facilities, provided you maintain clear directions 271 | next to the object code saying where to find the Corresponding Source. 272 | Regardless of what server hosts the Corresponding Source, you remain 273 | obligated to ensure that it is available for as long as needed to 274 | satisfy these requirements. 275 | - e\) Convey the object code using peer-to-peer transmission, provided you 276 | inform other peers where the object code and Corresponding Source of the 277 | work are being offered to the general public at no charge under 278 | subsection 6d. 279 | 280 | A separable portion of the object code, whose source code is excluded 281 | from the Corresponding Source as a System Library, need not be included 282 | in conveying the object code work. 283 | 284 | A "User Product" is either (1) a "consumer product", which means any 285 | tangible personal property which is normally used for personal, family, 286 | or household purposes, or (2) anything designed or sold for 287 | incorporation into a dwelling. In determining whether a product is a 288 | consumer product, doubtful cases shall be resolved in favor of coverage. 289 | For a particular product received by a particular user, "normally used" 290 | refers to a typical or common use of that class of product, regardless 291 | of the status of the particular user or of the way in which the 292 | particular user actually uses, or expects or is expected to use, the 293 | product. A product is a consumer product regardless of whether the 294 | product has substantial commercial, industrial or non-consumer uses, 295 | unless such uses represent the only significant mode of use of the 296 | product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product 301 | from a modified version of its Corresponding Source. The information 302 | must suffice to ensure that the continued functioning of the modified 303 | object code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied by 312 | the Installation Information. But this requirement does not apply if 313 | neither you nor any third party retains the ability to install modified 314 | object code on the User Product (for example, the work has been 315 | installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, in 326 | accord with this section must be in a format that is publicly documented 327 | (and with an implementation available to the public in source code 328 | form), and must require no special password or key for unpacking, 329 | reading or copying. 330 | 331 | #### 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by this 340 | License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option remove 343 | any additional permissions from that copy, or from any part of it. 344 | (Additional permissions may be written to require their own removal in 345 | certain cases when you modify the work.) You may place additional 346 | permissions on material, added by you to a covered work, for which you 347 | have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders 351 | of that material) supplement the terms of this License with terms: 352 | 353 | - a\) Disclaiming warranty or limiting liability differently from the terms 354 | of sections 15 and 16 of this License; or 355 | - b\) Requiring preservation of specified reasonable legal notices or 356 | author attributions in that material or in the Appropriate Legal Notices 357 | displayed by works containing it; or 358 | - c\) Prohibiting misrepresentation of the origin of that material, or 359 | requiring that modified versions of such material be marked in 360 | reasonable ways as different from the original version; or 361 | - d\) Limiting the use for publicity purposes of names of licensors or 362 | authors of the material; or 363 | - e\) Declining to grant rights under trademark law for use of some trade 364 | names, trademarks, or service marks; or 365 | - f\) Requiring indemnification of licensors and authors of that material 366 | by anyone who conveys the material (or modified versions of it) with 367 | contractual assumptions of liability to the recipient, for any liability 368 | that these contractual assumptions directly impose on those licensors 369 | and authors. 370 | 371 | All other non-permissive additional terms are considered "further 372 | restrictions" within the meaning of section 10. If the Program as you 373 | received it, or any part of it, contains a notice stating that it is 374 | governed by this License along with a term that is a further 375 | restriction, you may remove that term. If a license document contains a 376 | further restriction but permits relicensing or conveying under this 377 | License, you may add to a covered work material governed by the terms of 378 | that license document, provided that the further restriction does not 379 | survive such relicensing or conveying. 380 | 381 | If you add terms to a covered work in accord with this section, you must 382 | place, in the relevant source files, a statement of the additional terms 383 | that apply to those files, or a notice indicating where to find the 384 | applicable terms. 385 | 386 | Additional terms, permissive or non-permissive, may be stated in the 387 | form of a separately written license, or stated as exceptions; the above 388 | requirements apply either way. 389 | 390 | #### 8. Termination. 391 | 392 | You may not propagate or modify a covered work except as expressly 393 | provided under this License. Any attempt otherwise to propagate or 394 | modify it is void, and will automatically terminate your rights under 395 | this License (including any patent licenses granted under the third 396 | paragraph of section 11). 397 | 398 | However, if you cease all violation of this License, then your license 399 | from a particular copyright holder is reinstated (a) provisionally, 400 | unless and until the copyright holder explicitly and finally terminates 401 | your license, and (b) permanently, if the copyright holder fails to 402 | notify you of the violation by some reasonable means prior to 60 days 403 | after the cessation. 404 | 405 | Moreover, your license from a particular copyright holder is reinstated 406 | permanently if the copyright holder notifies you of the violation by 407 | some reasonable means, this is the first time you have received notice 408 | of violation of this License (for any work) from that copyright holder, 409 | and you cure the violation prior to 30 days after your receipt of the 410 | notice. 411 | 412 | Termination of your rights under this section does not terminate the 413 | licenses of parties who have received copies or rights from you under 414 | this License. If your rights have been terminated and not permanently 415 | reinstated, you do not qualify to receive new licenses for the same 416 | material under section 10. 417 | 418 | #### 9. Acceptance Not Required for Having Copies. 419 | 420 | You are not required to accept this License in order to receive or run a 421 | copy of the Program. Ancillary propagation of a covered work occurring 422 | solely as a consequence of using peer-to-peer transmission to receive a 423 | copy likewise does not require acceptance. However, nothing other than 424 | this License grants you permission to propagate or modify any covered 425 | work. These actions infringe copyright if you do not accept this 426 | License. Therefore, by modifying or propagating a covered work, you 427 | indicate your acceptance of this License to do so. 428 | 429 | #### 10. Automatic Licensing of Downstream Recipients. 430 | 431 | Each time you convey a covered work, the recipient automatically 432 | receives a license from the original licensors, to run, modify and 433 | propagate that work, subject to this License. You are not responsible 434 | for enforcing compliance by third parties with this License. 435 | 436 | An "entity transaction" is a transaction transferring control of an 437 | organization, or substantially all assets of one, or subdividing an 438 | organization, or merging organizations. If propagation of a covered work 439 | results from an entity transaction, each party to that transaction who 440 | receives a copy of the work also receives whatever licenses to the work 441 | the party's predecessor in interest had or could give under the previous 442 | paragraph, plus a right to possession of the Corresponding Source of the 443 | work from the predecessor in interest, if the predecessor has it or can 444 | get it with reasonable efforts. 445 | 446 | You may not impose any further restrictions on the exercise of the 447 | rights granted or affirmed under this License. For example, you may not 448 | impose a license fee, royalty, or other charge for exercise of rights 449 | granted under this License, and you may not initiate litigation 450 | (including a cross-claim or counterclaim in a lawsuit) alleging that any 451 | patent claim is infringed by making, using, selling, offering for sale, 452 | or importing the Program or any portion of it. 453 | 454 | #### 11. Patents. 455 | 456 | A "contributor" is a copyright holder who authorizes use under this 457 | License of the Program or a work on which the Program is based. The work 458 | thus licensed is called the contributor's "contributor version". 459 | 460 | A contributor's "essential patent claims" are all patent claims owned or 461 | controlled by the contributor, whether already acquired or hereafter 462 | acquired, that would be infringed by some manner, permitted by this 463 | License, of making, using, or selling its contributor version, but do 464 | not include claims that would be infringed only as a consequence of 465 | further modification of the contributor version. For purposes of this 466 | definition, "control" includes the right to grant patent sublicenses in 467 | a manner consistent with the requirements of this License. 468 | 469 | Each contributor grants you a non-exclusive, worldwide, royalty-free 470 | patent license under the contributor's essential patent claims, to make, 471 | use, sell, offer for sale, import and otherwise run, modify and 472 | propagate the contents of its contributor version. 473 | 474 | In the following three paragraphs, a "patent license" is any express 475 | agreement or commitment, however denominated, not to enforce a patent 476 | (such as an express permission to practice a patent or covenant not to 477 | sue for patent infringement). To "grant" such a patent license to a 478 | party means to make such an agreement or commitment not to enforce a 479 | patent against the party. 480 | 481 | If you convey a covered work, knowingly relying on a patent license, and 482 | the Corresponding Source of the work is not available for anyone to 483 | copy, free of charge and under the terms of this License, through a 484 | publicly available network server or other readily accessible means, 485 | then you must either (1) cause the Corresponding Source to be so 486 | available, or (2) arrange to deprive yourself of the benefit of the 487 | patent license for this particular work, or (3) arrange, in a manner 488 | consistent with the requirements of this License, to extend the patent 489 | license to downstream recipients. "Knowingly relying" means you have 490 | actual knowledge that, but for the patent license, your conveying the 491 | covered work in a country, or your recipient's use of the covered work 492 | in a country, would infringe one or more identifiable patents in that 493 | country that you have reason to believe are valid. 494 | 495 | If, pursuant to or in connection with a single transaction or 496 | arrangement, you convey, or propagate by procuring conveyance of, a 497 | covered work, and grant a patent license to some of the parties 498 | receiving the covered work authorizing them to use, propagate, modify or 499 | convey a specific copy of the covered work, then the patent license you 500 | grant is automatically extended to all recipients of the covered work 501 | and works based on it. 502 | 503 | A patent license is "discriminatory" if it does not include within the 504 | scope of its coverage, prohibits the exercise of, or is conditioned on 505 | the non-exercise of one or more of the rights that are specifically 506 | granted under this License. You may not convey a covered work if you are 507 | a party to an arrangement with a third party that is in the business of 508 | distributing software, under which you make payment to the third party 509 | based on the extent of your activity of conveying the work, and under 510 | which the third party grants, to any of the parties who would receive 511 | the covered work from you, a discriminatory patent license (a) in 512 | connection with copies of the covered work conveyed by you (or copies 513 | made from those copies), or (b) primarily for and in connection with 514 | specific products or compilations that contain the covered work, unless 515 | you entered into that arrangement, or that patent license was granted, 516 | prior to 28 March 2007. 517 | 518 | Nothing in this License shall be construed as excluding or limiting any 519 | implied license or other defenses to infringement that may otherwise be 520 | available to you under applicable patent law. 521 | 522 | #### 12. No Surrender of Others' Freedom. 523 | 524 | If conditions are imposed on you (whether by court order, agreement or 525 | otherwise) that contradict the conditions of this License, they do not 526 | excuse you from the conditions of this License. If you cannot convey a 527 | covered work so as to satisfy simultaneously your obligations under this 528 | License and any other pertinent obligations, then as a consequence you 529 | may not convey it at all. For example, if you agree to terms that 530 | obligate you to collect a royalty for further conveying from those to 531 | whom you convey the Program, the only way you could satisfy both those 532 | terms and this License would be to refrain entirely from conveying the 533 | Program. 534 | 535 | #### 13. Remote Network Interaction; Use with the GNU General Public License. 536 | 537 | Notwithstanding any other provision of this License, if you modify the 538 | Program, your modified version must prominently offer all users 539 | interacting with it remotely through a computer network (if your version 540 | supports such interaction) an opportunity to receive the Corresponding 541 | Source of your version by providing access to the Corresponding Source 542 | from a network server at no charge, through some standard or customary 543 | means of facilitating copying of software. This Corresponding Source 544 | shall include the Corresponding Source for any work covered by version 3 545 | of the GNU General Public License that is incorporated pursuant to the 546 | following paragraph. 547 | 548 | Notwithstanding any other provision of this License, you have permission 549 | to link or combine any covered work with a work licensed under version 3 550 | of the GNU General Public License into a single combined work, and to 551 | convey the resulting work. The terms of this License will continue to 552 | apply to the part which is the covered work, but the work with which it 553 | is combined will remain governed by version 3 of the GNU General Public 554 | License. 555 | 556 | #### 14. Revised Versions of this License. 557 | 558 | The Free Software Foundation may publish revised and/or new versions of 559 | the GNU Affero General Public License from time to time. Such new 560 | versions will be similar in spirit to the present version, but may 561 | differ in detail to address new problems or concerns. 562 | 563 | Each version is given a distinguishing version number. If the Program 564 | specifies that a certain numbered version of the GNU Affero General 565 | Public License "or any later version" applies to it, you have the option 566 | of following the terms and conditions either of that numbered version or 567 | of any later version published by the Free Software Foundation. If the 568 | Program does not specify a version number of the GNU Affero General 569 | Public License, you may choose any version ever published by the Free 570 | Software Foundation. 571 | 572 | If the Program specifies that a proxy can decide which future versions 573 | of the GNU Affero General Public License can be used, that proxy's 574 | public statement of acceptance of a version permanently authorizes you 575 | to choose that version for the Program. 576 | 577 | Later license versions may give you additional or different permissions. 578 | However, no additional obligations are imposed on any author or 579 | copyright holder as a result of your choosing to follow a later version. 580 | 581 | #### 15. Disclaimer of Warranty. 582 | 583 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 584 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 585 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT 586 | WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT 587 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 588 | PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF 589 | THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME 590 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 591 | 592 | #### 16. Limitation of Liability. 593 | 594 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 595 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR 596 | CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 597 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES 598 | ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT 599 | NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES 600 | SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE 601 | WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN 602 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 603 | 604 | #### 17. Interpretation of Sections 15 and 16. 605 | 606 | If the disclaimer of warranty and limitation of liability provided above 607 | cannot be given local legal effect according to their terms, reviewing 608 | courts shall apply local law that most closely approximates an absolute 609 | waiver of all civil liability in connection with the Program, unless a 610 | warranty or assumption of liability accompanies a copy of the Program in 611 | return for a fee. 612 | 613 | END OF TERMS AND CONDITIONS 614 | 615 | ### How to Apply These Terms to Your New Programs 616 | 617 | If you develop a new program, and you want it to be of the greatest 618 | possible use to the public, the best way to achieve this is to make it 619 | free software which everyone can redistribute and change under these 620 | terms. 621 | 622 | To do so, attach the following notices to the program. It is safest to 623 | attach them to the start of each source file to most effectively state 624 | the exclusion of warranty; and each file should have at least the 625 | "copyright" line and a pointer to where the full notice is found. 626 | 627 | 628 | Copyright (C) 629 | 630 | This program is free software: you can redistribute it and/or modify 631 | it under the terms of the GNU Affero General Public License as 632 | published by the Free Software Foundation, either version 3 of the 633 | License, or (at your option) any later version. 634 | 635 | This program is distributed in the hope that it will be useful, 636 | but WITHOUT ANY WARRANTY; without even the implied warranty of 637 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 638 | GNU Affero General Public License for more details. 639 | 640 | You should have received a copy of the GNU Affero General Public License 641 | along with this program. If not, see . 642 | 643 | Also add information on how to contact you by electronic and paper mail. 644 | 645 | If your software can interact with users remotely through a computer 646 | network, you should also make sure that it provides a way for users to 647 | get its source. For example, if your program is a web application, its 648 | interface could display a "Source" link that leads users to an archive 649 | of the code. There are many ways you could offer source, and different 650 | solutions will be better for different programs; see section 13 for the 651 | specific requirements. 652 | 653 | You should also get your employer (if you work as a programmer) or 654 | school, if any, to sign a "copyright disclaimer" for the program, if 655 | necessary. For more information on this, and how to apply and follow the 656 | GNU AGPL, see <>. 657 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # encrypted-gist 2 | 3 | 4 | Store any type of file by uploading them to GitHub as encrypted text files. (Compatible only with Chrome and Firefox, see [Limitations](#limitations)) 5 | 6 | The code is fairly simple, 30 lines for the [GitHub API](src/github.ts), 200 lines for [everything else](src/main.tsx). There are no dependencies. 7 | 8 | **Update 2018-09: Sadly GitHub no longer allows the creation of gists without login. This means that uploading new files will no longer work** 9 | 10 | #### Hosted version: 11 | 12 | https://phiresky.github.io/encrypted-gist/ 13 | 14 | #### Sample image: 15 | 16 | https://phiresky.github.io/encrypted-gist/#1sEvMfJVEedVYQ!MxxLThUm9bwx5ECH6z0UlQ 17 | 18 | which is stored in this Gist: https://gist.github.com/anonymous/d6c12f31f25511e75561 19 | 20 | #### Sample audio file: 21 | 22 | https://phiresky.github.io/encrypted-gist/#hEYvbZypBIsr7w!ZpNA6hisoEF-9Cnk2uVmjw 23 | 24 | --- 25 | 26 | For a while, imgur was the perfect image hoster. No bullshit, simple interface, allows private uploads. 27 | But they have become a complete social network, even [covertly redirecting direct .jpg requests to their 28 | (ad- and meme-filled) gallery pages](http://minimaxir.com/2014/02/moved-temporarily/). 29 | 30 | I often send screenshots, so I need somewhere to put my images. I hate it when links stop working, so 31 | self-hosting isn't really a solution for me because I don't want to maintain a permanent server. 32 | 33 | So I had the *genius* idea to use github repositories or gists as a raw file storage, encrypting the 34 | files client-side so only the people I send the link to can view them. 35 | 36 | The terms of service of github don't disallow this (but I'm not sure if they like it, so don't use it for important or huge stuff). 37 | 38 | Starting with only image uploads, I expanded it to work for any file type. 39 | 40 | ## How it works 41 | 42 | ### Uploading 43 | 44 | 1. Show file dialog, load file into memory, prepend metadata as JSON. 45 | 3. Encrypt it using AES-GCM 128bit, which also ensures authentication. 46 | 4. Send base64-encoded file to [github gist api](https://developer.github.com/v3/gists/), creating an anonymous gist. 47 | 5. Create link based on gist id and encryption key. The key is put into the url hash so it is never sent to any server. 48 | 49 | ### Viewing 50 | 51 | 1. Get encryption key and location from url fragment 52 | 2. Download file from API 53 | 3. Decrypt file 54 | 3. View file according its metadata 55 | 56 | This tool also had support for uploading the files to github repositories, 57 | but I removed that because it was a hassle ([see here](https://github.com/phiresky/encrypted-gist/commit/5fdd0aa003d97bc2e5d8c548a9f7b4a714406a24)). 58 | 59 | ## Limitations 60 | 61 | * Mostly client side, so uses a fair amount of processing power and direct embedding of the images is not possible 62 | * Github API is fairly limited, so this wastes some data and is slow when images are > 750 kB. I also added an arbitrary limit of 5 MB, though the API supports more. 63 | * Github might block this if it's used a lot (though I'm not sure how that would be possible except for disabling the API) 64 | * Tested on Chrome and Firefox, that's probably it because this uses very new features 65 | ([crypto api](https://developer.mozilla.org/en-US/docs/Web/API/Crypto), 66 | [fetch api](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) and generators for async/await) 67 | 68 | ## Building 69 | 70 | "Binaries" are included. 71 | 72 | Written using Typescript/ES2016 with async/await. Get Typescript, run `npm install babel` and start the build watch with `./build.js` 73 | -------------------------------------------------------------------------------- /bin/bin.js: -------------------------------------------------------------------------------- 1 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 2 | return new (P || (P = Promise))(function (resolve, reject) { 3 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 4 | function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } 5 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } 6 | step((generator = generator.apply(thisArg, _arguments)).next()); 7 | }); 8 | }; 9 | var base64; 10 | (function (base64_1) { 11 | base64_1._chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 12 | base64_1._chars_url = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; 13 | base64_1.encode = function (arraybuffer, url, equals) { 14 | const chars = url ? base64_1._chars_url : base64_1._chars; 15 | var bytes = new Uint8Array(arraybuffer), len = bytes.length, base64 = ""; 16 | for (let i = 0; i < len; i += 3) { 17 | base64 += chars[bytes[i] >> 2]; 18 | base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; 19 | base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; 20 | base64 += chars[bytes[i + 2] & 63]; 21 | } 22 | if ((len % 3) === 2) { 23 | base64 = base64.substring(0, base64.length - 1) + (equals ? "=" : ""); 24 | } 25 | else if (len % 3 === 1) { 26 | base64 = base64.substring(0, base64.length - 2) + (equals ? "==" : ""); 27 | } 28 | return base64; 29 | }; 30 | base64_1.decode = function (base64, url) { 31 | const chars = url ? base64_1._chars_url : base64_1._chars; 32 | const len = base64.length; 33 | var bufferLength = len * 0.75, p = 0; 34 | if (base64[len - 1] === "=") { 35 | bufferLength--; 36 | if (base64[len - 2] === "=") { 37 | bufferLength--; 38 | } 39 | } 40 | const bytes = new Uint8Array(new ArrayBuffer(bufferLength)); 41 | for (let i = 0; i < len; i += 4) { 42 | const encoded1 = chars.indexOf(base64[i]); 43 | const encoded2 = chars.indexOf(base64[i + 1]); 44 | const encoded3 = chars.indexOf(base64[i + 2]); 45 | const encoded4 = chars.indexOf(base64[i + 3]); 46 | bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); 47 | bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); 48 | bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); 49 | } 50 | return bytes.buffer; 51 | }; 52 | })(base64 || (base64 = {})); 53 | class Github { 54 | constructor(apiUrl = `https://api.github.com/`) { 55 | this.apiUrl = apiUrl; 56 | } 57 | fetch(path, data) { 58 | return __awaiter(this, void 0, void 0, function* () { 59 | log("fetching " + (data && data.method || "") + " " + this.apiUrl + path); 60 | return yield fetch(this.apiUrl + path, data); 61 | }); 62 | } 63 | fetchJSON(path, data) { 64 | return __awaiter(this, void 0, void 0, function* () { 65 | return yield (yield this.fetch(path, data)).json(); 66 | }); 67 | } 68 | fetchRaw(path) { 69 | return __awaiter(this, void 0, void 0, function* () { 70 | const headers = new Headers(); 71 | headers.append("Accept", "application/vnd.github.v3.raw"); 72 | const r = yield this.fetch(path, { headers }); 73 | return yield r.arrayBuffer(); 74 | }); 75 | } 76 | postJSON(path, data, method = "POST") { 77 | return __awaiter(this, void 0, void 0, function* () { 78 | const headers = new Headers(); 79 | headers.append("Content-Type", "application/json;charset=UTF-8"); 80 | return yield this.fetchJSON(path, { method, headers, body: JSON.stringify(data) }); 81 | }); 82 | } 83 | createGist(description, files, is_public = true) { 84 | return __awaiter(this, void 0, void 0, function* () { 85 | return yield this.postJSON("gists", { description, public: is_public, files: files }, "POST"); 86 | }); 87 | } 88 | getGist(id) { 89 | return __awaiter(this, void 0, void 0, function* () { 90 | return yield this.fetchJSON("gists/" + id); 91 | }); 92 | } 93 | } 94 | let github = new Github(); 95 | function log(info) { 96 | console.log(info); 97 | const e = document.getElementById("log"); 98 | if (e) 99 | e.appendChild(React.createElement("span", null, 100 | info, 101 | React.createElement("br", null))); 102 | } 103 | function showLog() { 104 | document.getElementById("showlogbutton").style.display = 'none'; 105 | document.getElementById("showlog").style.display = ''; 106 | } 107 | var SimpleCrypto; 108 | (function (SimpleCrypto) { 109 | SimpleCrypto.encryptionAlgorithm = "AES-GCM"; 110 | function encrypt(data) { 111 | return __awaiter(this, void 0, void 0, function* () { 112 | log("Generating key and IV..."); 113 | const key = yield crypto.subtle.generateKey({ name: SimpleCrypto.encryptionAlgorithm, length: 128 }, true, ["encrypt"]); 114 | const iv = new Uint8Array(16); 115 | crypto.getRandomValues(iv); 116 | log("Encrypting..."); 117 | const encrypted = yield crypto.subtle.encrypt({ name: SimpleCrypto.encryptionAlgorithm, iv }, key, data); 118 | return { 119 | data: [iv, new Uint8Array(encrypted)], 120 | key: base64.encode(yield crypto.subtle.exportKey("raw", key), true, false), 121 | }; 122 | }); 123 | } 124 | SimpleCrypto.encrypt = encrypt; 125 | function decrypt(data, key_str) { 126 | return __awaiter(this, void 0, void 0, function* () { 127 | log("Decoding IV..."); 128 | const iv = data.subarray(0, 16); 129 | const encrypted_data = data.subarray(16); 130 | const key = new Uint8Array(base64.decode(key_str, true)); 131 | log("Decrypting..."); 132 | const imported_key = yield crypto.subtle.importKey("raw", key, SimpleCrypto.encryptionAlgorithm, false, ["decrypt"]); 133 | return yield crypto.subtle.decrypt({ name: SimpleCrypto.encryptionAlgorithm, iv }, imported_key, encrypted_data); 134 | }); 135 | } 136 | SimpleCrypto.decrypt = decrypt; 137 | })(SimpleCrypto || (SimpleCrypto = {})); 138 | var Upload; 139 | (function (Upload) { 140 | function uploadToGist(d) { 141 | return __awaiter(this, void 0, void 0, function* () { 142 | const f = Util.randomString(1, 16); 143 | if (d.byteLength >= 1000 * 3 / 4 * 1000) 144 | log("Data should be < 700 kB to avoid calling api twice"); 145 | if (d.byteLength >= 5e6) 146 | throw "Data must be < 5 MB"; // more should be possible 147 | return (yield github.createGist(Util.randomString(0, 10), { 148 | [f]: { content: base64.encode(d.buffer, true, false) } 149 | })).id; 150 | }); 151 | } 152 | function downloadFromGist(sha) { 153 | return __awaiter(this, void 0, void 0, function* () { 154 | const gist = yield github.getGist(sha); 155 | const file = gist.files[Object.keys(gist.files)[0]]; 156 | if (file.truncated) { 157 | return base64.decode(yield (yield fetch(file.raw_url)).text(), true); 158 | } 159 | else 160 | return base64.decode(file.content, true); 161 | }); 162 | } 163 | function uploadEncrypted(meta, raw_data) { 164 | return __awaiter(this, void 0, void 0, function* () { 165 | log("Uploading..."); 166 | const nullByte = new Uint8Array(1); 167 | const inputData = yield Util.joinBuffers(new TextEncoder().encode(JSON.stringify(meta)), nullByte, raw_data); 168 | const { data, key } = yield SimpleCrypto.encrypt(inputData); 169 | // TODO: don't copy all data twice (via Util.joinBuffers) 170 | return { data, key, sha: yield uploadToGist(yield Util.joinBuffers(...data)) }; 171 | }); 172 | } 173 | Upload.uploadEncrypted = uploadEncrypted; 174 | function downloadEncrypted(sha, key) { 175 | return __awaiter(this, void 0, void 0, function* () { 176 | sha = Util.arrToHex(new Uint8Array(base64.decode(sha, true))); 177 | const buf = yield SimpleCrypto.decrypt(new Uint8Array(yield downloadFromGist(sha)), key); 178 | const sep = new Uint8Array(buf).indexOf(0); 179 | const meta = new TextDecoder().decode(new Uint8Array(buf, 0, sep)); 180 | log("Decoded metadata: " + meta); 181 | return { 182 | meta: JSON.parse(meta), 183 | data: new Uint8Array(buf, sep + 1) 184 | }; 185 | }); 186 | } 187 | Upload.downloadEncrypted = downloadEncrypted; 188 | })(Upload || (Upload = {})); 189 | var Util; 190 | (function (Util) { 191 | function readFile(f) { 192 | return __awaiter(this, void 0, void 0, function* () { 193 | return new Promise(resolve => { 194 | const r = new FileReader(); 195 | r.onload = _ => resolve(r.result); 196 | r.readAsArrayBuffer(f); 197 | }); 198 | }); 199 | } 200 | Util.readFile = readFile; 201 | function randomString(minlength, maxlength = minlength) { 202 | const length = (Math.random() * (maxlength + 1 - minlength) + minlength) | 0; 203 | return base64.encode(crypto.getRandomValues(new Uint8Array((length * 3 / 4 + 2) | 0)).buffer, true, false).substr(0, length); 204 | } 205 | Util.randomString = randomString; 206 | function hexToArr(hex) { 207 | const out = new Uint8Array(hex.length / 2); 208 | for (let i = 0; i < hex.length; i += 2) { 209 | out[i / 2] = parseInt(hex.substr(i, 2), 16); 210 | } 211 | return out; 212 | } 213 | Util.hexToArr = hexToArr; 214 | function arrToHex(arr) { 215 | let out = ""; 216 | for (let byte of arr) 217 | out += (byte < 16 ? "0" + byte.toString(16) : byte.toString(16)); 218 | return out; 219 | } 220 | Util.arrToHex = arrToHex; 221 | function joinBuffers(...arrs) { 222 | return __awaiter(this, void 0, void 0, function* () { 223 | return new Uint8Array(yield Util.readFile(new Blob(arrs))); 224 | }); 225 | } 226 | Util.joinBuffers = joinBuffers; 227 | function createBlobUrl(data) { 228 | log(`Displaying ${data.byteLength / 1000} kByte file`); 229 | return URL.createObjectURL(new Blob([data])); 230 | } 231 | Util.createBlobUrl = createBlobUrl; 232 | })(Util || (Util = {})); 233 | // tiny native DOM creator wrapped in a simple React API for use with Typescript JSX 234 | var React; 235 | (function (React) { 236 | function render(element, target) { 237 | target.innerHTML = ""; 238 | target.appendChild(element); 239 | } 240 | React.render = render; 241 | function createElement(tag, attributes, ...children) { 242 | const ele = document.createElement(tag); 243 | for (let name in attributes) 244 | ele.setAttribute(name, attributes[name]); 245 | for (let child of children) 246 | React.elementAddChild(ele, child); 247 | return ele; 248 | } 249 | React.createElement = createElement; 250 | function elementAddChild(ele, child) { 251 | if (child instanceof Node) 252 | ele.appendChild(child); 253 | else if (child instanceof Array) 254 | for (let subchild of child) 255 | React.elementAddChild(ele, subchild); 256 | else 257 | ele.appendChild(document.createTextNode(child)); 258 | } 259 | React.elementAddChild = elementAddChild; 260 | })(React || (React = {})); 261 | var GUI; 262 | (function (GUI) { 263 | const container = document.getElementsByClassName("container")[0]; 264 | ; 265 | GUI.types = [ 266 | { name: "Text", toHTML: (_, data) => React.createElement("pre", { class: "uploaded" }, new TextDecoder().decode(data)) }, 267 | { name: "Raw", toHTML: (f, data) => React.createElement("a", { href: Util.createBlobUrl(data), download: f }, 268 | "Download ", 269 | f) }, 270 | { name: "Image", toHTML: (_, data) => React.createElement("img", { src: Util.createBlobUrl(data) }) }, 271 | { name: "Audio", toHTML: (_, data) => React.createElement("audio", { controls: true }, 272 | React.createElement("source", { src: Util.createBlobUrl(data) })) }, 273 | { name: "Video", toHTML: (_, data) => React.createElement("video", { controls: true }, 274 | React.createElement("source", { src: Util.createBlobUrl(data) })) } 275 | ]; 276 | function displayFile(info) { 277 | const type = GUI.types.find(t => t.name == info.meta.type); 278 | if (type) { 279 | React.render(React.createElement("div", null, 280 | React.createElement("h3", null, 281 | "File ", 282 | info.meta.name), 283 | type.toHTML(info.meta.name, info.data)), container); 284 | log("Displayed file as " + info.meta.type); 285 | } 286 | else 287 | log("unknown type " + info.meta.type); 288 | } 289 | function beginUpload() { 290 | return __awaiter(this, void 0, void 0, function* () { 291 | try { 292 | const file = document.querySelector("input[type=file]").files[0]; 293 | if (file) { 294 | const data = new Uint8Array(yield Util.readFile(file)); 295 | const type = document.querySelector("input[type=radio]:checked"); 296 | if (!type) 297 | throw Error("no type selected"); 298 | React.render(React.createElement("h3", null, "Uploading..."), container); 299 | const meta = { name: file.name, type: type.value }; 300 | const info = yield Upload.uploadEncrypted(meta, data); 301 | log("Uploaded. Updating URL and displaying..."); 302 | const sha = base64.encode(Util.hexToArr(info.sha).buffer, true, false); 303 | history.replaceState({}, "", "#" + sha + "!" + info.key); 304 | displayFile({ meta, data }); 305 | document.getElementById("removeIfUpload").style.display = ""; 306 | } 307 | else 308 | throw Error("no file selected"); 309 | } 310 | catch (e) { 311 | log(e); 312 | showLog(); 313 | throw e; 314 | } 315 | }); 316 | } 317 | GUI.beginUpload = beginUpload; 318 | function initializeUploader() { 319 | React.render(React.createElement("div", null, 320 | React.createElement("h3", null, "Upload a file (image/audio/video/text)"), 321 | React.createElement("p", null, 322 | React.createElement("input", { type: "file", id: "fileinput" })), 323 | React.createElement("div", null, GUI.types.map(type => React.createElement("span", null, 324 | React.createElement("input", { type: "radio", name: "type", id: "type_" + type.name, value: type.name }), 325 | React.createElement("label", { for: "type_" + type.name }, type.name)))), 326 | React.createElement("button", { id: "uploadbutton" }, "Upload"), 327 | React.createElement("p", null, "The file will be encrypted and authenticated completely client-side using 128bit AES-GCM. Limit 5 MB.")), container); 328 | document.getElementById("removeIfUpload").style.display = "none"; 329 | document.getElementById("uploadbutton").addEventListener('click', beginUpload); 330 | } 331 | document.addEventListener('DOMContentLoaded', () => { 332 | if (location.hash) { 333 | const [filename, key] = location.hash.substr(1).split("!"); 334 | log("Loading..."); 335 | React.render(React.createElement("h3", null, "Loading..."), container); 336 | Upload.downloadEncrypted(filename, key).then(displayFile); 337 | } 338 | else { 339 | initializeUploader(); 340 | } 341 | }); 342 | window.addEventListener('hashchange', () => location.reload()); 343 | })(GUI || (GUI = {})); 344 | //# sourceMappingURL=bin.js.map -------------------------------------------------------------------------------- /bin/bin.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/base64.ts","../src/github.ts","../src/main.tsx"],"names":[],"mappings":";;;;;;;;AAAA,IAAO,MAAM,CAkDZ;AAlDD,WAAO,QAAM;IACC,eAAM,GAAG,kEAAkE,CAAC;IAC5E,mBAAU,GAAG,kEAAkE,CAAC;IAChF,eAAM,GAAG,UAAS,WAAwB,EAAE,GAAY,EAAE,MAAe;QACrF,MAAM,KAAK,GAAG,GAAG,GAAG,SAAA,UAAU,GAAG,SAAA,MAAM,CAAC;QACxC,IAAI,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC;QAEzE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC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,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,GAAG,CAAC,YAAY,CAAC,CAAC;YAClB,KAAK,CAAC,MAAM,CAAC,6CAAmB,EAAE,SAAS,CAAC,CAAC;YAC7C,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9D,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,kBAAkB,EAAE,CAAC;QACzB,CAAC;IACL,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;AACnE,CAAC,EArES,GAAG,KAAH,GAAG,QAqEZ"} -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Encrypted Github Data Uploader 4 | 10 |
Initializing...
11 | 12 | 13 | 17 | Upload a file 18 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/base64.ts: -------------------------------------------------------------------------------- 1 | module base64 { 2 | export const _chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 3 | export const _chars_url = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; 4 | export const encode = function(arraybuffer: ArrayBuffer, url: boolean, equals: boolean) { 5 | const chars = url ? _chars_url : _chars; 6 | var bytes = new Uint8Array(arraybuffer), len = bytes.length, base64 = ""; 7 | 8 | for (let i = 0; i < len; i += 3) { 9 | base64 += chars[bytes[i] >> 2]; 10 | base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; 11 | base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; 12 | base64 += chars[bytes[i + 2] & 63]; 13 | } 14 | 15 | if ((len % 3) === 2) { 16 | base64 = base64.substring(0, base64.length - 1) + (equals ? "=" : ""); 17 | } else if (len % 3 === 1) { 18 | base64 = base64.substring(0, base64.length - 2) + (equals ? "==" : ""); 19 | } 20 | 21 | return base64; 22 | }; 23 | 24 | export const decode = function(base64: string, url: boolean) { 25 | const chars = url ? _chars_url : _chars; 26 | const len = base64.length; 27 | var bufferLength = len * 0.75, p = 0; 28 | 29 | if (base64[len - 1] === "=") { 30 | bufferLength--; 31 | if (base64[len - 2] === "=") { 32 | bufferLength--; 33 | } 34 | } 35 | 36 | const bytes = new Uint8Array(new ArrayBuffer(bufferLength)); 37 | 38 | for (let i = 0; i < len; i += 4) { 39 | const encoded1 = chars.indexOf(base64[i]); 40 | const encoded2 = chars.indexOf(base64[i + 1]); 41 | const encoded3 = chars.indexOf(base64[i + 2]); 42 | const encoded4 = chars.indexOf(base64[i + 3]); 43 | 44 | bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); 45 | bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); 46 | bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); 47 | } 48 | 49 | return bytes.buffer; 50 | } 51 | } -------------------------------------------------------------------------------- /src/github.ts: -------------------------------------------------------------------------------- 1 | class Github { 2 | constructor(public apiUrl = `https://api.github.com/`) { } 3 | async fetch(path: string, data?: RequestInit) { 4 | log("fetching " + (data && data.method||"") + " " +this.apiUrl + path); 5 | return await fetch(this.apiUrl + path, data); 6 | } 7 | async fetchJSON(path: string, data?: RequestInit) { 8 | return await (await this.fetch(path, data)).json(); 9 | } 10 | async fetchRaw(path: string) { 11 | const headers = new Headers(); 12 | headers.append("Accept", "application/vnd.github.v3.raw"); 13 | const r = await this.fetch(path, { headers }); 14 | return await r.arrayBuffer(); 15 | } 16 | async postJSON(path: string, data: any, method = "POST") { 17 | const headers = new Headers(); 18 | headers.append("Content-Type", "application/json;charset=UTF-8"); 19 | return await this.fetchJSON(path, { method, headers, body: JSON.stringify(data) }); 20 | } 21 | async createGist(description: string, files: { [filename: string]: { content: string } }, is_public = true) { 22 | return await this.postJSON("gists", { description, public: is_public, files: files }, "POST"); 23 | } 24 | async getGist(id: string) { 25 | return await this.fetchJSON("gists/" + id); 26 | } 27 | } -------------------------------------------------------------------------------- /src/main.tsx: -------------------------------------------------------------------------------- 1 | let github = new Github(); 2 | 3 | function log(info: any) { 4 | console.log(info); 5 | const e = document.getElementById("log"); 6 | if (e) e.appendChild({info}
); 7 | } 8 | function showLog() { 9 | document.getElementById("showlogbutton")!.style.display = 'none'; 10 | document.getElementById("showlog")!.style.display = ''; 11 | } 12 | declare var TextDecoder: any, TextEncoder: any, fetch: typeof window.fetch; 13 | 14 | module SimpleCrypto { 15 | export let encryptionAlgorithm = "AES-GCM"; 16 | export async function encrypt(data: Uint8Array) { 17 | log("Generating key and IV..."); 18 | const key: CryptoKey = await crypto.subtle.generateKey({ name: encryptionAlgorithm, length: 128 }, true, ["encrypt"]); 19 | const iv = new Uint8Array(16); crypto.getRandomValues(iv); 20 | log("Encrypting..."); 21 | const encrypted = await crypto.subtle.encrypt({ name: encryptionAlgorithm, iv }, key, data); 22 | return { 23 | data: [iv, new Uint8Array(encrypted)], 24 | key: base64.encode(await crypto.subtle.exportKey("raw", key), true, false), 25 | }; 26 | } 27 | export async function decrypt(data: Uint8Array, key_str: string) { 28 | log("Decoding IV..."); 29 | const iv = data.subarray(0, 16); 30 | const encrypted_data = data.subarray(16); 31 | const key = new Uint8Array(base64.decode(key_str, true)); 32 | log("Decrypting..."); 33 | const imported_key = await crypto.subtle.importKey("raw", key, encryptionAlgorithm, false, ["decrypt"]); 34 | return await crypto.subtle.decrypt({ name: encryptionAlgorithm, iv }, imported_key, encrypted_data); 35 | } 36 | } 37 | interface UploadMetadata { name: string, type: string } 38 | module Upload { 39 | async function uploadToGist(d: Uint8Array) { 40 | const f = Util.randomString(1, 16); 41 | if (d.byteLength >= 1000 * 3 / 4 * 1000) log("Data should be < 700 kB to avoid calling api twice"); 42 | if (d.byteLength >= 5e6) throw "Data must be < 5 MB"; // more should be possible 43 | return (await github.createGist(Util.randomString(0, 10), { 44 | [f]: { content: base64.encode(d.buffer, true, false) } 45 | })).id; 46 | } 47 | async function downloadFromGist(sha: string) { 48 | const gist = await github.getGist(sha); 49 | const file = gist.files[Object.keys(gist.files)[0]]; 50 | if (file.truncated) { 51 | return base64.decode(await (await fetch(file.raw_url)).text(), true); 52 | } else 53 | return base64.decode(file.content, true); 54 | } 55 | export async function uploadEncrypted(meta: UploadMetadata, raw_data: Uint8Array) { 56 | log("Uploading..."); 57 | const nullByte = new Uint8Array(1); 58 | const inputData = await Util.joinBuffers(new TextEncoder().encode(JSON.stringify(meta)), nullByte, raw_data); 59 | const {data, key} = await SimpleCrypto.encrypt(inputData); 60 | // TODO: don't copy all data twice (via Util.joinBuffers) 61 | return { data, key, sha: await uploadToGist(await Util.joinBuffers(...data)) }; 62 | } 63 | export async function downloadEncrypted(sha: string, key: string) { 64 | sha = Util.arrToHex(new Uint8Array(base64.decode(sha, true))); 65 | const buf = await SimpleCrypto.decrypt(new Uint8Array(await downloadFromGist(sha)), key); 66 | const sep = new Uint8Array(buf).indexOf(0); 67 | const meta = new TextDecoder().decode(new Uint8Array(buf, 0, sep)); 68 | log("Decoded metadata: " + meta); 69 | return { 70 | meta: JSON.parse(meta) as UploadMetadata, 71 | data: new Uint8Array(buf, sep + 1) 72 | } 73 | } 74 | } 75 | 76 | module Util { 77 | export async function readFile(f: File | Blob) { 78 | return new Promise(resolve => { 79 | const r = new FileReader(); 80 | r.onload = _ => resolve(r.result as ArrayBuffer); 81 | r.readAsArrayBuffer(f); 82 | }); 83 | } 84 | export function randomString(minlength: number, maxlength = minlength) { 85 | const length = (Math.random() * (maxlength + 1 - minlength) + minlength) | 0; 86 | return base64.encode(crypto.getRandomValues(new Uint8Array((length * 3 / 4 + 2) | 0)).buffer, true, false).substr(0, length); 87 | } 88 | export function hexToArr(hex: string) { 89 | const out = new Uint8Array(hex.length / 2); 90 | for (let i = 0; i < hex.length; i += 2) { 91 | out[i / 2] = parseInt(hex.substr(i, 2), 16); 92 | } 93 | return out; 94 | } 95 | export function arrToHex(arr: Uint8Array) { 96 | let out = ""; 97 | for (let byte of arr) out += (byte < 16 ? "0" + byte.toString(16) : byte.toString(16)); 98 | return out; 99 | } 100 | export async function joinBuffers(...arrs: Uint8Array[]) { 101 | return new Uint8Array(await Util.readFile(new Blob(arrs))); 102 | } 103 | export function createBlobUrl(data: Uint8Array) { 104 | log(`Displaying ${data.byteLength / 1000} kByte file`); 105 | return URL.createObjectURL(new Blob([data])); 106 | } 107 | } 108 | // tiny native DOM creator wrapped in a simple React API for use with Typescript JSX 109 | module React { 110 | export function render(element: HTMLElement, target: Element) { 111 | target.innerHTML = ""; 112 | target.appendChild(element); 113 | } 114 | export function createElement(tag: string, attributes: { [name: string]: string }, ...children: any[]) { 115 | const ele = document.createElement(tag); 116 | for (let name in attributes) ele.setAttribute(name, attributes[name]); 117 | for (let child of children) React.elementAddChild(ele, child); 118 | return ele; 119 | } 120 | export function elementAddChild(ele: Element, child: any) { 121 | if (child instanceof Node) ele.appendChild(child); 122 | else if (child instanceof Array) for(let subchild of child) React.elementAddChild(ele, subchild); 123 | else ele.appendChild(document.createTextNode(child)); 124 | } 125 | } 126 | declare namespace JSX { 127 | type IntrinsicElements = {[name: string]: { [name: string]: string | number | boolean }}; 128 | type Element = HTMLElement; 129 | } 130 | 131 | namespace GUI { 132 | const container = document.getElementsByClassName("container")[0]; 133 | interface UploadType { name: string, toHTML: (filename: string, data: Uint8Array) => HTMLElement }; 134 | export const types: UploadType[] = [ 135 | { name: "Text", toHTML: (_, data) =>
{new TextDecoder().decode(data)}
}, 136 | { name: "Raw", toHTML: (f, data) => Download {f} }, 137 | { name: "Image", toHTML: (_, data) => }, 138 | { name: "Audio", toHTML: (_, data) => }, 139 | { name: "Video", toHTML: (_, data) => } 140 | ] 141 | 142 | function displayFile(info: { meta: UploadMetadata, data: Uint8Array }) { 143 | const type = types.find(t => t.name == info.meta.type); 144 | if (type) { 145 | React.render(

File {info.meta.name}

{type.toHTML(info.meta.name, info.data)}
, container); 146 | log("Displayed file as " + info.meta.type); 147 | } else log("unknown type " + info.meta.type); 148 | } 149 | 150 | export async function beginUpload() { 151 | try { 152 | const file = (document.querySelector("input[type=file]") as HTMLInputElement).files![0]; 153 | if (file) { 154 | const data = new Uint8Array(await Util.readFile(file)); 155 | const type = document.querySelector("input[type=radio]:checked") as HTMLInputElement; 156 | if (!type) throw Error("no type selected"); 157 | React.render(

Uploading...

, container); 158 | const meta = { name: file.name, type: type.value }; 159 | const info = await Upload.uploadEncrypted(meta, data); 160 | log("Uploaded. Updating URL and displaying..."); 161 | const sha = base64.encode(Util.hexToArr(info.sha).buffer, true, false); 162 | history.replaceState({}, "", "#" + sha + "!" + info.key); 163 | displayFile({ meta, data }); 164 | document.getElementById("removeIfUpload")!.style.display = ""; 165 | } else throw Error("no file selected"); 166 | } catch (e) { 167 | log(e); showLog(); throw e; 168 | } 169 | } 170 | 171 | function initializeUploader() { 172 | React.render( 173 |
174 |

Upload a file (image/audio/video/text)

175 |

176 |
{types.map(type => 177 | 178 | 179 | )}
180 | 181 |

The file will be encrypted and authenticated completely client-side using 128bit AES-GCM. Limit 5 MB.

182 |
, 183 | container 184 | ); 185 | document.getElementById("removeIfUpload")!.style.display = "none"; 186 | document.getElementById("uploadbutton")!.addEventListener('click', beginUpload); 187 | } 188 | 189 | document.addEventListener('DOMContentLoaded', () => { 190 | if (location.hash) { 191 | const [filename, key] = location.hash.substr(1).split("!"); 192 | log("Loading..."); 193 | React.render(

Loading...

, container); 194 | Upload.downloadEncrypted(filename, key).then(displayFile); 195 | } else { 196 | initializeUploader(); 197 | } 198 | }); 199 | window.addEventListener('hashchange', () => location.reload()); 200 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "sourceMap": true, 5 | "out": "bin/bin.js", 6 | "strictNullChecks": true, 7 | "noImplicitAny": true, 8 | "noImplicitReturns": true, 9 | "noImplicitThis": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "noUnusedLocals": true, 12 | "noUnusedParameters": true, 13 | "jsx": "react" 14 | } 15 | } 16 | --------------------------------------------------------------------------------