Compare commits

..

247 commits

Author SHA1 Message Date
Masu Baumgartner a4080cc1b1
Merge pull request #418 from Moonlight-Panel/v2_UpdateToDotnet8
Upgraded moonlight to dotnet 8
2024-05-27 14:32:46 +02:00
Masu Baumgartner 4f5a4913d7 Upgraded moonlight to dotnet 8 2024-05-27 14:32:16 +02:00
Masu Baumgartner c340e48f02
Merge pull request #415 from Moonlight-Panel/v2_addNodeOnlineCheckOnServerDeploy
Added node online check on server create
2024-05-23 14:37:26 +02:00
Masu Baumgartner 257af8106d
Merge pull request #417 from Moonlight-Panel/v2_ImproveModularUI
Made user dashboard modular and extendable via plugins
2024-05-21 21:50:43 +02:00
Moritz 6eedc8aba9 Renamed the Implementation 2024-05-21 14:12:46 +02:00
Moritz cba98bdf6f Made Index page Modular
Made Index Page editable with the Plugin System, added greeting Component
2024-05-20 09:07:06 +02:00
Marcel Baumgartner d2da868b71 Updated to use the new mooncore version 2024-05-19 20:37:54 +02:00
Masu Baumgartner 685221b454
Merge pull request #416 from Moonlight-Panel/v2_ResponsivenessImprovements
Improved responsive behaviour
2024-05-19 15:33:08 +02:00
Moritz f12e5f10d5 Improved Server Ui responsivity 2024-05-19 15:20:24 +02:00
Moritz cc7b4d7daa Improved Responsiveness for auth pages 2024-05-19 14:52:42 +02:00
Moritz 769c876dc5 Added a way to sort the admin components with an index 2024-05-19 14:27:45 +02:00
Moritz ccec79cca7 Added node online check on Server create 2024-05-19 00:04:27 +02:00
Moritz e79f2199c3
Forgot two stars - readme.md 2024-05-18 23:52:09 +02:00
Moritz c53d315bd8
Update README.md 2024-05-18 23:51:18 +02:00
Moritz 0ae9c27d93 Removed Last buggy thing
Forgot to remove it :(
2024-05-18 22:17:04 +02:00
Masu Baumgartner 2950034a30
Merge pull request #407 from Moonlight-Panel/v2_ImprovedAdminPage
Improved admin page with extendable columns and components via plugin system
2024-05-18 22:15:06 +02:00
Masu Baumgartner 158115bb3b
Merge branch 'v2' into v2_ImprovedAdminPage 2024-05-18 22:14:05 +02:00
Moritz 56184a8254 Final admin Page
Added Admin System To be as Modular as masu wants it to be
2024-05-18 22:11:58 +02:00
Masu Baumgartner c27b1689f3
Merge pull request #410 from Moonlight-Panel/v2_AdminPageLinkFix
Fixed Linking and Cards on Admin Page
2024-05-17 08:42:01 +02:00
Moritz 3c3dd2af92
Made issue template v2 ready
Removed Wings Issue field, edited placeholders for version
2024-05-16 16:26:09 +02:00
Moritz 125260e7ef Fixed Linking and Cards on Admin Page 2024-05-16 16:21:39 +02:00
Marcel Baumgartner b608a0779c Quick-fix for server loading in user view 2024-05-14 21:57:08 +02:00
Moritz 7225db0bf1 added some informations 2024-05-14 14:52:27 +02:00
Masu Baumgartner 3f0cdff262
Merge pull request #408 from Moonlight-Panel/v2_FileManagerImprovements
Adding some more file manager improvements to the main branch
2024-05-14 14:50:10 +02:00
Moritz 3270039a6a improved admin page
Added the logic for a more modular admin page, where every feature can add cards and components with just a call of a function
2024-05-14 14:43:54 +02:00
Marcel Baumgartner fda972a90e Implemented archiving and extracting for users 2024-05-14 14:08:07 +02:00
Masu Baumgartner 45e81c98bf
Merge pull request #406 from Moonlight-Panel/v2_AddAdminPage
Added Basic Admin Page, will still be adding more in the future
2024-05-14 00:46:27 +02:00
Moritz d9dd9bbf4d Optimized it, as Masu wished 2024-05-14 00:42:00 +02:00
Moritz 160de6443b Added Basic Admin Page, will still be adding more in the future 2024-05-13 18:38:52 +02:00
Masu Baumgartner 923a3c18b8 Started adding archive ui 2024-05-13 16:20:38 +02:00
Masu Baumgartner 8dc37525ce Improved egg importing so it should be able to import any egg now 2024-05-06 18:34:50 +02:00
Masu Baumgartner 7bd34842fa Commented out dummy value 2024-05-06 10:26:08 +02:00
Masu Baumgartner da8b01bb98 Added server kill confirmation prompt. Improved power action handling 2024-05-06 10:24:45 +02:00
Masu Baumgartner c9fe469f5b
Merge pull request #404 from Moonlight-Panel/v2_FileManagerImprovements
Improved file manager. This is the first merge of this branch. More commits are planned
2024-05-06 09:45:54 +02:00
Masu Baumgartner 406f7cad65 Added empty file list indicator. Removed dropzone.js 2024-05-06 09:44:38 +02:00
Masu Baumgartner 558e237608 Small fix for node memory calculation
Made calculation accurate using:
https://stackoverflow.com/questions/41224738/how-to-calculate-system-memory-usage-from-proc-meminfo-like-htop
2024-05-06 09:15:27 +02:00
Marcel Baumgartner b4251a0f1f Started with adding modules for archiving for the file manager 2024-05-04 23:06:15 +02:00
Marcel Baumgartner 0234a8e179 Increased kestrel default limits and added option to change the moonlight defaults 2024-05-01 20:17:41 +02:00
Masu Baumgartner efacaa9b86
Merge pull request #402 from Moonlight-Panel/v2_addFaviconWithAssetApi
V2 add favicon with asset api
2024-04-30 09:04:24 +02:00
Moritz 7c40d999ff Image already existed so i used that one 2024-04-29 16:34:11 +02:00
Moritz 99c14693d5 Added Favicon using the asset api 2024-04-29 16:19:54 +02:00
Marcel Baumgartner 2cf03d4b68 Improved MySQL container boot handling
This will reduce the large error messages to a single line saying that the mysql container is still booting. Hopefully this fixes the login cli command as well
2024-04-29 16:16:25 +02:00
Masu Baumgartner 52bab229ea
Add files via upload 2024-04-27 22:29:17 +02:00
Marcel Baumgartner 8b15383b45 Fixed percentage calculation of disk space 2024-04-27 22:05:03 +02:00
Marcel Baumgartner eaddefdc8e Fixed node overview crash when no cores are available 2024-04-27 21:58:20 +02:00
Marcel Baumgartner 95cfa815fb Added some missing labels for the server manager ui 2024-04-27 17:35:24 +02:00
Marcel Baumgartner 870b2516a1 Fixed node list percentage calculation for storage 2024-04-27 17:03:45 +02:00
Masu Baumgartner ef982a52ed
Merge pull request #398 from Moonlight-Panel/v2_FixNodeLogsNullRef
Fixed the null reference exception when moonlight is unable to reach the node
2024-04-27 13:49:48 +02:00
Marcel Baumgartner 6ae2390b46 Fixed the null reference exception when moonlight is unable to reach the node 2024-04-27 13:49:15 +02:00
Masu Baumgartner e1fbf601f3
Merge pull request #397 from Moonlight-Panel/v2_AddDetailsInNodeList
Added more details into the node list (like cpu, memory and disk)
2024-04-27 13:48:03 +02:00
Marcel Baumgartner 2364a53dd1 Added more details into the node list (like cpu, memory and disk) 2024-04-27 13:47:15 +02:00
Marcel Baumgartner be7cecc721 Added github issue templates and funding.yml file
Thank you @gOOvER  for the templates. Just added them back in from the main branch
2024-04-26 19:08:14 +02:00
Masu Baumgartner f2aad2ccdf
Merge pull request #395 from Moonlight-Panel/v2_AddNodeLogView
Added node log view
2024-04-23 16:58:55 +02:00
Marcel Baumgartner 8e76a68b62 Added node log view 2024-04-23 16:58:11 +02:00
Masu Baumgartner 6c722a9ac3
Merge pull request #394 from Moonlight-Panel/v2_AddFooterCustomisation
Added footer customization
2024-04-23 16:26:50 +02:00
Marcel Baumgartner 52515e7df1 Added footer customization 2024-04-23 16:26:26 +02:00
Masu Baumgartner 722c56271f
Merge pull request #393 from Moonlight-Panel/v2_SmallUiImprovements
Small ui improvements
2024-04-23 16:04:36 +02:00
Marcel Baumgartner 9e85c35f59 Upgraded to mooncoreui 1.1.6 2024-04-23 16:03:51 +02:00
Marcel Baumgartner 538a15b609 Added new mooncore form attributes for creating servers 2024-04-23 16:03:35 +02:00
Marcel Baumgartner bb0ab9dc67 Added missing space for tooltip in the settings 2024-04-23 16:03:03 +02:00
Marcel Baumgartner 87b9b5e1c2 Fixed mobile layout for permission integer input 2024-04-23 16:02:43 +02:00
Masu Baumgartner ba0b46db90
Merge pull request #392 from theghostofakatsuki/v2_AddNodeFqdnValidation
Added validation for the fqdn field of the node
2024-04-23 14:06:44 +02:00
theghostofakatsuki ddcbf56abe Added validation for the fqdn field of the node 2024-04-23 14:03:35 +02:00
Masu Baumgartner c553f6f5da
Merge pull request #390 from Moonlight-Panel/v2_AddRegisterDeny
Added the option to disable register
2024-04-22 18:23:48 +02:00
Marcel Baumgartner 5b25774851 Added the option to disable register 2024-04-22 18:23:09 +02:00
Marcel Baumgartner 01729b982d Improved console disposing and closing 2024-04-17 17:03:18 +02:00
Masu Baumgartner fd01787dfb
Merge pull request #388 from Moonlight-Panel/v2_ImproveConsoleStreaming
Improved console streaming
2024-04-17 15:43:32 +02:00
Marcel Baumgartner 90eed5c74c Fixed a bug. Improved error handling. Small cleanup of code 2024-04-17 15:42:51 +02:00
Marcel Baumgartner dcfb836b39 Added some documentation
it triggered me that this was missing, okay?
2024-04-17 15:42:23 +02:00
Marcel Baumgartner 610501ef19 Improved console ui disposing 2024-04-17 07:49:48 +02:00
Marcel Baumgartner 48e2e1eb98 Fixed weird console restore glitch 2024-04-17 07:31:56 +02:00
Marcel Baumgartner f3ad71e33f Switched to improved mooncore advanced websocket stream version 2024-04-16 22:56:42 +02:00
Marcel Baumgartner eaacdb3446 Fixed memory calculation of moonlight itself 2024-04-16 17:18:40 +02:00
Marcel Baumgartner be173e1d48 Working on improved console streaming 2024-04-16 07:40:48 +02:00
Marcel Baumgartner e3f040c978 Added the ability to send commands using the Enter key and not clicking the button
Was about time lol
2024-04-15 18:40:53 +02:00
Marcel Baumgartner e25b005643 Upgraded to MoonCoreUI 1.1.5. Added allocations needed field for images 2024-04-15 17:39:23 +02:00
Masu Baumgartner 4631e66dca
Merge pull request #387 from Moonlight-Panel/v2_FixImageDelete
Fixed image deletion
2024-04-14 11:58:08 +02:00
Marcel Baumgartner 73b93f8262 Fixed image deletion 2024-04-14 11:56:04 +02:00
Masu Baumgartner 5a1ecebbe9
Merge pull request #384 from gOOvER/name-lengh
Updated all user name length attributes in form models
2024-04-13 00:39:17 +02:00
gOOvER 8dbf458ea3 lot more placews for the Username lengh 2024-04-12 15:13:49 +02:00
Masu Baumgartner c5fef04d06
Merge pull request #382 from gOOvER/goover
Change username length to 6
2024-04-12 10:42:55 +02:00
Marcel Baumgartner 5fb507febc Handle node booting state in the server console websocket 2024-04-12 10:41:54 +02:00
gOOvER 50d6954829 change username leght to 6 2024-04-12 08:20:44 +02:00
Marcel Baumgartner e5f4fd9d62 Added auth header for console streaming 2024-04-11 13:07:27 +02:00
Masu Baumgartner 7da87fb065
Merge pull request #380 from Moonlight-Panel/v2_EarlyAccessFixes
Fixed bugs reported by early access people
2024-04-11 08:46:05 +02:00
Marcel Baumgartner b81646c1d4 Fixed crash when deleting images 2024-04-11 08:41:43 +02:00
Marcel Baumgartner 752f84127c Changed lets encrypt email. Formatted command better 2024-04-10 22:30:43 +02:00
Marcel Baumgartner bf1b9533c8 Updated node setup url 2024-04-10 12:29:47 +02:00
Masu Baumgartner feddea1a69
Merge pull request #374 from Moonlight-Panel/v2_FinalizeFileManager
Finalized file manager
2024-04-01 20:32:42 +02:00
Marcel Baumgartner 20fcd5015e Improved file manager, switched to faster node/daemon file communication. Removed old components 2024-04-01 17:04:38 +02:00
Marcel Baumgartner 9abf32b288 Added select folder dialog. Added item moving as a module 2024-03-30 23:47:59 +01:00
Marcel Baumgartner 5d9c32a196 Added file editor to the api. Made the entire file manager available to the interfaces. 2024-03-30 22:39:28 +01:00
Marcel Baumgartner cdc2954d0b Implemented modular create actions 2024-03-30 22:26:52 +01:00
Marcel Baumgartner b2929fe211 Added modular selection actions 2024-03-30 22:06:33 +01:00
Marcel Baumgartner 3a74f3abcd Fixed small mistake on native ssl support 2024-03-30 00:21:33 +01:00
Marcel Baumgartner 49077e7023 Reimplemented the file manager with a cleaner ui, a base path protection from the core and modular and expandable 2024-03-30 00:18:40 +01:00
Marcel Baumgartner 44b2d07fdb Moved logo assets to the core asset folder. Removed unused default avatar 2024-03-24 21:16:21 +01:00
Marcel Baumgartner 0ee4f3fe04 Replaced io usage with network usage in stats page 2024-03-24 21:09:54 +01:00
Marcel Baumgartner 456d87f262 Added http debug middleware to trace requests 2024-03-24 19:20:13 +01:00
Marcel Baumgartner e47a4c29f7 Switched to mooncore log rotation. Added experimental https support 2024-03-24 12:48:50 +01:00
Marcel Baumgartner f172d765e3 Started adding node setup page 2024-03-22 20:50:11 +01:00
Marcel Baumgartner 9bf129f1ad Added automatic user creation on first start 2024-03-19 17:31:15 +01:00
Marcel Baumgartner 1cb603a3f3 Added default assets to docker image 2024-03-19 17:30:58 +01:00
Marcel Baumgartner 0a807605ad New v2 project structure 2024-03-18 09:31:33 +01:00
Marcel Baumgartner e20415a5bd New gitignore 2024-03-18 09:31:13 +01:00
Marcel Baumgartner 15a3789174 Remove old v2 structure 2024-03-18 09:30:30 +01:00
Masu Baumgartner 823970f617
Merge pull request #372 from Moonlight-Panel/v2_ServerFeature
V2 server feature
2024-03-18 09:27:23 +01:00
Masu Baumgartner 5a025eb75b
Create README.md 2024-03-04 11:17:17 +01:00
Marcel Baumgartner bf6641c151 Reimplemented config in diagnose file and added node data 2024-02-14 12:07:14 +01:00
Marcel Baumgartner f18877f9b1 Small ui fix 2024-02-14 11:46:05 +01:00
Marcel Baumgartner c3679afed7 Fixed debug log config 2024-02-14 10:34:05 +01:00
Marcel Baumgartner a0ca9af5c9 Started implementing schedules feature 2024-02-14 10:20:04 +01:00
Marcel Baumgartner d1f73e6d78 Added reconnecting animation instead of connection lost icon for connection indicator 2024-02-13 22:56:18 +01:00
Marcel Baumgartner 368886c95c Removed console border 2024-02-13 22:52:46 +01:00
Marcel Baumgartner 86f3957028 Adjusted some font styles for server view 2024-02-13 22:50:37 +01:00
Marcel Baumgartner 6ec86fdc25 Improved ux for ticket popup 2024-02-13 22:46:31 +01:00
Marcel Baumgartner 068858f3a1 Added spacing to server user layout navbar 2024-02-13 22:33:06 +01:00
Marcel Baumgartner 8d11d2360e Redesigned network tab 2024-02-13 22:32:49 +01:00
Marcel Baumgartner 970bca7121 Fixed input alignment for variable page 2024-02-11 17:57:16 +01:00
Marcel Baumgartner 07c09e48e3 Started adding network tab for servers 2024-02-11 17:54:15 +01:00
Marcel Baumgartner b2c816cafb Added console page as default page 2024-02-11 16:41:20 +01:00
Marcel Baumgartner 960a0bceff Reduced server console initial content 2024-02-11 16:38:51 +01:00
Marcel Baumgartner aaf4c05630 Fixed moving items to the location they are currently at 2024-02-11 16:38:28 +01:00
Marcel Baumgartner fada1a11b0 Added docker image select / variable editor page 2024-02-07 22:30:51 +01:00
Marcel Baumgartner dfa34a6808 Fixed variable loading for single server query 2024-02-07 22:30:10 +01:00
Marcel Baumgartner 1b427607d1 Fixed jwt validation error. Added node allocations editor. Small fixes 2024-02-07 21:08:37 +01:00
Marcel Baumgartner 70445069fd Fixed docker build and ensured a storage folder is created to mount to volume to 2024-02-07 21:07:38 +01:00
Marcel Baumgartner 423616b9f3 Implemented download in the file manager. Made file access jwt more modular 2024-02-06 22:23:47 +01:00
Marcel Baumgartner 26ed50c94b Refactored and cleaned some stuff 2024-02-06 19:30:30 +01:00
Marcel Baumgartner caa34dd79d Reimplemented filemanager and fixed some bugs 2024-02-06 11:12:04 +01:00
Marcel Baumgartner 0eabe27196 Reimplementing file manager and code editor (untested)
TODO: Add ftp auth back
2024-02-05 22:40:15 +01:00
Marcel Baumgartner dfc2b5af17 Added hotkey service. Modified jwt service to use jwt types 2024-02-05 22:39:09 +01:00
Marcel Baumgartner 955946d0a6 Implemented console. Fixed streaming bugs. Added server command sending. Added reset and router back 2024-02-03 12:18:06 +01:00
Marcel Baumgartner 9e515d9ed7 Added state streaming. Started working on server console 2024-02-02 22:21:31 +01:00
Marcel Baumgartner 95507fd41f Added database migration checking and fixed/mocked server layout 2024-02-01 22:43:43 +01:00
Marcel Baumgartner 8d75b30ae4 Finished switching to mooncore 2024-02-01 17:56:05 +01:00
Marcel Baumgartner 64bcfe74e7 Refactored whole solution to use the MoonCore and MoonCoreUI library 2024-02-01 14:57:10 +01:00
Marcel Baumgartner 2729564495 Moved service admin pages to correct folder 2024-01-31 12:13:57 +01:00
Marcel Baumgartner 0ec6949095 Started updating service feature with missing changes from AddServersFeature branch 2024-01-30 22:56:26 +01:00
Marcel Baumgartner 681403ec6e Fixed some bugs and added a error handler for the service creation 2024-01-30 22:42:07 +01:00
Marcel Baumgartner aaee81e9c4 Improved image editor and added more options 2024-01-29 17:17:42 +01:00
Marcel Baumgartner 4e5124cc1b Added image update pages. Added forms models. Implemented parts of the image editor components 2024-01-28 17:50:20 +01:00
Marcel Baumgartner 99a7d7bd73 Started implementing image editor and parse config editor 2024-01-28 13:58:23 +01:00
Marcel Baumgartner 6fd1336f1c Added base models for servers. Added ws packet connection utility. Added some ui from old branch. Added some packeges. And more smaller things 2024-01-27 13:28:09 +01:00
Marcel Baumgartner 33c1ffa0ba Started reimplementing server feature because we use a new project structure now. This is way cleaner than the last implementation 2024-01-26 20:09:53 +01:00
Marcel Baumgartner 19001e5836
Merge pull request #362 from Moonlight-Panel/v2_RestructureTry2
Restructured whole v2 project to be easier to develop new features
2024-01-26 17:02:30 +01:00
Marcel Baumgartner 12bc66a95b Restructured the rest of the features to their own environment 2024-01-26 13:53:34 +01:00
Marcel Baumgartner 63b2b40227 After the first try literally gave me a head ace, there is the second try with a better way of structuring it and not divinding so much core components in individual features. Still not done though 2024-01-25 21:40:23 +01:00
Marcel Baumgartner bb53f1c40a
Merge pull request #359 from Moonlight-Panel/v2_TransactionImprovement
Implemented transaction dates
2024-01-19 10:34:33 +01:00
Marcel Baumgartner 46f08059d7 Implemented transaction dates 2024-01-19 10:34:01 +01:00
Marcel Baumgartner a9af1ec15e
Merge pull request #358 from Moonlight-Panel/v2_UiFixes
Added some ui fixes
2024-01-16 16:32:14 +01:00
Marcel Baumgartner 9179d6825c Improved order duration border effect 2024-01-16 16:30:44 +01:00
Marcel Baumgartner 4816befa71 Improved ticket popup button. Added better separation between tickets in the user view 2024-01-16 16:25:34 +01:00
Marcel Baumgartner 67c846ddc8 Renamed announcements to news in community navigation 2024-01-16 16:18:38 +01:00
Marcel Baumgartner 79d860351c Resized profile picture change text in user settings 2024-01-16 16:15:09 +01:00
Marcel Baumgartner c1216ea708 Improved 2fa and password ui 2024-01-16 16:12:36 +01:00
Marcel Baumgartner a11569a737 Fixed inconsistent spacing. Reduced page size for transactions 2024-01-16 16:03:52 +01:00
Marcel Baumgartner cd4feec58f Made space for more diagnose components 2024-01-16 16:02:01 +01:00
Marcel Baumgartner 518ec7055a Removed inconsistent border in settings/configuration page 2024-01-16 15:57:39 +01:00
Marcel Baumgartner 2552b92e5d Improved user dashboard 2024-01-16 15:38:28 +01:00
Marcel Baumgartner e9d3ab5307 Added error reporting in soft error handler 2024-01-16 15:02:15 +01:00
Marcel Baumgartner becc67c46b Improved error message view of soft error handler 2024-01-16 14:59:44 +01:00
Marcel Baumgartner c3a0833410 Improved error view of smart form 2024-01-16 14:56:10 +01:00
Marcel Baumgartner da53a0eef7
Merge pull request #357 from Moonlight-Panel/v2_AddEnvironmentConfiguration
Implemented environment variable loading in config service
2024-01-16 14:39:14 +01:00
Marcel Baumgartner 289f8921ff Implemented environment variable loading in config service 2024-01-16 14:38:43 +01:00
Marcel Baumgartner e1a0cfeebb Merge branch 'v2' of https://github.com/Moonlight-Panel/Moonlight into v2 2024-01-08 08:43:29 +01:00
Marcel Baumgartner 55a7d71c7f Improved error message for username regex on register form 2024-01-08 08:43:11 +01:00
Marcel Baumgartner 8d1cb47a8a
Merge pull request #353 from Moonlight-Panel/v2_ImproveTicketing
Improved ticketing
2024-01-08 08:34:39 +01:00
Marcel Baumgartner 2510d6748c Implemented viewing of closed tickets for users 2024-01-08 08:32:57 +01:00
Marcel Baumgartner f17ff9246d Implemented input disable on closed tickets for users 2024-01-08 08:32:39 +01:00
Marcel Baumgartner a2a9a6e21d
Merge pull request #352 from Moonlight-Panel/v2_AntiAdBlocker
Implemented basic adblocker prevention
2024-01-05 11:44:18 +01:00
Marcel Baumgartner 0e1ddfbccb Implemented basic adblocker prevention
Tested with uBlockOrigin
2024-01-05 11:43:37 +01:00
Marcel Baumgartner 2edf8b4a9f
Merge pull request #351 from Moonlight-Panel/v2_Fixes
Some fixes
2024-01-05 11:06:10 +01:00
Marcel Baumgartner e47cac71fc Added a proper error message when starting a charge process without selecting a payment gateway 2024-01-05 11:05:35 +01:00
Marcel Baumgartner 0aa28d9764 Fixed service renewal check to allow admins to access the service even if it is expired 2024-01-05 11:04:43 +01:00
Marcel Baumgartner 8b032462c0
Merge pull request #350 from Moonlight-Panel/v2_AddDiagnoseFileExport
Added diagnose file export
2024-01-04 16:04:28 +01:00
Marcel Baumgartner 3ae694a3da Added diagnose file export 2024-01-04 16:03:55 +01:00
Marcel Baumgartner 741d13b18a Changed invalid img sources 2023-12-22 23:09:58 +01:00
Marcel Baumgartner 0d8cc5bd5d
Merge pull request #345 from Moonlight-Panel/v2_AddThemeFeature
Added theme feature
2023-12-22 23:03:29 +01:00
Marcel Baumgartner 04ef9dc827 Added asset proxy. Adding google fonts as file instead of loading it externally. Removed demo theme 2023-12-22 23:02:37 +01:00
Marcel Baumgartner c11ff632d2 Implemented theme exporting and importing 2023-12-22 20:47:00 +01:00
Marcel Baumgartner c5a3c0550c As the default theme is not shown in the Themes page, we do not need this way of checking if its enabled 2023-12-22 14:38:08 +01:00
Marcel Baumgartner a67829035e Implemented basic theme feature. Missing are import, export and asset proxy 2023-12-22 14:27:37 +01:00
Marcel Baumgartner f57aac4f6c Made some ui changes 2023-11-18 23:25:52 +01:00
Marcel Baumgartner 3a53fa0a3c Done some todo's and removed old TL tags 2023-11-16 00:48:06 +01:00
Marcel Baumgartner 7145890801
Merge pull request #338 from Moonlight-Panel/AddServiceImplementationApi
Added service implementation api and some service utils
2023-11-15 21:06:02 +01:00
Marcel Baumgartner 6d5a5fd16c Added expired services overview to store pages 2023-11-15 21:02:35 +01:00
Baumgartner Marcel 3092daaad4 Fixed cookie loading. Started implementing service expire handling 2023-11-15 15:24:27 +01:00
Baumgartner Marcel 0f989a38c3 Implemented service admin view 2023-11-15 11:05:12 +01:00
Baumgartner Marcel e8706cad1c Made implementation api cleaner 2023-11-15 10:25:28 +01:00
Baumgartner Marcel d55490dd51 Started working on service implementation api 2023-11-14 17:54:15 +01:00
Marcel Baumgartner a1cd6b5cd9
Merge pull request #337 from Moonlight-Panel/AddTicketSystem
Added ticket system
2023-11-10 15:14:49 +01:00
Marcel Baumgartner 0e43278bdd
Merge branch 'v2' into AddTicketSystem 2023-11-10 15:13:51 +01:00
Marcel Baumgartner d8bb2b7356 Implemented bucket delete and improved avatar update 2023-11-10 15:10:09 +01:00
Marcel Baumgartner f779e5e920 Added logo and favicon 2023-11-09 21:47:11 +01:00
Marcel Baumgartner c57ad9cce7 Fixed ui bugs. Implemented ticket deletion when a user is going to be deleted 2023-11-09 14:42:41 +01:00
Marcel Baumgartner b492d65efb Added details in ticket view. Renamed mail verify button 2023-11-09 14:09:23 +01:00
Marcel Baumgartner 332937f964 Started implementing admin ticket ui. Cleaned up some stuff 2023-11-09 01:56:14 +01:00
Marcel Baumgartner f5501f77fe Implemented file upload and improved ui. Fixed file upload bug in ticket service 2023-11-06 17:41:24 +01:00
Marcel Baumgartner 30bfae96fd
Merge pull request #336 from Moonlight-Panel/AddPanelRestart
Added basic restarting for instances running in docker
2023-11-06 16:36:30 +01:00
Marcel Baumgartner d95d613a57 Added basic restarting for instances running in docker 2023-11-06 16:34:52 +01:00
Marcel Baumgartner 1c96f9d13c Started implementing the ticket system. Implemented user site tickets without attachments atm. Added db models 2023-11-01 17:35:12 +01:00
Marcel Baumgartner 9e182768f6
Merge pull request #333 from Moonlight-Panel/AddConfigEditor
Added config editor
2023-10-31 10:48:53 +01:00
Baumgartner Marcel 11dace2617 Implemented config editor. Fixed auto property 2023-10-31 10:48:20 +01:00
Marcel Baumgartner 93cfe7cd1a Started on implementing a better reflection based editor 2023-10-30 00:40:59 +01:00
Marcel Baumgartner b580781618
Merge pull request #332 from Moonlight-Panel/ImproveUserDelete
Improved user delete
2023-10-29 17:52:12 +01:00
Marcel Baumgartner ee9190447f Fixed some user deletion issues 2023-10-29 17:51:47 +01:00
Marcel Baumgartner aa501244e1 Improved user delete to delete relational data and remove all content from a user 2023-10-29 16:42:02 +01:00
Marcel Baumgartner 52d39151da
Merge pull request #331 from Moonlight-Panel/AddUserAdmin
Added user view/edit. Added some tool tips. Improved some ui
2023-10-29 16:07:14 +01:00
Marcel Baumgartner 0241be13cf Added user view/edit. Added some tool tips. Improved some ui 2023-10-29 16:05:29 +01:00
Marcel Baumgartner c3acb4898e
Merge pull request #330 from Moonlight-Panel/AddCommunity
Added community tab
2023-10-29 11:15:05 +01:00
Marcel Baumgartner 559a00c181 Added sorting by creation date 2023-10-29 11:14:00 +01:00
Marcel Baumgartner 122a205f92 Fixed some bugs. Added admin ui. Added word filter 2023-10-29 00:49:15 +02:00
Marcel Baumgartner c4e7e10f5e Added events and projects. Finished the basic community features 2023-10-28 22:27:25 +02:00
Marcel Baumgartner 6d83c31f42 Implemented update and delete for posts 2023-10-28 19:33:59 +02:00
Baumgartner Marcel d98e8ef0f8 Added test logo file. Started adding community posts and comments 2023-10-27 15:10:44 +02:00
Baumgartner Marcel a29dc8257e Implemented text editor 2023-10-27 09:05:45 +02:00
Marcel Baumgartner 801c78bb84 Started implementing text editor 2023-10-27 07:34:25 +02:00
Marcel Baumgartner a671e601c0
Merge pull request #329 from Moonlight-Panel/AddStore
Implemented new store system
2023-10-26 10:13:29 +02:00
Baumgartner Marcel 4de6804f13 Added transaction event and mail sending for the transaction 2023-10-26 09:45:54 +02:00
Marcel Baumgartner 7a3d61c659 FInished auto crud. Switched to auto crud for coupons. Added gift code manage 2023-10-25 22:22:32 +02:00
Baumgartner Marcel b0d9837256 Added auto form stuff and started implementing auto crud and store admin things 2023-10-25 16:26:42 +02:00
Marcel Baumgartner f07e3c5a5a Started working on store admin 2023-10-24 23:45:00 +02:00
Marcel Baumgartner 19b5c7816a Small changes 2023-10-24 21:42:47 +02:00
Marcel Baumgartner dae09668b2 Started on implementing mail sending for store system 2023-10-24 16:16:45 +02:00
Marcel Baumgartner aa150a7a69 Extended plugin system to support kestrel pipeline injection 2023-10-24 12:26:29 +02:00
Marcel Baumgartner d0f03a19a2 Add gift code redeem 2023-10-24 11:13:06 +02:00
Baumgartner Marcel 863a002370 Started implementing modular payment gateways. Implemented a basic plugin system
TODO: Add capability for plugins to modify the kestrel pipeline
2023-10-23 17:04:36 +02:00
Baumgartner Marcel ff9bcc6433 Add payments page with transaction history 2023-10-23 15:04:57 +02:00
Baumgartner Marcel e062df4eb6 Fixed some bugs. Added renew 2023-10-23 13:27:49 +02:00
Marcel Baumgartner 2dd1d1f69c Added coupon processing. Fixed price calculation 2023-10-22 22:02:45 +02:00
Marcel Baumgartner 3d4f22f6f6 Refactored some forms. Added service shares 2023-10-22 21:28:15 +02:00
Marcel Baumgartner 48c95d4ec6 Added service ordering and implemented basic service creation 2023-10-19 11:35:14 +02:00
Marcel Baumgartner b19208b3b0 Add payment link to profile menu 2023-10-19 00:41:00 +02:00
Marcel Baumgartner 6410846afc Implemented order ui and validation. Added coupon handling 2023-10-19 00:30:54 +02:00
Marcel Baumgartner f7a16fd287 Implemented basic store and store admin system. Added alerts. Added db models for store 2023-10-18 21:09:14 +02:00
Marcel Baumgartner 4159170244 Added ticket models. Did some ui 2023-10-17 09:00:59 +02:00
Marcel Baumgartner 8c82631569 Implemented live chat ui 2023-10-16 23:09:24 +02:00
Marcel Baumgartner 96bd131807 Implemented permissions. Added user overview and session overview. Added lazy loader.. Did some ui 2023-10-16 21:15:04 +02:00
Marcel Baumgartner 0cde0fe302 Added mail system. Added password reset and email verify. Switched to new event system. Added event based mail sending 2023-10-16 17:13:15 +02:00
Marcel Baumgartner 49c893f515 Implemented basic user auth, register, login, details and avatar stuff from helio 2023-10-15 19:19:47 +02:00
Marcel Baumgartner 3bb4e7daab Added event system, soft error handler and added some things from helio 2023-10-13 21:42:12 +02:00
Marcel Baumgartner afb3a7f3a3 Added some helpers, a new logger and log migration and modified the router 2023-10-13 21:08:56 +02:00
Marcel Baumgartner 69b50275cd Added theme and basic ui defaults 2023-10-13 20:48:36 +02:00
Marcel Baumgartner 76866fe14f Update .gitignore 2023-10-13 11:29:29 +02:00
Marcel Baumgartner 3308def6c5 Update .gitignore 2023-10-13 11:23:29 +02:00
Marcel Baumgartner 39b632d483 Removed old project structure 2023-10-13 11:06:16 +02:00
1368 changed files with 51980 additions and 146686 deletions

View file

@ -1,20 +0,0 @@
{
"name": "C# (.NET)",
"image": "mcr.microsoft.com/devcontainers/dotnet:0-6.0",
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"streetsidesoftware.code-spell-checker"
]
}
},
"portsAttributes": {
"5118": {
"label": "Moonlight",
"onAutoForward": "notify"
}
}
}

