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

STAND

2 | 3 | 4 |
5 | 6 | ## Table of Contents 7 | 8 | - [Links](#links) 9 | - [About](#about) 10 | - [Installation](#installation) 11 | - [Usage](#usage) 12 | - [Features](#features) 13 | - [Configuration](#configuration) 14 | - [Techstack](#techstack) 15 | - [Contributing](#contributing) 16 | - [License](#license) 17 | 18 | ## Links 19 | - [STAND-FRONTEND-FOSSHACK](https://github.com/bitspaceorg/STAND-FRONTEND-FOSSHACK) 20 | - [STAND-APP](https://github.com/bitspaceorg/STAND-APP) 21 | 22 | ## About 23 | 24 | STAND (Scalable Technology for Advanced Network Deployment) is a self-hosting open-source project designed for on-premise servers. 25 | It allows users to deploy applications directly from GitHub using a simple and intuitive web UI. 26 | STAND aims to simplify deploying and managing applications on local servers, providing a scalable and efficient solution. 27 | All the data required to deploy and host the applications is stored locally, ensuring data privacy and security and providing the user full control over their data. 28 | 29 | ## Installation 30 | 31 | To install STAND, follow these steps: 32 | 33 | 1. Clone the repository: 34 | ```bash 35 | git clone https://github.com/bitspaceorg/stand-fosshack.git 36 | ``` 37 | 2. Navigate to the project directory: 38 | ```bash 39 | cd stand-fosshack 40 | ``` 41 | 3. Install the application: 42 | ```bash 43 | make install 44 | ``` 45 | 46 | ## Usage 47 | 48 | To use STAND, follow these steps: 49 | 50 | 1. Initialize the application: 51 | ```bash 52 | stand init 53 | ``` 54 | 2. Start the application: 55 | ```bash 56 | stand start 57 | ``` 58 | 3. Open your web browser and navigate to `http://localhost:3000`. 59 | 4. Download the GitHub app as per the instructions provided on the web UI. 60 | 5. Start hosting your projects. 61 | 62 | ## Features 63 | 64 | - **Automated Configuration:** Automatically generates configuration files based on user input through the web UI, eliminating the need for manual edits. 65 | - **Scalability:** Easily manage and scale your on-premise servers and applications. 66 | - **Simple Web UI:** Intuitive and user-friendly interface for deploying applications directly from GitHub repositories. 67 | - **Customizable Deployment:** Supports various programming languages and versions, with customizable build and run commands. 68 | - **Efficient Logging:** Configurable log directories for easy access and management of application logs. 69 | - **Environment Management:** Easily set and manage environment variables for your applications. 70 | - **Quick Initialization:** Simple commands (`stand init` and `stand start`) to initialize and start the application, getting you up and running quickly. 71 | - **Secure Hosting:** Provides options for enabling SSL to secure your deployments. 72 | 73 | ## Configuration 74 | 75 | STAND generates the following configuration automatically based on user input from the web UI: 76 | 77 | ```yaml 78 | project: 79 | name: your_project_name 80 | home: /path/to/your/project 81 | log: /path/to/log/directory/ 82 | requirements: 83 | language: your_language 84 | version: your_version 85 | build: 86 | - name: install_dependencies 87 | cmd: your_install_command 88 | run: 89 | - name: start_application 90 | cmd: your_start_command 91 | env: 92 | - name: ENV_VARIABLE_NAME 93 | value: your_value 94 | ``` 95 | 96 | This configuration file is generated automatically and does not need to be manually edited. Users can specify project details, dependencies, build commands, run commands, and environment variables through the web UI, and STAND will handle the rest. 97 | 98 | ## Techstack 99 | 100 | We used GO for its exceptional performance and efficiency, GO also provides great support for concurrency and parallelism which is essential for a project like STAND. 101 | 102 | ![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge&logo=go&logoColor=white) 103 | 104 | The reason for using Next.js is its ability to provide a great user experience with its server-side rendering capabilities and its ability to provide a great developer experience with its hot reloading feature. 105 | 106 | ![Next JS](https://img.shields.io/badge/Next-black?style=for-the-badge&logo=next.js&logoColor=white) 107 | 108 | Currently, STAND supports NodeJS applications, but we plan to add support for more languages and frameworks in the future. 109 | 110 | ![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) 111 | 112 | NPM is used to manage the dependencies of the node applications. 113 | 114 | ![NPM](https://img.shields.io/badge/NPM-%23CB3837.svg?style=for-the-badge&logo=npm&logoColor=white) 115 | 116 | ## DEMO 117 | https://youtu.be/71eHuWTqhhI 118 | 119 | ## Contributing 120 | 121 | We welcome contributions from the community! If you would like to contribute to STAND, please follow the steps below: 122 | 123 | 1. Fork the repository 124 | 2. Clone the repository 125 | 3. Create a new branch 126 | 4. Make your changes 127 | 5. Commit your changes 128 | 6. Push your changes to your fork 129 | 7. Create a pull request explaining your changes 130 | 131 | If possible try to create an issue before making a pull request so that we can discuss the changes and make sure that they are in line with the project goals. 132 | Note: Please make sure to follow the code of conduct and the contribution guidelines when contributing to STAND. 133 | 134 | ## License 135 | 136 | STAND is licensed under the GNU GENERAL PUBLIC LICENSE. See the LICENSE file for more details. 137 | -------------------------------------------------------------------------------- /cmd/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/bitspaceorg/STAND-FOSSHACK/gui" 8 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/api" 9 | "github.com/bitspaceorg/STAND-FOSSHACK/user" 10 | ) 11 | 12 | func main() { 13 | 14 | if len(os.Args) < 2 { 15 | fmt.Println("Usage: cli [command]") 16 | fmt.Println("Commands: init, start") 17 | return 18 | } 19 | 20 | command := os.Args[1] 21 | 22 | switch command { 23 | case "init": 24 | User.CreateUser() 25 | case "start": 26 | if User.ValidateUser() { 27 | // TODO 28 | // 1. Check for dependencies 29 | // 2. Initialize GUI 30 | gui.Init() 31 | // 3. Invoke metrics API 32 | api.Init() 33 | // 4. Start process? 34 | } 35 | default: 36 | fmt.Println("Invalid command:", command) 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/joho/godotenv" 7 | ) 8 | 9 | const httpPort = "6789" 10 | 11 | type AppConfig struct { 12 | ServerPort string 13 | } 14 | 15 | func SetupEnv() (cfg AppConfig, err error) { 16 | if os.Getenv("APP_ENV") == "dev" { 17 | godotenv.Load() 18 | } 19 | 20 | return AppConfig{ 21 | ServerPort: httpPort, 22 | }, nil 23 | } 24 | -------------------------------------------------------------------------------- /example/example-project/index.js: -------------------------------------------------------------------------------- 1 | // Import the Express module 2 | const express = require('express'); 3 | 4 | // Create a new Express application 5 | const app = express(); 6 | 7 | // Define a route for the root URL 8 | app.get('/', (req, res) => { 9 | res.send('Hello, World!'); 10 | }); 11 | 12 | // Start the server on port 3000 13 | const PORT = process.env.HTTP_PORT; 14 | app.listen(PORT, () => { console.log(`Server is running on http://localhost:${PORT}`); 15 | }); 16 | -------------------------------------------------------------------------------- /example/example-project/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "test", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.19.2" 13 | } 14 | }, 15 | "node_modules/accepts": { 16 | "version": "1.3.8", 17 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", 18 | "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", 19 | "license": "MIT", 20 | "dependencies": { 21 | "mime-types": "~2.1.34", 22 | "negotiator": "0.6.3" 23 | }, 24 | "engines": { 25 | "node": ">= 0.6" 26 | } 27 | }, 28 | "node_modules/array-flatten": { 29 | "version": "1.1.1", 30 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 31 | "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", 32 | "license": "MIT" 33 | }, 34 | "node_modules/body-parser": { 35 | "version": "1.20.2", 36 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", 37 | "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", 38 | "license": "MIT", 39 | "dependencies": { 40 | "bytes": "3.1.2", 41 | "content-type": "~1.0.5", 42 | "debug": "2.6.9", 43 | "depd": "2.0.0", 44 | "destroy": "1.2.0", 45 | "http-errors": "2.0.0", 46 | "iconv-lite": "0.4.24", 47 | "on-finished": "2.4.1", 48 | "qs": "6.11.0", 49 | "raw-body": "2.5.2", 50 | "type-is": "~1.6.18", 51 | "unpipe": "1.0.0" 52 | }, 53 | "engines": { 54 | "node": ">= 0.8", 55 | "npm": "1.2.8000 || >= 1.4.16" 56 | } 57 | }, 58 | "node_modules/bytes": { 59 | "version": "3.1.2", 60 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 61 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 62 | "license": "MIT", 63 | "engines": { 64 | "node": ">= 0.8" 65 | } 66 | }, 67 | "node_modules/call-bind": { 68 | "version": "1.0.7", 69 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", 70 | "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", 71 | "license": "MIT", 72 | "dependencies": { 73 | "es-define-property": "^1.0.0", 74 | "es-errors": "^1.3.0", 75 | "function-bind": "^1.1.2", 76 | "get-intrinsic": "^1.2.4", 77 | "set-function-length": "^1.2.1" 78 | }, 79 | "engines": { 80 | "node": ">= 0.4" 81 | }, 82 | "funding": { 83 | "url": "https://github.com/sponsors/ljharb" 84 | } 85 | }, 86 | "node_modules/content-disposition": { 87 | "version": "0.5.4", 88 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 89 | "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", 90 | "license": "MIT", 91 | "dependencies": { 92 | "safe-buffer": "5.2.1" 93 | }, 94 | "engines": { 95 | "node": ">= 0.6" 96 | } 97 | }, 98 | "node_modules/content-type": { 99 | "version": "1.0.5", 100 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 101 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 102 | "license": "MIT", 103 | "engines": { 104 | "node": ">= 0.6" 105 | } 106 | }, 107 | "node_modules/cookie": { 108 | "version": "0.6.0", 109 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", 110 | "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", 111 | "license": "MIT", 112 | "engines": { 113 | "node": ">= 0.6" 114 | } 115 | }, 116 | "node_modules/cookie-signature": { 117 | "version": "1.0.6", 118 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 119 | "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", 120 | "license": "MIT" 121 | }, 122 | "node_modules/debug": { 123 | "version": "2.6.9", 124 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 125 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 126 | "license": "MIT", 127 | "dependencies": { 128 | "ms": "2.0.0" 129 | } 130 | }, 131 | "node_modules/define-data-property": { 132 | "version": "1.1.4", 133 | "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", 134 | "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", 135 | "license": "MIT", 136 | "dependencies": { 137 | "es-define-property": "^1.0.0", 138 | "es-errors": "^1.3.0", 139 | "gopd": "^1.0.1" 140 | }, 141 | "engines": { 142 | "node": ">= 0.4" 143 | }, 144 | "funding": { 145 | "url": "https://github.com/sponsors/ljharb" 146 | } 147 | }, 148 | "node_modules/depd": { 149 | "version": "2.0.0", 150 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 151 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 152 | "license": "MIT", 153 | "engines": { 154 | "node": ">= 0.8" 155 | } 156 | }, 157 | "node_modules/destroy": { 158 | "version": "1.2.0", 159 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", 160 | "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", 161 | "license": "MIT", 162 | "engines": { 163 | "node": ">= 0.8", 164 | "npm": "1.2.8000 || >= 1.4.16" 165 | } 166 | }, 167 | "node_modules/ee-first": { 168 | "version": "1.1.1", 169 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 170 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", 171 | "license": "MIT" 172 | }, 173 | "node_modules/encodeurl": { 174 | "version": "1.0.2", 175 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 176 | "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", 177 | "license": "MIT", 178 | "engines": { 179 | "node": ">= 0.8" 180 | } 181 | }, 182 | "node_modules/es-define-property": { 183 | "version": "1.0.0", 184 | "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", 185 | "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", 186 | "license": "MIT", 187 | "dependencies": { 188 | "get-intrinsic": "^1.2.4" 189 | }, 190 | "engines": { 191 | "node": ">= 0.4" 192 | } 193 | }, 194 | "node_modules/es-errors": { 195 | "version": "1.3.0", 196 | "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", 197 | "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", 198 | "license": "MIT", 199 | "engines": { 200 | "node": ">= 0.4" 201 | } 202 | }, 203 | "node_modules/escape-html": { 204 | "version": "1.0.3", 205 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 206 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", 207 | "license": "MIT" 208 | }, 209 | "node_modules/etag": { 210 | "version": "1.8.1", 211 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 212 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", 213 | "license": "MIT", 214 | "engines": { 215 | "node": ">= 0.6" 216 | } 217 | }, 218 | "node_modules/express": { 219 | "version": "4.19.2", 220 | "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", 221 | "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", 222 | "license": "MIT", 223 | "dependencies": { 224 | "accepts": "~1.3.8", 225 | "array-flatten": "1.1.1", 226 | "body-parser": "1.20.2", 227 | "content-disposition": "0.5.4", 228 | "content-type": "~1.0.4", 229 | "cookie": "0.6.0", 230 | "cookie-signature": "1.0.6", 231 | "debug": "2.6.9", 232 | "depd": "2.0.0", 233 | "encodeurl": "~1.0.2", 234 | "escape-html": "~1.0.3", 235 | "etag": "~1.8.1", 236 | "finalhandler": "1.2.0", 237 | "fresh": "0.5.2", 238 | "http-errors": "2.0.0", 239 | "merge-descriptors": "1.0.1", 240 | "methods": "~1.1.2", 241 | "on-finished": "2.4.1", 242 | "parseurl": "~1.3.3", 243 | "path-to-regexp": "0.1.7", 244 | "proxy-addr": "~2.0.7", 245 | "qs": "6.11.0", 246 | "range-parser": "~1.2.1", 247 | "safe-buffer": "5.2.1", 248 | "send": "0.18.0", 249 | "serve-static": "1.15.0", 250 | "setprototypeof": "1.2.0", 251 | "statuses": "2.0.1", 252 | "type-is": "~1.6.18", 253 | "utils-merge": "1.0.1", 254 | "vary": "~1.1.2" 255 | }, 256 | "engines": { 257 | "node": ">= 0.10.0" 258 | } 259 | }, 260 | "node_modules/finalhandler": { 261 | "version": "1.2.0", 262 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", 263 | "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", 264 | "license": "MIT", 265 | "dependencies": { 266 | "debug": "2.6.9", 267 | "encodeurl": "~1.0.2", 268 | "escape-html": "~1.0.3", 269 | "on-finished": "2.4.1", 270 | "parseurl": "~1.3.3", 271 | "statuses": "2.0.1", 272 | "unpipe": "~1.0.0" 273 | }, 274 | "engines": { 275 | "node": ">= 0.8" 276 | } 277 | }, 278 | "node_modules/forwarded": { 279 | "version": "0.2.0", 280 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 281 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", 282 | "license": "MIT", 283 | "engines": { 284 | "node": ">= 0.6" 285 | } 286 | }, 287 | "node_modules/fresh": { 288 | "version": "0.5.2", 289 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 290 | "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", 291 | "license": "MIT", 292 | "engines": { 293 | "node": ">= 0.6" 294 | } 295 | }, 296 | "node_modules/function-bind": { 297 | "version": "1.1.2", 298 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", 299 | "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", 300 | "license": "MIT", 301 | "funding": { 302 | "url": "https://github.com/sponsors/ljharb" 303 | } 304 | }, 305 | "node_modules/get-intrinsic": { 306 | "version": "1.2.4", 307 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", 308 | "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", 309 | "license": "MIT", 310 | "dependencies": { 311 | "es-errors": "^1.3.0", 312 | "function-bind": "^1.1.2", 313 | "has-proto": "^1.0.1", 314 | "has-symbols": "^1.0.3", 315 | "hasown": "^2.0.0" 316 | }, 317 | "engines": { 318 | "node": ">= 0.4" 319 | }, 320 | "funding": { 321 | "url": "https://github.com/sponsors/ljharb" 322 | } 323 | }, 324 | "node_modules/gopd": { 325 | "version": "1.0.1", 326 | "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", 327 | "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", 328 | "license": "MIT", 329 | "dependencies": { 330 | "get-intrinsic": "^1.1.3" 331 | }, 332 | "funding": { 333 | "url": "https://github.com/sponsors/ljharb" 334 | } 335 | }, 336 | "node_modules/has-property-descriptors": { 337 | "version": "1.0.2", 338 | "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", 339 | "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", 340 | "license": "MIT", 341 | "dependencies": { 342 | "es-define-property": "^1.0.0" 343 | }, 344 | "funding": { 345 | "url": "https://github.com/sponsors/ljharb" 346 | } 347 | }, 348 | "node_modules/has-proto": { 349 | "version": "1.0.3", 350 | "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", 351 | "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", 352 | "license": "MIT", 353 | "engines": { 354 | "node": ">= 0.4" 355 | }, 356 | "funding": { 357 | "url": "https://github.com/sponsors/ljharb" 358 | } 359 | }, 360 | "node_modules/has-symbols": { 361 | "version": "1.0.3", 362 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 363 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", 364 | "license": "MIT", 365 | "engines": { 366 | "node": ">= 0.4" 367 | }, 368 | "funding": { 369 | "url": "https://github.com/sponsors/ljharb" 370 | } 371 | }, 372 | "node_modules/hasown": { 373 | "version": "2.0.2", 374 | "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", 375 | "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", 376 | "license": "MIT", 377 | "dependencies": { 378 | "function-bind": "^1.1.2" 379 | }, 380 | "engines": { 381 | "node": ">= 0.4" 382 | } 383 | }, 384 | "node_modules/http-errors": { 385 | "version": "2.0.0", 386 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 387 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 388 | "license": "MIT", 389 | "dependencies": { 390 | "depd": "2.0.0", 391 | "inherits": "2.0.4", 392 | "setprototypeof": "1.2.0", 393 | "statuses": "2.0.1", 394 | "toidentifier": "1.0.1" 395 | }, 396 | "engines": { 397 | "node": ">= 0.8" 398 | } 399 | }, 400 | "node_modules/iconv-lite": { 401 | "version": "0.4.24", 402 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 403 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 404 | "license": "MIT", 405 | "dependencies": { 406 | "safer-buffer": ">= 2.1.2 < 3" 407 | }, 408 | "engines": { 409 | "node": ">=0.10.0" 410 | } 411 | }, 412 | "node_modules/inherits": { 413 | "version": "2.0.4", 414 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 415 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 416 | "license": "ISC" 417 | }, 418 | "node_modules/ipaddr.js": { 419 | "version": "1.9.1", 420 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 421 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 422 | "license": "MIT", 423 | "engines": { 424 | "node": ">= 0.10" 425 | } 426 | }, 427 | "node_modules/media-typer": { 428 | "version": "0.3.0", 429 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 430 | "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", 431 | "license": "MIT", 432 | "engines": { 433 | "node": ">= 0.6" 434 | } 435 | }, 436 | "node_modules/merge-descriptors": { 437 | "version": "1.0.1", 438 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 439 | "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", 440 | "license": "MIT" 441 | }, 442 | "node_modules/methods": { 443 | "version": "1.1.2", 444 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 445 | "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", 446 | "license": "MIT", 447 | "engines": { 448 | "node": ">= 0.6" 449 | } 450 | }, 451 | "node_modules/mime": { 452 | "version": "1.6.0", 453 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 454 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 455 | "license": "MIT", 456 | "bin": { 457 | "mime": "cli.js" 458 | }, 459 | "engines": { 460 | "node": ">=4" 461 | } 462 | }, 463 | "node_modules/mime-db": { 464 | "version": "1.52.0", 465 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 466 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 467 | "license": "MIT", 468 | "engines": { 469 | "node": ">= 0.6" 470 | } 471 | }, 472 | "node_modules/mime-types": { 473 | "version": "2.1.35", 474 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 475 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 476 | "license": "MIT", 477 | "dependencies": { 478 | "mime-db": "1.52.0" 479 | }, 480 | "engines": { 481 | "node": ">= 0.6" 482 | } 483 | }, 484 | "node_modules/ms": { 485 | "version": "2.0.0", 486 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 487 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", 488 | "license": "MIT" 489 | }, 490 | "node_modules/negotiator": { 491 | "version": "0.6.3", 492 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", 493 | "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", 494 | "license": "MIT", 495 | "engines": { 496 | "node": ">= 0.6" 497 | } 498 | }, 499 | "node_modules/object-inspect": { 500 | "version": "1.13.2", 501 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", 502 | "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", 503 | "license": "MIT", 504 | "engines": { 505 | "node": ">= 0.4" 506 | }, 507 | "funding": { 508 | "url": "https://github.com/sponsors/ljharb" 509 | } 510 | }, 511 | "node_modules/on-finished": { 512 | "version": "2.4.1", 513 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 514 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 515 | "license": "MIT", 516 | "dependencies": { 517 | "ee-first": "1.1.1" 518 | }, 519 | "engines": { 520 | "node": ">= 0.8" 521 | } 522 | }, 523 | "node_modules/parseurl": { 524 | "version": "1.3.3", 525 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 526 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 527 | "license": "MIT", 528 | "engines": { 529 | "node": ">= 0.8" 530 | } 531 | }, 532 | "node_modules/path-to-regexp": { 533 | "version": "0.1.7", 534 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 535 | "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", 536 | "license": "MIT" 537 | }, 538 | "node_modules/proxy-addr": { 539 | "version": "2.0.7", 540 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 541 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 542 | "license": "MIT", 543 | "dependencies": { 544 | "forwarded": "0.2.0", 545 | "ipaddr.js": "1.9.1" 546 | }, 547 | "engines": { 548 | "node": ">= 0.10" 549 | } 550 | }, 551 | "node_modules/qs": { 552 | "version": "6.11.0", 553 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 554 | "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", 555 | "license": "BSD-3-Clause", 556 | "dependencies": { 557 | "side-channel": "^1.0.4" 558 | }, 559 | "engines": { 560 | "node": ">=0.6" 561 | }, 562 | "funding": { 563 | "url": "https://github.com/sponsors/ljharb" 564 | } 565 | }, 566 | "node_modules/range-parser": { 567 | "version": "1.2.1", 568 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 569 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 570 | "license": "MIT", 571 | "engines": { 572 | "node": ">= 0.6" 573 | } 574 | }, 575 | "node_modules/raw-body": { 576 | "version": "2.5.2", 577 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", 578 | "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", 579 | "license": "MIT", 580 | "dependencies": { 581 | "bytes": "3.1.2", 582 | "http-errors": "2.0.0", 583 | "iconv-lite": "0.4.24", 584 | "unpipe": "1.0.0" 585 | }, 586 | "engines": { 587 | "node": ">= 0.8" 588 | } 589 | }, 590 | "node_modules/safe-buffer": { 591 | "version": "5.2.1", 592 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 593 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 594 | "funding": [ 595 | { 596 | "type": "github", 597 | "url": "https://github.com/sponsors/feross" 598 | }, 599 | { 600 | "type": "patreon", 601 | "url": "https://www.patreon.com/feross" 602 | }, 603 | { 604 | "type": "consulting", 605 | "url": "https://feross.org/support" 606 | } 607 | ], 608 | "license": "MIT" 609 | }, 610 | "node_modules/safer-buffer": { 611 | "version": "2.1.2", 612 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 613 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 614 | "license": "MIT" 615 | }, 616 | "node_modules/send": { 617 | "version": "0.18.0", 618 | "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", 619 | "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", 620 | "license": "MIT", 621 | "dependencies": { 622 | "debug": "2.6.9", 623 | "depd": "2.0.0", 624 | "destroy": "1.2.0", 625 | "encodeurl": "~1.0.2", 626 | "escape-html": "~1.0.3", 627 | "etag": "~1.8.1", 628 | "fresh": "0.5.2", 629 | "http-errors": "2.0.0", 630 | "mime": "1.6.0", 631 | "ms": "2.1.3", 632 | "on-finished": "2.4.1", 633 | "range-parser": "~1.2.1", 634 | "statuses": "2.0.1" 635 | }, 636 | "engines": { 637 | "node": ">= 0.8.0" 638 | } 639 | }, 640 | "node_modules/send/node_modules/ms": { 641 | "version": "2.1.3", 642 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 643 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 644 | "license": "MIT" 645 | }, 646 | "node_modules/serve-static": { 647 | "version": "1.15.0", 648 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", 649 | "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", 650 | "license": "MIT", 651 | "dependencies": { 652 | "encodeurl": "~1.0.2", 653 | "escape-html": "~1.0.3", 654 | "parseurl": "~1.3.3", 655 | "send": "0.18.0" 656 | }, 657 | "engines": { 658 | "node": ">= 0.8.0" 659 | } 660 | }, 661 | "node_modules/set-function-length": { 662 | "version": "1.2.2", 663 | "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", 664 | "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", 665 | "license": "MIT", 666 | "dependencies": { 667 | "define-data-property": "^1.1.4", 668 | "es-errors": "^1.3.0", 669 | "function-bind": "^1.1.2", 670 | "get-intrinsic": "^1.2.4", 671 | "gopd": "^1.0.1", 672 | "has-property-descriptors": "^1.0.2" 673 | }, 674 | "engines": { 675 | "node": ">= 0.4" 676 | } 677 | }, 678 | "node_modules/setprototypeof": { 679 | "version": "1.2.0", 680 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 681 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", 682 | "license": "ISC" 683 | }, 684 | "node_modules/side-channel": { 685 | "version": "1.0.6", 686 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", 687 | "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", 688 | "license": "MIT", 689 | "dependencies": { 690 | "call-bind": "^1.0.7", 691 | "es-errors": "^1.3.0", 692 | "get-intrinsic": "^1.2.4", 693 | "object-inspect": "^1.13.1" 694 | }, 695 | "engines": { 696 | "node": ">= 0.4" 697 | }, 698 | "funding": { 699 | "url": "https://github.com/sponsors/ljharb" 700 | } 701 | }, 702 | "node_modules/statuses": { 703 | "version": "2.0.1", 704 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 705 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 706 | "license": "MIT", 707 | "engines": { 708 | "node": ">= 0.8" 709 | } 710 | }, 711 | "node_modules/toidentifier": { 712 | "version": "1.0.1", 713 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 714 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 715 | "license": "MIT", 716 | "engines": { 717 | "node": ">=0.6" 718 | } 719 | }, 720 | "node_modules/type-is": { 721 | "version": "1.6.18", 722 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 723 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 724 | "license": "MIT", 725 | "dependencies": { 726 | "media-typer": "0.3.0", 727 | "mime-types": "~2.1.24" 728 | }, 729 | "engines": { 730 | "node": ">= 0.6" 731 | } 732 | }, 733 | "node_modules/unpipe": { 734 | "version": "1.0.0", 735 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 736 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 737 | "license": "MIT", 738 | "engines": { 739 | "node": ">= 0.8" 740 | } 741 | }, 742 | "node_modules/utils-merge": { 743 | "version": "1.0.1", 744 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 745 | "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", 746 | "license": "MIT", 747 | "engines": { 748 | "node": ">= 0.4.0" 749 | } 750 | }, 751 | "node_modules/vary": { 752 | "version": "1.1.2", 753 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 754 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", 755 | "license": "MIT", 756 | "engines": { 757 | "node": ">= 0.8" 758 | } 759 | } 760 | } 761 | } 762 | -------------------------------------------------------------------------------- /example/example-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js", 8 | "start2": "node index2.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "express": "^4.19.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /example/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "lockfileVersion": 3, 4 | "requires": true, 5 | "packages": {} 6 | } 7 | -------------------------------------------------------------------------------- /example/test.yml: -------------------------------------------------------------------------------- 1 | project: 2 | name: test 3 | home: /home/t-aswath/projects/STAND-FOSSHACK/example/example-project 4 | log: /tmp/testLog/ 5 | requirements: 6 | language: node 7 | version: 20 8 | build: 9 | - name: install_dependencies 10 | cmd: npm install 11 | run: 12 | - name: start_api 13 | cmd: npm run start 14 | env: 15 | - name: HTTP_PORT 16 | value: 3000 17 | 18 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/bitspaceorg/STAND-FOSSHACK 2 | 3 | go 1.22.5 4 | 5 | require ( 6 | github.com/gofiber/fiber/v2 v2.52.5 7 | github.com/joho/godotenv v1.5.1 8 | github.com/shirou/gopsutil v3.21.11+incompatible 9 | gopkg.in/natefinch/lumberjack.v2 v2.2.1 10 | gopkg.in/src-d/go-git.v4 v4.13.1 11 | gopkg.in/yaml.v3 v3.0.1 12 | ) 13 | 14 | require ( 15 | github.com/andybalholm/brotli v1.0.5 // indirect 16 | github.com/emirpasic/gods v1.12.0 // indirect 17 | github.com/go-ole/go-ole v1.2.6 // indirect 18 | github.com/google/uuid v1.5.0 // indirect 19 | github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect 20 | github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect 21 | github.com/klauspost/compress v1.17.0 // indirect 22 | github.com/mattn/go-colorable v0.1.13 // indirect 23 | github.com/mattn/go-isatty v0.0.20 // indirect 24 | github.com/mattn/go-runewidth v0.0.15 // indirect 25 | github.com/mitchellh/go-homedir v1.1.0 // indirect 26 | github.com/rivo/uniseg v0.2.0 // indirect 27 | github.com/sergi/go-diff v1.0.0 // indirect 28 | github.com/src-d/gcfg v1.4.0 // indirect 29 | github.com/stretchr/testify v1.9.0 // indirect 30 | github.com/tklauser/go-sysconf v0.3.14 // indirect 31 | github.com/tklauser/numcpus v0.8.0 // indirect 32 | github.com/valyala/bytebufferpool v1.0.0 // indirect 33 | github.com/valyala/fasthttp v1.51.0 // indirect 34 | github.com/valyala/tcplisten v1.0.0 // indirect 35 | github.com/xanzy/ssh-agent v0.2.1 // indirect 36 | github.com/yusufpapurcu/wmi v1.2.4 // indirect 37 | golang.org/x/crypto v0.14.0 // indirect 38 | golang.org/x/net v0.17.0 // indirect 39 | golang.org/x/sys v0.19.0 // indirect 40 | gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect 41 | gopkg.in/warnings.v0 v0.1.2 // indirect 42 | ) 43 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= 2 | github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= 3 | github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= 4 | github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= 5 | github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= 6 | github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= 7 | github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= 8 | github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= 9 | github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= 10 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 11 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 12 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 13 | github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= 14 | github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= 15 | github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= 16 | github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= 17 | github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= 18 | github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= 19 | github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= 20 | github.com/gofiber/fiber/v2 v2.52.5 h1:tWoP1MJQjGEe4GB5TUGOi7P2E0ZMMRx5ZTG4rT+yGMo= 21 | github.com/gofiber/fiber/v2 v2.52.5/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= 22 | github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= 23 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 24 | github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= 25 | github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 26 | github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= 27 | github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= 28 | github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= 29 | github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= 30 | github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= 31 | github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= 32 | github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= 33 | github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= 34 | github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= 35 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 36 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 37 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 38 | github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= 39 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 40 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 41 | github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= 42 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= 43 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= 44 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= 45 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 46 | github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= 47 | github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= 48 | github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= 49 | github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 50 | github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= 51 | github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 52 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 53 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 54 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 55 | github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= 56 | github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= 57 | github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= 58 | github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= 59 | github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= 60 | github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= 61 | github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4= 62 | github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= 63 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 64 | github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= 65 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 66 | github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= 67 | github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 68 | github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= 69 | github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= 70 | github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY= 71 | github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE= 72 | github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= 73 | github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= 74 | github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= 75 | github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= 76 | github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= 77 | github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= 78 | github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= 79 | github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= 80 | github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= 81 | github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= 82 | golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 83 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 84 | golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 85 | golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= 86 | golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= 87 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 88 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 89 | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 90 | golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= 91 | golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= 92 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 93 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 94 | golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 95 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 96 | golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 97 | golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 98 | golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 99 | golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 100 | golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= 101 | golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 102 | golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= 103 | golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= 104 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 105 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 106 | golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= 107 | golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 108 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 109 | golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= 110 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 111 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= 112 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 113 | gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= 114 | gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= 115 | gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg= 116 | gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= 117 | gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOAJK+LsJg= 118 | gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= 119 | gopkg.in/src-d/go-git.v4 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE= 120 | gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8= 121 | gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= 122 | gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= 123 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 124 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 125 | -------------------------------------------------------------------------------- /gui/main.go: -------------------------------------------------------------------------------- 1 | package gui 2 | 3 | import ( 4 | "fmt" 5 | "github.com/bitspaceorg/STAND-FOSSHACK/utils" 6 | "os" 7 | "os/exec" 8 | "strings" 9 | ) 10 | 11 | // Sequentially initializes the GUI 12 | func Init() { 13 | fmt.Println("Starting GUI...") 14 | 15 | // Checks if GUI already exists - if not fetches from the remote URL 16 | if _, err := os.Stat(utils.GetShadowGUIFilePath()); os.IsNotExist(err) { 17 | fmt.Println("GUI not found. Fetching from remote...") 18 | fetchCmds := strings.Split(fmt.Sprintf("git clone %v %v", utils.GUIFetchLink, utils.GetShadowGUIFilePath()), " ") 19 | fetchExec := exec.Command(fetchCmds[0], fetchCmds[1:]...) 20 | if err := fetchExec.Run(); err != nil { 21 | fmt.Println("Error fetching GUI:", err) 22 | return 23 | } 24 | } 25 | 26 | // Checks if the GUI is already built - if not yarn build it 27 | if _, yarnbuilderr := os.Stat(fmt.Sprintf("%v/node_modules", utils.GetShadowGUIFilePath())); os.IsNotExist(yarnbuilderr) { 28 | fmt.Println("Building GUI...") 29 | yarnBuildCmds := strings.Split(fmt.Sprintf("cd %v && npm i && npm run build", utils.GetShadowGUIFilePath()), " ") 30 | yarnBuildExec := exec.Command("sh", "-c", strings.Join(yarnBuildCmds, " ")) 31 | if err := yarnBuildExec.Run(); err != nil { 32 | fmt.Println("Error building GUI:", err) 33 | return 34 | } 35 | } 36 | // fmt.Println("[Running GUI on port 6789]") 37 | 38 | // // Start the GUI on port [6789] 39 | // yarnCmds := strings.Split(fmt.Sprintf("cd %v && yarn dev", utils.GetShadowGUIFilePath()), " ") 40 | // yarnExec := exec.Command("sh", "-c", strings.Join(yarnCmds, " ")) 41 | // if err := yarnExec.Run(); err != nil { 42 | // fmt.Println("Error running GUI:", err) 43 | // return 44 | // } 45 | } 46 | -------------------------------------------------------------------------------- /internal/api/api.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "github.com/bitspaceorg/STAND-FOSSHACK/config" 5 | "log" 6 | ) 7 | 8 | func Init() { 9 | cfg, err := config.SetupEnv() 10 | 11 | if err != nil { 12 | log.Fatalf("Error setting up env : %v", err) 13 | } 14 | log.Printf("[Running GUI on port %v]", cfg.ServerPort) 15 | StartServer(cfg) 16 | } 17 | -------------------------------------------------------------------------------- /internal/api/rest/handlers/buildHandler.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | 8 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/api/rest" 9 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/deploy" 10 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/puller" 11 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/runtime" 12 | "github.com/bitspaceorg/STAND-FOSSHACK/utils" 13 | "github.com/gofiber/fiber/v2" 14 | ) 15 | 16 | type buildHandler struct { 17 | } 18 | 19 | type MessageStruct struct { 20 | Message string `json:"message"` 21 | Success bool `json:"success"` 22 | } 23 | 24 | type BuildDTO struct { 25 | Link string `json:"link"` 26 | Name string `json:"name"` 27 | } 28 | 29 | func (b *buildHandler) build(c *fiber.Ctx) error { 30 | var dto BuildDTO 31 | if err := c.BodyParser(&dto); err != nil { 32 | return err 33 | } 34 | 35 | runtime := runtime.NodeRuntimeInstaller{} 36 | 37 | deployer := deploy.GetInstance(&runtime) 38 | 39 | projectFolder := fmt.Sprintf("%s/%s/", utils.ShadowFolder, dto.Name) 40 | buildFile := projectFolder + dto.Name + ".yml" 41 | 42 | if err := os.RemoveAll(projectFolder+dto.Name); err != nil { 43 | return err 44 | } 45 | 46 | err := deployer.Kill(dto.Name) 47 | if err != nil { 48 | return err 49 | } 50 | 51 | puller := puller.GitPuller{ 52 | RepoLink: dto.Link, 53 | Path: projectFolder + dto.Name, 54 | } 55 | 56 | err = puller.Pull() 57 | if err != nil { 58 | return err 59 | } 60 | 61 | msgChan := make(chan MessageStruct) 62 | var msg MessageStruct 63 | go deployer.Deploy(buildFile, func(message string, success bool) { 64 | msgChan <- MessageStruct{ 65 | Message: message, 66 | Success: success, 67 | } 68 | close(msgChan) 69 | }) 70 | msg = <-msgChan 71 | log.Println(msg) 72 | return c.JSON(msg) 73 | } 74 | 75 | func SetupBuildRoutes(rh *rest.RestHandler) { 76 | app := rh.App 77 | b := buildHandler{} 78 | app.Post("/build", b.build) 79 | } 80 | -------------------------------------------------------------------------------- /internal/api/rest/handlers/healthHandler.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "github.com/gofiber/fiber/v2" 5 | "net/http" 6 | 7 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/api/rest" 8 | ) 9 | 10 | type healthHandler struct { 11 | } 12 | 13 | func (h *healthHandler) health(c *fiber.Ctx) error { 14 | return c.Status(http.StatusOK).JSON(fiber.Map{ 15 | "status": "ok", 16 | }) 17 | } 18 | 19 | func SetupHealthRoutes(rh *rest.RestHandler) { 20 | app := rh.App 21 | h := healthHandler{} 22 | app.Get("/health", h.health) 23 | } 24 | -------------------------------------------------------------------------------- /internal/api/rest/handlers/metricsHandler.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | "os" 6 | "runtime" 7 | "time" 8 | 9 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/api/rest" 10 | "github.com/gofiber/fiber/v2" 11 | "github.com/shirou/gopsutil/disk" 12 | "github.com/shirou/gopsutil/host" 13 | "github.com/shirou/gopsutil/mem" 14 | ) 15 | 16 | type metricHandler struct { 17 | } 18 | 19 | func (m *metricHandler) metric(c *fiber.Ctx) error { 20 | memStat, _ := mem.VirtualMemory() 21 | diskStat, _ := disk.Usage("/") 22 | hostStat, _ := host.Info() 23 | uptime := time.Duration(hostStat.Uptime) * time.Second 24 | hostname, _ := os.Hostname() 25 | username := os.Getenv("USER") 26 | return c.Status(http.StatusOK).JSON(fiber.Map{ 27 | "status": "ok", 28 | "os": runtime.GOOS, 29 | "cpuCount": runtime.NumCPU(), 30 | "memory": fiber.Map{ 31 | "totalMemory": ((memStat.Total / 1024) / 1024) / 1024, 32 | "usedMemory": ((memStat.Used / 1024) / 1024) / 1024, 33 | }, 34 | "disk": fiber.Map{ 35 | "totalDisk": ((diskStat.Total / 1024) / 1024) / 1024, 36 | "usedDisk": ((diskStat.Used / 1024) / 1024) / 1024, 37 | }, 38 | "upTime": uptime.String(), 39 | "maxProcs": runtime.GOMAXPROCS(0), 40 | "hostname": hostname, 41 | "username": username, 42 | }) 43 | } 44 | 45 | func SetupMetricRoutes(rh *rest.RestHandler) { 46 | app := rh.App 47 | m := metricHandler{} 48 | app.Get("/metric", m.metric) 49 | } 50 | -------------------------------------------------------------------------------- /internal/api/rest/handlers/projectHandler.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | 8 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/api/rest" 9 | parser "github.com/bitspaceorg/STAND-FOSSHACK/internal/build-parser" 10 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/deploy" 11 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/puller" 12 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/runtime" 13 | "github.com/bitspaceorg/STAND-FOSSHACK/utils" 14 | "github.com/gofiber/fiber/v2" 15 | "gopkg.in/yaml.v3" 16 | ) 17 | 18 | type projectHandler struct { 19 | } 20 | 21 | func (h *projectHandler) newProject(c *fiber.Ctx) error { 22 | var cfg parser.NodeBuildConfig 23 | 24 | runtime := runtime.NodeRuntimeInstaller{} 25 | 26 | deployer := deploy.GetInstance(&runtime) 27 | 28 | 29 | if err := c.BodyParser(&cfg); err != nil { 30 | return err 31 | } 32 | ymlData, err := yaml.Marshal(&cfg) 33 | if err != nil { 34 | return err 35 | } 36 | 37 | projectFolder := fmt.Sprintf("%s/%s/", utils.ShadowFolder, cfg.Project.Name) 38 | buildFile := projectFolder + cfg.Project.Name + ".yml" 39 | err = os.MkdirAll(projectFolder, 0755) 40 | if err != nil { 41 | return err 42 | } 43 | file, err := os.Create(buildFile) 44 | if err != nil { 45 | return err 46 | } 47 | defer file.Close() 48 | 49 | _, err = file.Write(ymlData) 50 | 51 | if err != nil { 52 | return err 53 | } 54 | 55 | puller := puller.GitPuller{ 56 | RepoLink: cfg.Project.RepoLink, 57 | Path: projectFolder + cfg.Project.Name, 58 | } 59 | 60 | err = puller.Pull() 61 | if err != nil { 62 | return err 63 | } 64 | 65 | msgChan := make(chan MessageStruct) 66 | var msg MessageStruct 67 | go deployer.Deploy(buildFile, func(message string, success bool) { 68 | msgChan <- MessageStruct{ 69 | Message: message, 70 | Success: success, 71 | } 72 | close(msgChan) 73 | }) 74 | msg = <-msgChan 75 | log.Println(msg) 76 | return c.JSON(msg) 77 | 78 | } 79 | 80 | func SetupProjectRoutes(rh *rest.RestHandler) { 81 | app := rh.App 82 | h := projectHandler{} 83 | 84 | app.Post("/newProject", h.newProject) 85 | } 86 | -------------------------------------------------------------------------------- /internal/api/rest/handlers/repoHandler.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "github.com/gofiber/fiber/v2" 7 | "net/http" 8 | "os" 9 | 10 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/api/rest" 11 | "github.com/bitspaceorg/STAND-FOSSHACK/utils" 12 | ) 13 | 14 | type repoHandler struct { 15 | } 16 | 17 | func (h *repoHandler) getRepo(c *fiber.Ctx) error { 18 | file, err := os.Open(utils.GetShadowReposFilePath()) 19 | if err != nil { 20 | fmt.Println("Error opening file:", err) 21 | } 22 | defer file.Close() 23 | 24 | scanner := bufio.NewScanner(file) 25 | arr := []string{} 26 | for scanner.Scan() { 27 | line := scanner.Text() 28 | arr = append(arr, line) 29 | } 30 | return c.Status(http.StatusOK).JSON(fiber.Map{ 31 | "repos": arr, 32 | }) 33 | } 34 | 35 | func (h *repoHandler) repo(c *fiber.Ctx) error { 36 | body := struct { 37 | Repo []string `json:"repos"` 38 | }{} 39 | 40 | if err := c.BodyParser(&body); err != nil { 41 | return c.Status(http.StatusBadRequest).JSON(fiber.Map{ 42 | "error": err.Error(), 43 | }) 44 | } 45 | 46 | for _, repo := range body.Repo { 47 | err := utils.AppendToFile(utils.GetShadowReposFilePath(), fmt.Sprintf("%v\n", repo)) 48 | if err != nil { 49 | return c.Status(http.StatusInternalServerError).JSON(fiber.Map{ 50 | "error": err.Error(), 51 | }) 52 | } 53 | } 54 | 55 | return c.Status(http.StatusOK).JSON(fiber.Map{ 56 | "status": "ok", 57 | }) 58 | } 59 | 60 | func SetupRepoRoutes(rh *rest.RestHandler) { 61 | app := rh.App 62 | h := repoHandler{} 63 | app.Post("/repos", h.repo) 64 | app.Get("/repos", h.getRepo) 65 | } 66 | -------------------------------------------------------------------------------- /internal/api/rest/handlers/userVerificationHandler.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "net/http" 7 | "os" 8 | "strings" 9 | 10 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/api/rest" 11 | "github.com/bitspaceorg/STAND-FOSSHACK/utils" 12 | "github.com/gofiber/fiber/v2" 13 | ) 14 | 15 | type userVerification struct { 16 | } 17 | 18 | func ValidateUser(username string, password string) bool { 19 | hashedPassword := utils.HashPassword(password) 20 | 21 | file, err := os.Open(utils.GetShadowAuthFilePath()) 22 | if err != nil { 23 | fmt.Println("Error opening file:", err) 24 | return false 25 | } 26 | defer file.Close() 27 | 28 | scanner := bufio.NewScanner(file) 29 | for scanner.Scan() { 30 | line := scanner.Text() 31 | parts := strings.Split(line, ":") 32 | if len(parts) != 2 { 33 | fmt.Println("Invalid shadow file format.") 34 | return false 35 | } 36 | 37 | if parts[0] == username && parts[1] == hashedPassword { 38 | fmt.Println("User authenticated.") 39 | return true 40 | } 41 | } 42 | 43 | fmt.Println("Invalid username or password.") 44 | return false 45 | } 46 | 47 | func (h *userVerification) verifyUser(c *fiber.Ctx) error { 48 | username := c.Query("username") 49 | password := c.Query("password") 50 | status := false 51 | if ValidateUser(username, password) { 52 | status = true 53 | } 54 | return c.Status(http.StatusOK).JSON(fiber.Map{ 55 | "status": status, 56 | }) 57 | } 58 | 59 | func SetupUserVerificationRoutes(rh *rest.RestHandler) { 60 | app := rh.App 61 | h := userVerification{} 62 | app.Post("/verifyUser", h.verifyUser) 63 | } 64 | -------------------------------------------------------------------------------- /internal/api/rest/httphandler.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import "github.com/gofiber/fiber/v2" 4 | 5 | 6 | type RestHandler struct { 7 | App *fiber.App 8 | } 9 | -------------------------------------------------------------------------------- /internal/api/server.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "github.com/bitspaceorg/STAND-FOSSHACK/config" 5 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/api/rest" 6 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/api/rest/handlers" 7 | "github.com/bitspaceorg/STAND-FOSSHACK/utils" 8 | "github.com/gofiber/fiber/v2" 9 | "github.com/gofiber/fiber/v2/middleware/cors" 10 | "log" 11 | ) 12 | 13 | func StartServer(config config.AppConfig) { 14 | app := fiber.New(fiber.Config{ 15 | DisableStartupMessage: false, 16 | }) 17 | app.Use(cors.New()) 18 | 19 | rh := rest.RestHandler{ 20 | App: app, 21 | } 22 | 23 | app.Static("/", utils.GetShadowGUIBuildPath()) 24 | 25 | setupRoutes(&rh) 26 | 27 | err := app.Listen(":" + config.ServerPort) 28 | 29 | if err != nil { 30 | log.Fatalf("Error starting the server :%v", err) 31 | } 32 | } 33 | 34 | func setupRoutes(rh *rest.RestHandler) { 35 | handlers.SetupMetricRoutes(rh) 36 | handlers.SetupUserVerificationRoutes(rh) 37 | handlers.SetupHealthRoutes(rh) 38 | handlers.SetupRepoRoutes(rh) 39 | handlers.SetupBuildRoutes(rh) 40 | handlers.SetupProjectRoutes(rh) 41 | handlers.SetupRepoRoutes(rh) 42 | } 43 | -------------------------------------------------------------------------------- /internal/build-parser/default_interface.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import "fmt" 4 | 5 | type Command struct { 6 | Name string `yaml:"name" json:"name"` 7 | Cmd string `yaml:"cmd" json:"cmd"` 8 | } 9 | 10 | type Env struct { 11 | Name string `yaml:"name" json:"name"` 12 | Value string `yaml:"value" json:"value"` 13 | } 14 | 15 | // default grammar for python build file 16 | type PythonBuildConfig struct { 17 | Project struct { 18 | Name string `yaml:"name"` 19 | Home string `yaml:"home"` 20 | } 21 | Requirements struct { 22 | Language string `yaml:"language"` 23 | Version string `yaml:"version"` 24 | } 25 | Build []Command `yaml:"build"` 26 | 27 | Run []Command `yaml:"run"` 28 | 29 | Envs []Env `yaml:"env"` 30 | } 31 | 32 | // default grammar for python build file 33 | type NodeBuildConfig struct { 34 | Project struct { 35 | Name string `yaml:"name" json:"name"` 36 | Home string `yaml:"home" json:"home"` 37 | LogDir string `yaml:"log" json:"log"` 38 | RepoLink string `yaml:"link" json:"link"` 39 | } 40 | Requirements struct { 41 | Language string `yaml:"language" json:"language"` 42 | Version string `yaml:"version" json:"version"` 43 | } 44 | Build []Command `yaml:"build" json:"build"` 45 | 46 | Run []Command `yaml:"run" json:"run"` 47 | 48 | Envs []Env `yaml:"env" json:"env"` 49 | } 50 | 51 | func (c *NodeBuildConfig) GetEnv() []string { 52 | envs := []string{} 53 | for _, v := range c.Envs { 54 | envs = append(envs, fmt.Sprintf("%v=%v", v.Name, v.Value)) 55 | } 56 | 57 | return envs 58 | } 59 | -------------------------------------------------------------------------------- /internal/build-parser/parser.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | 8 | "gopkg.in/yaml.v3" 9 | ) 10 | 11 | // BuildFileParser decodes the config file for the 12 | // project build 13 | type BuildFileParser struct { 14 | 15 | //the data which is contained in the yml file 16 | Data map[interface{}]interface{} 17 | 18 | //path to the build file 19 | filePath string 20 | } 21 | 22 | 23 | func NewBuildFileParser(filePath string) *BuildFileParser { 24 | return &BuildFileParser{ 25 | Data: make(map[interface{}]interface{}), 26 | filePath: filePath, 27 | } 28 | } 29 | 30 | // It tries to prase the given yml|yaml file 31 | // into the interface which is passed in 32 | func (p *BuildFileParser) Parse(data interface{}) error { 33 | file, err := os.ReadFile(p.filePath) 34 | if err != nil { 35 | return fmt.Errorf("Error opening the file: %v", err.Error()) 36 | } 37 | 38 | err = yaml.Unmarshal(file, data) 39 | 40 | if err != nil { 41 | log.Fatalf("Error parsing file into interface : %v", err.Error()) 42 | } 43 | 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /internal/deploy/deploy.go: -------------------------------------------------------------------------------- 1 | package deploy 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | "log" 8 | "os/exec" 9 | "strings" 10 | "sync" 11 | 12 | parser "github.com/bitspaceorg/STAND-FOSSHACK/internal/build-parser" 13 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/runnable" 14 | "github.com/bitspaceorg/STAND-FOSSHACK/internal/runtime" 15 | "github.com/bitspaceorg/STAND-FOSSHACK/utils" 16 | ) 17 | 18 | type DeployCallback func(message string, status bool) 19 | 20 | type Deployer struct { 21 | //interface to install runtime 22 | RuntimeInstaller runtime.RuntimeInstaller 23 | 24 | //map to hold the list of all deployments 25 | Deploymnets map[string]runnable.Runnable 26 | } 27 | 28 | var instance *Deployer 29 | var once sync.Once 30 | 31 | // GetInstance returns the singleton instance 32 | func GetInstance(installer runtime.RuntimeInstaller) *Deployer { 33 | once.Do(func() { 34 | instance = &Deployer{ 35 | RuntimeInstaller: installer, 36 | Deploymnets: make(map[string]runnable.Runnable), 37 | } 38 | }) 39 | return instance 40 | } 41 | 42 | func NewDeployer(installer runtime.RuntimeInstaller) Deployer { 43 | return Deployer{ 44 | RuntimeInstaller: installer, 45 | Deploymnets: make(map[string]runnable.Runnable), 46 | } 47 | } 48 | 49 | func (d *Deployer) Kill(name string) error { 50 | runner, ok := d.Deploymnets[name] 51 | if !ok { 52 | log.Println(d.Deploymnets) 53 | return errors.New("Process does not exist!") 54 | } 55 | if err := runner.Kill(); err != nil { 56 | log.Println("Here =====>",err) 57 | return err 58 | } 59 | delete(d.Deploymnets, name) 60 | return nil 61 | } 62 | 63 | func (d *Deployer) Deploy(builPath string, cb DeployCallback) { 64 | var BuildConfig parser.NodeBuildConfig 65 | parser := parser.NewBuildFileParser(builPath) 66 | parser.Parse(&BuildConfig) 67 | projectFolder := fmt.Sprintf("%s/%s/", utils.ShadowFolder, BuildConfig.Project.Name) 68 | log.Printf("%+v", BuildConfig) 69 | if BuildConfig.Requirements.Language != "node" { 70 | log.Println("Only node is supported") 71 | cb("Only Node is supported", false) 72 | return 73 | } 74 | 75 | d.RuntimeInstaller.SetHome(projectFolder) 76 | d.RuntimeInstaller.SetVersion(BuildConfig.Requirements.Version) 77 | 78 | err := d.RuntimeInstaller.Install() 79 | if err != nil { 80 | if !runtime.IsExitCode(3, err) { 81 | log.Println(fmt.Sprintf("[Error] :%v", err.Error())) 82 | cb(fmt.Sprintf("[Error] :%v", err.Error()), false) 83 | return 84 | } 85 | } 86 | 87 | cmdi := exec.Command("n", "i", BuildConfig.Requirements.Version) 88 | if err := cmdi.Run(); err != nil { 89 | log.Println("could not install node version") 90 | cb("Could not install node version", false) 91 | return 92 | } 93 | 94 | cmd := exec.Command("n", BuildConfig.Requirements.Version) 95 | if err := cmd.Run(); err != nil { 96 | log.Println("could not change node version") 97 | cb("Could not change node version", false) 98 | return 99 | } 100 | 101 | for _, rawCmd := range BuildConfig.Build { 102 | cmds := strings.Split(rawCmd.Cmd, " ") 103 | buildCmd := exec.Command(cmds[0], cmds[1:]...) 104 | buildCmd.Dir = projectFolder+BuildConfig.Project.Name 105 | // buildCmd.Stdout = os.Stdout 106 | // buildCmd.Stderr = os.Stderr 107 | if buf, err := buildCmd.CombinedOutput(); err != nil { 108 | log.Println(fmt.Sprintf("[Error]:%v", rawCmd.Cmd)) 109 | log.Println("OUTPUT:", string(buf)) 110 | cb(fmt.Sprintf("[Error] :%v", rawCmd.Name), false) 111 | return 112 | } 113 | } 114 | 115 | cfg := runnable.NewStandConfig(BuildConfig.Project.Name, BuildConfig.Run[0].Cmd, projectFolder+BuildConfig.Project.Name, BuildConfig.Project.LogDir) 116 | 117 | runner, err := runnable.NewStandRunner(context.Background(), cfg) 118 | if err != nil { 119 | log.Println(fmt.Sprintf("[Error] :%v", err.Error())) 120 | cb(fmt.Sprintf("[Error] :%v", err.Error()), false) 121 | return 122 | } 123 | runner.SetEnv(BuildConfig.GetEnv()) 124 | log.Println("Build Successful!") 125 | 126 | d.Deploymnets[BuildConfig.Project.Name] = runner 127 | cb("Build Successful", true) 128 | err = runner.Run() 129 | if err != nil { 130 | log.Println("Error in running :", err) 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /internal/puller/gitPuller.go: -------------------------------------------------------------------------------- 1 | package puller 2 | 3 | import ( 4 | "log" 5 | 6 | "gopkg.in/src-d/go-git.v4" 7 | ) 8 | 9 | // this encapsulates all the pull logic of the git folder 10 | type GitPuller struct { 11 | RepoLink string 12 | Path string 13 | } 14 | 15 | func (p *GitPuller) Pull() error { 16 | // Clone the repository 17 | _, err := git.PlainClone(p.Path, false, &git.CloneOptions{ 18 | URL: p.RepoLink, 19 | // Auth: &http.BasicAuth{ 20 | // Username: "your-username", // Username can be anything except an empty string 21 | // Password: "your-access-token", // Personal access token 22 | // }, 23 | }) 24 | if err != nil { 25 | log.Fatalf("Failed to clone the repository: %v", err) 26 | } 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /internal/runnable/config.go: -------------------------------------------------------------------------------- 1 | package runnable 2 | 3 | import ( 4 | "log" 5 | "os" 6 | ) 7 | 8 | // Config to initialize a new StandRunner 9 | type StandConfig struct { 10 | ProjectName string 11 | CmdString string 12 | HomeDir string 13 | LogDir string 14 | Env []string 15 | 16 | //log management config 17 | LogMaxAge int64 18 | LogMaxSize int64 19 | LogMaxBackups int64 20 | LogCompression bool 21 | } 22 | 23 | // Creates the log and home directories of the project folder 24 | // and the log folder 25 | func (cfg *StandConfig) CreateDirectories() error { 26 | err := os.MkdirAll(cfg.HomeDir, os.ModeAppend|os.ModePerm) 27 | if err != nil { 28 | return err 29 | } 30 | err = os.MkdirAll(cfg.LogDir, os.ModeAppend|os.ModePerm) 31 | if err != nil { 32 | return err 33 | } 34 | 35 | return nil 36 | } 37 | 38 | // gives the default config 39 | func NewStandConfig(ProjectName, CmdString, HomeDir, LogDir string) *StandConfig { 40 | log.Println("Runner Created at: ",HomeDir) 41 | return &StandConfig{ 42 | ProjectName: ProjectName, 43 | CmdString: CmdString, 44 | HomeDir: HomeDir, 45 | LogDir: LogDir, 46 | Env: []string{}, 47 | LogMaxAge: 14, 48 | //max sise of the file in bytes 49 | LogMaxSize: 10, 50 | //number of backup files 51 | LogMaxBackups: 2, 52 | LogCompression: true, 53 | } 54 | } 55 | 56 | func (cfg *StandConfig) SetLogMaxAge(age int64) *StandConfig { 57 | cfg.LogMaxAge = age 58 | return cfg 59 | } 60 | 61 | func (cfg *StandConfig) SetLogMaxSize(size int64) *StandConfig { 62 | cfg.LogMaxSize = size 63 | return cfg 64 | } 65 | 66 | func (cfg *StandConfig) SetLogMaxBackups(x int64) *StandConfig { 67 | cfg.LogMaxBackups = x 68 | return cfg 69 | } 70 | 71 | func (cfg *StandConfig) SetLogCompression(compress bool) *StandConfig { 72 | cfg.LogCompression = compress 73 | return cfg 74 | } 75 | -------------------------------------------------------------------------------- /internal/runnable/runnable.go: -------------------------------------------------------------------------------- 1 | package runnable 2 | 3 | // Runnable represents anything that can be 4 | // spawned and runned as an daemon 5 | type Runnable interface { 6 | 7 | //Starts the Runner function 8 | //returns the error 9 | Run() error 10 | 11 | //takes the variables as the list of arguments 12 | //seperated by = , eg. key=value 13 | SetEnv(vars []string) 14 | 15 | //Calls the clean up logic such as closing the log file 16 | Flush() error 17 | 18 | //kills the process 19 | Kill() error 20 | } 21 | -------------------------------------------------------------------------------- /internal/runnable/runner.go: -------------------------------------------------------------------------------- 1 | package runnable 2 | 3 | import ( 4 | "context" 5 | "log" 6 | "os" 7 | "os/exec" 8 | "strings" 9 | "syscall" 10 | 11 | "gopkg.in/natefinch/lumberjack.v2" 12 | ) 13 | 14 | // Implements the Runnable interface 15 | type StandRunner struct { 16 | cmd *exec.Cmd 17 | pty *os.File 18 | logFile *lumberjack.Logger 19 | } 20 | 21 | func NewStandRunner(ctx context.Context, cfg *StandConfig) (*StandRunner, error) { 22 | args := strings.Split(cfg.CmdString, " ") 23 | cmd := exec.CommandContext(ctx, args[0], args[1:]...) 24 | 25 | cmd.SysProcAttr = &syscall.SysProcAttr{ 26 | Setpgid: true, 27 | } 28 | 29 | err := cfg.CreateDirectories() 30 | if err != nil { 31 | return nil, err 32 | } 33 | 34 | logger := &lumberjack.Logger{ 35 | Filename: cfg.LogDir + "/" + cfg.ProjectName + ".log", 36 | MaxSize: 10, 37 | MaxBackups: 2, 38 | MaxAge: 14, 39 | Compress: true, 40 | } 41 | 42 | cmd.Stdout = logger 43 | cmd.Stderr = logger 44 | cmd.Dir = cfg.HomeDir 45 | 46 | return &StandRunner{ 47 | cmd: cmd, 48 | logFile: logger, 49 | }, nil 50 | } 51 | 52 | func (s *StandRunner) Env() []string { 53 | return s.cmd.Env 54 | } 55 | 56 | func (s *StandRunner) SetEnv(vars []string) { 57 | s.cmd.Env = append(os.Environ(), vars...) 58 | } 59 | 60 | // Clean up Function 61 | func (s *StandRunner) Flush() error { 62 | s.logFile.Close() 63 | return nil 64 | } 65 | 66 | // kills the runner 67 | func (s *StandRunner) Kill() error { 68 | defer s.Flush() 69 | log.Println("Killed him!") 70 | 71 | return syscall.Kill(-s.cmd.Process.Pid, syscall.SIGKILL) 72 | } 73 | func (s *StandRunner) Run() error { 74 | 75 | //clean up logic when the run ends 76 | defer func() { 77 | s.Flush() 78 | }() 79 | 80 | err := s.cmd.Run() 81 | if err != nil { 82 | return err 83 | } 84 | return nil 85 | } 86 | -------------------------------------------------------------------------------- /internal/runtime/runtimeInstaller.go: -------------------------------------------------------------------------------- 1 | package runtime 2 | 3 | import ( 4 | "errors" 5 | "log" 6 | "os" 7 | "os/exec" 8 | "strings" 9 | ) 10 | 11 | // Each step in the install of the runtime 12 | type Installstep struct { 13 | cmd []string 14 | err string 15 | } 16 | 17 | type RuntimeInstaller interface { 18 | // installs the runtime of the specific language to the local repository 19 | Install() error 20 | 21 | //sets the version of the runtime 22 | SetVersion(string) 23 | 24 | //sets the home of the runtime 25 | SetHome(string) 26 | } 27 | 28 | type NodeRuntimeInstaller struct { 29 | fetcher string 30 | Home string 31 | Version string 32 | } 33 | 34 | // runs the command and throws the error 35 | // it will block until the command is completed with a exit code 36 | func (i *NodeRuntimeInstaller) runCommand(cmdString string) error { 37 | cmds := strings.Split(cmdString, " ") 38 | cmd := exec.Command(cmds[0], cmds[1:]...) 39 | cmd.Dir = i.Home 40 | 41 | cmd.Stdout = os.Stdout 42 | cmd.Stdin = os.Stdin 43 | 44 | err := cmd.Run() 45 | if err != nil { 46 | return err 47 | } 48 | return nil 49 | } 50 | 51 | // check for the installation of fetch tool 52 | func (i *NodeRuntimeInstaller) GetFetcher() error { 53 | toRun := []string{"which curl", "which wget"} 54 | for _, v := range toRun { 55 | err := i.runCommand(v) 56 | if err == nil { 57 | i.fetcher = strings.Split(v, " ")[1] 58 | return nil 59 | } 60 | } 61 | return errors.New("Your majesty, wget or curl is required for this peasant!") 62 | } 63 | 64 | func (i *NodeRuntimeInstaller) Install() error { 65 | var err error 66 | err = i.GetFetcher() 67 | if err != nil { 68 | return err 69 | } 70 | err = i.runCommand(i.fetcher + " -L -o node_install.sh https://bit.ly/n-install") 71 | if err != nil { 72 | log.Printf("Fetcher error: %v", err.Error()) 73 | return errors.New("Could not access " + i.fetcher) 74 | } 75 | 76 | err = i.runCommand("chmod +x node_install.sh") 77 | if err != nil { 78 | return errors.New("could not give permission") 79 | } 80 | err = i.runCommand("bash node_install.sh -y") 81 | if err != nil { 82 | return err 83 | } 84 | return nil 85 | } 86 | 87 | func (i *NodeRuntimeInstaller) SetVersion(version string) { 88 | i.Version = version 89 | } 90 | 91 | func (i *NodeRuntimeInstaller) SetHome(home string) { 92 | i.Home = home 93 | } 94 | -------------------------------------------------------------------------------- /internal/runtime/runtimeUtil.go: -------------------------------------------------------------------------------- 1 | package runtime 2 | 3 | import ( 4 | "os/exec" 5 | "syscall" 6 | ) 7 | 8 | func IsExitCode(code int, err error) bool { 9 | if exitError, ok := err.(*exec.ExitError); ok { 10 | if status, ok := exitError.Sys().(syscall.WaitStatus); ok { 11 | exitCode := status.ExitStatus() 12 | if exitCode == code { 13 | return true 14 | } else { 15 | return false 16 | } 17 | } 18 | } else { 19 | return false 20 | } 21 | return false 22 | } 23 | -------------------------------------------------------------------------------- /user/main.go: -------------------------------------------------------------------------------- 1 | package User 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "github.com/bitspaceorg/STAND-FOSSHACK/utils" 7 | "os" 8 | "strings" 9 | ) 10 | 11 | func CreateUser() { 12 | reader := bufio.NewReader(os.Stdin) 13 | 14 | fmt.Print("Enter username: ") 15 | username, _ := reader.ReadString('\n') 16 | username = strings.TrimSpace(username) 17 | 18 | fmt.Print("Enter password: ") 19 | password, _ := reader.ReadString('\n') 20 | password = strings.TrimSpace(password) 21 | 22 | hashedPassword := utils.HashPassword(password) 23 | 24 | userData := fmt.Sprintf("%s:%s\n", username, hashedPassword) 25 | 26 | if _, err := os.Stat(utils.ShadowFolder); os.IsNotExist(err) { 27 | os.MkdirAll(utils.ShadowFolder, 0700) 28 | } 29 | 30 | err := utils.AppendToFile(utils.GetShadowAuthFilePath(), userData) 31 | if err != nil { 32 | fmt.Println("Error creating user:", err) 33 | return 34 | } 35 | 36 | fmt.Println("User created successfully.") 37 | } 38 | 39 | func ValidateUser() bool { 40 | reader := bufio.NewReader(os.Stdin) 41 | 42 | fmt.Print("Enter username: ") 43 | username, _ := reader.ReadString('\n') 44 | username = strings.TrimSpace(username) 45 | 46 | fmt.Print("Enter password: ") 47 | password, _ := reader.ReadString('\n') 48 | password = strings.TrimSpace(password) 49 | 50 | hashedPassword := utils.HashPassword(password) 51 | 52 | file, err := os.Open(utils.GetShadowAuthFilePath()) 53 | if err != nil { 54 | fmt.Println("Error opening file:", err) 55 | return false 56 | } 57 | defer file.Close() 58 | 59 | scanner := bufio.NewScanner(file) 60 | for scanner.Scan() { 61 | line := scanner.Text() 62 | parts := strings.Split(line, ":") 63 | if len(parts) != 2 { 64 | fmt.Println("Invalid shadow file format.") 65 | return false 66 | } 67 | 68 | if parts[0] == username && parts[1] == hashedPassword { 69 | fmt.Println("User authenticated.") 70 | return true 71 | } 72 | } 73 | 74 | fmt.Println("Invalid username or password.") 75 | return false 76 | } 77 | -------------------------------------------------------------------------------- /utils/main.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "crypto/sha256" 5 | "encoding/hex" 6 | "fmt" 7 | "os" 8 | ) 9 | 10 | var ShadowFolder string = fmt.Sprintf("%v/.stand", os.Getenv("HOME")) 11 | 12 | const ShadowAuthFile string = "/auth" 13 | const ShadowGUIFile string = "/gui" 14 | const ShadowReposFile string = "/repos" 15 | const GUIFetchLink string = "https://github.com/bitspaceorg/STAND-FRONTEND-FOSSHACK" 16 | 17 | func GetShadowAuthFilePath() string { 18 | return fmt.Sprintf("%v%v", ShadowFolder, ShadowAuthFile) 19 | } 20 | 21 | func GetShadowReposFilePath() string { 22 | return fmt.Sprintf("%v%v", ShadowFolder, ShadowReposFile) 23 | } 24 | 25 | func GetShadowGUIFilePath() string { 26 | return fmt.Sprintf("%v%v", ShadowFolder, ShadowGUIFile) 27 | } 28 | 29 | func GetShadowGUIBuildPath() string { 30 | return fmt.Sprintf("%v%v/out", ShadowFolder, ShadowGUIFile) 31 | } 32 | 33 | func HashPassword(password string) string { 34 | hash := sha256.New() 35 | hash.Write([]byte(password)) 36 | return hex.EncodeToString(hash.Sum(nil)) 37 | } 38 | 39 | func AppendToFile(filename, data string) error { 40 | f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600) 41 | if err != nil { 42 | return err 43 | } 44 | defer f.Close() 45 | 46 | _, err = f.WriteString(data) 47 | return err 48 | } 49 | --------------------------------------------------------------------------------