View file

@ -1,5 +1,4 @@
**/.classpath
**/.dockerignore
**/.dockerignore
**/.env
**/.git
**/.gitignore
@ -8,6 +7,7 @@
**/.toolstarget
**/.vs
**/.vscode
**/.idea
**/*.*proj.user
**/*.dbmdl
**/*.jfm

8
.gitattributes vendored
View file

@ -1,10 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
Moonlight/wwwroot/** linguist-vendored
Moonlight/wwwroot/assets/js/scripts.bundle.js linguist-vendored
Moonlight/wwwroot/assets/js/widgets.bundle.js linguist-vendored
Moonlight/wwwroot/assets/js/theme.js linguist-vendored
Moonlight/wwwroot/assets/css/boxicons.min.css linguist-vendored
Moonlight/wwwroot/assets/css/style.bundle.css linguist-vendored
Moonlight/wwwroot/assets/plugins/** linguist-vendored
Moonlight/wwwroot/assets/fonts/** linguist-vendored

View file

@ -33,7 +33,7 @@ body:
attributes:
label: Panel Version
description: Version number of your Panel (latest is not a version)
placeholder: 1.4.0
placeholder: v2 EA
validations:
required: true
@ -42,16 +42,7 @@ body:
attributes:
label: Daemon Version
description: Version number of your Daemon (latest is not a version)
placeholder: 1.4.2
validations:
required: true
- type: input
id: wings-version
attributes:
label: Wings Version
description: Version number of your Wings (latest is not a version)
placeholder: 1.4.2
placeholder: v2 EA
validations:
required: true
@ -93,4 +84,4 @@ body:
- label: I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
required: true
- label: I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
required: true
required: true

View file

@ -1,12 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# Maintain Github workflows
- package-ecosystem: "github-actions"
directory: "/" # Must be set to / although they're located in .github/workflows
schedule:
interval: "daily"

View file

@ -1,27 +0,0 @@
name: Canary Docker Build
on:
workflow_dispatch:
pull_request:
types:
- closed
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login into docker hub
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PW }}
- name: Build and Push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Moonlight/Dockerfile
push: true
tags: moonlightpanel/moonlight:canary
platforms: linux/amd64,linux/arm64

View file

@ -1,25 +0,0 @@
name: Release Docker Build
on:
workflow_dispatch:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login into docker hub
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PW }}
- name: Build and Push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Moonlight/Dockerfile
push: true
tags: moonlightpanel/moonlight:beta
platforms: linux/amd64,linux/arm64

View file

@ -1,18 +0,0 @@
name: Test Build
on:
push:
branches: [ "main" ]
pull_request:
types:
- closed
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t moonlightpanel/moonlight:${{ github.sha }} -f Moonlight/Dockerfile .

433
.gitignore vendored
View file

@ -1,45 +1,404 @@
 Common IntelliJ Platform excludes
# User specific
**/.idea/**/workspace.xml
**/.idea/**/tasks.xml
**/.idea/shelf/*
**/.idea/dictionaries
**/.idea/httpRequests/
# Sensitive or high-churn files
**/.idea/**/dataSources/
**/.idea/**/dataSources.ids
**/.idea/**/dataSources.xml
**/.idea/**/dataSources.local.xml
**/.idea/**/sqlDataSources.xml
**/.idea/**/dynamic.xml
# Rider
# Rider auto-generates .iml files, and contentModel.xml
**/.idea/**/*.iml
**/.idea/**/contentModel.xml
**/.idea/**/modules.xml
Moonlight/[Bb]in/
Moonlight/[Oo]bj/
Moonlight/_UpgradeReport_Files/
Moonlight/[Pp]ackages/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
.vs/
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
_UpgradeReport_Files/
[Pp]ackages/
[Ll]og/
[Ll]ogs/
Thumbs.db
Desktop.ini
.DS_Store
.idea/.idea.Moonlight/.idea/discord.xml
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
storage/
Moonlight/publish.ps1
Moonlight/version
.idea/.idea.Moonlight/.idea/dataSources.xml
Moonlight/wwwroot/css/theme.css
Moonlight/wwwroot/css/theme.css.map
.idea/.idea.Moonlight/.idea/discord.xml

View file

@ -2,9 +2,9 @@
/shelf/
/workspace.xml
# Rider ignored files
/modules.xml
/contentModel.xml
/projectSettingsUpdater.xml
/modules.xml
/.idea.Moonlight.iml
# Editor-based HTTP Client requests
/httpRequests/

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="PROJECT_FILES" />
<option name="description" value="" />
<option name="theme" value="material" />
<option name="button1Title" value="" />
<option name="button1Url" value="" />
<option name="button2Title" value="" />
<option name="button2Url" value="" />
</component>
</project>

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EfCoreCommonOptions">
<option name="migrationsToStartupProjects">
<map>
<entry key="16141d00-a997-4ba6-b0dc-af6f4712613a" value="16141d00-a997-4ba6-b0dc-af6f4712613a" />
</map>
</option>
<option name="solutionLevelOptions">
<map>
<entry key="migrationsProject" value="16141d00-a997-4ba6-b0dc-af6f4712613a" />
<entry key="startupProject" value="16141d00-a997-4ba6-b0dc-af6f4712613a" />
</map>
</option>
<option name="startupToMigrationsProjects">
<map>
<entry key="16141d00-a997-4ba6-b0dc-af6f4712613a" value="16141d00-a997-4ba6-b0dc-af6f4712613a" />
</map>
</option>
</component>
</project>

View file

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EfCoreDialogsState">
<option name="keyValueStorage">
<map>
<entry key="Common:16141d00-a997-4ba6-b0dc-af6f4712613a:dbContext" value="Moonlight.App.Database.DataContext" />
<entry key="Common:buildConfiguration" value="Debug" />
<entry key="Common:noBuild" value="false" />
<entry key="Common:outputFolder" value="App/Database/Migrations" />
<entry key="Common:useDefaultConnection" value="true" />
</map>
</option>
</component>
</project>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MaterialThemeProjectNewConfig">
<option name="metadata">
<MTProjectMetadataState>
<option name="migrated" value="true" />
<option name="pristineConfig" value="false" />
<option name="userId" value="52a374ed:18c1029d858:-8000" />
<option name="version" value="8.13.2" />
</MTProjectMetadataState>
</option>
</component>
</project>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View file

@ -1,3 +0,0 @@
<values>
<value name="mac.address" type="string">a6a05ab0b1614c08281b54fc3b3339170b0f57a5e246c20b7393333dfa28f8f1</value>
</values>

View file

@ -1,3 +0,0 @@
<values>
<value name="StillAlive" type="qword">133564417297189136</value>
</values>

View file

@ -1,3 +0,0 @@
<values>
<value name="MachineId" type="string">{A6A05AB0-B161-4C08-281B-54FC3B333917}</value>
</values>

35
.vscode/launch.json vendored
View file

@ -1,35 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md.
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/Moonlight/bin/Debug/net6.0/Moonlight.dll",
"args": [],
"cwd": "${workspaceFolder}/Moonlight",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

41
.vscode/tasks.json vendored
View file

@ -1,41 +0,0 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Moonlight.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/Moonlight.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/Moonlight.sln"
],
"problemMatcher": "$msCompile"
}
]
}

View file

@ -1,9 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32516.85
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Moonlight", "Moonlight\Moonlight.csproj", "{16141D00-A997-4BA6-B0DC-AF6F4712613A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Moonlight", "Moonlight\Moonlight.csproj", "{B9AD26D2-AAA7-4C57-884D-5AACAA54D5B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -11,15 +8,11 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{16141D00-A997-4BA6-B0DC-AF6F4712613A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{16141D00-A997-4BA6-B0DC-AF6F4712613A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{16141D00-A997-4BA6-B0DC-AF6F4712613A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{16141D00-A997-4BA6-B0DC-AF6F4712613A}.Release|Any CPU.Build.0 = Release|Any CPU
{B9AD26D2-AAA7-4C57-884D-5AACAA54D5B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B9AD26D2-AAA7-4C57-884D-5AACAA54D5B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B9AD26D2-AAA7-4C57-884D-5AACAA54D5B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B9AD26D2-AAA7-4C57-884D-5AACAA54D5B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9C904DEA-9663-4892-B3CA-5CD6E710648C}
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
EndGlobal

26
Moonlight/App.razor Normal file
View file

@ -0,0 +1,26 @@
@using Moonlight.Core.UI.Layouts
@using Moonlight.Core.Services
@inject FeatureService FeatureService
@{
var assemblies = FeatureService.UiContext.RouteAssemblies;
var firstAssembly = assemblies.First();
var additionalAssemblies = assemblies.Skip(1).ToArray();
}
<Router AppAssembly="@firstAssembly" AdditionalAssemblies="@additionalAssemblies">
<Found Context="routeData">
<CascadingValue TValue="Type" Name="TargetPageType" Value="@routeData.PageType">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
</CascadingValue>
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<IconAlert Title="Unknown page" Icon="bx-search">
The address you are trying to access is not associated with any page. To resume please go back or to the <a href="/">homepage</a>
</IconAlert>
</LayoutView>
</NotFound>
</Router>

View file

@ -1,81 +0,0 @@
using Newtonsoft.Json;
using RestSharp;
namespace Moonlight.App.ApiClients.CloudPanel;
public class CloudPanelApiHelper
{
private readonly RestClient Client;
public CloudPanelApiHelper()
{
Client = new();
}
public async Task Post(Database.Entities.CloudPanel cloudPanel, string resource, object? body)
{
var request = CreateRequest(cloudPanel, resource);
request.Method = Method.Post;
if(body != null)
request.AddParameter("text/plain", JsonConvert.SerializeObject(body), ParameterType.RequestBody);
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new CloudPanelException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
}
public async Task Delete(Database.Entities.CloudPanel cloudPanel, string resource, object? body)
{
var request = CreateRequest(cloudPanel, resource);
request.Method = Method.Delete;
if(body != null)
request.AddParameter("text/plain", JsonConvert.SerializeObject(body), ParameterType.RequestBody);
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new CloudPanelException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
}
private RestRequest CreateRequest(Database.Entities.CloudPanel cloudPanel, string resource)
{
var url = $"{cloudPanel.ApiUrl}/" + resource;
var request = new RestRequest(url);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Bearer " + cloudPanel.ApiKey);
return request;
}
}

View file

@ -1,32 +0,0 @@
using System.Runtime.Serialization;
namespace Moonlight.App.ApiClients.CloudPanel;
[Serializable]
public class CloudPanelException : Exception
{
public int StatusCode { get; set; }
public CloudPanelException()
{
}
public CloudPanelException(string message, int statusCode) : base(message)
{
StatusCode = statusCode;
}
public CloudPanelException(string message) : base(message)
{
}
public CloudPanelException(string message, Exception inner) : base(message, inner)
{
}
protected CloudPanelException(
SerializationInfo info,
StreamingContext context) : base(info, context)
{
}
}

View file

@ -1,18 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.CloudPanel.Requests;
public class AddDatabase
{
[JsonProperty("domainName")]
public string DomainName { get; set; }
[JsonProperty("databaseName")]
public string DatabaseName { get; set; }
[JsonProperty("databaseUserName")]
public string DatabaseUserName { get; set; }
[JsonProperty("databaseUserPassword")]
public string DatabaseUserPassword { get; set; }
}

View file

@ -1,16 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.CloudPanel.Requests;
public class AddPhpSite
{
[JsonProperty("domainName")] public string DomainName { get; set; } = "";
[JsonProperty("siteUser")] public string SiteUser { get; set; } = "";
[JsonProperty("siteUserPassword")] public string SiteUserPassword { get; set; } = "";
[JsonProperty("vHostTemplate")] public string VHostTemplate { get; set; } = "";
[JsonProperty("phpVersion")] public string PhpVersion { get; set; } = "";
}

View file

@ -1,9 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.CloudPanel.Requests;
public class InstallLetsEncrypt
{
[JsonProperty("domainName")]
public string DomainName { get; set; }
}

View file

@ -1,106 +0,0 @@
using Moonlight.App.Database.Entities;
using Newtonsoft.Json;
using RestSharp;
namespace Moonlight.App.ApiClients.Daemon;
public class DaemonApiHelper
{
private readonly RestClient Client;
public DaemonApiHelper()
{
Client = new();
}
public async Task<T> Get<T>(Node node, string resource)
{
var request = await CreateRequest(node, resource);
request.Method = Method.Get;
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new DaemonException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
return JsonConvert.DeserializeObject<T>(response.Content!)!;
}
public async Task Post(Node node, string resource, object body)
{
var request = await CreateRequest(node, resource);
request.Method = Method.Post;
request.AddParameter("text/plain", JsonConvert.SerializeObject(body), ParameterType.RequestBody);
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new DaemonException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
}
public async Task Delete(Node node, string resource, object body)
{
var request = await CreateRequest(node, resource);
request.Method = Method.Delete;
request.AddParameter("text/plain", JsonConvert.SerializeObject(body), ParameterType.RequestBody);
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new DaemonException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
}
private Task<RestRequest> CreateRequest(Node node, string resource)
{
var url = $"http://{node.Fqdn}:{node.MoonlightDaemonPort}/";
RestRequest request = new(url + resource);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", node.Token);
return Task.FromResult(request);
}
}

View file

@ -1,32 +0,0 @@
using System.Runtime.Serialization;
namespace Moonlight.App.ApiClients.Daemon;
[Serializable]
public class DaemonException : Exception
{
public int StatusCode { get; set; }
public DaemonException()
{
}
public DaemonException(string message, int statusCode) : base(message)
{
StatusCode = statusCode;
}
public DaemonException(string message) : base(message)
{
}
public DaemonException(string message, Exception inner) : base(message, inner)
{
}
protected DaemonException(
SerializationInfo info,
StreamingContext context) : base(info, context)
{
}
}

View file

@ -1,8 +0,0 @@
namespace Moonlight.App.ApiClients.Daemon.Requests;
public class Mount
{
public string Server { get; set; } = "";
public string ServerPath { get; set; } = "";
public string Path { get; set; } = "";
}

View file

@ -1,6 +0,0 @@
namespace Moonlight.App.ApiClients.Daemon.Requests;
public class Unmount
{
public string Path { get; set; } = "";
}

View file

@ -1,10 +0,0 @@
namespace Moonlight.App.ApiClients.Daemon.Resources;
public class Container
{
public string Name { get; set; } = "";
public long Memory { get; set; }
public double Cpu { get; set; }
public long NetworkIn { get; set; }
public long NetworkOut { get; set; }
}

View file

@ -1,7 +0,0 @@
namespace Moonlight.App.ApiClients.Daemon.Resources;
public class CpuMetrics
{
public string CpuModel { get; set; } = "";
public double CpuUsage { get; set; }
}

View file

@ -1,7 +0,0 @@
namespace Moonlight.App.ApiClients.Daemon.Resources;
public class DiskMetrics
{
public long Used { get; set; }
public long Total { get; set; }
}

View file

@ -1,6 +0,0 @@
namespace Moonlight.App.ApiClients.Daemon.Resources;
public class DockerMetrics
{
public Container[] Containers { get; set; } = Array.Empty<Container>();
}

View file

@ -1,7 +0,0 @@
namespace Moonlight.App.ApiClients.Daemon.Resources;
public class MemoryMetrics
{
public long Used { get; set; }
public long Total { get; set; }
}

View file

@ -1,7 +0,0 @@
namespace Moonlight.App.ApiClients.Daemon.Resources;
public class SystemMetrics
{
public string OsName { get; set; } = "";
public long Uptime { get; set; }
}

View file

@ -1,21 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Google.Requests;
public class GoogleOAuth2CodePayload
{
[JsonProperty("grant_type")]
public string GrantType { get; set; } = "authorization_code";
[JsonProperty("code")]
public string Code { get; set; }
[JsonProperty("client_id")]
public string ClientId { get; set; }
[JsonProperty("client_secret")]
public string ClientSecret { get; set; }
[JsonProperty("redirect_uri")]
public string RedirectUri { get; set; }
}

View file

@ -1,48 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.IpLocate.Resources;
public class IpLocate
{
[JsonProperty("query")]
public string Query { get; set; }
[JsonProperty("status")]
public string Status { get; set; }
[JsonProperty("country")]
public string Country { get; set; }
[JsonProperty("countryCode")]
public string CountryCode { get; set; }
[JsonProperty("region")]
public string Region { get; set; }
[JsonProperty("regionName")]
public string RegionName { get; set; }
[JsonProperty("city")]
public string City { get; set; }
[JsonProperty("zip")]
public string Zip { get; set; }
[JsonProperty("lat")]
public double Lat { get; set; }
[JsonProperty("lon")]
public double Lon { get; set; }
[JsonProperty("timezone")]
public string Timezone { get; set; }
[JsonProperty("isp")]
public string Isp { get; set; }
[JsonProperty("org")]
public string Org { get; set; }
[JsonProperty("as")]
public string As { get; set; }
}

View file

@ -1,58 +0,0 @@
using Newtonsoft.Json;
using RestSharp;
namespace Moonlight.App.ApiClients.Modrinth;
public class ModrinthApiHelper
{
private readonly RestClient Client;
public ModrinthApiHelper()
{
Client = new();
Client.AddDefaultParameter(
new HeaderParameter("User-Agent", "Moonlight-Panel/Moonlight (admin@endelon-hosting.de)")
);
}
public async Task<T> Get<T>(string resource)
{
var request = CreateRequest(resource);
request.Method = Method.Get;
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new ModrinthException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
return JsonConvert.DeserializeObject<T>(response.Content!)!;
}
private RestRequest CreateRequest(string resource)
{
var url = "https://api.modrinth.com/v2/" + resource;
var request = new RestRequest(url)
{
Timeout = 300000
};
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
return request;
}
}

View file

@ -1,19 +0,0 @@
namespace Moonlight.App.ApiClients.Modrinth;
public class ModrinthException : Exception
{
public int StatusCode { get; set; }
public ModrinthException()
{
}
public ModrinthException(string message, int statusCode) : base(message)
{
StatusCode = statusCode;
}
public ModrinthException(string message, Exception inner) : base(message, inner)
{
}
}

View file

@ -1,14 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Modrinth.Resources;
public class Pagination
{
[JsonProperty("hits")] public Project[] Hits { get; set; }
[JsonProperty("offset")] public long Offset { get; set; }
[JsonProperty("limit")] public long Limit { get; set; }
[JsonProperty("total_hits")] public long TotalHits { get; set; }
}

View file

@ -1,48 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Modrinth.Resources;
public class Project
{
[JsonProperty("project_id")] public string ProjectId { get; set; }
[JsonProperty("project_type")] public string ProjectType { get; set; }
[JsonProperty("slug")] public string Slug { get; set; }
[JsonProperty("author")] public string Author { get; set; }
[JsonProperty("title")] public string Title { get; set; }
[JsonProperty("description")] public string Description { get; set; }
[JsonProperty("categories")] public string[] Categories { get; set; }
[JsonProperty("display_categories")] public string[] DisplayCategories { get; set; }
[JsonProperty("versions")] public string[] Versions { get; set; }
[JsonProperty("downloads")] public long Downloads { get; set; }
[JsonProperty("follows")] public long Follows { get; set; }
[JsonProperty("icon_url")] public string IconUrl { get; set; }
[JsonProperty("date_created")] public DateTimeOffset DateCreated { get; set; }
[JsonProperty("date_modified")] public DateTimeOffset DateModified { get; set; }
[JsonProperty("latest_version")] public string LatestVersion { get; set; }
[JsonProperty("license")] public string License { get; set; }
[JsonProperty("client_side")] public string ClientSide { get; set; }
[JsonProperty("server_side")] public string ServerSide { get; set; }
[JsonProperty("gallery")] public Uri[] Gallery { get; set; }
[JsonProperty("featured_gallery")] public Uri FeaturedGallery { get; set; }
[JsonProperty("color")] public long? Color { get; set; }
}

View file

@ -1,57 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Modrinth.Resources;
public class Version
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("version_number")]
public string VersionNumber { get; set; }
[JsonProperty("changelog")]
public string Changelog { get; set; }
[JsonProperty("dependencies")]
public object[] Dependencies { get; set; }
[JsonProperty("game_versions")]
public object[] GameVersions { get; set; }
[JsonProperty("version_type")]
public string VersionType { get; set; }
[JsonProperty("loaders")]
public object[] Loaders { get; set; }
[JsonProperty("featured")]
public bool Featured { get; set; }
[JsonProperty("status")]
public string Status { get; set; }
[JsonProperty("requested_status")]
public string RequestedStatus { get; set; }
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("project_id")]
public string ProjectId { get; set; }
[JsonProperty("author_id")]
public string AuthorId { get; set; }
[JsonProperty("date_published")]
public DateTime DatePublished { get; set; }
[JsonProperty("downloads")]
public long Downloads { get; set; }
[JsonProperty("changelog_url")]
public object ChangelogUrl { get; set; }
[JsonProperty("files")]
public VersionFile[] Files { get; set; }
}

View file

@ -1,21 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Modrinth.Resources;
public class VersionFile
{
[JsonProperty("url")]
public Uri Url { get; set; }
[JsonProperty("filename")]
public string Filename { get; set; }
[JsonProperty("primary")]
public bool Primary { get; set; }
[JsonProperty("size")]
public long Size { get; set; }
[JsonProperty("file_type")]
public string FileType { get; set; }
}

View file

@ -1,49 +0,0 @@
using Moonlight.App.Exceptions;
using Newtonsoft.Json;
using RestSharp;
namespace Moonlight.App.ApiClients.Paper;
public class PaperApiHelper
{
private string ApiUrl { get; set; }
public PaperApiHelper()
{
ApiUrl = "https://api.papermc.io/v2/projects/";
}
public async Task<T> Get<T>(string url)
{
RestClient client = new();
string requrl = "NONSET";
if (ApiUrl.EndsWith("/"))
requrl = ApiUrl + url;
else
requrl = ApiUrl + "/" + url;
RestRequest request = new(requrl, Method.Get);
request.AddHeader("Content-Type", "application/json");
var response = await client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new PaperException(
$"An error occured: ({response.StatusCode}) {response.Content}"
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
return JsonConvert.DeserializeObject<T>(response.Content!)!;
}
}

View file

@ -1,16 +0,0 @@
namespace Moonlight.App.ApiClients.Paper;
public class PaperException : Exception
{
public PaperException()
{
}
public PaperException(string message) : base(message)
{
}
public PaperException(string message, Exception inner) : base(message, inner)
{
}
}

View file

@ -1,18 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Paper.Resources;
public class PaperBuilds
{
[JsonProperty("project_id")]
public string ProjectId { get; set; }
[JsonProperty("project_name")]
public string ProjectName { get; set; }
[JsonProperty("version")]
public string Version { get; set; }
[JsonProperty("builds")]
public List<string> Builds { get; set; }
}

View file

@ -1,18 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Paper.Resources;
public class PaperVersions
{
[JsonProperty("project_id")]
public string ProjectId { get; set; }
[JsonProperty("project_name")]
public string ProjectName { get; set; }
[JsonProperty("version_groups")]
public List<string> VersionGroups { get; set; }
[JsonProperty("versions")]
public List<string> Versions { get; set; }
}

View file

@ -1,11 +0,0 @@
namespace Moonlight.App.ApiClients.Telemetry.Requests;
public class TelemetryData
{
public string AppUrl { get; set; } = "";
public int Servers { get; set; }
public int Nodes { get; set; }
public int Users { get; set; }
public int Databases { get; set; }
public int Webspaces { get; set; }
}

View file

@ -1,52 +0,0 @@
using Newtonsoft.Json;
using RestSharp;
namespace Moonlight.App.ApiClients.Telemetry;
public class TelemetryApiHelper
{
private readonly RestClient Client;
public TelemetryApiHelper()
{
Client = new();
}
public async Task Post(string resource, object? body)
{
var request = CreateRequest(resource);
request.Method = Method.Post;
request.AddParameter("application/json", JsonConvert.SerializeObject(body), ParameterType.RequestBody);
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new TelemetryException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
}
private RestRequest CreateRequest(string resource)
{
var url = "https://telemetry.moonlightpanel.xyz/" + resource;
var request = new RestRequest(url)
{
Timeout = 3000000
};
return request;
}
}

View file

@ -1,32 +0,0 @@
using System.Runtime.Serialization;
namespace Moonlight.App.ApiClients.Telemetry;
[Serializable]
public class TelemetryException : Exception
{
public int StatusCode { get; set; }
public TelemetryException()
{
}
public TelemetryException(string message, int statusCode) : base(message)
{
StatusCode = statusCode;
}
public TelemetryException(string message) : base(message)
{
}
public TelemetryException(string message, Exception inner) : base(message, inner)
{
}
protected TelemetryException(
SerializationInfo info,
StreamingContext context) : base(info, context)
{
}
}

View file

@ -1,9 +0,0 @@
namespace Moonlight.App.ApiClients.Wings;
public enum PowerSignal
{
Start,
Stop,
Kill,
Restart
}

View file

@ -1,12 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Requests;
public class CompressFiles
{
[JsonProperty("root")]
public string Root { get; set; }
[JsonProperty("files")]
public string[] Files { get; set; }
}

View file

@ -1,15 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Requests;
public class CreateBackup
{
[JsonProperty("adapter")]
public string Adapter { get; set; }
[JsonProperty("uuid")]
public Guid Uuid { get; set; }
[JsonProperty("ignore")]
public string Ignore { get; set; }
}

View file

@ -1,12 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Requests;
public class CreateDirectory
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("path")]
public string Path { get; set; }
}

View file

@ -1,12 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Requests;
public class CreateServer
{
[JsonProperty("uuid")]
public Guid Uuid { get; set; }
[JsonProperty("start_on_completion")]
public bool StartOnCompletion { get; set; }
}

View file

@ -1,12 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Requests;
public class DecompressFile
{
[JsonProperty("root")]
public string Root { get; set; }
[JsonProperty("file")]
public string File { get; set; }
}

View file

@ -1,11 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Requests;
public class DeleteFiles
{
[JsonProperty("root")]
public string Root { get; set; }
[JsonProperty("files")] public List<string> Files { get; set; } = new();
}

View file

@ -1,20 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Requests;
public class RenameFiles
{
[JsonProperty("root")]
public string Root { get; set; }
[JsonProperty("files")] public RenameFilesData[] Files { get; set; }
}
public class RenameFilesData
{
[JsonProperty("from")]
public string From { get; set; }
[JsonProperty("to")]
public string To { get; set; }
}

View file

@ -1,12 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Requests;
public class RestoreBackup
{
[JsonProperty("adapter")]
public string Adapter { get; set; }
[JsonProperty("truncate_directory")] public bool TruncateDirectory { get; set; } = false;
[JsonProperty("download_url")] public string DownloadUrl { get; set; } = "";
}

View file

@ -1,9 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Requests;
public class ServerPower
{
[JsonProperty("action")]
public string Action { get; set; }
}

View file

@ -1,30 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Resources;
public class ListDirectory
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("created")]
public DateTimeOffset Created { get; set; }
[JsonProperty("modified")]
public DateTimeOffset Modified { get; set; }
[JsonProperty("size")]
public long Size { get; set; }
[JsonProperty("directory")]
public bool Directory { get; set; }
[JsonProperty("file")]
public bool File { get; set; }
[JsonProperty("symlink")]
public bool Symlink { get; set; }
[JsonProperty("mime")]
public string Mime { get; set; }
}

View file

@ -1,48 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Resources;
public class ServerDetails
{
[JsonProperty("state")]
public string State { get; set; }
[JsonProperty("is_suspended")]
public bool IsSuspended { get; set; }
[JsonProperty("utilization")]
public ServerDetailsUtilization Utilization { get; set; }
public class ServerDetailsUtilization
{
[JsonProperty("memory_bytes")]
public long MemoryBytes { get; set; }
[JsonProperty("memory_limit_bytes")]
public long MemoryLimitBytes { get; set; }
[JsonProperty("cpu_absolute")]
public double CpuAbsolute { get; set; }
[JsonProperty("network")]
public ServerDetailsNetwork Network { get; set; }
[JsonProperty("uptime")]
public long Uptime { get; set; }
[JsonProperty("state")]
public string State { get; set; }
[JsonProperty("disk_bytes")]
public long DiskBytes { get; set; }
}
public class ServerDetailsNetwork
{
[JsonProperty("rx_bytes")]
public long RxBytes { get; set; }
[JsonProperty("tx_bytes")]
public long TxBytes { get; set; }
}
}

View file

@ -1,21 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.ApiClients.Wings.Resources;
public class SystemStatus
{
[JsonProperty("architecture")]
public string Architecture { get; set; }
[JsonProperty("cpu_count")]
public long CpuCount { get; set; }
[JsonProperty("kernel_version")]
public string KernelVersion { get; set; }
[JsonProperty("os")]
public string Os { get; set; }
[JsonProperty("version")]
public string Version { get; set; }
}

View file

@ -1,221 +0,0 @@
using Moonlight.App.Database.Entities;
using Moonlight.App.Exceptions;
using Newtonsoft.Json;
using RestSharp;
namespace Moonlight.App.ApiClients.Wings;
public class WingsApiHelper
{
private readonly RestClient Client;
public WingsApiHelper()
{
Client = new();
}
public async Task<T> Get<T>(Node node, string resource)
{
var request = CreateRequest(node, resource);
request.Method = Method.Get;
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new WingsException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
return JsonConvert.DeserializeObject<T>(response.Content!)!;
}
public async Task<string> GetRaw(Node node, string resource)
{
var request = CreateRequest(node, resource);
request.Method = Method.Get;
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new WingsException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
return response.Content!;
}
public async Task<T> Post<T>(Node node, string resource, object? body)
{
var request = CreateRequest(node, resource);
request.Method = Method.Post;
request.AddParameter("text/plain",
JsonConvert.SerializeObject(body),
ParameterType.RequestBody
);
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new WingsException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
return JsonConvert.DeserializeObject<T>(response.Content!)!;
}
public async Task Post(Node node, string resource, object? body)
{
var request = CreateRequest(node, resource);
request.Method = Method.Post;
if(body != null)
request.AddParameter("text/plain", JsonConvert.SerializeObject(body), ParameterType.RequestBody);
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new WingsException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
}
public async Task PostRaw(Node node, string resource, object body)
{
var request = CreateRequest(node, resource);
request.Method = Method.Post;
request.AddParameter("text/plain", body, ParameterType.RequestBody);
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new WingsException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
}
public async Task Delete(Node node, string resource, object? body)
{
var request = CreateRequest(node, resource);
request.Method = Method.Delete;
if(body != null)
request.AddParameter("text/plain", JsonConvert.SerializeObject(body), ParameterType.RequestBody);
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new WingsException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
}
public async Task Put(Node node, string resource, object? body)
{
var request = CreateRequest(node, resource);
request.Method = Method.Put;
request.AddParameter("text/plain", JsonConvert.SerializeObject(body), ParameterType.RequestBody);
var response = await Client.ExecuteAsync(request);
if (!response.IsSuccessful)
{
if (response.StatusCode != 0)
{
throw new WingsException(
$"An error occured: ({response.StatusCode}) {response.Content}",
(int)response.StatusCode
);
}
else
{
throw new Exception($"An internal error occured: {response.ErrorMessage}");
}
}
}
private RestRequest CreateRequest(Node node, string resource)
{
var url = (node.Ssl ? "https" : "http") + $"://{node.Fqdn}:{node.HttpPort}/" + resource;
var request = new RestRequest(url)
{
Timeout = 300000
};
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Bearer " + node.Token);
return request;
}
}

View file

@ -1,32 +0,0 @@
using System.Runtime.Serialization;
namespace Moonlight.App.ApiClients.Wings;
[Serializable]
public class WingsException : Exception
{
public int StatusCode { get; set; }
public WingsException()
{
}
public WingsException(string message, int statusCode) : base(message)
{
StatusCode = statusCode;
}
public WingsException(string message) : base(message)
{
}
public WingsException(string message, Exception inner) : base(message, inner)
{
}
protected WingsException(
SerializationInfo info,
StreamingContext context) : base(info, context)
{
}
}

View file

@ -1,410 +0,0 @@
using System.ComponentModel;
using Moonlight.App.Helpers;
namespace Moonlight.App.Configuration;
using System;
using Newtonsoft.Json;
public class ConfigV1
{
[JsonProperty("Moonlight")] public MoonlightData Moonlight { get; set; } = new();
public class MoonlightData
{
[JsonProperty("AppUrl")]
[Description("The url moonlight is accesible with from the internet")]
public string AppUrl { get; set; } = "http://your-moonlight-url-without-slash";
[JsonProperty("EnableLatencyCheck")]
[Description(
"This will enable a latency check for connections to moonlight. Users with an too high latency will be warned that moonlight might be buggy for them")]
public bool EnableLatencyCheck { get; set; } = true;
[JsonProperty("LatencyCheckThreshold")]
[Description("Specify the latency threshold which has to be reached in order to trigger the warning message")]
public int LatencyCheckThreshold { get; set; } = 1000;
[JsonProperty("LetsEncrypt")] public LetsEncrypt LetsEncrypt { get; set; } = new();
[JsonProperty("Auth")] public AuthData Auth { get; set; } = new();
[JsonProperty("Database")] public DatabaseData Database { get; set; } = new();
[JsonProperty("DiscordBotApi")] public DiscordBotApiData DiscordBotApi { get; set; } = new();
[JsonProperty("DiscordBot")] public DiscordBotData DiscordBot { get; set; } = new();
[JsonProperty("Domains")] public DomainsData Domains { get; set; } = new();
[JsonProperty("Html")] public HtmlData Html { get; set; } = new();
[JsonProperty("Marketing")] public MarketingData Marketing { get; set; } = new();
[JsonProperty("OAuth2")] public OAuth2Data OAuth2 { get; set; } = new();
[JsonProperty("Security")] public SecurityData Security { get; set; } = new();
[JsonProperty("Mail")] public MailData Mail { get; set; } = new();
[JsonProperty("Cleanup")] public CleanupData Cleanup { get; set; } = new();
[JsonProperty("DiscordNotifications")]
public DiscordNotificationsData DiscordNotifications { get; set; } = new();
[JsonProperty("Statistics")] public StatisticsData Statistics { get; set; } = new();
[JsonProperty("Rating")] public RatingData Rating { get; set; } = new();
[JsonProperty("SmartDeploy")] public SmartDeployData SmartDeploy { get; set; } = new();
[JsonProperty("Sentry")] public SentryData Sentry { get; set; } = new();
[JsonProperty("Stripe")] public StripeData Stripe { get; set; } = new();
[JsonProperty("Tickets")] public TicketsData Tickets { get; set; } = new();
}
public class LetsEncrypt
{
[JsonProperty("Enable")]
[Description("Enable automatic lets encrypt certificate issuing. This is a beta feature")]
public bool Enable { get; set; } = false;
[JsonProperty("ExpireEmail")]
[Description("Lets encrypt will send you an email upon certificate expiration to this address")]
public string ExpireEmail { get; set; } = "your@email.test";
[JsonProperty("CountryCode")]
[Description("Country code to use for generating the certificate")]
public string CountryCode { get; set; } = "DE";
[JsonProperty("State")]
[Description("State to use for generating the certificate")]
public string State { get; set; } = "Germany";
[JsonProperty("Locality")]
[Description("Locality to use for generating the certificate")]
public string Locality { get; set; } = "Bavaria";
[JsonProperty("Organization")]
[Description("Organization to use for generating the certificate")]
public string Organization { get; set; } = "Moonlight Panel";
}
public class TicketsData
{
[JsonProperty("WelcomeMessage")]
[Description("The message that will be sent when a user created a ticket")]
public string WelcomeMessage { get; set; } = "Welcome to the support";
}
public class StripeData
{
[JsonProperty("ApiKey")]
[Description(
"Put here your stripe api key if you add subscriptions. Currently the only billing option is stripe which is enabled by default and cannot be turned off. This feature is still experimental")]
public string ApiKey { get; set; } = "";
}
public class AuthData
{
[JsonProperty("DenyLogin")]
[Description("Prevent every new login")]
public bool DenyLogin { get; set; } = false;
[JsonProperty("DenyRegister")]
[Description("Prevent every new user to register")]
public bool DenyRegister { get; set; } = false;
[JsonProperty("CheckForBots")]
[Description("Check for bots when a user has been registered")]
public bool CheckForBots { get; set; } = true;
[JsonProperty("BlockLinuxUsers")]
[Description("Blocks linux users from registering")]
public bool BlockLinuxUsers { get; set; } = false;
}
public class CleanupData
{
[JsonProperty("Cpu")]
[Description("The maximum amount of cpu usage in percent a node is allowed to use before the cleanup starts")]
public long Cpu { get; set; } = 90;
[JsonProperty("Memory")]
[Description("The minumum amount of memory in megabytes avaliable before the cleanup starts")]
public long Memory { get; set; } = 8192;
[JsonProperty("Wait")]
[Description("The delay between every cleanup check in minutes")]
public long Wait { get; set; } = 15;
[JsonProperty("Uptime")]
[Description("The maximum uptime of any server in hours before it the server restarted by the cleanup system")]
public long Uptime { get; set; } = 6;
[JsonProperty("Enable")]
[Description(
"The cleanup system provides a fair way for stopping unused servers and staying stable even with overallocation. A detailed explanation: docs.endelon-hosting.de/erklaerungen/cleanup")]
public bool Enable { get; set; } = false;
[JsonProperty("MinUptime")]
[Description("The minumum uptime of a server in minutes to prevent stopping servers which just started")]
public long MinUptime { get; set; } = 10;
}
public class DatabaseData
{
[JsonProperty("Database")] public string Database { get; set; } = "moonlight_db";
[JsonProperty("Host")] public string Host { get; set; } = "your.database.host";
[JsonProperty("Password")] [Blur] public string Password { get; set; } = "secret";
[JsonProperty("Port")] public long Port { get; set; } = 3306;
[JsonProperty("Username")] public string Username { get; set; } = "moonlight_user";
}
public class DiscordBotApiData
{
[JsonProperty("Enable")]
[Description("Enable the discord bot api. Currently only DatBot is using this api")]
public bool Enable { get; set; } = false;
[JsonProperty("Token")]
[Description("Specify the token the api client needs to provide")]
[Blur]
public string Token { get; set; } = Guid.NewGuid().ToString();
}
public class DiscordBotData
{
[JsonProperty("Enable")]
[Description("The discord bot can be used to allow customers to manage their servers via discord")]
public bool Enable { get; set; } = false;
[JsonProperty("Token")]
[Description("Your discord bot token goes here")]
[Blur]
public string Token { get; set; } = "discord token here";
[JsonProperty("PowerActions")]
[Description("Enable actions like starting and stopping servers")]
public bool PowerActions { get; set; } = false;
[JsonProperty("SendCommands")]
[Description("Allow users to send commands to their servers")]
public bool SendCommands { get; set; } = false;
}
public class DiscordNotificationsData
{
[JsonProperty("Enable")]
[Description(
"The discord notification system sends you a message everytime a event like a new support chat message is triggered with usefull data describing the event")]
public bool Enable { get; set; } = false;
[JsonProperty("WebHook")]
[Description("The discord webhook the notifications are being sent to")]
[Blur]
public string WebHook { get; set; } = "http://your-discord-webhook-url";
}
public class DomainsData
{
[JsonProperty("Enable")]
[Description("This enables the domain system")]
public bool Enable { get; set; } = false;
[JsonProperty("AccountId")]
[Description("This option specifies the cloudflare account id")]
public string AccountId { get; set; } = "cloudflare acc id";
[JsonProperty("Email")]
[Description("This specifies the cloudflare email to use for communicating with the cloudflare api")]
public string Email { get; set; } = "cloudflare@acc.email";
[JsonProperty("Key")]
[Description("Your cloudflare api key goes here")]
[Blur]
public string Key { get; set; } = "secret";
}
public class HtmlData
{
[JsonProperty("Headers")] public HeadersData Headers { get; set; } = new();
}
public class HeadersData
{
[JsonProperty("Color")]
[Description(
"This specifies the color of the embed generated by platforms like discord when someone posts a link to your moonlight instance")]
public string Color { get; set; } = "#4b27e8";
[JsonProperty("Description")]
[Description(
"This specifies the description text of the embed generated by platforms like discord when someone posts a link to your moonlight instance and can also help google to index your moonlight instance correctly")]
public string Description { get; set; } = "the next generation hosting panel";
[JsonProperty("Keywords")]
[Description(
"To help search engines like google to index your moonlight instance correctly you can specify keywords seperated by a comma here")]
public string Keywords { get; set; } = "moonlight";
[JsonProperty("Title")]
[Description(
"This specifies the title of the embed generated by platforms like discord when someone posts a link to your moonlight instance")]
public string Title { get; set; } = "Moonlight - endelon.link";
}
public class MailData
{
[JsonProperty("Email")] public string Email { get; set; } = "username@your.mail.host";
[JsonProperty("Server")] public string Server { get; set; } = "your.mail.host";
[JsonProperty("Password")] [Blur] public string Password { get; set; } = "secret";
[JsonProperty("Port")] public int Port { get; set; } = 465;
[JsonProperty("Ssl")] public bool Ssl { get; set; } = true;
}
public class MarketingData
{
[JsonProperty("BrandName")] public string BrandName { get; set; } = "Endelon Hosting";
[JsonProperty("Imprint")] public string Imprint { get; set; } = "https://your-site.xyz/imprint";
[JsonProperty("Privacy")] public string Privacy { get; set; } = "https://your-site.xyz/privacy";
[JsonProperty("About")] public string About { get; set; } = "https://your-site.xyz/about";
[JsonProperty("Website")] public string Website { get; set; } = "https://your-site.xyz";
}
public class OAuth2Data
{
[JsonProperty("OverrideUrl")]
[Description("This overrides the redirect url which would be typicaly the app url")]
public string OverrideUrl { get; set; } = "https://only-for-development.cases";
[JsonProperty("EnableOverrideUrl")]
[Description("This enables the url override")]
public bool EnableOverrideUrl { get; set; } = false;
[JsonProperty("Providers")]
public OAuth2ProviderData[] Providers { get; set; } = Array.Empty<OAuth2ProviderData>();
}
public class OAuth2ProviderData
{
[JsonProperty("Id")] public string Id { get; set; }
[JsonProperty("ClientId")] public string ClientId { get; set; }
[JsonProperty("ClientSecret")] [Blur] public string ClientSecret { get; set; }
}
public class RatingData
{
[JsonProperty("Enabled")]
[Description(
"The rating systems shows a user who is registered longer than the set amout of days a popup to rate this platform if he hasnt rated it before")]
public bool Enabled { get; set; } = false;
[JsonProperty("Url")]
[Description(
"This is the url a user who rated above a set limit is shown to rate you again. Its recommended to put your google or trustpilot rate link here")]
public string Url { get; set; } = "https://link-to-google-or-smth";
[JsonProperty("MinRating")]
[Description("The minimum star count on the rating ranging from 1 to 5")]
public int MinRating { get; set; } = 4;
[JsonProperty("DaysSince")]
[Description("The days a user has to be registered to even be able to get this popup")]
public int DaysSince { get; set; } = 5;
}
public class SecurityData
{
[JsonProperty("Token")]
[Description(
"This is the moonlight app token. It is used to encrypt and decrypt data and validate tokens and sessions")]
[Blur]
public string Token { get; set; } = Guid.NewGuid().ToString();
[JsonProperty("MalwareCheckOnStart")]
[Description(
"This option will enable the scanning for malware on every server before it has been started and if something has been found, the power action will be canceled")]
public bool MalwareCheckOnStart { get; set; } = true;
[JsonProperty("BlockIpDuration")]
[Description("The duration in minutes a ip will be blocked by the anti ddos system")]
public int BlockIpDuration { get; set; } = 15;
[JsonProperty("ReCaptcha")] public ReCaptchaData ReCaptcha { get; set; } = new();
[JsonProperty("BlockDatacenterIps")]
[Description(
"If this option is enabled, users with an ip from datacenters will not be able to access the panel")]
public bool BlockDatacenterIps { get; set; } = true;
[JsonProperty("AllowCloudflareIps")]
[Description("Allow cloudflare ips to bypass the datacenter ip check")]
public bool AllowCloudflareIps { get; set; } = false;
}
public class ReCaptchaData
{
[JsonProperty("Enable")]
[Description(
"Enables repatcha at places like the register page. For information how to get your recaptcha credentails go to google.com/recaptcha/about/")]
public bool Enable { get; set; } = false;
[JsonProperty("SiteKey")] [Blur] public string SiteKey { get; set; } = "recaptcha site key here";
[JsonProperty("SecretKey")] [Blur] public string SecretKey { get; set; } = "recaptcha secret here";
}
public class SentryData
{
[JsonProperty("Enable")]
[Description(
"Sentry is a way to monitor application crashes and performance issues in real time. Enable this option only if you set a sentry dsn")]
public bool Enable { get; set; } = false;
[JsonProperty("Dsn")]
[Description("The dsn is the key moonlight needs to communicate with your sentry instance")]
[Blur]
public string Dsn { get; set; } = "http://your-sentry-url-here";
}
public class SmartDeployData
{
[JsonProperty("Server")] public SmartDeployServerData Server { get; set; } = new();
}
public class SmartDeployServerData
{
[JsonProperty("EnableOverride")] public bool EnableOverride { get; set; } = false;
[JsonProperty("OverrideNode")] public long OverrideNode { get; set; } = 1;
}
public class StatisticsData
{
[JsonProperty("Enabled")] public bool Enabled { get; set; } = false;
[JsonProperty("Wait")] public long Wait { get; set; } = 15;
}
public class SellPassData
{
[JsonProperty("Enable")] public bool Enable { get; set; } = false;
[JsonProperty("Url")] public string Url { get; set; } = "https://not-implemented-yet";
}
}

View file

@ -1,78 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Moonlight.App.Database.Entities;
using Moonlight.App.Database.Entities.Notification;
using Moonlight.App.Database.Interceptors;
using Moonlight.App.Services;
namespace Moonlight.App.Database;
public class DataContext : DbContext
{
private readonly ConfigService ConfigService;
public DataContext(ConfigService configService)
{
ConfigService = configService;
}
public DbSet<DockerImage> DockerImages { get; set; }
public DbSet<Image> Images { get; set; }
public DbSet<ImageVariable> ImageVariables { get; set; }
public DbSet<Node> Nodes { get; set; }
public DbSet<NodeAllocation> NodeAllocations { get; set; }
public DbSet<Server> Servers { get; set; }
public DbSet<ServerBackup> ServerBackups { get; set; }
public DbSet<ServerVariable> ServerVariables { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<LoadingMessage> LoadingMessages { get; set; }
public DbSet<SharedDomain> SharedDomains { get; set; }
public DbSet<Domain> Domains { get; set; }
public DbSet<Revoke> Revokes { get; set; }
public DbSet<NotificationClient> NotificationClients { get; set; }
public DbSet<NotificationAction> NotificationActions { get; set; }
public DbSet<DdosAttack> DdosAttacks { get; set; }
public DbSet<Subscription> Subscriptions { get; set; }
public DbSet<StatisticsData> Statistics { get; set; }
public DbSet<NewsEntry> NewsEntries { get; set; }
public DbSet<CloudPanel> CloudPanels { get; set; }
public DbSet<MySqlDatabase> Databases { get; set; }
public DbSet<WebSpace> WebSpaces { get; set; }
public DbSet<SupportChatMessage> SupportChatMessages { get; set; }
public DbSet<IpBan> IpBans { get; set; }
public DbSet<PermissionGroup> PermissionGroups { get; set; }
public DbSet<SecurityLog> SecurityLogs { get; set; }
public DbSet<BlocklistIp> BlocklistIps { get; set; }
public DbSet<WhitelistIp> WhitelistIps { get; set; }
public DbSet<Ticket> Tickets { get; set; }
public DbSet<TicketMessage> TicketMessages { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
var config = ConfigService
.Get()
.Moonlight.Database;
var connectionString = $"host={config.Host};" +
$"port={config.Port};" +
$"database={config.Database};" +
$"uid={config.Username};" +
$"pwd={config.Password}";
optionsBuilder.UseMySql(
connectionString,
ServerVersion.Parse("5.7.37-mysql"),
builder =>
{
builder.EnableRetryOnFailure(5);
}
);
if(ConfigService.SqlDebugMode)
optionsBuilder.AddInterceptors(new SqlLoggingInterceptor());
}
}
}

View file

@ -1,10 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class BlocklistIp
{
public int Id { get; set; }
public string Ip { get; set; } = "";
public DateTime ExpiresAt { get; set; }
public long Packets { get; set; }
public DateTime CreatedAt { get; set; }
}

View file

@ -1,10 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class CloudPanel
{
public int Id { get; set; }
public string Name { get; set; } = "";
public string ApiUrl { get; set; } = "";
public string ApiKey { get; set; } = "";
public string Host { get; set; } = "";
}

View file

@ -1,11 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class DdosAttack
{
public int Id { get; set; }
public bool Ongoing { get; set; }
public long Data { get; set; }
public string Ip { get; set; } = "";
public Node Node { get; set; } = null!;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}

View file

@ -1,11 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.Database.Entities;
public class DockerImage
{
[JsonIgnore]
public int Id { get; set; }
public bool Default { get; set; } = false;
public string Name { get; set; } = "";
}

View file

@ -1,13 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace Moonlight.App.Database.Entities;
public class Domain
{
public int Id { get; set; }
[Required]
public string Name { get; set; }
public SharedDomain SharedDomain { get; set; }
public User Owner { get; set; }
}

View file

@ -1,24 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.Database.Entities;
public class Image
{
[JsonIgnore]
public int Id { get; set; }
public Guid Uuid { get; set; }
public string Name { get; set; } = "";
public string Description { get; set; } = "";
public string ConfigFiles { get; set; } = "{}";
public string StopCommand { get; set; } = "";
public string StartupDetection { get; set; } = "";
public string InstallScript { get; set; } = "";
public string InstallDockerImage { get; set; } = "";
public string InstallEntrypoint { get; set; } = "";
public string Startup { get; set; } = "";
public int Allocations { get; set; } = 1;
public List<DockerImage> DockerImages { get; set; } = new();
public List<ImageVariable> Variables { get; set; } = new();
public string TagsJson { get; set; } = "";
public string BackgroundImageUrl { get; set; } = "";
}

View file

@ -1,11 +0,0 @@
using Newtonsoft.Json;
namespace Moonlight.App.Database.Entities;
public class ImageVariable
{
[JsonIgnore]
public int Id { get; set; }
public string Key { get; set; } = "";
public string DefaultValue { get; set; } = "";
}

View file

@ -1,8 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class IpBan
{
public int Id { get; set; }
public string Ip { get; set; } = "";
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}

View file

@ -1,7 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class LoadingMessage
{
public int Id { get; set; }
public string Message { get; set; } = "";
}

View file

@ -1,9 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class MySqlDatabase
{
public int Id { get; set; }
public WebSpace WebSpace { get; set; }
public string UserName { get; set; } = "";
public string Password { get; set; } = "";
}

View file

@ -1,10 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class NewsEntry
{
public int Id { get; set; }
public DateTime Date { get; set; }
public string Title { get; set; }
public string Markdown { get; set; }
}

View file

@ -1,15 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class Node
{
public int Id { get; set; }
public string Name { get; set; } = "";
public string Fqdn { get; set; } = "";
public string TokenId { get; set; } = "";
public string Token { get; set; } = "";
public int SftpPort { get; set; }
public int HttpPort { get; set; }
public int MoonlightDaemonPort { get; set; }
public List<NodeAllocation> Allocations { get; set; } = new();
public bool Ssl { get; set; } = false;
}

View file

@ -1,7 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class NodeAllocation
{
public int Id { get; set; }
public int Port { get; set; }
}

View file

@ -1,8 +0,0 @@
namespace Moonlight.App.Database.Entities.Notification;
public class NotificationAction
{
public int Id { get; set; }
public NotificationClient NotificationClient { get; set; }
public string Action { get; set; }
}

View file

@ -1,7 +0,0 @@
namespace Moonlight.App.Database.Entities.Notification;
public class NotificationClient
{
public int Id { get; set; }
public User User { get; set; }
}

View file

@ -1,8 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class PermissionGroup
{
public int Id { get; set; }
public string Name { get; set; } = "";
public byte[] Permissions { get; set; } = Array.Empty<byte>();
}

View file

@ -1,7 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class Revoke
{
public int Id { get; set; }
public string Identifier { get; set; } = "";
}

View file

@ -1,8 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class SecurityLog
{
public int Id { get; set; }
public string Text { get; set; } = "";
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}

View file

@ -1,26 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class Server
{
public int Id { get; set; }
public Guid Uuid { get; set; }
public string Name { get; set; } = "";
public int Cpu { get; set; }
public long Memory { get; set; }
public long Disk { get; set; }
public Image Image { get; set; } = null!;
public int DockerImageIndex { get; set; } = 0;
public string OverrideStartup { get; set; } = "";
public bool Installing { get; set; } = false;
public bool Suspended { get; set; } = false;
public bool IsArchived { get; set; } = false;
public ServerBackup? Archive { get; set; } = null;
public List<ServerVariable> Variables { get; set; } = new();
public List<ServerBackup> Backups { get; set; } = new();
public List<NodeAllocation> Allocations { get; set; } = new();
public NodeAllocation? MainAllocation { get; set; } = null;
public Node Node { get; set; } = null!;
public User Owner { get; set; } = null!;
public bool IsCleanupException { get; set; } = false;
}

View file

@ -1,11 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class ServerBackup
{
public int Id { get; set; }
public string Name { get; set; } = "";
public Guid Uuid { get; set; }
public DateTime CreatedAt { get; set; }
public bool Created { get; set; } = false;
public long Bytes { get; set; }
}

View file

@ -1,8 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class ServerVariable
{
public int Id { get; set; }
public string Key { get; set; } = "";
public string Value { get; set; } = "";
}

View file

@ -1,8 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class SharedDomain
{
public int Id { get; set; }
public string Name { get; set; }
public string CloudflareId { get; set; }
}

View file

@ -1,12 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class StatisticsData
{
public int Id { get; set; }
public string Chart { get; set; }
public double Value { get; set; }
public DateTime Date { get; set; }
}

View file

@ -1,16 +0,0 @@
using Moonlight.App.Models.Misc;
namespace Moonlight.App.Database.Entities;
public class Subscription
{
public int Id { get; set; }
public string Name { get; set; } = "";
public string Description { get; set; } = "";
public Currency Currency { get; set; } = Currency.USD;
public double Price { get; set; }
public string StripeProductId { get; set; } = "";
public string StripePriceId { get; set; } = "";
public string LimitsJson { get; set; } = "";
public int Duration { get; set; } = 30;
}

View file

@ -1,21 +0,0 @@
using Moonlight.App.Models.Misc;
namespace Moonlight.App.Database.Entities;
public class SupportChatMessage
{
public int Id { get; set; }
public string Content { get; set; } = "";
public string Attachment { get; set; } = "";
public User? Sender { get; set; }
public User Recipient { get; set; }
public bool IsQuestion { get; set; } = false;
public QuestionType QuestionType { get; set; }
public string Answer { get; set; } = "";
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
}

View file

@ -1,8 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class SupportChatSnippets
{
public int Id { get; set; }
public string Name { get; set; } = "";
public string Description { get; set; } = "";
}

View file

@ -1,19 +0,0 @@
using Moonlight.App.Models.Misc;
namespace Moonlight.App.Database.Entities;
public class Ticket
{
public int Id { get; set; }
public string IssueTopic { get; set; } = "";
public string IssueDescription { get; set; } = "";
public string IssueTries { get; set; } = "";
public User CreatedBy { get; set; }
public User? AssignedTo { get; set; }
public TicketPriority Priority { get; set; }
public TicketStatus Status { get; set; }
public TicketSubject Subject { get; set; }
public int SubjectId { get; set; }
public List<TicketMessage> Messages { get; set; } = new();
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}

View file

@ -1,14 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class TicketMessage
{
public int Id { get; set; }
public string Content { get; set; } = "";
public string? AttachmentUrl { get; set; }
public User? Sender { get; set; }
public bool IsSystemMessage { get; set; }
public bool IsEdited { get; set; }
public bool IsSupportMessage { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}

View file

@ -1,63 +0,0 @@
using System.ComponentModel.DataAnnotations;
using Moonlight.App.Models.Misc;
namespace Moonlight.App.Database.Entities;
public class User
{
public int Id { get; set; }
// Personal data
public string FirstName { get; set; } = "";
public string LastName { get; set; } = "";
public string Email { get; set; } = "";
public string Password { get; set; } = "";
public string Address { get; set; } = "";
public string City { get; set; } = "";
public string State { get; set; } = "";
public string Country { get; set; } = "";
public string ServerListLayoutJson { get; set; } = "";
// States
public UserStatus Status { get; set; } = UserStatus.Unverified;
public bool Admin { get; set; } = false;
public bool SupportPending { get; set; } = false;
public bool HasRated { get; set; } = false;
public int Rating { get; set; } = 0;
public bool StreamerMode { get; set; } = false;
// Security
public bool TotpEnabled { get; set; } = false;
public string TotpSecret { get; set; } = "";
public DateTime TokenValidTime { get; set; } = DateTime.UtcNow;
public byte[] Permissions { get; set; } = Array.Empty<byte>();
public PermissionGroup? PermissionGroup { get; set; }
// Discord
public ulong DiscordId { get; set; }
// Date stuff
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
public DateTime LastVisitedAt { get; set; } = DateTime.UtcNow;
// Subscriptions
public Subscription? CurrentSubscription { get; set; } = null;
public DateTime SubscriptionSince { get; set; } = DateTime.UtcNow;
public DateTime SubscriptionExpires { get; set; } = DateTime.UtcNow;
// Ip logs
public string RegisterIp { get; set; } = "";
public string LastIp { get; set; } = "";
}

View file

@ -1,13 +0,0 @@
namespace Moonlight.App.Database.Entities;
public class WebSpace
{
public int Id { get; set; }
public string Domain { get; set; } = "";
public string UserName { get; set; } = "";
public string Password { get; set; } = "";
public string VHostTemplate { get; set; } = "";
public User Owner { get; set; }
public List<MySqlDatabase> Databases { get; set; } = new();
public CloudPanel CloudPanel { get; set; }
}

Some files were not shown because too many files have changed in this diff Show more