145 Commits
v1b16 ... v1

Author SHA1 Message Date
Masu Baumgartner
39a1bdeb5d Merge pull request #373 from Moonlight-Panel/v1_FixWingsContentLenght
Fix Content-Lenght for wings
2024-04-01 12:46:30 +02:00
Masu Baumgartner
18f107e485 A possible hotfix 2024-04-01 10:45:01 +00:00
Masu Baumgartner
b56b94041f Update README.md 2024-03-04 11:02:32 +01:00
Marcel Baumgartner
1a3b339983 Merge pull request #369 from NaysKutzu/patch-1
Update README.md
2024-02-09 14:22:39 +01:00
NaysKutzu
106af71c17 Update README.md
Update the logo because it won't be displayed due to your captcha on the page
2024-02-09 14:20:46 +01:00
Marcel Baumgartner
cb1da9f5cd Removed old license 2024-02-06 21:38:33 +01:00
Marcel Baumgartner
743b0b1c1b Updated license 2024-02-06 21:37:32 +01:00
Marcel Baumgartner
8fe695f0cf Merge pull request #367 from gOOvER/issuetemplates
added issue templates
2024-02-03 09:09:09 +01:00
Marcel Baumgartner
344ea046f2 Merge pull request #366 from gOOvER/dependabot
added dependabot.yml to autocheck action updates
2024-02-03 09:08:57 +01:00
Marcel Baumgartner
73a014500d Merge pull request #365 from gOOvER/updateworkflow
update workflow files to latest releases
2024-02-03 09:08:38 +01:00
gOOvER
d3f8ba5434 added issue templates 2024-02-03 08:44:05 +01:00
gOOvER
c068679f9b added dependabot.yml to autocheck action updates 2024-02-03 08:27:36 +01:00
gOOvER
9dfba1e6c4 update workflow files to latest releases 2024-02-03 08:24:07 +01:00
Marcel Baumgartner
27f9ca551c Create FUNDING.yml 2024-01-31 10:35:55 +01:00
Marcel Baumgartner
4d69e8bacb Merge pull request #361 from Dannyx1604/patch-1
Update README.md (grammar check)
2024-01-25 21:43:00 +01:00
Dannyx
ed2d33c69b Update README.md (grammar check) 2024-01-25 21:39:48 +01:00
Marcel Baumgartner
d880189f2b Hotfix for WingsServerConverter 2024-01-12 19:45:18 +01:00
Marcel Baumgartner
9221a66597 Merge pull request #324 from Moonlight-Panel/FixLetsEncrypt
Added additional logs for lets encrypt certificates
2023-10-13 23:02:45 +02:00
Marcel Baumgartner
e1c4f8a2a9 Added additional logs for lets encrypt certificates 2023-10-13 23:02:23 +02:00
Marcel Baumgartner
84d39c1c75 Merge pull request #318 from Moonlight-Panel/AddBotCheck
Implemented a basic bot check
2023-09-18 18:59:02 +02:00
Marcel Baumgartner
9abd9d86b2 Implemented a basic bot check 2023-09-18 18:58:32 +02:00
Marcel Baumgartner
73a07761f8 Merge pull request #317 from Moonlight-Panel/AddManualMalwareScan
Added manual malware scan
2023-09-12 10:50:29 +02:00
Marcel Baumgartner
ebe2d9d7ef Added manual malware scan 2023-09-12 08:49:12 +00:00
Marcel Baumgartner
48b12fde90 Merge pull request #316 from Moonlight-Panel/FixIpBinding
Fixed ip binding
2023-09-10 03:13:31 +02:00
Marcel Baumgartner
8ac4fae9c1 Fixed ip binding 2023-09-10 03:12:54 +02:00
Marcel Baumgartner
d224f1e1bb Merge pull request #315 from Moonlight-Panel/FixStartup
Fixed startup for new instances
2023-09-10 03:00:46 +02:00
Marcel Baumgartner
13131e6fca Fixed startup for new instances 2023-09-10 03:00:09 +02:00
Marcel Baumgartner
26fdfe112b Merge pull request #313 from Moonlight-Panel/FixProfileMenu
Fixed profile menu
2023-09-09 09:48:59 +02:00
Marcel Baumgartner
ecf0d372e5 Fixed profile menu 2023-09-09 09:47:44 +02:00
Marcel Baumgartner
e281cfadbd Fixed typo 2023-09-07 20:45:00 +02:00
Marcel Baumgartner
ae2228e08a Added release build. Modified canary build events 2023-09-07 20:09:04 +02:00
Marcel Baumgartner
3f5a7504fa Merge branch 'main' of https://github.com/Moonlight-Panel/Moonlight 2023-09-07 18:14:26 +02:00
Marcel Baumgartner
f8af48aeab Added canary build action. Not tested yet 2023-09-07 18:14:22 +02:00
Marcel Baumgartner
9b9656892d Update README.md 2023-09-06 20:18:16 +02:00
Marcel Baumgartner
db2c6ec30d Merge pull request #311 from Moonlight-Panel/FixAuthDesign
Fixed login and register oauth2 view
2023-09-06 20:06:08 +02:00
Marcel Baumgartner
e46122b030 Fixed login and register oauth2 view 2023-09-06 20:05:38 +02:00
Marcel Baumgartner
1a9836a884 Merge pull request #309 from Moritz-Deiaco/main
added a 'moonlight worth' scrollbar
2023-09-06 19:58:34 +02:00
Marcel Baumgartner
ef930400c8 Fixed issues with other scrollbars 2023-09-06 19:58:12 +02:00
Moritz
450a954b9d Merge branch 'Moonlight-Panel:main' into main 2023-09-06 19:51:07 +02:00
Moritz
31ba5f04cc somechanges for uwu 2023-09-06 19:48:38 +02:00
Moritz
6ca024d6cb made the corners squared like masuwu wanted 2023-09-06 19:33:39 +02:00
Marcel Baumgartner
cef5cb11cb Merge pull request #310 from Moonlight-Panel/NewStartup
Switched to new startup
2023-09-06 19:26:31 +02:00
Marcel Baumgartner
e91a9b2239 Switched to new startup 2023-09-06 19:25:01 +02:00
Moritz
d7ca9d1fe6 added a 'moonlight worth' scrollbar 2023-09-06 19:14:09 +02:00
Marcel Baumgartner
564745b4a2 Merge pull request #308 from Moonlight-Panel/AddAutoLetsEncrypt
Added auto lets encrypt certificate issuing
2023-09-06 17:45:00 +02:00
Marcel Baumgartner
74361b7a4a Small changes 2023-09-06 17:40:56 +02:00
Marcel Baumgartner
7a992d71fb Merge pull request #305 from Moonlight-Panel/FixSharedDomain
Fixed shared domain loading
2023-09-06 17:19:51 +02:00
Marcel Baumgartner
b8d30f0380 Fixed shared domain loading 2023-09-06 17:19:32 +02:00
Marcel Baumgartner
07d7df8188 Merge pull request #304 from Moonlight-Panel/UpdateBadScriptFilter
Updated bad script filters
2023-09-06 17:08:22 +02:00
Marcel Baumgartner
2ddb8723af Updated bad script filters 2023-09-06 17:07:48 +02:00
Marcel Baumgartner
caf990dd4e Merge pull request #302 from Moonlight-Panel/FixHostRename
Fixed host file system rename
2023-09-06 15:43:53 +02:00
Marcel Baumgartner
d0401a1709 Fixed host file system rename 2023-09-06 13:42:48 +00:00
Marcel Baumgartner
67974123db Added some config files for codespaces. Modified for codespaces 2023-09-06 13:10:57 +00:00
Marcel Baumgartner
05817a8866 Added devcontainer for testing 2023-09-06 14:05:38 +02:00
Marcel Baumgartner
707776f1ed Merge pull request #301 from Moonlight-Panel/NewBadScriptScan
Added new bad script scan in order to find reduce scan time
2023-09-05 01:24:20 +02:00
Marcel Baumgartner
4ba7634b94 Added new bad script scan in order to find reduce scan time 2023-09-05 01:23:31 +02:00
Marcel Baumgartner
732abe53e0 Implemented a basic https certificate issuing using lets encrypt 2023-09-04 21:58:26 +02:00
Marcel Baumgartner
37b1288ae6 Update README.md 2023-09-04 21:24:04 +02:00
Marcel Baumgartner
dda302ebf1 Merge pull request #300 from Moonlight-Panel/SmallFixes
Fixed some small bugs
2023-08-31 01:29:12 +02:00
Marcel Baumgartner
f1aace98c3 Fixed some small bugs 2023-08-31 01:28:56 +02:00
Marcel Baumgartner
f48ec2245c Merge pull request #299 from Moonlight-Panel/AddNewScan
Added discord nuke bot scan
2023-08-31 01:03:24 +02:00
Marcel Baumgartner
37a3a35120 Added discord nuke bot scan 2023-08-31 01:01:15 +02:00
Marcel Baumgartner
c549d45d54 Merge pull request #298 from Moonlight-Panel/AddProxyScan
Added proxy scan
2023-08-30 16:21:46 +02:00
Marcel Baumgartner
42a011541c Added proxy scan 2023-08-30 16:20:57 +02:00
Marcel Baumgartner
71a8839f5f Merge pull request #297 from Moonlight-Panel/AddLiveStatistics
Add live statistics
2023-08-29 16:10:31 +02:00
Marcel Baumgartner
b99e8b5476 Merge branch 'main' into AddLiveStatistics 2023-08-29 16:10:16 +02:00
Marcel Baumgartner
5793bd9747 Added new live statistics to navigation 2023-08-29 16:07:43 +02:00
Marcel Baumgartner
24ce51a62e Merge pull request #296 from Moonlight-Panel/NewAdminDomainNavigation
Added new admin domain navigation
2023-08-29 15:55:46 +02:00
Marcel Baumgartner
762d3cc1a1 Added new admin domain navigation 2023-08-29 15:54:37 +02:00
Marcel Baumgartner
ea19105006 Fixed null server handling for the malware result event 2023-08-29 15:11:42 +02:00
Marcel Baumgartner
a372c756e4 Merge pull request #295 from Moonlight-Panel/AddIpFiltering
Implemented ip filtering to detect datacenter and vpn ips
2023-08-29 15:03:31 +02:00
Marcel Baumgartner
18b7c82613 Implemented ip filtering to detect datacenter and vpn ips 2023-08-29 15:03:07 +02:00
Marcel Baumgartner
5d91077d42 Updated MinerScan 2023-08-29 11:55:45 +02:00
Marcel Baumgartner
c0872d0d02 Fixed build errors caused by the removal of defaultstorage 2023-08-28 17:41:29 +02:00
Marcel Baumgartner
00722c4046 Merge pull request #294 from Moonlight-Panel/NewResourceSync
Switched to new resource sync
2023-08-28 17:33:37 +02:00
Marcel Baumgartner
f16a29dafb Switched to new resource sync 2023-08-28 17:32:34 +02:00
Marcel Baumgartner
6da8393612 Merge pull request #293 from Moonlight-Panel/SmallFixes
Some small fixes
2023-08-28 16:29:54 +02:00
Marcel Baumgartner
2ef00b81b8 Switched to new apex charts version 2023-08-28 16:27:59 +02:00
Marcel Baumgartner
0be4ebc7ff Small fix when starting a new malware scan 2023-08-28 16:20:24 +02:00
Marcel Baumgartner
e0d5e754b7 Merge pull request #292 from Moonlight-Panel/ImprovedMalwareScan
Improved malware scan. Added server and user purge
2023-08-28 05:09:10 +02:00
Marcel Baumgartner
6972c2bb32 Improved malware scan. Added server and user purge 2023-08-28 05:08:52 +02:00
Marcel Baumgartner
95ba81eab4 Merge pull request #291 from Moonlight-Panel/FixInitialInstallConsole
Fixed initial install console and added a better redirect handling when creating a server
2023-08-27 20:41:40 +02:00
Marcel Baumgartner
b9c094cafa Fixed initial install console and added a better redirect handling when creating a server 2023-08-27 20:40:58 +02:00
Marcel Baumgartner
bada1e829b Merge pull request #290 from Moonlight-Panel/ReduceExternalJs
Reduced external js, added libraries to assets
2023-08-27 17:29:57 +02:00
Marcel Baumgartner
1d33cf3110 Reduced external js, added libraries to assets 2023-08-27 17:29:37 +02:00
Marcel Baumgartner
abfcefba60 Merge pull request #286 from Moonlight-Panel/OwO
OwO
2023-08-23 17:42:48 +02:00
Marcel Baumgartner
6efb443481 Update launchSettings.json 2023-08-23 17:42:24 +02:00
Marcel Baumgartner
10c017932a Added a basic live statistics system 2023-08-23 17:29:34 +02:00
Marcel Baumgartner
a4be4bdc52 Merge pull request #285 from Moonlight-Panel/ImproveTotpSetup
Improved totp setup
2023-08-23 13:33:01 +02:00
Marcel Baumgartner
88d5a1de86 Improved totp setup 2023-08-23 13:32:23 +02:00
Marcel Baumgartner
1b88827d16 Merge pull request #284 from Moonlight-Panel/UserDiscordIdFilter
Added discord id filter
2023-08-23 13:23:52 +02:00
Marcel Baumgartner
12e25dc4bc Added discord id filter 2023-08-23 13:23:36 +02:00
Marcel Baumgartner
37c3fc7a53 Merge pull request #283 from Moonlight-Panel/ImproveFrontend
Improve frontend
2023-08-23 13:17:51 +02:00
Marcel Baumgartner
0c6cbe0ba7 Changed background image
Thanks to @nuhuhwy
2023-08-23 13:10:21 +02:00
Marcel Baumgartner
5cf63240a3 Removed the white mode and useless css 2023-08-23 13:06:04 +02:00
Marcel Baumgartner
4d04d12a39 Removed old js calls 2023-08-23 12:35:30 +02:00
Marcel Baumgartner
b846b28802 Reduced css and js which was not used 2023-08-23 11:20:52 +02:00
Marcel Baumgartner
b94217abc0 Merge pull request #277 from 1Pot2Nutella-p/FRlanguage
add french language
2023-08-17 18:44:21 +02:00
1Pot2Nutella-p
de0d6a3808 add frensh language 2023-08-16 20:56:49 +02:00
Marcel Baumgartner
eca9b6ec52 Merge pull request #275 from Moonlight-Panel/RedesignServerPage
Redesign server page
2023-08-15 22:10:39 +02:00
Marcel Baumgartner
b6e048e982 Added spacing to network tab 2023-08-15 22:07:47 +02:00
Marcel Baumgartner
b8b2ae7865 Merge pull request #274 from Moonlight-Panel/ImproveServerTabIconHandling
Improved server tab icon handling
2023-08-15 21:59:51 +02:00
Marcel Baumgartner
0611988019 Improved server tab icon handling 2023-08-15 21:59:35 +02:00
Marcel Baumgartner
f9fd7199b6 Merge pull request #273 from realspinelle/SomeUXFix
Set unsorted servers to open by default
2023-08-15 19:58:28 +02:00
realspinelle
6ff4861fc6 Set unsorted servers to open by default 2023-08-15 19:21:31 +02:00
Marcel Baumgartner
2db7748703 Merge pull request #272 from Moonlight-Panel/ImproveLatencyCheckThreshold
Improved latency check default threshould
2023-08-15 15:50:30 +02:00
Marcel Baumgartner
87744e4846 Improved latency check default threshould
As mentioned in issue 263
2023-08-15 15:49:55 +02:00
Marcel Baumgartner
ce7125b50b Merge pull request #271 from Moonlight-Panel/ImproveAutoAdminSecurity
Improved auto admin security
2023-08-15 15:45:46 +02:00
Marcel Baumgartner
31d8c3f469 Improved auto admin security
As mentioned in issue 253
2023-08-15 15:45:12 +02:00
Marcel Baumgartner
c80622c2fd Merge pull request #270 from Moonlight-Panel/ImproveSecurityLogPrivacy
Improved the privacy for security logs
2023-08-15 15:33:38 +02:00
Marcel Baumgartner
95e659e5f7 Improved the privacy for security logs
As mentioned in issue 262
2023-08-15 15:33:18 +02:00
Marcel Baumgartner
c155909e82 Merge pull request #269 from Moonlight-Panel/MoveChangelog
Moved changelog to admin section
2023-08-15 15:26:44 +02:00
Marcel Baumgartner
0011ed29b7 Moved changelog to admin section 2023-08-15 15:26:24 +02:00
Marcel Baumgartner
52c4ca0c0a Merge pull request #268 from Moonlight-Panel/AddBetterSelfbotDetection
Improved the whole malware scan system. Made it possible for plugins to add them. Improved self bot detection for python
2023-08-15 15:15:30 +02:00
Marcel Baumgartner
c197d0ca96 Improved the whole malware scan system. Made it possible for plugins to add them. Improved self bot detection for python 2023-08-15 15:14:28 +02:00
Marcel Baumgartner
25902034e9 Switched to horizontal nav bar in the server view 2023-08-14 22:16:59 +02:00
Marcel Baumgartner
b10db643fe Merge pull request #266 from Moonlight-Panel/ImproveSoftErrors
Improved soft error boundary
2023-08-14 18:33:58 +02:00
Marcel Baumgartner
4c7ffe6714 Improved soft error boundary 2023-08-14 18:22:20 +02:00
Marcel Baumgartner
a0c2b45a61 Merge pull request #249 from Dannyx1604/main
Update README.md because of new installer
2023-08-13 21:16:53 +02:00
Marcel Baumgartner
e49a9d3505 Merge branch 'main' into main 2023-08-13 21:16:42 +02:00
Dannyx
7ddae9c3e1 t
t
2023-08-13 20:04:47 +02:00
Daniel Balk
290e865ae0 Merge pull request #261 from NaysKutzu/main
Fix a lot of typing mistakes and added Romanian translations.
2023-08-09 15:52:42 +02:00
NaysKutzu
00ee625e2e Create ro_ro.lang 2023-08-09 15:10:57 +02:00
NaysKutzu
274e2d93f2 Fix the locations of the elements. 2023-08-09 14:48:09 +02:00
NaysKutzu
781171f7c5 Fix typo 2023-08-09 14:46:41 +02:00
NaysKutzu
4a8618da79 Merge pull request #1 from NaysKutzu/NaysKutzu-patch-1
Fix some typos in the README.
2023-08-09 14:44:23 +02:00
NaysKutzu
296cf0db6f Fix typo in readme 2023-08-09 14:43:26 +02:00
Marcel Baumgartner
48cdba5155 Removed unused a tags in ticket view 2023-08-09 04:08:28 +02:00
Marcel Baumgartner
35c1b255b5 Update README.md 2023-08-09 03:47:50 +02:00
Marcel Baumgartner
244b920305 Merge pull request #260 from Moonlight-Panel/RemoveFormatterByteUtils
switched to the new converter instead of the formatter functions to convert byte sizes
2023-08-09 03:46:42 +02:00
Marcel Baumgartner
3d4a2128e2 switched to the new converter instead of the formatter functions to convert byte sizes 2023-08-09 03:42:33 +02:00
Marcel Baumgartner
1cf8430ad8 Small include improvment 2023-08-09 03:33:28 +02:00
Marcel Baumgartner
a9b7d10fb0 Fix invalid include with new include 2023-08-09 03:23:34 +02:00
Marcel Baumgartner
47e333630e Removed useless links in the tickets overview for admins 2023-08-09 01:00:55 +02:00
Marcel Baumgartner
8b41a9fc13 Add message sender include 2023-08-09 00:57:40 +02:00
Marcel Baumgartner
d09957fdac Merge pull request #259 from Moonlight-Panel/ImproveBackgroundImage
Made the background image darker
2023-08-09 00:37:53 +02:00
Marcel Baumgartner
f9ecb61d71 Made the background image darker
Thanks to https://github.com/nuhuhwy
2023-08-09 00:37:36 +02:00
Marcel Baumgartner
ef92dd47ad Merge pull request #258 from Moonlight-Panel/ImproveTicketSystemUI
Improved ticket system ui and some backend code
2023-08-09 00:36:33 +02:00
Marcel Baumgartner
c2c533675b Improved ticket system ui and some backend code 2023-08-09 00:35:49 +02:00
Marcel Baumgartner
569dd69bdd Merge pull request #257 from Moritz-Deiaco/main
pagination button gap fix
2023-08-08 17:14:07 +02:00
Moritz
242870b3e1 pagination button gap fix 2023-08-08 17:08:54 +02:00
Daniel Balk
30b6e45235 Merge pull request #254 from Moritz-Deiaco/main
New Translations
2023-08-08 16:33:00 +02:00
Moritz
cd62fdc5f6 fixed a typo, rechecked everything 2023-08-08 16:28:46 +02:00
Moritz Deiaco
2c54b91e6c New translations in de_de.lang 2023-08-08 12:16:14 +02:00
Dannyx
78bfd68d63 Update README.md because of New installer 2023-08-07 22:23:20 +02:00
216 changed files with 12371 additions and 354147 deletions

View File

@@ -0,0 +1,20 @@
{
"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"
}
}
}

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
# These are supported funding model platforms
ko_fi: masuowo

96
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,96 @@
name: Bug Report
description: Something isn't working quite right in the software.
labels: [not confirmed]
body:
- type: markdown
attributes:
value: |
Bug reports should only be used for reporting issues with how the software works. For assistance installing this software, as well as debugging issues with dependencies, please use our [Discord server](https://discord.gg/TJaspT7A8p).
- type: textarea
attributes:
label: Current Behavior
description: Please provide a clear & concise description of the issue.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: Please describe what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: Please be as detailed as possible when providing steps to reproduce, failure to provide steps will result in this issue being closed.
validations:
required: true
- type: input
id: panel-version
attributes:
label: Panel Version
description: Version number of your Panel (latest is not a version)
placeholder: 1.4.0
validations:
required: true
- type: input
id: daemon-version
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
validations:
required: true
- type: input
id: image-details
attributes:
label: Games and/or Images Affected
description: Please include the specific game(s) or Image(s) you are running into this bug with.
placeholder: Minecraft (Paper), Minecraft (Forge)
- type: input
id: docker-image
attributes:
label: Docker Image
description: The specific Docker image you are using for the game(s) above.
placeholder: ghcr.io/xxx/yolks:java_17
- type: textarea
id: panel-logs
attributes:
label: Error Logs
description: |
Run the following command to collect logs on your system.
Panel: `docker logs moonlight`
Wings: `sudo wings diagnostics`
placeholder: logs here
render: bash
validations:
required: false
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please [search here](https://github.com/Moonlight-Panel/Moonlight/issues) to see if an issue already exists for your problem.
options:
- label: I have searched the existing issues before opening this issue.
required: true
- 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

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Installation Help
url: https://discord.gg/TJaspT7A8p
about: Please visit our Discord for help with your installation.
- name: General Question
url: https://discord.gg/TJaspT7A8p
about: Please visit our Discord for general questions about Moonlight Panel.

View File

@@ -0,0 +1,32 @@
name: Feature Request
description: Suggest a new feature or improvement for the software.
labels: [feature request]
body:
- type: checkboxes
attributes:
label: Is there an existing feature request for this?
description: Please [search here](https://github.com/Moonlight-Panel/Moonlight/issues?q=is%3Aissue) to see if someone else has already suggested this.
options:
- label: I have searched the existing issues before opening this feature request.
required: true
- type: textarea
attributes:
label: Describe the feature you would like to see.
description: "A clear & concise description of the feature you'd like to have added, and what issues it would solve."
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like.
description: "You must explain how you'd like to see this feature implemented. Technical implementation details are not necessary, rather an idea of how you'd like to see this feature used."
validations:
required: true
- type: textarea
attributes:
label: Additional context to this request.
description: "Add any other context or screenshots about the feature request."
validations:
required: false

12
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# 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

@@ -0,0 +1,27 @@
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

@@ -0,0 +1,25 @@
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

@@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Build Docker image - name: Build Docker image
run: docker build -t moonlightpanel/moonlight:${{ github.sha }} -f Moonlight/Dockerfile . run: docker build -t moonlightpanel/moonlight:${{ github.sha }} -f Moonlight/Dockerfile .

View File

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

View File

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

View File

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

35
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,35 @@
{
"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 Normal file
View File

@@ -0,0 +1,41 @@
{
"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"
}
]
}

121
LICENSE Normal file
View File

@@ -0,0 +1,121 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.

View File

@@ -1,128 +0,0 @@
<h3>Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License (modified)</h3>
<p>By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.</p>
<p id="s1"><strong>Section 1 Definitions.</strong></p>
<ol type="a">
<li id="s1a"><strong>Adapted Material</strong> means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.</li>
<li id="s1b"><strong>Adapter's License</strong> means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.</li>
<li id="s1c"><strong>BY-NC-SA Compatible License</strong> means a license listed at <a href="//creativecommons.org/compatiblelicenses"> creativecommons.org/compatiblelicenses</a>, approved by Creative Commons as essentially the equivalent of this Public License.</li>
<li id="s1d"><strong>Copyright and Similar Rights</strong> means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section <a href="#s2b">2(b)(1)-(2)</a> are not Copyright and Similar Rights.</li>
<li id="s1e"><strong>Effective Technological Measures</strong> means those measures that, in the absence of proper authority, may not
be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar
international agreements.</li>
<li id="s1f"><strong>Exceptions and Limitations</strong> means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.</li>
<li id="s1g"><strong>License Elements</strong> means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution, NonCommercial, and ShareAlike.</li>
<li id="s1h"><strong>Licensed Material</strong> means the artistic or literary work, database, or other material to which the Licensor applied this Public License.</li>
<li id="s1i"><strong>Licensed Rights</strong> means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.</li>
<li id="s1j"><strong>Licensor</strong> means the individual(s) or entity(ies) granting rights under this Public License.</li>
<li id="s1k"><strong>NonCommercial</strong> means not primarily intended for or directed towards commercial advantage or monetary compensation. This also includes free hosting services or simmular which have no direct permission from the moonlight panel team to use this software. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.</li>
<li id="s1l"><strong>Share</strong> means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.</li>
<li id="s1m"><strong>Sui Generis Database Rights</strong> means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.</li>
<li id="s1n"><strong>You</strong> means the individual or entity exercising the Licensed Rights under this Public License. <strong>Your</strong> has a corresponding meaning.</li>
</ol>
<p id="s2"><strong>Section 2 Scope.</strong></p>
<ol type="a">
<li id="s2a"><strong>License grant</strong>.
<ol>
<li id="s2a1">Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
<ol type="A">
<li id="s2a1A">reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and</li>
<li id="s2a1B">produce, reproduce, and Share Adapted Material for NonCommercial purposes only.</li>
</ol>
</li><li id="s2a2"><span style="text-decoration: underline;">Exceptions and Limitations</span>. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.</li>
<li id="s2a3"><span style="text-decoration: underline;">Term</span>. The term of this Public License is specified in Section <a href="#s6a">6(a)</a>.</li>
<li id="s2a4"><span style="text-decoration: underline;">Media and formats; technical modifications allowed</span>. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section <a href="#s2a4">2(a)(4)</a> never produces Adapted Material.</li>
<li id="s2a5"><span style="text-decoration: underline;">Downstream recipients</span>.
<div class="para">
<ol type="A">
<li id="s2a5A"><span style="text-decoration: underline;">Offer from the Licensor Licensed Material</span>. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.</li>
<li id="s2a5B"><span style="text-decoration: underline;">Additional offer from the Licensor Adapted Material</span>. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapters License You apply.</li>
<li id="s2a5C"><span style="text-decoration: underline;">No downstream restrictions</span>. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.</li>
</ol>
</div>
</li><li id="s2a6"><span style="text-decoration: underline;">No endorsement</span>. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section <a href="#s3a1Ai">3(a)(1)(A)(i)</a>.</li>
</ol>
</li><li id="s2b"><p><strong>Other rights</strong>.</p>
<ol>
<li id="s2b1">Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.</li>
<li id="s2b2">Patent and trademark rights are not licensed under this Public License.</li>
<li id="s2b3">To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.</li>
</ol>
</li>
</ol>
<p id="s3"><strong>Section 3 License Conditions.</strong></p>
<p>Your exercise of the Licensed Rights is expressly made subject to the following conditions.</p>
<ol type="a">
<li id="s3a"><p><strong>Attribution</strong>.</p>
<ol>
<li id="s3a1"><p>If You Share the Licensed Material (including in modified form), You must:</p>
<ol type="A">
<li id="s3a1A">retain the following if it is supplied by the Licensor with the Licensed Material:
<ol type="i">
<li id="s3a1Ai">identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);</li>
<li id="s3a1Aii">a copyright notice;</li>
<li id="s3a1Aiii">a notice that refers to this Public License; </li>
<li id="s3a1Aiv">a notice that refers to the disclaimer of warranties;</li>
<li id="s3a1Av">a URI or hyperlink to the Licensed Material to the extent reasonably practicable;</li>
</ol>
</li><li id="s3a1B">indicate if You modified the Licensed Material and retain an indication of any previous modifications; and</li>
<li id="s3a1C">indicate the Licensed Material is licensed under this Public License,
and include the text of, or the URI or hyperlink to, this Public
License.</li>
</ol>
</li>
<li id="s3a2">You may satisfy the conditions in Section <a href="#s3a1">3(a)(1)</a> in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.</li>
<li id="s3a3">If requested by the Licensor, You must remove any of the information required by Section <a href="#s3a1A">3(a)(1)(A)</a> to the extent reasonably practicable.</li>
</ol>
</li>
<li id="s3b"><strong>ShareAlike</strong>.
<p>In addition to the conditions in Section <a href="#s3a">3(a)</a>, if You Share Adapted Material You produce, the following conditions also apply.</p>
<ol>
<li id="s3b1">The Adapters License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License.</li>
<li id="s3b2">You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.</li>
<li id="s3b3">You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.</li>
</ol>
</li>
</ol>
<p id="s4"><strong>Section 4 Sui Generis Database Rights.</strong></p>
<p>Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:</p>
<ol type="a">
<li id="s4a">for the avoidance of doubt, Section <a href="#s2a1">2(a)(1)</a> grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;</li>
<li id="s4b">if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section <a href="#s3b">3(b)</a>; and</li>
<li id="s4c">You must comply with the conditions in Section <a href="#s3a">3(a)</a> if You Share all or a substantial portion of the contents of the database.</li>
</ol>
For the avoidance of doubt, this Section <a href="#s4">4</a> supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
<p id="s5"><strong>Section 5 Disclaimer of Warranties and Limitation of Liability.</strong></p>
<ol style="font-weight: bold;" type="a">
<li id="s5a"><strong>Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.</strong></li>
<li id="s5b"><strong>To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.</strong></li>
</ol>
<ol start="3" type="a">
<li id="s5c">The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.</li>
</ol>
<p id="s6"><strong>Section 6 Term and Termination.</strong></p>
<ol type="a">
<li id="s6a">This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.</li>
<li id="s6b">
<p>Where Your right to use the Licensed Material has terminated under Section <a href="#s6a">6(a)</a>, it reinstates:</p>
<ol>
<li id="s6b1">automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or</li>
<li id="s6b2">upon express reinstatement by the Licensor.</li>
</ol>
For the avoidance of doubt, this Section <a href="#s6b">6(b)</a> does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.</li>
<li id="s6c">For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.</li>
<li id="s6d">Sections <a href="#s1">1</a>, <a href="#s5">5</a>, <a href="#s6">6</a>, <a href="#s7">7</a>, and <a href="#s8">8</a> survive termination of this Public License.</li>
</ol>
<p id="s7"><strong>Section 7 Other Terms and Conditions.</strong></p>
<ol type="a">
<li id="s7a">The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.</li>
<li id="s7b">Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.</li>
</ol>
<p id="s8"><strong>Section 8 Interpretation.</strong></p>
<ol type="a">
<li id="s8a">For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.</li>
<li id="s8b">To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.</li>
<li id="s8c">No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.</li>
<li id="s8d">Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.</li>
</ol>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -8,8 +8,7 @@ using Newtonsoft.Json;
public class ConfigV1 public class ConfigV1
{ {
[JsonProperty("Moonlight")] [JsonProperty("Moonlight")] public MoonlightData Moonlight { get; set; } = new();
public MoonlightData Moonlight { get; set; } = new();
public class MoonlightData public class MoonlightData
{ {
@@ -24,7 +23,9 @@ public class ConfigV1
[JsonProperty("LatencyCheckThreshold")] [JsonProperty("LatencyCheckThreshold")]
[Description("Specify the latency threshold which has to be reached in order to trigger the warning message")] [Description("Specify the latency threshold which has to be reached in order to trigger the warning message")]
public int LatencyCheckThreshold { get; set; } = 500; public int LatencyCheckThreshold { get; set; } = 1000;
[JsonProperty("LetsEncrypt")] public LetsEncrypt LetsEncrypt { get; set; } = new();
[JsonProperty("Auth")] public AuthData Auth { get; set; } = new(); [JsonProperty("Auth")] public AuthData Auth { get; set; } = new();
@@ -48,7 +49,8 @@ public class ConfigV1
[JsonProperty("Cleanup")] public CleanupData Cleanup { get; set; } = new(); [JsonProperty("Cleanup")] public CleanupData Cleanup { get; set; } = new();
[JsonProperty("DiscordNotifications")] public DiscordNotificationsData DiscordNotifications { get; set; } = new(); [JsonProperty("DiscordNotifications")]
public DiscordNotificationsData DiscordNotifications { get; set; } = new();
[JsonProperty("Statistics")] public StatisticsData Statistics { get; set; } = new(); [JsonProperty("Statistics")] public StatisticsData Statistics { get; set; } = new();
@@ -63,6 +65,33 @@ public class ConfigV1
[JsonProperty("Tickets")] public TicketsData Tickets { 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 public class TicketsData
{ {
[JsonProperty("WelcomeMessage")] [JsonProperty("WelcomeMessage")]
@@ -73,7 +102,8 @@ public class ConfigV1
public class StripeData public class StripeData
{ {
[JsonProperty("ApiKey")] [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")] [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 string ApiKey { get; set; } = "";
} }
@@ -86,6 +116,14 @@ public class ConfigV1
[JsonProperty("DenyRegister")] [JsonProperty("DenyRegister")]
[Description("Prevent every new user to register")] [Description("Prevent every new user to register")]
public bool DenyRegister { get; set; } = false; 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 public class CleanupData
@@ -107,7 +145,8 @@ public class ConfigV1
public long Uptime { get; set; } = 6; public long Uptime { get; set; } = 6;
[JsonProperty("Enable")] [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")] [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; public bool Enable { get; set; } = false;
[JsonProperty("MinUptime")] [JsonProperty("MinUptime")]
@@ -121,9 +160,7 @@ public class ConfigV1
[JsonProperty("Host")] public string Host { get; set; } = "your.database.host"; [JsonProperty("Host")] public string Host { get; set; } = "your.database.host";
[JsonProperty("Password")] [JsonProperty("Password")] [Blur] public string Password { get; set; } = "secret";
[Blur]
public string Password { get; set; } = "secret";
[JsonProperty("Port")] public long Port { get; set; } = 3306; [JsonProperty("Port")] public long Port { get; set; } = 3306;
@@ -141,6 +178,7 @@ public class ConfigV1
[Blur] [Blur]
public string Token { get; set; } = Guid.NewGuid().ToString(); public string Token { get; set; } = Guid.NewGuid().ToString();
} }
public class DiscordBotData public class DiscordBotData
{ {
[JsonProperty("Enable")] [JsonProperty("Enable")]
@@ -164,7 +202,8 @@ public class ConfigV1
public class DiscordNotificationsData public class DiscordNotificationsData
{ {
[JsonProperty("Enable")] [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")] [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; public bool Enable { get; set; } = false;
[JsonProperty("WebHook")] [JsonProperty("WebHook")]
@@ -201,19 +240,23 @@ public class ConfigV1
public class HeadersData public class HeadersData
{ {
[JsonProperty("Color")] [JsonProperty("Color")]
[Description("This specifies the color of the embed generated by platforms like discord when someone posts a link to your moonlight instance")] [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"; public string Color { get; set; } = "#4b27e8";
[JsonProperty("Description")] [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")] [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"; public string Description { get; set; } = "the next generation hosting panel";
[JsonProperty("Keywords")] [JsonProperty("Keywords")]
[Description("To help search engines like google to index your moonlight instance correctly you can specify keywords seperated by a comma here")] [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"; public string Keywords { get; set; } = "moonlight";
[JsonProperty("Title")] [JsonProperty("Title")]
[Description("This specifies the title of the embed generated by platforms like discord when someone posts a link to your moonlight instance")] [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 string Title { get; set; } = "Moonlight - endelon.link";
} }
@@ -223,9 +266,7 @@ public class ConfigV1
[JsonProperty("Server")] public string Server { get; set; } = "your.mail.host"; [JsonProperty("Server")] public string Server { get; set; } = "your.mail.host";
[JsonProperty("Password")] [JsonProperty("Password")] [Blur] public string Password { get; set; } = "secret";
[Blur]
public string Password { get; set; } = "secret";
[JsonProperty("Port")] public int Port { get; set; } = 465; [JsonProperty("Port")] public int Port { get; set; } = 465;
@@ -263,19 +304,19 @@ public class ConfigV1
[JsonProperty("ClientId")] public string ClientId { get; set; } [JsonProperty("ClientId")] public string ClientId { get; set; }
[JsonProperty("ClientSecret")] [JsonProperty("ClientSecret")] [Blur] public string ClientSecret { get; set; }
[Blur]
public string ClientSecret { get; set; }
} }
public class RatingData public class RatingData
{ {
[JsonProperty("Enabled")] [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")] [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; public bool Enabled { get; set; } = false;
[JsonProperty("Url")] [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")] [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"; public string Url { get; set; } = "https://link-to-google-or-smth";
[JsonProperty("MinRating")] [JsonProperty("MinRating")]
@@ -290,36 +331,49 @@ public class ConfigV1
public class SecurityData public class SecurityData
{ {
[JsonProperty("Token")] [JsonProperty("Token")]
[Description("This is the moonlight app token. It is used to encrypt and decrypt data and validte tokens and sessions")] [Description(
"This is the moonlight app token. It is used to encrypt and decrypt data and validate tokens and sessions")]
[Blur] [Blur]
public string Token { get; set; } = Guid.NewGuid().ToString(); 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")] [JsonProperty("BlockIpDuration")]
[Description("The duration in minutes a ip will be blocked by the anti ddos system")] [Description("The duration in minutes a ip will be blocked by the anti ddos system")]
public int BlockIpDuration { get; set; } = 15; public int BlockIpDuration { get; set; } = 15;
[JsonProperty("ReCaptcha")] public ReCaptchaData ReCaptcha { get; set; } = new(); [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 public class ReCaptchaData
{ {
[JsonProperty("Enable")] [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/")] [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; public bool Enable { get; set; } = false;
[JsonProperty("SiteKey")] [JsonProperty("SiteKey")] [Blur] public string SiteKey { get; set; } = "recaptcha site key here";
[Blur]
public string SiteKey { get; set; } = "recaptcha site key here";
[JsonProperty("SecretKey")] [JsonProperty("SecretKey")] [Blur] public string SecretKey { get; set; } = "recaptcha secret here";
[Blur]
public string SecretKey { get; set; } = "recaptcha secret here";
} }
public class SentryData public class SentryData
{ {
[JsonProperty("Enable")] [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")] [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; public bool Enable { get; set; } = false;
[JsonProperty("Dsn")] [JsonProperty("Dsn")]

View File

@@ -113,13 +113,18 @@ public class EventSystem
return Task.CompletedTask; return Task.CompletedTask;
} }
public Task<T> WaitForEvent<T>(string id, object handle, Func<T, bool> filter) public Task<T> WaitForEvent<T>(string id, object handle, Func<T, bool>? filter = null)
{ {
var taskCompletionSource = new TaskCompletionSource<T>(); var taskCompletionSource = new TaskCompletionSource<T>();
Func<T, Task> action = async data => Func<T, Task> action = async data =>
{ {
if (filter.Invoke(data)) if (filter == null)
{
taskCompletionSource.SetResult(data);
await Off(id, handle);
}
else if(filter.Invoke(data))
{ {
taskCompletionSource.SetResult(data); taskCompletionSource.SetResult(data);
await Off(id, handle); await Off(id, handle);

View File

@@ -45,9 +45,18 @@ public class DatabaseCheckupService
{ {
Logger.Info($"{migrations.Length} migrations pending. Updating now"); Logger.Info($"{migrations.Length} migrations pending. Updating now");
try
{
var backupHelper = new BackupHelper(); var backupHelper = new BackupHelper();
await backupHelper.CreateBackup( await backupHelper.CreateBackup(
PathBuilder.File("storage", "backups", $"{new DateTimeOffset(DateTime.UtcNow).ToUnixTimeMilliseconds()}.zip")); PathBuilder.File("storage", "backups", $"{new DateTimeOffset(DateTime.UtcNow).ToUnixTimeMilliseconds()}.zip"));
}
catch (Exception e)
{
Logger.Fatal("Unable to create backup");
Logger.Fatal(e);
Logger.Fatal("Moonlight will continue to start and apply the migrations without a backup");
}
Logger.Info("Applying migrations"); Logger.Info("Applying migrations");

View File

@@ -110,15 +110,15 @@ public class HostFileAccess : FileAccess
if (fileData.IsFile) if (fileData.IsFile)
File.Delete(currhp + fileData.Name); File.Delete(currhp + fileData.Name);
else else
Directory.Delete(currhp + fileData.Name); Directory.Delete(currhp + fileData.Name, true);
} }
public override async Task Move(FileData fileData, string newPath) public override async Task Move(FileData fileData, string newPath)
{ {
if (fileData.IsFile) if (fileData.IsFile)
File.Move(currhp + fileData.Name, newPath); File.Move(currhp + fileData.Name, BasePath + newPath);
else else
Directory.Move(currhp + fileData.Name, newPath); Directory.Move(currhp + fileData.Name, BasePath + newPath);
} }
public override Task Compress(params FileData[] files) public override Task Compress(params FileData[] files)

View File

@@ -1,4 +1,5 @@
using System.Text; using System.Text;
using Microsoft.AspNetCore.Components;
using Moonlight.App.Services; using Moonlight.App.Services;
namespace Moonlight.App.Helpers; namespace Moonlight.App.Helpers;
@@ -156,11 +157,47 @@ public static class Formatter
} }
} }
public static double BytesToGb(long bytes) public static double CalculateAverage(List<double> values)
{ {
const double gbMultiplier = 1024 * 1024 * 1024; // 1 GB = 1024 MB * 1024 KB * 1024 B if (values == null || values.Count == 0)
{
throw new ArgumentException("The list cannot be null or empty.");
}
double gigabytes = (double)bytes / gbMultiplier; double sum = 0;
return gigabytes; foreach (double value in values)
{
sum += value;
}
return sum / values.Count;
}
public static double CalculatePercentage(double part, double total)
{
if (total == 0)
{
return 0;
}
return (part / total) * 100;
}
public static RenderFragment FormatLineBreaks(string content)
{
return builder =>
{
int i = 0;
var arr = content.Split("\n", StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
foreach (var line in arr)
{
builder.AddContent(i, line);
if (i++ != arr.Length - 1)
{
builder.AddMarkupContent(i, "<br/>");
}
}
};
} }
} }

View File

@@ -43,4 +43,48 @@ public static class StringHelper
return firstChar + restOfString; return firstChar + restOfString;
} }
public static string CutInHalf(string input)
{
if (string.IsNullOrEmpty(input))
return input;
int length = input.Length;
int halfLength = length / 2;
return input.Substring(0, halfLength);
}
public static bool EndsInOneOf(string suffix, IEnumerable<string> strings)
{
foreach (string str in strings)
{
if (suffix.EndsWith(str))
{
return true;
}
}
return false;
}
public static bool ContainsOneOf(string textToSearch, IEnumerable<string> strings, out string foundText)
{
foreach (string str in strings)
{
if (textToSearch.Contains(str))
{
foundText = str;
return true;
}
}
foundText = "";
return false;
}
public static bool ContainsOneOf(string textToSearch, IEnumerable<string> strings)
{
return ContainsOneOf(textToSearch, strings, out _);
}
} }

View File

@@ -218,6 +218,16 @@ public class WingsConsole : IDisposable
break; break;
case "install output": case "install output":
if (ServerState != ServerState.Installing)
{
// Because wings is sending "install output" events BEFORE
// sending the "install started" event,
// we need to set the install state here
// See https://github.com/pterodactyl/panel/issues/4853
// for more details
//await UpdateServerState(ServerState.Installing);
}
foreach (var line in eventData.Args) foreach (var line in eventData.Args)
{ {
await SaveMessage(line); await SaveMessage(line);

View File

@@ -61,6 +61,10 @@ public class WingsServerConverter
.First(x => x.Id == server.Image.Id); .First(x => x.Id == server.Image.Id);
// Container // Container
if(server.DockerImageIndex >= image.DockerImages.Count() || server.DockerImageIndex == -1)
wingsServer.Settings.Container.Image = image.DockerImages.Last().Name;
else
wingsServer.Settings.Container.Image = image.DockerImages[server.DockerImageIndex].Name; wingsServer.Settings.Container.Image = image.DockerImages[server.DockerImageIndex].Name;
// Egg // Egg

View File

@@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Mvc;
using Moonlight.App.Events;
using Moonlight.App.Services;
namespace Moonlight.App.Http.Controllers.WellKnown;
[ApiController]
[Route(".well-known/acme-challenge")]
public class AcmeController : Controller
{
private readonly LetsEncryptService LetsEncryptService;
private readonly EventSystem Event;
public AcmeController(LetsEncryptService letsEncryptService, EventSystem eventSystem)
{
LetsEncryptService = letsEncryptService;
Event = eventSystem;
}
[HttpGet("{token}")]
public async Task<ActionResult> Get([FromRoute] string token)
{
if (string.IsNullOrEmpty(LetsEncryptService.HttpChallenge) || string.IsNullOrEmpty(LetsEncryptService.HttpChallengeToken))
return Problem();
if (string.IsNullOrEmpty(token) || LetsEncryptService.HttpChallengeToken != token)
return Problem();
await Event.Emit("letsEncrypt.challengeFetched");
return Ok(LetsEncryptService.HttpChallenge);
}
}

View File

@@ -0,0 +1,78 @@
using Moonlight.App.Database.Entities;
using Moonlight.App.Helpers;
using Moonlight.App.Models.Misc;
using Moonlight.App.Services;
namespace Moonlight.App.MalwareScans;
public class BadScriptsScan : MalwareScan
{
public override string Name => "BadScripts Scan";
public override string Description => "This scanner tries to find scripts like proxies or other bad stuff";
public async override Task<MalwareScanResult?> Scan(Server server, IServiceProvider serviceProvider)
{
var serverService = serviceProvider.GetRequiredService<ServerService>();
var fileAccess = await serverService.CreateFileAccess(server, null!);
string[] fileExtensions =
{
".py",
".js",
".json",
".txt",
".sh",
".env",
".md",
".html",
".htm"
};
string[] badWords =
{
"cloudscraper",
"shadowsocks",
"karma-ddos",
"quake",
"nuked by",
"nuke bot",
"t-e-s-tweb",
"nezha",
"rblxwild.com",
"proxyscrape",
"vless://",
"vmess://",
"trojan://",
"shadowrocket",
"urfate/afk-bot",
"token vc spammer",
"pretreer.com",
"madfutters.com",
"ultrafut",
"selfcord.py",
"https://github.com/go-gost/gost",
"nodejs-proxy"
};
var files = await fileAccess.Ls();
var filteredFiles = files.Where(x =>
StringHelper.EndsInOneOf(x.Name, fileExtensions));
foreach (var file in filteredFiles)
{
var content = await fileAccess.Read(file);
var processableContent = content.ToLower();
if (StringHelper.ContainsOneOf(processableContent, badWords, out string foundText))
{
return new()
{
Title = "Software which is not allowed",
Description = $"Found bad word in script '{file.Name}': '{foundText}'",
Author = "Marcel Baumgartner"
};
}
}
return null;
}
}

View File

@@ -0,0 +1,39 @@
using Moonlight.App.Database.Entities;
using Moonlight.App.Models.Misc;
using Moonlight.App.Services;
namespace Moonlight.App.MalwareScans;
public class FakePlayerPluginScan : MalwareScan
{
public override string Name => "Fake player plugin scan";
public override string Description => "This scan is a simple fake player plugin scan provided by moonlight";
public override async Task<MalwareScanResult?> Scan(Server server, IServiceProvider serviceProvider)
{
var serverService = serviceProvider.GetRequiredService<ServerService>();
var access = await serverService.CreateFileAccess(server, null!);
var fileElements = await access.Ls();
if (fileElements.Any(x => !x.IsFile && x.Name == "plugins")) // Check for plugins folder
{
await access.Cd("plugins");
fileElements = await access.Ls();
foreach (var fileElement in fileElements)
{
if (fileElement.Name.ToLower().Contains("fakeplayer"))
{
return new()
{
Title = "Fake player plugin",
Description = $"Suspicious plugin file: {fileElement.Name}",
Author = "Marcel Baumgartner"
};
}
}
}
return null;
}
}

View File

@@ -0,0 +1,37 @@
using Moonlight.App.Database.Entities;
using Moonlight.App.Models.Misc;
using Moonlight.App.Services;
namespace Moonlight.App.MalwareScans;
public class MinerJarScan : MalwareScan
{
public override string Name => "Miner jar scan";
public override string Description => "This scan is a simple miner jar scan provided by moonlight";
public override async Task<MalwareScanResult?> Scan(Server server, IServiceProvider serviceProvider)
{
var serverService = serviceProvider.GetRequiredService<ServerService>();
var access = await serverService.CreateFileAccess(server, null!);
var fileElements = await access.Ls();
if (fileElements.Any(x => x.Name == "libraries" && !x.IsFile))
{
await access.Cd("libraries");
fileElements = await access.Ls();
if (fileElements.Any(x => x.Name == "jdk" && !x.IsFile))
{
return new()
{
Title = "Found Miner",
Description = "Detected suspicious library directory which may contain a script for miners",
Author = "Marcel Baumgartner"
};
}
}
return null;
}
}

View File

@@ -0,0 +1,10 @@
using Moonlight.App.Database.Entities;
namespace Moonlight.App.Models.Misc;
public abstract class MalwareScan
{
public abstract string Name { get; }
public abstract string Description { get; }
public abstract Task<MalwareScanResult?> Scan(Server server, IServiceProvider serviceProvider);
}

View File

@@ -2,7 +2,7 @@
public class MalwareScanResult public class MalwareScanResult
{ {
public string Title { get; set; } = ""; public string Title { get; set; }
public string Description { get; set; } = ""; public string Description { get; set; } = "";
public string Author { get; set; } = ""; public string Author { get; set; } = "";
} }

View File

@@ -408,6 +408,20 @@ public static class Permissions
Description = "Manage the integrated ddos protection" Description = "Manage the integrated ddos protection"
}; };
public static Permission AdminChangelog = new()
{
Index = 60,
Name = "Admin changelog",
Description = "View the changelog"
};
public static Permission AdminStatisticsLive = new()
{
Index = 61,
Name = "Admin statistics live",
Description = "View the live statistics"
};
public static Permission? FromString(string name) public static Permission? FromString(string name)
{ {
var type = typeof(Permissions); var type = typeof(Permissions);

View File

@@ -1,4 +1,5 @@
using Moonlight.App.Plugin.UI.Servers; using Moonlight.App.Models.Misc;
using Moonlight.App.Plugin.UI.Servers;
using Moonlight.App.Plugin.UI.Webspaces; using Moonlight.App.Plugin.UI.Webspaces;
namespace Moonlight.App.Plugin; namespace Moonlight.App.Plugin;
@@ -12,4 +13,5 @@ public abstract class MoonlightPlugin
public Func<ServerPageContext, Task>? OnBuildServerPage { get; set; } public Func<ServerPageContext, Task>? OnBuildServerPage { get; set; }
public Func<WebspacePageContext, Task>? OnBuildWebspacePage { get; set; } public Func<WebspacePageContext, Task>? OnBuildWebspacePage { get; set; }
public Func<IServiceCollection, Task>? OnBuildServices { get; set; } public Func<IServiceCollection, Task>? OnBuildServices { get; set; }
public Func<List<MalwareScan>, Task<List<MalwareScan>>>? OnBuildMalwareScans { get; set; }
} }

View File

@@ -93,14 +93,14 @@ public class CleanupService
Logger.Debug($"Max CPU: {maxCpu}"); Logger.Debug($"Max CPU: {maxCpu}");
executeCleanup = true; executeCleanup = true;
} }
else if (Formatter.BytesToGb(memoryMetrics.Total) - Formatter.BytesToGb(memoryMetrics.Used) < else if (ByteSizeValue.FromKiloBytes(memoryMetrics.Total).MegaBytes - ByteSizeValue.FromKiloBytes(memoryMetrics.Used).MegaBytes <
minMemory / 1024D) minMemory)
{ {
Logger.Debug($"{node.Name}: Memory Usage is too high"); Logger.Debug($"{node.Name}: Memory Usage is too high");
Logger.Debug($"Memory (Total): {Formatter.BytesToGb(memoryMetrics.Total)}"); Logger.Debug($"Memory (Total): {ByteSizeValue.FromKiloBytes(memoryMetrics.Total).MegaBytes}");
Logger.Debug($"Memory (Used): {Formatter.BytesToGb(memoryMetrics.Used)}"); Logger.Debug($"Memory (Used): {ByteSizeValue.FromKiloBytes(memoryMetrics.Used).MegaBytes}");
Logger.Debug( Logger.Debug(
$"Memory (Free): {Formatter.BytesToGb(memoryMetrics.Total) - Formatter.BytesToGb(memoryMetrics.Used)}"); $"Memory (Free): {ByteSizeValue.FromKiloBytes(memoryMetrics.Total).MegaBytes - ByteSizeValue.FromKiloBytes(memoryMetrics.Used).MegaBytes}");
Logger.Debug($"Min Memory: {minMemory}"); Logger.Debug($"Min Memory: {minMemory}");
executeCleanup = true; executeCleanup = true;
} }

View File

@@ -31,9 +31,8 @@ public class DiscordNotificationService
Client = new(config.WebHook); Client = new(config.WebHook);
AppUrl = configService.Get().Moonlight.AppUrl; AppUrl = configService.Get().Moonlight.AppUrl;
Event.On<User>("supportChat.new", this, OnNewSupportChat); Event.On<Ticket>("tickets.new", this, OnNewTicket);
Event.On<SupportChatMessage>("supportChat.message", this, OnSupportChatMessage); Event.On<Ticket>("tickets.status", this, OnTicketStatusUpdated);
Event.On<User>("supportChat.close", this, OnSupportChatClose);
Event.On<User>("user.rating", this, OnUserRated); Event.On<User>("user.rating", this, OnUserRated);
Event.On<User>("billing.completed", this, OnBillingCompleted); Event.On<User>("billing.completed", this, OnBillingCompleted);
Event.On<BlocklistIp>("ddos.add", this, OnIpBlockListed); Event.On<BlocklistIp>("ddos.add", this, OnIpBlockListed);
@@ -44,6 +43,24 @@ public class DiscordNotificationService
} }
} }
private async Task OnTicketStatusUpdated(Ticket ticket)
{
await SendNotification("", builder =>
{
builder.Title = "Ticket status has been updated";
builder.AddField("Issue topic", ticket.IssueTopic);
builder.AddField("Status", ticket.Status);
if (ticket.AssignedTo != null)
{
builder.AddField("Assigned to", $"{ticket.AssignedTo.FirstName} {ticket.AssignedTo.LastName}");
}
builder.Color = Color.Green;
builder.Url = $"{AppUrl}/admin/support/view/{ticket.Id}";
});
}
private async Task OnIpBlockListed(BlocklistIp blocklistIp) private async Task OnIpBlockListed(BlocklistIp blocklistIp)
{ {
await SendNotification("", builder => await SendNotification("", builder =>
@@ -85,46 +102,14 @@ public class DiscordNotificationService
}); });
} }
private async Task OnSupportChatClose(User user) private async Task OnNewTicket(Ticket ticket)
{ {
await SendNotification("", builder => await SendNotification("", builder =>
{ {
builder.Title = "A new support chat has been marked as closed"; builder.Title = "A new ticket has been created";
builder.Color = Color.Red; builder.AddField("Issue topic", ticket.IssueTopic);
builder.AddField("Email", user.Email);
builder.AddField("Firstname", user.FirstName);
builder.AddField("Lastname", user.LastName);
builder.Url = $"{AppUrl}/admin/support/view/{user.Id}";
});
}
private async Task OnSupportChatMessage(SupportChatMessage message)
{
if(message.Sender == null)
return;
await SendNotification("", builder =>
{
builder.Title = "New message in support chat";
builder.Color = Color.Blue;
builder.AddField("Message", message.Content);
builder.Author = new EmbedAuthorBuilder()
.WithName($"{message.Sender.FirstName} {message.Sender.LastName}")
.WithIconUrl(ResourceService.Avatar(message.Sender));
builder.Url = $"{AppUrl}/admin/support/view/{message.Recipient.Id}";
});
}
private async Task OnNewSupportChat(User user)
{
await SendNotification("", builder =>
{
builder.Title = "A new support chat has been marked as active";
builder.Color = Color.Green; builder.Color = Color.Green;
builder.AddField("Email", user.Email); builder.Url = $"{AppUrl}/admin/support/view/{ticket.Id}";
builder.AddField("Firstname", user.FirstName);
builder.AddField("Lastname", user.LastName);
builder.Url = $"{AppUrl}/admin/support/view/{user.Id}";
}); });
} }

View File

@@ -0,0 +1,148 @@
using Moonlight.App.ApiClients.Daemon.Resources;
using Moonlight.App.Database.Entities;
using Moonlight.App.Events;
using Moonlight.App.Exceptions;
using Moonlight.App.Helpers;
using Moonlight.App.Models.Misc;
using Moonlight.App.Repositories;
namespace Moonlight.App.Services.Background;
public class MalwareBackgroundScanService
{
private readonly EventSystem Event;
private readonly IServiceScopeFactory ServiceScopeFactory;
public bool IsRunning => !ScanTask?.IsCompleted ?? false;
public bool ScanAllServers { get; set; }
public readonly Dictionary<Server, MalwareScanResult> ScanResults;
public string Status { get; private set; } = "N/A";
private Task? ScanTask;
public MalwareBackgroundScanService(IServiceScopeFactory serviceScopeFactory, EventSystem eventSystem)
{
ServiceScopeFactory = serviceScopeFactory;
Event = eventSystem;
ScanResults = new();
}
public Task Start()
{
if (IsRunning)
throw new DisplayException("Malware scan is already running");
ScanTask = Task.Run(Run);
return Task.CompletedTask;
}
private async Task Run()
{
// Clean results
Status = "Clearing last results";
await Event.Emit("malwareScan.status", IsRunning);
lock (ScanResults)
ScanResults.Clear();
await Event.Emit("malwareScan.result");
using var scope = ServiceScopeFactory.CreateScope();
var serverRepo = scope.ServiceProvider.GetRequiredService<Repository<Server>>();
var malwareScanService = scope.ServiceProvider.GetRequiredService<MalwareScanService>();
Status = "Fetching servers to scan";
await Event.Emit("malwareScan.status", IsRunning);
Server[] servers;
if (ScanAllServers)
servers = serverRepo.Get().ToArray();
else
servers = await GetOnlineServers();
// Perform scan
int i = 1;
foreach (var server in servers)
{
Status = $"[{i} / {servers.Length}] Scanning server {server.Name}";
await Event.Emit("malwareScan.status", IsRunning);
var result = await malwareScanService.Perform(server);
if (result != null)
{
lock (ScanResults)
{
ScanResults.Add(server, result);
}
await Event.Emit("malwareScan.result", server);
}
i++;
}
Task.Run(async () => // Because we use the task as the status indicator we need to notify the event system in a new task
{
await Task.Delay(TimeSpan.FromSeconds(5));
await Event.Emit("malwareScan.status", IsRunning);
});
}
private async Task<Server[]> GetOnlineServers()
{
using var scope = ServiceScopeFactory.CreateScope();
// Load services from di scope
var nodeRepo = scope.ServiceProvider.GetRequiredService<Repository<Node>>();
var serverRepo = scope.ServiceProvider.GetRequiredService<Repository<Server>>();
var nodeService = scope.ServiceProvider.GetRequiredService<NodeService>();
var nodes = nodeRepo.Get().ToArray();
var containers = new List<Container>();
// Fetch and summarize all running containers from all nodes
Logger.Verbose("Fetching and summarizing all running containers from all nodes");
Status = "Fetching and summarizing all running containers from all nodes";
await Event.Emit("malwareScan.status", IsRunning);
foreach (var node in nodes)
{
var metrics = await nodeService.GetDockerMetrics(node);
foreach (var container in metrics.Containers)
{
containers.Add(container);
}
}
var containerServerMapped = new Dictionary<Server, Container>();
// Map all the containers to their corresponding server if existing
Logger.Verbose("Mapping all the containers to their corresponding server if existing");
Status = "Mapping all the containers to their corresponding server if existing";
await Event.Emit("malwareScan.status", IsRunning);
foreach (var container in containers)
{
if (Guid.TryParse(container.Name, out Guid uuid))
{
var server = serverRepo
.Get()
.FirstOrDefault(x => x.Uuid == uuid);
if(server == null)
continue;
containerServerMapped.Add(server, container);
}
}
return containerServerMapped.Keys.ToArray();
}
}

View File

@@ -1,238 +0,0 @@
using Moonlight.App.ApiClients.Daemon.Resources;
using Moonlight.App.Database.Entities;
using Moonlight.App.Events;
using Moonlight.App.Exceptions;
using Moonlight.App.Helpers;
using Moonlight.App.Models.Misc;
using Moonlight.App.Repositories;
namespace Moonlight.App.Services.Background;
public class MalwareScanService
{
private Repository<Server> ServerRepository;
private Repository<Node> NodeRepository;
private NodeService NodeService;
private ServerService ServerService;
private readonly EventSystem Event;
private readonly IServiceScopeFactory ServiceScopeFactory;
public bool IsRunning { get; private set; }
public bool ScanAllServers { get; set; }
public readonly Dictionary<Server, MalwareScanResult[]> ScanResults;
public string Status { get; private set; } = "N/A";
public MalwareScanService(IServiceScopeFactory serviceScopeFactory, EventSystem eventSystem)
{
ServiceScopeFactory = serviceScopeFactory;
Event = eventSystem;
ScanResults = new();
}
public Task Start()
{
if (IsRunning)
throw new DisplayException("Malware scan is already running");
Task.Run(Run);
return Task.CompletedTask;
}
private async Task Run()
{
// Clean results
IsRunning = true;
Status = "Clearing last results";
await Event.Emit("malwareScan.status", IsRunning);
lock (ScanResults)
{
ScanResults.Clear();
}
await Event.Emit("malwareScan.result");
// Load servers to scan
using var scope = ServiceScopeFactory.CreateScope();
// Load services from di scope
NodeRepository = scope.ServiceProvider.GetRequiredService<Repository<Node>>();
ServerRepository = scope.ServiceProvider.GetRequiredService<Repository<Server>>();
NodeService = scope.ServiceProvider.GetRequiredService<NodeService>();
ServerService = scope.ServiceProvider.GetRequiredService<ServerService>();
Status = "Fetching servers to scan";
await Event.Emit("malwareScan.status", IsRunning);
Server[] servers;
if (ScanAllServers)
servers = ServerRepository.Get().ToArray();
else
servers = await GetOnlineServers();
// Perform scan
int i = 1;
foreach (var server in servers)
{
Status = $"[{i} / {servers.Length}] Scanning server {server.Name}";
await Event.Emit("malwareScan.status", IsRunning);
var results = await PerformScanOnServer(server);
if (results.Any())
{
lock (ScanResults)
{
ScanResults.Add(server, results);
}
await Event.Emit("malwareScan.result");
}
i++;
}
IsRunning = false;
await Event.Emit("malwareScan.status", IsRunning);
}
private async Task<Server[]> GetOnlineServers()
{
using var scope = ServiceScopeFactory.CreateScope();
// Load services from di scope
NodeRepository = scope.ServiceProvider.GetRequiredService<Repository<Node>>();
ServerRepository = scope.ServiceProvider.GetRequiredService<Repository<Server>>();
NodeService = scope.ServiceProvider.GetRequiredService<NodeService>();
ServerService = scope.ServiceProvider.GetRequiredService<ServerService>();
var nodes = NodeRepository.Get().ToArray();
var containers = new List<Container>();
// Fetch and summarize all running containers from all nodes
Logger.Verbose("Fetching and summarizing all running containers from all nodes");
Status = "Fetching and summarizing all running containers from all nodes";
await Event.Emit("malwareScan.status", IsRunning);
foreach (var node in nodes)
{
var metrics = await NodeService.GetDockerMetrics(node);
foreach (var container in metrics.Containers)
{
containers.Add(container);
}
}
var containerServerMapped = new Dictionary<Server, Container>();
// Map all the containers to their corresponding server if existing
Logger.Verbose("Mapping all the containers to their corresponding server if existing");
Status = "Mapping all the containers to their corresponding server if existing";
await Event.Emit("malwareScan.status", IsRunning);
foreach (var container in containers)
{
if (Guid.TryParse(container.Name, out Guid uuid))
{
var server = ServerRepository
.Get()
.FirstOrDefault(x => x.Uuid == uuid);
if(server == null)
continue;
containerServerMapped.Add(server, container);
}
}
return containerServerMapped.Keys.ToArray();
}
private async Task<MalwareScanResult[]> PerformScanOnServer(Server server)
{
var results = new List<MalwareScanResult>();
// TODO: Move scans to an universal format / api
// Define scans here
async Task ScanSelfBot()
{
var access = await ServerService.CreateFileAccess(server, null!);
var fileElements = await access.Ls();
if (fileElements.Any(x => x.Name == "tokens.txt"))
{
results.Add(new ()
{
Title = "Found SelfBot",
Description = "Detected suspicious 'tokens.txt' file which may contain tokens for a selfbot",
Author = "Marcel Baumgartner"
});
}
}
async Task ScanMinerJar()
{
var access = await ServerService.CreateFileAccess(server, null!);
var fileElements = await access.Ls();
if (fileElements.Any(x => x.Name == "libraries" && !x.IsFile))
{
await access.Cd("libraries");
fileElements = await access.Ls();
if (fileElements.Any(x => x.Name == "jdk" && !x.IsFile))
{
results.Add(new ()
{
Title = "Found Miner",
Description = "Detected suspicious library directory which may contain a script for miners",
Author = "Marcel Baumgartner"
});
}
}
}
async Task ScanFakePlayerPlugins()
{
var access = await ServerService.CreateFileAccess(server, null!);
var fileElements = await access.Ls();
if (fileElements.Any(x => !x.IsFile && x.Name == "plugins")) // Check for plugins folder
{
await access.Cd("plugins");
fileElements = await access.Ls();
foreach (var fileElement in fileElements)
{
if (fileElement.Name.ToLower().Contains("fake"))
{
results.Add(new()
{
Title = "Fake player plugin",
Description = $"Suspicious plugin file: {fileElement.Name}",
Author = "Marcel Baumgartner"
});
}
}
}
}
// Execute scans
await ScanSelfBot();
await ScanFakePlayerPlugins();
await ScanMinerJar();
return results.ToArray();
}
}

View File

@@ -17,7 +17,6 @@ public class ConfigService
public ConfigService(StorageService storageService) public ConfigService(StorageService storageService)
{ {
StorageService = storageService; StorageService = storageService;
StorageService.EnsureCreated();
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ML_CONFIG_PATH"))) if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ML_CONFIG_PATH")))
Path = Environment.GetEnvironmentVariable("ML_CONFIG_PATH")!; Path = Environment.GetEnvironmentVariable("ML_CONFIG_PATH")!;

View File

@@ -5,6 +5,7 @@ using CloudFlare.Client.Api.Parameters.Data;
using CloudFlare.Client.Api.Result; using CloudFlare.Client.Api.Result;
using CloudFlare.Client.Api.Zones; using CloudFlare.Client.Api.Zones;
using CloudFlare.Client.Api.Zones.DnsRecord; using CloudFlare.Client.Api.Zones.DnsRecord;
using CloudFlare.Client.Client.Zones;
using CloudFlare.Client.Enumerators; using CloudFlare.Client.Enumerators;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Moonlight.App.Database.Entities; using Moonlight.App.Database.Entities;
@@ -82,12 +83,27 @@ public class DomainService
if (!ConfigService.Get().Moonlight.Domains.Enable) if (!ConfigService.Get().Moonlight.Domains.Enable)
return Array.Empty<Zone>(); return Array.Empty<Zone>();
var domains = GetData( var domains = new List<Zone>();
await Client.Zones.GetAsync(new()
var initialResponse = await Client.Zones.GetAsync();
domains.AddRange(GetData(initialResponse));
// Check if there are more pages
while (initialResponse.ResultInfo.Page < initialResponse.ResultInfo.TotalPage)
{ {
AccountId = AccountId // Get the next page of data
}) var nextPageResponse = await Client.Zones.GetAsync(
displayOptions: new()
{
Page = initialResponse.ResultInfo.Page + 1
}
); );
var nextPageZones = GetData(nextPageResponse);
domains.AddRange(nextPageZones);
initialResponse = nextPageResponse;
}
var sharedDomains = SharedDomainRepository.Get().ToArray(); var sharedDomains = SharedDomainRepository.Get().ToArray();

View File

@@ -1,15 +1,11 @@
using Moonlight.App.Helpers; using Moonlight.App.Helpers;
using Octokit;
namespace Moonlight.App.Services.Files; namespace Moonlight.App.Services.Files;
public class StorageService public class StorageService
{ {
public StorageService() public async Task EnsureCreated()
{
EnsureCreated();
}
public void EnsureCreated()
{ {
Directory.CreateDirectory(PathBuilder.Dir("storage", "uploads")); Directory.CreateDirectory(PathBuilder.Dir("storage", "uploads"));
Directory.CreateDirectory(PathBuilder.Dir("storage", "configs")); Directory.CreateDirectory(PathBuilder.Dir("storage", "configs"));
@@ -17,8 +13,12 @@ public class StorageService
Directory.CreateDirectory(PathBuilder.Dir("storage", "backups")); Directory.CreateDirectory(PathBuilder.Dir("storage", "backups"));
Directory.CreateDirectory(PathBuilder.Dir("storage", "logs")); Directory.CreateDirectory(PathBuilder.Dir("storage", "logs"));
Directory.CreateDirectory(PathBuilder.Dir("storage", "plugins")); Directory.CreateDirectory(PathBuilder.Dir("storage", "plugins"));
Directory.CreateDirectory(PathBuilder.Dir("storage", "certs"));
if(IsEmpty(PathBuilder.Dir("storage", "resources"))) await UpdateResources();
return;
if (IsEmpty(PathBuilder.Dir("storage", "resources")))
{ {
Logger.Info("Default resources not found. Copying default resources"); Logger.Info("Default resources not found. Copying default resources");
@@ -39,10 +39,75 @@ public class StorageService
} }
} }
private async Task UpdateResources()
{
try
{
Logger.Info("Checking resources");
var client = new GitHubClient(
new ProductHeaderValue("Moonlight-Panel"));
var user = "Moonlight-Panel";
var repo = "Resources";
var resourcesDir = PathBuilder.Dir("storage", "resources");
async Task CopyDirectory(string dirPath, string localDir)
{
IReadOnlyList<RepositoryContent> contents;
if (string.IsNullOrEmpty(dirPath))
contents = await client.Repository.Content.GetAllContents(user, repo);
else
contents = await client.Repository.Content.GetAllContents(user, repo, dirPath);
foreach (var content in contents)
{
string localPath = Path.Combine(localDir, content.Name);
if (content.Type == ContentType.File)
{
if (content.Name.EndsWith(".gitattributes"))
continue;
if (File.Exists(localPath) && !content.Name.EndsWith(".lang"))
continue;
if (content.Name.EndsWith(".lang") && File.Exists(localPath) &&
new FileInfo(localPath).Length == content.Size)
continue;
var fileContent = await client.Repository.Content.GetRawContent(user, repo, content.Path);
Directory.CreateDirectory(localDir); // Ensure the directory exists
await File.WriteAllBytesAsync(localPath, fileContent);
Logger.Debug($"Synced file '{content.Path}'");
}
else if (content.Type == ContentType.Dir)
{
await CopyDirectory(content.Path, localPath);
}
}
}
await CopyDirectory("", resourcesDir);
}
catch (RateLimitExceededException)
{
Logger.Warn("Unable to sync resources due to your ip being rate-limited by github");
}
catch (Exception e)
{
Logger.Warn("Unable to sync resources");
Logger.Warn(e);
}
}
private bool IsEmpty(string path) private bool IsEmpty(string path)
{ {
return !Directory.EnumerateFileSystemEntries(path).Any(); return !Directory.EnumerateFileSystemEntries(path).Any();
} }
private static void CopyFilesRecursively(string sourcePath, string targetPath) private static void CopyFilesRecursively(string sourcePath, string targetPath)
{ {
//Now Create all of the directories //Now Create all of the directories
@@ -52,7 +117,7 @@ public class StorageService
} }
//Copy all the files & Replaces any files with the same name //Copy all the files & Replaces any files with the same name
foreach (string newPath in Directory.GetFiles(sourcePath, "*.*",SearchOption.AllDirectories)) foreach (string newPath in Directory.GetFiles(sourcePath, "*.*", SearchOption.AllDirectories))
{ {
File.Copy(newPath, newPath.Replace(sourcePath, targetPath), true); File.Copy(newPath, newPath.Replace(sourcePath, targetPath), true);
} }

View File

@@ -0,0 +1,91 @@
using Moonlight.App.Helpers;
using Whois.NET;
namespace Moonlight.App.Services;
public class IpVerificationService
{
private readonly ConfigService ConfigService;
public IpVerificationService(ConfigService configService)
{
ConfigService = configService;
}
public async Task<bool> IsDatacenterOrVpn(string ip)
{
if (!ConfigService.Get().Moonlight.Security.BlockDatacenterIps)
return false;
if (string.IsNullOrEmpty(ip))
return false;
var datacenterNames = new List<string>()
{
"amazon",
"aws",
"microsoft",
"azure",
"google",
"google cloud",
"gcp",
"digitalocean",
"linode",
"vultr",
"ovh",
"ovhcloud",
"alibaba",
"oracle",
"ibm cloud",
"bluehost",
"godaddy",
"rackpace",
"hetzner",
"tencent",
"scaleway",
"softlayer",
"dreamhost",
"a2 hosting",
"inmotion hosting",
"red hat openstack",
"kamatera",
"hostgator",
"siteground",
"greengeeks",
"liquidweb",
"joyent",
"aruba",
"interoute",
"fastcomet",
"rosehosting",
"lunarpages",
"fatcow",
"jelastic",
"datacamp"
};
if(!ConfigService.Get().Moonlight.Security.AllowCloudflareIps)
datacenterNames.Add("cloudflare");
try
{
var response = await WhoisClient.QueryAsync(ip);
var responseText = response.Raw.ToLower();
foreach (var name in datacenterNames)
{
if (responseText.Contains(name))
{
Logger.Debug(name);
return true;
}
}
}
catch (Exception)
{
return false;
}
return false;
}
}

View File

@@ -0,0 +1,180 @@
using System.Security.Cryptography.X509Certificates;
using Certes;
using Certes.Acme;
using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Http.Connections;
using Moonlight.App.Events;
using Moonlight.App.Helpers;
namespace Moonlight.App.Services;
public class LetsEncryptService
{
private readonly ConfigService ConfigService;
private readonly string LetsEncryptCertPath;
private readonly EventSystem Event;
private X509Certificate2 Certificate;
public string HttpChallenge { get; private set; } = "";
public string HttpChallengeToken { get; private set; } = "";
public LetsEncryptService(ConfigService configService, EventSystem eventSystem)
{
ConfigService = configService;
Event = eventSystem;
LetsEncryptCertPath = PathBuilder.File("storage", "certs", "letsencrypt.pfx");
}
public async Task AutoProcess()
{
try
{
if (!ConfigService.Get().Moonlight.LetsEncrypt.Enable)
return;
if (await CheckNeedsRenewal())
{
try
{
await Renew();
}
catch (Exception e)
{
Logger.Error("Unable to issue lets encrypt certificate");
Logger.Error(e);
}
}
else
Logger.Info("Skipping lets encrypt renewal");
await LoadCertificate();
}
catch(Exception e)
{
Logger.Error("Unhandled exception while auto proccessing lets encrypt certificates");
Logger.Error(e);
}
}
private Task LoadCertificate()
{
try
{
Certificate = new X509Certificate2(
LetsEncryptCertPath,
ConfigService.Get().Moonlight.Security.Token
);
Logger.Info($"Loaded ssl certificate. '{Certificate.FriendlyName}' issued by '{Certificate.IssuerName.Name}'");
}
catch (Exception e)
{
Logger.Warn("Unable to load ssl certificates");
Logger.Warn(e);
}
return Task.CompletedTask;
}
private async Task Renew()
{
Logger.Info("Renewing lets encrypt certificate");
var uri = new Uri(ConfigService.Get().Moonlight.AppUrl);
var config = ConfigService.Get().Moonlight.LetsEncrypt;
if (uri.HostNameType == UriHostNameType.IPv4 || uri.HostNameType == UriHostNameType.IPv6)
{
Logger.Warn("You cannot use an ip to issue a lets encrypt certificate");
return;
}
var acmeContext = new AcmeContext(WellKnownServers.LetsEncryptV2);
Logger.Info($"Starting lets encrypt certificate issuing. Using acme server '{acmeContext.DirectoryUri}'");
var account = await acmeContext.NewAccount(config.ExpireEmail, true);
Logger.Info("Creating order");
var order = await acmeContext.NewOrder(new[] { uri.Host });
var authZ = (await order.Authorizations()).First();
var challenge = await authZ.Http();
HttpChallengeToken = challenge.Token;
HttpChallenge = challenge.KeyAuthz;
Logger.Info("Waiting for http challenge to complete");
Task.Run(async () =>
{
await Task.Delay(TimeSpan.FromSeconds(3));
try
{
await challenge.Validate();
Logger.Info("Tried to validate");
}
catch (Exception e)
{
Logger.Error("Unable to validate challenge");
Logger.Error(e);
}
});
await Event.WaitForEvent<Object>("letsEncrypt.challengeFetched", this);
Logger.Info("Generating certificate");
var privateKey = KeyFactory.NewKey(KeyAlgorithm.ES256);
var certificate = await order.Generate(new CsrInfo
{
CountryName = config.CountryCode,
State = config.State,
Locality = config.Locality,
Organization = config.Organization,
OrganizationUnit = "Dev",
CommonName = uri.Host
}, privateKey);
var builder = certificate.ToPfx(privateKey);
var certBytes = builder.Build(
uri.Host,
ConfigService.Get().Moonlight.Security.Token
);
Logger.Info($"Saved lets encrypt certificate to '{LetsEncryptCertPath}'");
await File.WriteAllBytesAsync(LetsEncryptCertPath, certBytes);
}
private Task<bool> CheckNeedsRenewal()
{
if (!File.Exists(LetsEncryptCertPath))
{
Logger.Info("No lets encrypt certificate found");
return Task.FromResult(true);
}
var existingCert = new X509Certificate2(LetsEncryptCertPath, ConfigService.Get().Moonlight.Security.Token);
var expirationDate = existingCert.NotAfter;
if (DateTime.Now < expirationDate)
{
Logger.Info($"Lets encrypt certificate valid until {Formatter.FormatDate(expirationDate)}");
return Task.FromResult(false);
}
Logger.Info("Lets encrypt certificate expired");
return Task.FromResult(true);
}
public X509Certificate2? SelectCertificate(ConnectionContext? context, string? domain)
{
if (context == null)
return null;
return Certificate;
}
}

View File

@@ -0,0 +1,42 @@
using Moonlight.App.Database.Entities;
using Moonlight.App.MalwareScans;
using Moonlight.App.Models.Misc;
using Moonlight.App.Services.Plugins;
namespace Moonlight.App.Services;
public class MalwareScanService
{
private readonly PluginService PluginService;
private readonly IServiceScopeFactory ServiceScopeFactory;
public MalwareScanService(PluginService pluginService, IServiceScopeFactory serviceScopeFactory)
{
PluginService = pluginService;
ServiceScopeFactory = serviceScopeFactory;
}
public async Task<MalwareScanResult?> Perform(Server server)
{
var defaultScans = new List<MalwareScan>
{
new MinerJarScan(),
new FakePlayerPluginScan(),
new BadScriptsScan()
};
var scans = await PluginService.BuildMalwareScans(defaultScans.ToArray());
using var scope = ServiceScopeFactory.CreateScope();
foreach (var scan in scans)
{
var result = await scan.Scan(server, scope.ServiceProvider);
if (result != null)
return result;
}
return null;
}
}

View File

@@ -1,6 +1,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.Loader; using System.Runtime.Loader;
using Moonlight.App.Helpers; using Moonlight.App.Helpers;
using Moonlight.App.Models.Misc;
using Moonlight.App.Plugin; using Moonlight.App.Plugin;
using Moonlight.App.Plugin.UI.Servers; using Moonlight.App.Plugin.UI.Servers;
using Moonlight.App.Plugin.UI.Webspaces; using Moonlight.App.Plugin.UI.Webspaces;
@@ -12,11 +13,6 @@ public class PluginService
public readonly List<MoonlightPlugin> Plugins = new(); public readonly List<MoonlightPlugin> Plugins = new();
public readonly Dictionary<MoonlightPlugin, string> PluginFiles = new(); public readonly Dictionary<MoonlightPlugin, string> PluginFiles = new();
public PluginService()
{
ReloadPlugins().Wait();
}
public Task ReloadPlugins() public Task ReloadPlugins()
{ {
PluginFiles.Clear(); PluginFiles.Clear();
@@ -97,4 +93,17 @@ public class PluginService
await plugin.OnBuildServices.Invoke(serviceCollection); await plugin.OnBuildServices.Invoke(serviceCollection);
} }
} }
public async Task<MalwareScan[]> BuildMalwareScans(MalwareScan[] defaultScans)
{
var scanList = defaultScans.ToList();
foreach (var plugin in Plugins)
{
if (plugin.OnBuildMalwareScans != null)
scanList = await plugin.OnBuildMalwareScans.Invoke(scanList);
}
return scanList.ToArray();
}
} }

View File

@@ -12,6 +12,8 @@ using Moonlight.App.Helpers.Wings;
using Moonlight.App.Models.Misc; using Moonlight.App.Models.Misc;
using Moonlight.App.Repositories; using Moonlight.App.Repositories;
using Moonlight.App.Repositories.Servers; using Moonlight.App.Repositories.Servers;
using Moonlight.App.Services.Background;
using Moonlight.App.Services.Plugins;
using FileAccess = Moonlight.App.Helpers.Files.FileAccess; using FileAccess = Moonlight.App.Helpers.Files.FileAccess;
namespace Moonlight.App.Services; namespace Moonlight.App.Services;
@@ -32,6 +34,11 @@ public class ServerService
private readonly DateTimeService DateTimeService; private readonly DateTimeService DateTimeService;
private readonly EventSystem Event; private readonly EventSystem Event;
// We inject the dependencies for the malware scan service here because otherwise it may result in
// a circular dependency injection which will crash the app
private readonly PluginService PluginService;
private readonly IServiceScopeFactory ServiceScopeFactory;
public ServerService( public ServerService(
ServerRepository serverRepository, ServerRepository serverRepository,
WingsApiHelper wingsApiHelper, WingsApiHelper wingsApiHelper,
@@ -45,7 +52,9 @@ public class ServerService
NodeAllocationRepository nodeAllocationRepository, NodeAllocationRepository nodeAllocationRepository,
DateTimeService dateTimeService, DateTimeService dateTimeService,
EventSystem eventSystem, EventSystem eventSystem,
Repository<ServerVariable> serverVariablesRepository) Repository<ServerVariable> serverVariablesRepository,
PluginService pluginService,
IServiceScopeFactory serviceScopeFactory)
{ {
ServerRepository = serverRepository; ServerRepository = serverRepository;
WingsApiHelper = wingsApiHelper; WingsApiHelper = wingsApiHelper;
@@ -60,6 +69,8 @@ public class ServerService
DateTimeService = dateTimeService; DateTimeService = dateTimeService;
Event = eventSystem; Event = eventSystem;
ServerVariablesRepository = serverVariablesRepository; ServerVariablesRepository = serverVariablesRepository;
PluginService = pluginService;
ServiceScopeFactory = serviceScopeFactory;
} }
private Server EnsureNodeData(Server s) private Server EnsureNodeData(Server s)
@@ -99,6 +110,24 @@ public class ServerService
{ {
Server server = EnsureNodeData(s); Server server = EnsureNodeData(s);
if (ConfigService.Get().Moonlight.Security.MalwareCheckOnStart && signal == PowerSignal.Start ||
signal == PowerSignal.Restart)
{
var result = await new MalwareScanService(
PluginService,
ServiceScopeFactory
).Perform(server);
if (result != null)
{
Logger.Warn($"Found malware on server {server.Uuid}. Result: " + result.Title, "security");
throw new DisplayException(
$"Unable to start server. Found following malware on this server: {result.Title}. Please contact the support if you think this detection is a false positive",
true);
}
}
var rawSignal = signal.ToString().ToLower(); var rawSignal = signal.ToString().ToLower();
await WingsApiHelper.Post(server.Node, $"api/servers/{server.Uuid}/power", new ServerPower() await WingsApiHelper.Post(server.Node, $"api/servers/{server.Uuid}/power", new ServerPower()
@@ -420,10 +449,7 @@ public class ServerService
await new Retry() await new Retry()
.Times(3) .Times(3)
.At(x => x.Message.Contains("A task was canceled")) .At(x => x.Message.Contains("A task was canceled"))
.Call(async () => .Call(async () => { await WingsApiHelper.Delete(server.Node, $"api/servers/{server.Uuid}", null); });
{
await WingsApiHelper.Delete(server.Node, $"api/servers/{server.Uuid}", null);
});
} }
catch (WingsException e) catch (WingsException e)
{ {

View File

@@ -3,6 +3,7 @@ using JWT.Algorithms;
using JWT.Builder; using JWT.Builder;
using JWT.Exceptions; using JWT.Exceptions;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.JSInterop;
using Moonlight.App.Database.Entities; using Moonlight.App.Database.Entities;
using Moonlight.App.Helpers; using Moonlight.App.Helpers;
using Moonlight.App.Perms; using Moonlight.App.Perms;
@@ -16,6 +17,7 @@ public class IdentityService
private readonly Repository<User> UserRepository; private readonly Repository<User> UserRepository;
private readonly CookieService CookieService; private readonly CookieService CookieService;
private readonly IHttpContextAccessor HttpContextAccessor; private readonly IHttpContextAccessor HttpContextAccessor;
private readonly IJSRuntime JsRuntime;
private readonly string Secret; private readonly string Secret;
public User User { get; private set; } public User User { get; private set; }
@@ -29,11 +31,13 @@ public class IdentityService
CookieService cookieService, CookieService cookieService,
Repository<User> userRepository, Repository<User> userRepository,
IHttpContextAccessor httpContextAccessor, IHttpContextAccessor httpContextAccessor,
ConfigService configService) ConfigService configService,
IJSRuntime jsRuntime)
{ {
CookieService = cookieService; CookieService = cookieService;
UserRepository = userRepository; UserRepository = userRepository;
HttpContextAccessor = httpContextAccessor; HttpContextAccessor = httpContextAccessor;
JsRuntime = jsRuntime;
Secret = configService Secret = configService
.Get() .Get()
@@ -260,4 +264,21 @@ public class IdentityService
Permissions.IsReadyOnly = true; Permissions.IsReadyOnly = true;
} }
public async Task<bool> GetBotStatus()
{
var webDriverStatus = await JsRuntime
.InvokeAsync<bool>("moonlight.utils.getWebDriverStatus");
if (webDriverStatus)
return true;
var languagesStatus = await JsRuntime
.InvokeAsync<bool>("moonlight.utils.getLanguagesStatus");
if (languagesStatus)
return true;
return false;
}
} }

View File

@@ -24,29 +24,6 @@ public class TicketAdminService
BucketService = bucketService; BucketService = bucketService;
} }
public async Task<Dictionary<Ticket, TicketMessage?>> GetAssigned()
{
return await TicketServerService.GetUserAssignedTickets(IdentityService.User);
}
public async Task<Dictionary<Ticket, TicketMessage?>> GetUnAssigned()
{
return await TicketServerService.GetUnAssignedTickets();
}
public async Task<Ticket> Create(string issueTopic, string issueDescription, string issueTries,
TicketSubject subject, int subjectId)
{
return await TicketServerService.Create(
IdentityService.User,
issueTopic,
issueDescription,
issueTries,
subject,
subjectId
);
}
public async Task<TicketMessage> Send(string content, IBrowserFile? file = null) public async Task<TicketMessage> Send(string content, IBrowserFile? file = null)
{ {
string? attachment = null; string? attachment = null;
@@ -83,13 +60,8 @@ public class TicketAdminService
return await TicketServerService.GetMessages(Ticket!); return await TicketServerService.GetMessages(Ticket!);
} }
public async Task Claim() public async Task SetClaim(User? user)
{ {
await TicketServerService.Claim(Ticket!, IdentityService.User); await TicketServerService.SetClaim(Ticket!, user);
}
public async Task UnClaim()
{
await TicketServerService.Claim(Ticket!);
} }
} }

View File

@@ -24,11 +24,6 @@ public class TicketClientService
BucketService = bucketService; BucketService = bucketService;
} }
public async Task<Dictionary<Ticket, TicketMessage?>> Get()
{
return await TicketServerService.GetUserTickets(IdentityService.User);
}
public async Task<Ticket> Create(string issueTopic, string issueDescription, string issueTries, TicketSubject subject, int subjectId) public async Task<Ticket> Create(string issueTopic, string issueDescription, string issueTries, TicketSubject subject, int subjectId)
{ {
return await TicketServerService.Create( return await TicketServerService.Create(

View File

@@ -49,6 +49,12 @@ public class TicketServerService
// Do automatic stuff here // Do automatic stuff here
await SendSystemMessage(ticket, ConfigService.Get().Moonlight.Tickets.WelcomeMessage); await SendSystemMessage(ticket, ConfigService.Get().Moonlight.Tickets.WelcomeMessage);
if (ticket.Subject != TicketSubject.Other)
{
await SendMessage(ticket, creatorUser, $"Subject :\n\n{ticket.Subject}: {ticket.SubjectId}");
}
//TODO: Check for opening times //TODO: Check for opening times
return ticket; return ticket;
@@ -137,85 +143,7 @@ public class TicketServerService
return message; return message;
} }
public Task<Dictionary<Ticket, TicketMessage?>> GetUserTickets(User u)
{
using var scope = ServiceScopeFactory.CreateScope();
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
var tickets = ticketRepo
.Get()
.Include(x => x.CreatedBy)
.Include(x => x.Messages)
.Where(x => x.CreatedBy.Id == u.Id)
.Where(x => x.Status != TicketStatus.Closed)
.ToArray();
var result = new Dictionary<Ticket, TicketMessage?>();
foreach (var ticket in tickets)
{
var message = ticket.Messages
.OrderByDescending(x => x.Id)
.FirstOrDefault();
result.Add(ticket, message);
}
return Task.FromResult(result);
}
public Task<Dictionary<Ticket, TicketMessage?>> GetUserAssignedTickets(User u)
{
using var scope = ServiceScopeFactory.CreateScope();
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
var tickets = ticketRepo
.Get()
.Include(x => x.CreatedBy)
.Include(x => x.Messages)
.Where(x => x.Status != TicketStatus.Closed)
.Where(x => x.AssignedTo.Id == u.Id)
.ToArray();
var result = new Dictionary<Ticket, TicketMessage?>();
foreach (var ticket in tickets)
{
var message = ticket.Messages
.OrderByDescending(x => x.Id)
.FirstOrDefault();
result.Add(ticket, message);
}
return Task.FromResult(result);
}
public Task<Dictionary<Ticket, TicketMessage?>> GetUnAssignedTickets()
{
using var scope = ServiceScopeFactory.CreateScope();
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
var tickets = ticketRepo
.Get()
.Include(x => x.CreatedBy)
.Include(x => x.Messages)
.Include(x => x.AssignedTo)
.Where(x => x.AssignedTo == null)
.Where(x => x.Status != TicketStatus.Closed)
.ToArray();
var result = new Dictionary<Ticket, TicketMessage?>();
foreach (var ticket in tickets)
{
var message = ticket.Messages
.OrderByDescending(x => x.Id)
.FirstOrDefault();
result.Add(ticket, message);
}
return Task.FromResult(result);
}
public Task<TicketMessage[]> GetMessages(Ticket ticket) public Task<TicketMessage[]> GetMessages(Ticket ticket)
{ {
using var scope = ServiceScopeFactory.CreateScope(); using var scope = ServiceScopeFactory.CreateScope();
@@ -225,12 +153,13 @@ public class TicketServerService
.Get() .Get()
.Include(x => x.CreatedBy) .Include(x => x.CreatedBy)
.Include(x => x.Messages) .Include(x => x.Messages)
.ThenInclude(x => x.Sender)
.First(x => x.Id == ticket.Id); .First(x => x.Id == ticket.Id);
return Task.FromResult(tickets.Messages.ToArray()); return Task.FromResult(tickets.Messages.ToArray());
} }
public async Task Claim(Ticket t, User? u = null) public async Task SetClaim(Ticket t, User? u = null)
{ {
using var scope = ServiceScopeFactory.CreateScope(); using var scope = ServiceScopeFactory.CreateScope();
var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>(); var ticketRepo = scope.ServiceProvider.GetRequiredService<Repository<Ticket>>();
@@ -245,5 +174,8 @@ public class TicketServerService
await Event.Emit("tickets.status", ticket); await Event.Emit("tickets.status", ticket);
await Event.Emit($"tickets.{ticket.Id}.status", ticket); await Event.Emit($"tickets.{ticket.Id}.status", ticket);
var claimName = user == null ? "None" : user.FirstName + " " + user.LastName;
await SendSystemMessage(ticket, $"Ticked claim has been set to {claimName}");
} }
} }

View File

@@ -21,6 +21,7 @@ public class UserService
private readonly DateTimeService DateTimeService; private readonly DateTimeService DateTimeService;
private readonly ConfigService ConfigService; private readonly ConfigService ConfigService;
private readonly TempMailService TempMailService; private readonly TempMailService TempMailService;
private readonly MoonlightService MoonlightService;
private readonly string JwtSecret; private readonly string JwtSecret;
@@ -32,7 +33,8 @@ public class UserService
IdentityService identityService, IdentityService identityService,
IpLocateService ipLocateService, IpLocateService ipLocateService,
DateTimeService dateTimeService, DateTimeService dateTimeService,
TempMailService tempMailService) TempMailService tempMailService,
MoonlightService moonlightService)
{ {
UserRepository = userRepository; UserRepository = userRepository;
TotpService = totpService; TotpService = totpService;
@@ -42,6 +44,7 @@ public class UserService
IpLocateService = ipLocateService; IpLocateService = ipLocateService;
DateTimeService = dateTimeService; DateTimeService = dateTimeService;
TempMailService = tempMailService; TempMailService = tempMailService;
MoonlightService = moonlightService;
JwtSecret = configService JwtSecret = configService
.Get() .Get()
@@ -59,6 +62,19 @@ public class UserService
throw new DisplayException("This email is blacklisted"); throw new DisplayException("This email is blacklisted");
} }
if (ConfigService.Get().Moonlight.Auth.BlockLinuxUsers && IdentityService.Device.Contains("Linux"))
throw new DisplayException("This operation was disabled");
if (ConfigService.Get().Moonlight.Auth.CheckForBots)
{
var isABot = await IdentityService.GetBotStatus();
if (isABot)
{
throw new DisplayException("This operation was disabled");
}
}
// Check if the email is already taken // Check if the email is already taken
var emailTaken = UserRepository.Get().FirstOrDefault(x => x.Email == email) != null; var emailTaken = UserRepository.Get().FirstOrDefault(x => x.Email == email) != null;
@@ -67,11 +83,21 @@ public class UserService
throw new DisplayException("The email is already in use"); throw new DisplayException("The email is already in use");
} }
bool admin = false;
if (!UserRepository.Get().Any())
{
if ((DateTime.UtcNow - MoonlightService.StartTimestamp).TotalMinutes < 15)
admin = true;
else
throw new DisplayException("You have to register within 15 minutes after the start of moonlight to get admin permissions. Please restart moonlight in order to register as admin. Please note that this will only works once and will be deactivated after a admin has registered");
}
// Add user // Add user
var user = UserRepository.Add(new() var user = UserRepository.Add(new()
{ {
Address = "", Address = "",
Admin = !UserRepository.Get().Any(), Admin = admin,
City = "", City = "",
Country = "", Country = "",
Email = email.ToLower(), Email = email.ToLower(),
@@ -106,7 +132,7 @@ public class UserService
if (user == null) if (user == null)
{ {
Logger.Warn($"Failed login attempt. Email: {email} Password: {password}", "security"); Logger.Warn($"Failed login attempt. Email: {email} Password: {StringHelper.CutInHalf(password)}", "security");
throw new DisplayException("Email and password combination not found"); throw new DisplayException("Email and password combination not found");
} }
@@ -115,7 +141,7 @@ public class UserService
return user.TotpEnabled; return user.TotpEnabled;
} }
Logger.Warn($"Failed login attempt. Email: {email} Password: {password}", "security"); Logger.Warn($"Failed login attempt. Email: {email} Password: {StringHelper.CutInHalf(password)}", "security");
throw new DisplayException("Email and password combination not found");; throw new DisplayException("Email and password combination not found");;
} }
@@ -148,7 +174,7 @@ public class UserService
} }
else else
{ {
Logger.Warn($"Failed login attempt. Email: {email} Password: {password}", "security"); Logger.Warn($"Failed login attempt. Email: {email} Password: {StringHelper.CutInHalf(password)}", "security");
throw new DisplayException("2FA code invalid"); throw new DisplayException("2FA code invalid");
} }
} }
@@ -190,7 +216,7 @@ public class UserService
if (user == null) if (user == null)
{ {
Logger.Warn($"Detected an sftp bruteforce attempt. ID: {id} Password: {password}", "security"); Logger.Warn($"Detected an sftp bruteforce attempt. ID: {id} Password: {StringHelper.CutInHalf(password)}", "security");
throw new Exception("Invalid username"); throw new Exception("Invalid username");
} }
@@ -201,7 +227,7 @@ public class UserService
return user; return user;
} }
Logger.Warn($"Detected an sftp bruteforce attempt. ID: {id} Password: {password}", "security"); Logger.Warn($"Detected an sftp bruteforce attempt. ID: {id} Password: {StringHelper.CutInHalf(password)}", "security");
throw new Exception("Invalid userid or password"); throw new Exception("Invalid userid or password");
} }

View File

@@ -22,5 +22,4 @@ COPY --from=publish /app/publish .
RUN mkdir -p /app/storage RUN mkdir -p /app/storage
RUN touch /app/storage/donttriggeranyerrors RUN touch /app/storage/donttriggeranyerrors
RUN rm -r /app/storage/* RUN rm -r /app/storage/*
COPY "Moonlight/defaultstorage" "/app/defaultstorage"
ENTRYPOINT ["dotnet", "Moonlight.dll"] ENTRYPOINT ["dotnet", "Moonlight.dll"]

View File

@@ -17,6 +17,7 @@
<PackageReference Include="BlazorDownloadFile" Version="2.4.0.2" /> <PackageReference Include="BlazorDownloadFile" Version="2.4.0.2" />
<PackageReference Include="BlazorMonaco" Version="2.1.0" /> <PackageReference Include="BlazorMonaco" Version="2.1.0" />
<PackageReference Include="BlazorTable" Version="1.17.0" /> <PackageReference Include="BlazorTable" Version="1.17.0" />
<PackageReference Include="Certes" Version="3.0.4" />
<PackageReference Include="CloudFlare.Client" Version="6.1.4" /> <PackageReference Include="CloudFlare.Client" Version="6.1.4" />
<PackageReference Include="CurrieTechnologies.Razor.SweetAlert2" Version="5.5.0" /> <PackageReference Include="CurrieTechnologies.Razor.SweetAlert2" Version="5.5.0" />
<PackageReference Include="Discord.Net" Version="3.10.0" /> <PackageReference Include="Discord.Net" Version="3.10.0" />
@@ -55,6 +56,7 @@
<PackageReference Include="SSH.NET" Version="2020.0.2" /> <PackageReference Include="SSH.NET" Version="2020.0.2" />
<PackageReference Include="Stripe.net" Version="41.23.0-beta.1" /> <PackageReference Include="Stripe.net" Version="41.23.0-beta.1" />
<PackageReference Include="UAParser" Version="3.1.47" /> <PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="WhoisClient.NET" Version="5.0.0" />
<PackageReference Include="XtermBlazor" Version="1.8.1" /> <PackageReference Include="XtermBlazor" Version="1.8.1" />
</ItemGroup> </ItemGroup>
@@ -84,13 +86,109 @@
<_ContentIncludedByDefault Remove="Shared\Components\AuditLogEntrys\AuditLogEntryChangePowerState.razor" /> <_ContentIncludedByDefault Remove="Shared\Components\AuditLogEntrys\AuditLogEntryChangePowerState.razor" />
<_ContentIncludedByDefault Remove="Shared\Components\AuditLogEntrys\AuditLogEntryLogin.razor" /> <_ContentIncludedByDefault Remove="Shared\Components\AuditLogEntrys\AuditLogEntryLogin.razor" />
<_ContentIncludedByDefault Remove="Shared\Components\AuditLogEntrys\AuditLogEntryRegister.razor" /> <_ContentIncludedByDefault Remove="Shared\Components\AuditLogEntrys\AuditLogEntryRegister.razor" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\ckeditor\ckeditor-balloon-block.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\ckeditor\ckeditor-balloon.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\ckeditor\ckeditor-classic.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\ckeditor\ckeditor-document.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\ckeditor\ckeditor-inline.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\cookiealert\cookiealert.bundle.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\cookiealert\cookiealert.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\cropper\cropper.bundle.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\cropper\cropper.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\datatables\datatables.bundle.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\datatables\datatables.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\draggable\draggable.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\flotcharts\flotcharts.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\formrepeater\formrepeater.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\fslightbox\fslightbox.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\fullcalendar\fullcalendar.bundle.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\fullcalendar\fullcalendar.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\jkanban\jkanban.bundle.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\jkanban\jkanban.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\jstree\images\jstree\32px.png" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\jstree\images\jstree\throbber.gif" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\jstree\jstree.bundle.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\jstree\jstree.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\leaflet\leaflet.bundle.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\leaflet\leaflet.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\prismjs\prismjs.bundle.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\prismjs\prismjs.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\content\dark\content.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\content\dark\content.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\content\default\content.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\content\default\content.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\content\document\content.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\content\document\content.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\content\writer\content.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\content\writer\content.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\content.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\content.inline.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\content.inline.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\content.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\content.mobile.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\content.mobile.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\skin.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\skin.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\skin.mobile.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\skin.mobile.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\skin.shadowdom.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide-dark\skin.shadowdom.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\content.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\content.inline.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\content.inline.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\content.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\content.mobile.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\content.mobile.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\skin.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\skin.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\skin.mobile.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\skin.mobile.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\skin.shadowdom.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\skins\ui\oxide\skin.shadowdom.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\tinymce\tinymce.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\typedjs\typedjs.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\vis-timeline\vis-timeline.bundle.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\custom\vis-timeline\vis-timeline.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\@fortawesome\fa-brands-400.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\@fortawesome\fa-brands-400.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\@fortawesome\fa-regular-400.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\@fortawesome\fa-regular-400.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\@fortawesome\fa-solid-900.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\@fortawesome\fa-solid-900.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\@fortawesome\fa-v4compatibility.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\@fortawesome\fa-v4compatibility.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\bootstrap-icons\bootstrap-icons.woff" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\bootstrap-icons\bootstrap-icons.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\fonticon\fonticon.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\fonticon\fonticon.eot" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\fonticon\fonticon.svg" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\fonticon\fonticon.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\fonticon\fonticon.woff" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\fonticon\fonticon.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-brands-400.eot" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-brands-400.svg" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-brands-400.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-brands-400.woff" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-brands-400.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-regular-400.eot" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-regular-400.svg" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-regular-400.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-regular-400.woff" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-regular-400.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-solid-900.eot" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-solid-900.svg" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-solid-900.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-solid-900.woff" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\fonts\line-awesome\la-solid-900.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\plugins.bundle.css" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\plugins.bundle.js" />
<_ContentIncludedByDefault Remove="wwwroot\assets\plugins\global\sourcemaps\tiny-slider.css.map" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="App\ApiClients\CloudPanel\Resources\" /> <Folder Include="App\ApiClients\CloudPanel\Resources\" />
<Folder Include="App\Http\Middleware" /> <Folder Include="App\Http\Middleware" />
<Folder Include="storage\backups\" /> <Folder Include="storage\backups\" />
<Folder Include="storage\plugins\" />
<Folder Include="storage\resources\public\background\" /> <Folder Include="storage\resources\public\background\" />
</ItemGroup> </ItemGroup>

View File

@@ -1,4 +1,4 @@
@using Microsoft.AspNetCore.Components.Web @using Microsoft.AspNetCore.Components.Web
@using Moonlight.App.Extensions @using Moonlight.App.Extensions
@using Moonlight.App.Repositories @using Moonlight.App.Repositories
@using Moonlight.App.Services @using Moonlight.App.Services
@@ -41,7 +41,6 @@
<link rel="stylesheet" type="text/css" href="/assets/css/style.bundle.css"/> <link rel="stylesheet" type="text/css" href="/assets/css/style.bundle.css"/>
<link rel="stylesheet" type="text/css" href="/assets/css/flashbang.css"/> <link rel="stylesheet" type="text/css" href="/assets/css/flashbang.css"/>
<link rel="stylesheet" type="text/css" href="/assets/css/snow.css"/>
<link rel="stylesheet" type="text/css" href="/assets/css/utils.css"/> <link rel="stylesheet" type="text/css" href="/assets/css/utils.css"/>
<link rel="stylesheet" type="text/css" href="/assets/css/boxicons.min.css"/> <link rel="stylesheet" type="text/css" href="/assets/css/boxicons.min.css"/>
<link rel="stylesheet" type="text/css" href="/assets/css/blazor.css"/> <link rel="stylesheet" type="text/css" href="/assets/css/blazor.css"/>
@@ -49,8 +48,7 @@
<link rel="stylesheet" type="text/css" href="/_content/XtermBlazor/XtermBlazor.css"/> <link rel="stylesheet" type="text/css" href="/_content/XtermBlazor/XtermBlazor.css"/>
<link rel="stylesheet" type="text/css" href="/_content/BlazorMonaco/lib/monaco-editor/min/vs/editor/editor.main.css"/> <link rel="stylesheet" type="text/css" href="/_content/BlazorMonaco/lib/monaco-editor/min/vs/editor/editor.main.css"/>
<link rel="stylesheet" type="text/css" href="/_content/Blazor.ContextMenu/blazorContextMenu.min.css"/> <link rel="stylesheet" type="text/css" href="/_content/Blazor.ContextMenu/blazorContextMenu.min.css"/>
<link rel="stylesheet" type="text/css" href="/assets/css/toastr.css"/>
<link href="/assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/>
<base href="~/"/> <base href="~/"/>
@@ -96,31 +94,38 @@
</div> </div>
</div> </div>
<script src="/assets/plugins/global/plugins.bundle.js"></script> <script src="/assets/js/popper.min.js"></script>
<script src="/assets/js/bootstrap.min.js"></script>
<script src="/_content/Blazor-ApexCharts/js/apex-charts.min.js"></script>
<script src="/_content/Blazor-ApexCharts/js/blazor-apex-charts.js"></script>
<script src="/_content/XtermBlazor/XtermBlazor.min.js"></script> <script src="/_content/XtermBlazor/XtermBlazor.min.js"></script>
<script src="/_content/BlazorTable/BlazorTable.min.js"></script> <script src="/_content/BlazorTable/BlazorTable.min.js"></script>
<script src="/_content/CurrieTechnologies.Razor.SweetAlert2/sweetAlert2.min.js"></script> <script src="/_content/CurrieTechnologies.Razor.SweetAlert2/sweetAlert2.min.js"></script>
<script src="/_content/Blazor.ContextMenu/blazorContextMenu.min.js"></script> <script src="/_content/Blazor.ContextMenu/blazorContextMenu.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@@shopify/draggable@1.0.0-beta.11/lib/draggable.bundle.js"></script> <script src="/assets/js/draggable.bundle.js"></script>
<script src="https://www.google.com/recaptcha/api.js"></script> <script src="https://www.google.com/recaptcha/api.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.7.0/lib/xterm-addon-fit.min.js"></script> <script src="/assets/js/xterm-addon-fit.min.js"></script>
<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/toastr.min.js"></script>
<script src="/assets/js/apexcharts.js"></script>
<script src="/_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script> <script src="/_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script>
<script>require.config({ paths: { 'vs': '/_content/BlazorMonaco/lib/monaco-editor/min/vs' } });</script> <script>require.config({ paths: { 'vs': '/_content/BlazorMonaco/lib/monaco-editor/min/vs' } });</script>
<script src="/_content/BlazorMonaco/lib/monaco-editor/min/vs/editor/editor.main.js"></script> <script src="/_content/BlazorMonaco/lib/monaco-editor/min/vs/editor/editor.main.js"></script>
<script src="/_content/BlazorMonaco/jsInterop.js"></script> <script src="/_content/BlazorMonaco/jsInterop.js"></script>
<script src="/assets/js/scripts.bundle.js"></script>
<script src="/assets/js/moonlight.js"></script> <script src="/assets/js/moonlight.js"></script>
<script> <script>
moonlight.loading.registerXterm(); moonlight.loading.registerXterm();
</script> </script>
<script src="_content/Blazor-ApexCharts/js/apex-charts.min.js"></script>
<script src="_content/Blazor-ApexCharts/js/blazor-apex-charts.js"></script> <script src="_content/Blazor-ApexCharts/js/blazor-apex-charts.js"></script>
<script src="/_framework/blazor.server.js"></script> <script src="/_framework/blazor.server.js"></script>

View File

@@ -1,312 +1,17 @@
using BlazorDownloadFile;
using BlazorTable;
using HealthChecks.UI.Client;
using Moonlight.App.ApiClients.CloudPanel;
using Moonlight.App.ApiClients.Daemon;
using Moonlight.App.ApiClients.Modrinth;
using Moonlight.App.ApiClients.Paper;
using Moonlight.App.ApiClients.Telemetry;
using Moonlight.App.ApiClients.Wings;
using Moonlight.App.Database;
using Moonlight.App.Diagnostics.HealthChecks;
using Moonlight.App.Events;
using Moonlight.App.Helpers;
using Moonlight.App.Helpers.Wings;
using Moonlight.App.LogMigrator;
using Moonlight.App.Repositories;
using Moonlight.App.Repositories.Domains;
using Moonlight.App.Repositories.Servers;
using Moonlight.App.Services;
using Moonlight.App.Services.Addon;
using Moonlight.App.Services.Background;
using Moonlight.App.Services.DiscordBot;
using Moonlight.App.Services.Files;
using Moonlight.App.Services.Interop;
using Moonlight.App.Services.Mail;
using Moonlight.App.Services.Minecraft;
using Moonlight.App.Services.Notifications;
using Moonlight.App.Services.Plugins;
using Moonlight.App.Services.Sessions;
using Moonlight.App.Services.Statistics;
using Moonlight.App.Services.SupportChat;
using Moonlight.App.Services.Tickets;
using Sentry;
using Serilog;
using Serilog.Events;
using Stripe;
using SubscriptionService = Moonlight.App.Services.SubscriptionService;
namespace Moonlight namespace Moonlight
{ {
public class Program public class Program
{ {
private static readonly Startup Startup = new();
public static async Task Main(string[] args) public static async Task Main(string[] args)
{ {
// This will also copy all default config files Console.WriteLine("Moonlight Panel");
var configService = new ConfigService(new StorageService()); Console.WriteLine($"Copyright {DateTime.UtcNow.Year} moonlightpanel.xyz");
var shouldUseSentry = configService Console.WriteLine();
.Get()
.Moonlight.Sentry.Enable;
if (configService.DebugMode) await Startup.Init(args);
{ await Startup.Start();
if (shouldUseSentry)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.Enrich.FromLogContext()
.WriteTo.Console(
outputTemplate: "{Timestamp:HH:mm:ss} [{Level:u3}] {SourceContext} {Message:lj}{NewLine}{Exception}")
.WriteTo.File(PathBuilder.File("storage", "logs", $"{DateTime.UtcNow:yyyy-MM-dd}.log"))
.WriteTo.Sentry(options =>
{
options.MinimumBreadcrumbLevel = LogEventLevel.Debug;
options.MinimumEventLevel = LogEventLevel.Warning;
})
.CreateLogger();
}
else
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.Enrich.FromLogContext()
.WriteTo.Console(
outputTemplate: "{Timestamp:HH:mm:ss} [{Level:u3}] {SourceContext} {Message:lj}{NewLine}{Exception}")
.WriteTo.File(PathBuilder.File("storage", "logs", $"{DateTime.UtcNow:yyyy-MM-dd}.log"))
.CreateLogger();
}
}
else
{
if (shouldUseSentry)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.Enrich.FromLogContext()
.WriteTo.Console(
outputTemplate: "{Timestamp:HH:mm:ss} [{Level:u3}] {SourceContext} {Message:lj}{NewLine}{Exception}")
.WriteTo.Sentry(options =>
{
options.MinimumBreadcrumbLevel = LogEventLevel.Information;
options.MinimumEventLevel = LogEventLevel.Warning;
})
.WriteTo.File(PathBuilder.File("storage", "logs", $"{DateTime.UtcNow:yyyy-MM-dd}.log"))
.CreateLogger();
}
else
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.Enrich.FromLogContext()
.WriteTo.Console(
outputTemplate: "{Timestamp:HH:mm:ss} [{Level:u3}] {SourceContext} {Message:lj}{NewLine}{Exception}")
.WriteTo.File(PathBuilder.File("storage", "logs", $"{DateTime.UtcNow:yyyy-MM-dd}.log"))
.CreateLogger();
}
}
Logger.Info("Running pre-init tasks");
var databaseCheckupService = new DatabaseCheckupService(configService);
await databaseCheckupService.Perform();
var builder = WebApplication.CreateBuilder(args);
var pluginService = new PluginService();
await pluginService.BuildServices(builder.Services);
// Switch to logging.net injection
// TODO: Enable in production
builder.Logging.ClearProviders();
builder.Logging.AddProvider(new LogMigratorProvider());
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor()
.AddHubOptions(options =>
{
options.MaximumReceiveMessageSize = 10000000;
options.ClientTimeoutInterval = TimeSpan.FromSeconds(30);
options.HandshakeTimeout = TimeSpan.FromSeconds(10);
});
builder.Services.AddHttpContextAccessor();
builder.Services.AddHealthChecks()
.AddCheck<DatabaseHealthCheck>("Database")
.AddCheck<NodeHealthCheck>("Nodes")
.AddCheck<DaemonHealthCheck>("Daemons");
// Sentry
if (shouldUseSentry)
{
builder.WebHost.UseSentry(options =>
{
options.Dsn = configService
.Get()
.Moonlight.Sentry.Dsn;
options.Debug = configService.DebugMode;
options.DiagnosticLevel = SentryLevel.Warning;
options.TracesSampleRate = 1.0;
options.DiagnosticLogger = new SentryDiagnosticsLogger(SentryLevel.Warning);
});
}
// Databases
builder.Services.AddDbContext<DataContext>();
// Repositories
builder.Services.AddScoped<UserRepository>();
builder.Services.AddScoped<NodeRepository>();
builder.Services.AddScoped<ServerRepository>();
builder.Services.AddScoped<ServerBackupRepository>();
builder.Services.AddScoped<ImageRepository>();
builder.Services.AddScoped<DomainRepository>();
builder.Services.AddScoped<SharedDomainRepository>();
builder.Services.AddScoped<RevokeRepository>();
builder.Services.AddScoped<NotificationRepository>();
builder.Services.AddScoped<DdosAttackRepository>();
builder.Services.AddScoped<SubscriptionRepository>();
builder.Services.AddScoped<LoadingMessageRepository>();
builder.Services.AddScoped<NewsEntryRepository>();
builder.Services.AddScoped<NodeAllocationRepository>();
builder.Services.AddScoped<StatisticsRepository>();
builder.Services.AddScoped(typeof(Repository<>));
// Services
builder.Services.AddSingleton<ConfigService>();
builder.Services.AddSingleton<StorageService>();
builder.Services.AddScoped<CookieService>();
builder.Services.AddScoped<IdentityService>();
builder.Services.AddScoped<IpLocateService>();
builder.Services.AddScoped<AlertService>();
builder.Services.AddScoped<SmartTranslateService>();
builder.Services.AddScoped<UserService>();
builder.Services.AddScoped<TotpService>();
builder.Services.AddScoped<ToastService>();
builder.Services.AddScoped<NodeService>();
builder.Services.AddScoped<ServerService>();
builder.Services.AddSingleton<PaperService>();
builder.Services.AddScoped<ClipboardService>();
builder.Services.AddSingleton<ResourceService>();
builder.Services.AddScoped<DomainService>();
builder.Services.AddScoped<OneTimeJwtService>();
builder.Services.AddSingleton<NotificationServerService>();
builder.Services.AddScoped<NotificationAdminService>();
builder.Services.AddScoped<ModalService>();
builder.Services.AddScoped<SmartDeployService>();
builder.Services.AddScoped<WebSpaceService>();
builder.Services.AddScoped<StatisticsViewService>();
builder.Services.AddSingleton<DateTimeService>();
builder.Services.AddSingleton<EventSystem>();
builder.Services.AddScoped<FileDownloadService>();
builder.Services.AddScoped<ForgeService>();
builder.Services.AddScoped<FabricService>();
builder.Services.AddSingleton<BucketService>();
builder.Services.AddScoped<RatingService>();
builder.Services.AddScoped<ReCaptchaService>();
builder.Services.AddScoped<IpBanService>();
builder.Services.AddSingleton<OAuth2Service>();
builder.Services.AddScoped<DynamicBackgroundService>();
builder.Services.AddScoped<ServerAddonPluginService>();
builder.Services.AddScoped<KeyListenerService>();
builder.Services.AddScoped<PopupService>();
builder.Services.AddScoped<SubscriptionService>();
builder.Services.AddScoped<BillingService>();
builder.Services.AddSingleton<PluginStoreService>();
builder.Services.AddSingleton<TicketServerService>();
builder.Services.AddScoped<TicketClientService>();
builder.Services.AddScoped<TicketAdminService>();
builder.Services.AddScoped<SessionClientService>();
builder.Services.AddSingleton<SessionServerService>();
builder.Services.AddScoped<MailService>();
// Support chat
builder.Services.AddSingleton<SupportChatServerService>();
builder.Services.AddScoped<SupportChatClientService>();
builder.Services.AddScoped<SupportChatAdminService>();
// Helpers
builder.Services.AddSingleton<SmartTranslateHelper>();
builder.Services.AddScoped<WingsApiHelper>();
builder.Services.AddScoped<WingsServerConverter>();
builder.Services.AddSingleton<WingsJwtHelper>();
builder.Services.AddScoped<WingsConsoleHelper>();
builder.Services.AddSingleton<PaperApiHelper>();
builder.Services.AddSingleton<HostSystemHelper>();
builder.Services.AddScoped<DaemonApiHelper>();
builder.Services.AddScoped<CloudPanelApiHelper>();
builder.Services.AddScoped<ModrinthApiHelper>();
builder.Services.AddScoped<TelemetryApiHelper>();
// Background services
builder.Services.AddSingleton<DiscordBotService>();
builder.Services.AddSingleton<StatisticsCaptureService>();
builder.Services.AddSingleton<DiscordNotificationService>();
builder.Services.AddSingleton<CleanupService>();
builder.Services.AddSingleton<MalwareScanService>();
builder.Services.AddSingleton<TelemetryService>();
builder.Services.AddSingleton<TempMailService>();
builder.Services.AddSingleton<DdosProtectionService>();
builder.Services.AddSingleton(pluginService);
// Other
builder.Services.AddSingleton<MoonlightService>();
// Third party services
builder.Services.AddBlazorTable();
builder.Services.AddBlazorContextMenu();
builder.Services.AddBlazorDownloadFile();
StripeConfiguration.ApiKey = configService
.Get()
.Moonlight.Stripe.ApiKey;
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
// Sentry
if (shouldUseSentry)
{
app.UseSentryTracing();
}
app.UseStaticFiles();
app.UseRouting();
app.UseWebSockets();
app.MapControllers();
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.MapHealthChecks("/_health", new()
{
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
// AutoStart services
_ = app.Services.GetRequiredService<CleanupService>();
_ = app.Services.GetRequiredService<DiscordBotService>();
_ = app.Services.GetRequiredService<StatisticsCaptureService>();
_ = app.Services.GetRequiredService<DiscordNotificationService>();
_ = app.Services.GetRequiredService<MalwareScanService>();
_ = app.Services.GetRequiredService<TelemetryService>();
_ = app.Services.GetRequiredService<TempMailService>();
_ = app.Services.GetRequiredService<DdosProtectionService>();
_ = app.Services.GetRequiredService<MoonlightService>();
// Discord bot service
//var discordBotService = app.Services.GetRequiredService<DiscordBotService>();
await app.RunAsync();
} }
} }
} }

View File

@@ -9,7 +9,7 @@
"ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_ENVIRONMENT": "Development",
"ML_DEBUG": "true" "ML_DEBUG": "true"
}, },
"applicationUrl": "http://moonlight.testy:5118;https://localhost:7118;http://localhost:5118", "applicationUrl": "http://localhost:5118;http://moonlight.owo:5118",
"dotnetRunMessages": true "dotnetRunMessages": true
}, },
"Live DB": "Live DB":
@@ -21,7 +21,7 @@
"ML_DEBUG": "true", "ML_DEBUG": "true",
"ML_CONFIG_PATH": "storage\\configs\\live_config.json" "ML_CONFIG_PATH": "storage\\configs\\live_config.json"
}, },
"applicationUrl": "http://moonlight.testy:5118;https://localhost:7118;http://localhost:5118", "applicationUrl": "http://moonlight.owo:5118;http://localhost:5118",
"dotnetRunMessages": true "dotnetRunMessages": true
}, },
"Dev DB 1": "Dev DB 1":
@@ -33,7 +33,7 @@
"ML_DEBUG": "true", "ML_DEBUG": "true",
"ML_CONFIG_PATH": "storage\\configs\\dev_1_config.json" "ML_CONFIG_PATH": "storage\\configs\\dev_1_config.json"
}, },
"applicationUrl": "http://moonlight.testy:5118;https://localhost:7118;http://localhost:5118", "applicationUrl": "http://moonlight.owo:5118;http://localhost:5118",
"dotnetRunMessages": true "dotnetRunMessages": true
}, },
"Dev DB 2": "Dev DB 2":
@@ -45,7 +45,7 @@
"ML_DEBUG": "true", "ML_DEBUG": "true",
"ML_CONFIG_PATH": "storage\\configs\\dev_2_config.json" "ML_CONFIG_PATH": "storage\\configs\\dev_2_config.json"
}, },
"applicationUrl": "http://moonlight.testy:5118;https://localhost:7118;http://localhost:5118", "applicationUrl": "http://moonlight.owo:5118;http://localhost:5118",
"dotnetRunMessages": true "dotnetRunMessages": true
} }
} }

View File

@@ -1,13 +0,0 @@
### Some explanations
defaultstorage:
This directory is for the default assets of a moonlight instance, e.g. lang files, images etc
storage:
This directory is empty in fresh moonlight instances and will be populated with example config upon first run.
Before using moonlight this config file has to be modified.
Also resources are going to be copied from the default storage to this storage.
To access files in this storage we recommend to use the PathBuilder functions to ensure cross platform compatibility.
The storage directory should be mounted to a specific path when using docker container so when the container is replaced/rebuild your storage will not be modified

View File

@@ -55,11 +55,14 @@
</div> </div>
} }
@if (OAuth2Service.Providers.Any())
{
<div class="separator separator-content my-14"> <div class="separator separator-content my-14">
<span class="w-125px text-gray-500 fw-semibold fs-7"> <span class="w-125px text-gray-500 fw-semibold fs-7">
<TL>Or with email</TL> <TL>Or with email</TL>
</span> </span>
</div> </div>
}
<div class="mt-3 mb-3"> <div class="mt-3 mb-3">
<InputText @bind-Value="LoginData.Email" type="email" placeholder="@(SmartTranslateService.Translate("Email"))" class="form-control bg-transparent"/> <InputText @bind-Value="LoginData.Email" type="email" placeholder="@(SmartTranslateService.Translate("Email"))" class="form-control bg-transparent"/>

View File

@@ -48,11 +48,14 @@
</div> </div>
} }
@if (OAuth2Service.Providers.Any())
{
<div class="separator separator-content my-10"> <div class="separator separator-content my-10">
<span class="w-125px text-gray-500 fw-semibold fs-7"> <span class="w-125px text-gray-500 fw-semibold fs-7">
<TL>Or with email</TL> <TL>Or with email</TL>
</span> </span>
</div> </div>
}
<SmartForm Model="UserRegisterModel" OnValidSubmit="CreateUser"> <SmartForm Model="UserRegisterModel" OnValidSubmit="CreateUser">
<div class="fv-row mb-4 fv-plugins-icon-container"> <div class="fv-row mb-4 fv-plugins-icon-container">

View File

@@ -12,8 +12,9 @@
@inject AlertService AlertService @inject AlertService AlertService
@inject ConfigService ConfigService @inject ConfigService ConfigService
@inject SmartTranslateService SmartTranslateService @inject SmartTranslateService SmartTranslateService
@inject NavigationManager NavigationManager
@if (Crashed) @if (HardCrashed)
{ {
<div class="card card-flush h-md-100"> <div class="card card-flush h-md-100">
<div class="card-body d-flex flex-column justify-content-between mt-9 bgi-no-repeat bgi-size-cover bgi-position-x-center pb-0"> <div class="card-body d-flex flex-column justify-content-between mt-9 bgi-no-repeat bgi-size-cover bgi-position-x-center pb-0">
@@ -30,6 +31,16 @@
</div> </div>
</div> </div>
} }
else if (SoftCrashed)
{
<div class="card card-body bg-danger mb-5">
<span class="text-center">
@(ErrorMessage)
</span>
</div>
@ChildContent
}
else else
{ {
@ChildContent @ChildContent
@@ -37,7 +48,22 @@ else
@code @code
{ {
private bool Crashed = false; private bool HardCrashed = false;
private bool SoftCrashed = false;
private string ErrorMessage = "";
protected override void OnInitialized()
{
NavigationManager.LocationChanged += OnPathChanged;
}
private void OnPathChanged(object? sender, LocationChangedEventArgs e)
{
if (SoftCrashed)
SoftCrashed = false;
StateHasChanged();
}
protected override async Task OnErrorAsync(Exception exception) protected override async Task OnErrorAsync(Exception exception)
{ {
@@ -50,74 +76,57 @@ else
{ {
if (displayException.DoNotTranslate) if (displayException.DoNotTranslate)
{ {
await AlertService.Error( await SoftCrash(displayException.Message);
displayException.Message
);
} }
else else
{ {
await AlertService.Error( await SoftCrash(SmartTranslateService.Translate(displayException.Message));
SmartTranslateService.Translate(displayException.Message)
);
} }
} }
else if (exception is CloudflareException cloudflareException) else if (exception is CloudflareException cloudflareException)
{ {
await AlertService.Error( await SoftCrash(SmartTranslateService.Translate("Error from cloudflare: ") + cloudflareException.Message);
SmartTranslateService.Translate("Error from cloudflare api"),
cloudflareException.Message
);
} }
else if (exception is WingsException wingsException) else if (exception is WingsException wingsException)
{ {
await AlertService.Error( await SoftCrash(SmartTranslateService.Translate("Error from wings: ") + wingsException.Message);
SmartTranslateService.Translate("Error from wings"),
wingsException.Message
);
//TODO: Error log service
Logger.Warn($"Wings exception status code: {wingsException.StatusCode}"); Logger.Warn($"Wings exception status code: {wingsException.StatusCode}");
} }
else if (exception is DaemonException daemonException) else if (exception is DaemonException daemonException)
{ {
await AlertService.Error( await SoftCrash(SmartTranslateService.Translate("Error from daemon: ") + daemonException.Message);
SmartTranslateService.Translate("Error from daemon"),
daemonException.Message
);
Logger.Warn($"Wings exception status code: {daemonException.StatusCode}"); Logger.Warn($"Wings exception status code: {daemonException.StatusCode}");
} }
else if (exception is ModrinthException modrinthException) else if (exception is ModrinthException modrinthException)
{ {
await AlertService.Error( await SoftCrash(SmartTranslateService.Translate("Error from modrinth: ") + modrinthException.Message);
SmartTranslateService.Translate("Error from modrinth"),
modrinthException.Message
);
} }
else if (exception is CloudPanelException cloudPanelException) else if (exception is CloudPanelException cloudPanelException)
{ {
await AlertService.Error( await SoftCrash(SmartTranslateService.Translate("Error from cloudpanel: ") + cloudPanelException.Message);
SmartTranslateService.Translate("Error from cloud panel"),
cloudPanelException.Message
);
} }
else if (exception is NotImplementedException) else if (exception is NotImplementedException)
{ {
await AlertService.Error(SmartTranslateService.Translate("This function is not implemented")); await SoftCrash(SmartTranslateService.Translate("This function is not implemented"));
} }
else if (exception is StripeException stripeException) else if (exception is StripeException stripeException)
{ {
await AlertService.Error( await SoftCrash(SmartTranslateService.Translate("Error from stripe: ") + stripeException.Message);
SmartTranslateService.Translate("Unknown error from stripe"),
stripeException.Message
);
} }
else else
{ {
Logger.Warn(exception); Logger.Warn(exception);
Crashed = true; HardCrashed = true;
await InvokeAsync(StateHasChanged); await InvokeAsync(StateHasChanged);
} }
} }
private Task SoftCrash(string message)
{
SoftCrashed = true;
ErrorMessage = message;
return Task.CompletedTask;
}
} }

View File

@@ -2,7 +2,7 @@
@using BlazorContextMenu @using BlazorContextMenu
@using Moonlight.App.Helpers @using Moonlight.App.Helpers
<div class="table-responsive"> <div class="table-responsive single-color-scrollbar">
<div class="dataTables_scroll"> <div class="dataTables_scroll">
<div class="dataTables_scrollHead"> <div class="dataTables_scrollHead">
<div class="dataTables_scrollHeadInner"> <div class="dataTables_scrollHeadInner">

View File

@@ -0,0 +1,22 @@
<div class="card mb-5 mb-xl-10">
<div class="card-body pt-0 pb-0">
<ul class="nav nav-stretch nav-line-tabs nav-line-tabs-2x border-transparent fs-5 fw-bold">
<li class="nav-item mt-2">
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 0 ? "active" : "")" href="/admin/domains">
<TL>Domains</TL>
</a>
</li>
<li class="nav-item mt-2">
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 1 ? "active" : "")" href="/admin/domains/shared">
<TL>Shared domains</TL>
</a>
</li>
</ul>
</div>
</div>
@code
{
[Parameter]
public int Index { get; set; } = 0;
}

View File

@@ -0,0 +1,22 @@
<div class="card mb-5 mb-xl-10">
<div class="card-body pt-0 pb-0">
<ul class="nav nav-stretch nav-line-tabs nav-line-tabs-2x border-transparent fs-5 fw-bold">
<li class="nav-item mt-2">
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 0 ? "active" : "")" href="/admin/statistics">
<TL>Overview</TL>
</a>
</li>
<li class="nav-item mt-2">
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 1 ? "active" : "")" href="/admin/statistics/live">
<TL>Live data</TL>
</a>
</li>
</ul>
</div>
</div>
@code
{
[Parameter]
public int Index { get; set; } = 0;
}

View File

@@ -41,13 +41,6 @@
} }
<div class="app-navbar flex-shrink-0"> <div class="app-navbar flex-shrink-0">
<div class="app-navbar-item ms-1 ms-lg-3">
<ThemeSwitcher
ToggleBtnClass="btn btn-icon btn-custom btn-icon-muted btn-active-light btn-active-color-primary w-35px h-35px w-md-40px h-md-40px"
ToggleBtnIconClass="svg-icon svg-icon-2">
</ThemeSwitcher>
</div>
@if (User != null) @if (User != null)
{ {
<div class="app-navbar-item ms-1 ms-lg-3"> <div class="app-navbar-item ms-1 ms-lg-3">
@@ -56,43 +49,34 @@
</a> </a>
</div> </div>
<div class="app-navbar-item ms-1 ms-lg-3" id="kt_header_user_menu_toggle"> <div class="app-navbar-item ms-1 ms-lg-3 dropdown">
<div class="cursor-pointer symbol symbol-35px symbol-md-40px" data-kt-menu-trigger="click" data-kt-menu-attach="parent" data-kt-menu-placement="bottom-end"> <!-- Trigger -->
<img alt="Avatar" src="/api/moonlight/avatar/@(User.Id)"/> <a class="cursor-pointer d-block symbol symbol-35px symbol-md-40px" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
</div> <img alt="Avatar" src="/api/moonlight/avatar/@(User.Id)" width="35" height="35">
</a>
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-800 menu-state-bg menu-state-primary fw-semibold py-4 fs-6 w-275px" data-kt-menu="true"> <!-- Dropdown Menu -->
<div class="menu-item px-3"> <div class="dropdown-menu dropdown-menu-end w-275px p-5" aria-labelledby="dropdownMenuLink">
<div class="menu-content d-flex align-items-center px-3"> <div class="dropdown-item py-4 bg-body bg-hover-body ps-0">
<div class="symbol symbol-50px me-5"> <div class="d-flex align-items-center">
<img alt="Avatar" src="/api/moonlight/avatar/@(User.Id)"/> <img alt="Avatar" src="/api/moonlight/avatar/@(User.Id)" class="rounded-circle me-3" width="50" height="50">
</div>
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="fw-bold d-flex align-items-center fs-5"> <div class="fw-bold d-flex align-items-center">
<div class="@(User.StreamerMode ? "blur" : "")"> <div class="@(User.StreamerMode ? "blur" : "")">
@(User.FirstName) @(User.LastName) @(User.FirstName) @(User.LastName)
</div> </div>
@if (User.Admin) @if (User.Admin)
{ {
<span class="badge badge-light-success fw-bold fs-8 px-2 py-1 ms-2">Admin</span> <span class="badge bg-success fw-bold ms-2">Admin</span>
} }
</div> </div>
<a class="fw-semibold text-muted text-hover-primary fs-7 @(User.StreamerMode ? "blur" : "")">@(User.Email)</a> <a class="fw-semibold text-muted text-decoration-none @(User.StreamerMode ? "blur" : "")">@User.Email</a>
</div> </div>
</div> </div>
</div> </div>
<div class="separator my-2"></div> <hr class="dropdown-divider">
<div class="menu-item px-5 my-1"> <a href="/profile" class="dropdown-item rounded fs-7 py-4">Profile</a>
<a href="/profile" class="menu-link px-5"> <a href="#" @onclick:preventDefault @onclick="Logout" class="dropdown-item rounded fs-7 py-4">Logout</a>
<TL>Profile</TL>
</a>
</div>
<div class="menu-item px-5">
<a @onclick="Logout" class="menu-link px-5">
<TL>Logout</TL>
</a>
</div>
</div> </div>
</div> </div>
} }

View File

@@ -1,25 +0,0 @@
@using Moonlight.App.Services.Files
@inject ResourceService ResourceService
<div id="kt_app_header" class="app-header">
<div class="app-container container-fluid d-flex align-items-stretch justify-content-between">
<div class="d-flex align-items-center d-lg-none ms-n2 me-2" title="Show sidebar menu">
<div class="btn btn-icon btn-active-color-primary w-35px h-35px" id="kt_app_sidebar_mobile_toggle">
<i class="bx bx-menu bx-md"></i>
</div>
</div>
<div class="d-flex align-items-center flex-grow-1 flex-lg-grow-0">
<a href="/" class="d-lg-none">
<img alt="Logo" src="@(ResourceService.Image("logo.svg"))" class="h-30px"/>
</a>
</div>
<div class="d-flex align-items-stretch justify-content-between flex-lg-grow-1" id="kt_app_header_wrapper">
<div class="app-header-menu app-header-mobile-drawer align-items-stretch" data-kt-drawer="true" data-kt-drawer-name="app-header-menu" data-kt-drawer-activate="{default: true, lg: false}" data-kt-drawer-overlay="true" data-kt-drawer-width="225px" data-kt-drawer-direction="end" data-kt-drawer-toggle="#kt_app_header_menu_toggle" data-kt-swapper="true" data-kt-swapper-mode="{default: 'append', lg: 'prepend'}" data-kt-swapper-parent="{default: '#kt_app_body', lg: '#kt_app_header_wrapper'}">
<div class="menu menu-rounded menu-column menu-lg-row my-5 my-lg-0 align-items-stretch fw-semibold px-2 px-lg-0" id="kt_app_header_menu" data-kt-menu="true">
</div>
</div>
<Navbar></Navbar>
</div>
</div>
</div>

View File

@@ -1,57 +0,0 @@
@using Moonlight.App.Services.Sessions
@using Moonlight.App.Database.Entities
@using Moonlight.App.Services
@using Moonlight.App.Services.Files
@inject IdentityService IdentityService
@inject ResourceService ResourceService
@inject IJSRuntime JsRuntime
<div id="kt_app_sidebar" class="app-sidebar flex-column" data-kt-drawer="true" data-kt-drawer-name="app-sidebar" data-kt-drawer-activate="{default: true, lg: false}" data-kt-drawer-overlay="true" data-kt-drawer-width="225px" data-kt-drawer-direction="start" data-kt-drawer-toggle="#kt_app_sidebar_mobile_toggle">
<div class="app-sidebar-logo px-6" id="kt_app_sidebar_logo">
<a href="@(User != null ? "/" : "/login")">
@if (sidebar == "dark-sidebar")
{
<img alt="Logo" src="@(ResourceService.Image("logolong.png"))" class="h-45px app-sidebar-logo-default"/>
}
else
{
if (sidebar == "light-sidebar")
{
<img alt="Logo" src="@(ResourceService.Image("logo.svg"))" class="theme-light-show h-20px app-sidebar-logo-default"/>
<img alt="Logo" src="@(ResourceService.Image("logo.svg"))" class="theme-dark-show h-20px app-sidebar-logo-default"/>
}
}
<img alt="Logo" src="@(ResourceService.Image("logo.svg"))" class="h-20px app-sidebar-logo-minimize"/>
</a>
<div id="kt_app_sidebar_toggle" class="app-sidebar-toggle btn btn-icon btn-shadow btn-sm btn-color-muted btn-active-color-primary body-bg h-30px w-30px position-absolute top-50 start-100 translate-middle rotate" data-kt-toggle="true" data-kt-toggle-state="active" data-kt-toggle-target="body" data-kt-toggle-name="app-sidebar-minimize">
<i class="bx bx-chevrons-left bx-md"></i>
</div>
</div>
<SidebarMenu></SidebarMenu>
<div class="app-sidebar-footer flex-column-auto pt-2 pb-6 px-6" id="kt_app_sidebar_footer">
<a href="/support" class="btn btn-flex flex-center btn-custom btn-primary overflow-hidden text-nowrap px-0 h-40px w-100 btn-label">
<i class="bx bx-sm bx-support"></i>
</a>
</div>
</div>
@code
{
private string sidebar;
private User? User;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
User = IdentityService.User;
sidebar = await JsRuntime.InvokeAsync<string>("document.body.getAttribute", "data-kt-app-layout");
StateHasChanged();
}
}
}

View File

@@ -1,197 +0,0 @@
@using Moonlight.App.Services
@using Moonlight.App.Services.Sessions
@using Moonlight.App.Database.Entities
@inject IdentityService IdentityService
<div class="app-sidebar-menu overflow-hidden flex-column-fluid">
<div id="kt_app_sidebar_menu_wrapper" class="app-sidebar-wrapper hover-scroll-overlay-y my-5" data-kt-scroll="true" data-kt-scroll-activate="true" data-kt-scroll-height="auto" data-kt-scroll-dependencies="#kt_app_sidebar_logo, #kt_app_sidebar_footer" data-kt-scroll-wrappers="#kt_app_sidebar_menu" data-kt-scroll-offset="5px" data-kt-scroll-save-state="true">
<div class="menu menu-column menu-rounded menu-sub-indention px-3" id="#kt_app_sidebar_menu" data-kt-menu="true" data-kt-menu-expand="false">
@if (User == null)
{
<div class="menu-item">
<a class="menu-link" href="/login">
<span class="menu-icon">
<i class="bx bxs-log-in"></i>
</span>
<span class="menu-title"><TL>Login</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/register">
<span class="menu-icon">
<i class="bx bx-user-plus"></i>
</span>
<span class="menu-title"><TL>Register</TL></span>
</a>
</div>
}
else
{
<div class="menu-item">
<a class="menu-link" href="/">
<span class="menu-icon">
<i class="bx bx-layer"></i>
</span>
<span class="menu-title"><TL>Dashboard</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/servers">
<span class="menu-icon">
<i class="bx bx-server"></i>
</span>
<span class="menu-title"><TL>Servers</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/webspaces">
<span class="menu-icon">
<i class="bx bx-globe"></i>
</span>
<span class="menu-title"><TL>Webspaces</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/domains">
<span class="menu-icon">
<i class="bx bx-purchase-tag"></i>
</span>
<span class="menu-title"><TL>Domains</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/changelog">
<span class="menu-icon">
<i class="bx bx-notepad"></i>
</span>
<span class="menu-title"><TL>Changelog</TL></span>
</a>
</div>
if (IdentityService.Permissions.HasAnyPermissions())
{
<div class="menu-item pt-5">
<div class="menu-content">
<span class="menu-heading fw-bold text-uppercase fs-7"><TL>Admin</TL></span>
</div>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin">
<span class="menu-icon">
<i class="bx bx-layer"></i>
</span>
<span class="menu-title"><TL>Dashboard</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/system">
<span class="menu-icon">
<i class="bx bx-chip"></i>
</span>
<span class="menu-title"><TL>System</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/security">
<span class="menu-icon">
<i class="bx bx-shield"></i>
</span>
<span class="menu-title"><TL>Security</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/servers">
<span class="menu-icon">
<i class="bx bx-server"></i>
</span>
<span class="menu-title"><TL>Servers</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/webspaces">
<span class="menu-icon">
<i class="bx bx-globe"></i>
</span>
<span class="menu-title"><TL>Webspaces</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/users">
<span class="menu-icon">
<i class="bx bx-user"></i>
</span>
<span class="menu-title"><TL>Users</TL></span>
</a>
</div>
<div data-kt-menu-trigger="click" class="menu-item menu-accordion">
<span class="menu-link">
<span class="menu-icon">
<i class="bx bx-purchase-tag"></i>
</span>
<span class="menu-title"><TL>Domains</TL></span>
<span class="menu-arrow"></span>
</span>
<div class="menu-sub menu-sub-accordion">
<div class="menu-item">
<a class="menu-link" href="/admin/domains/">
<span class="menu-bullet">
<span class="bullet bullet-dot"></span>
</span>
<span class="menu-title"><TL>Domains</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/domains/shared">
<span class="menu-bullet">
<span class="bullet bullet-dot"></span>
</span>
<span class="menu-title"><TL>Shared domains</TL></span>
</a>
</div>
</div>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/support">
<span class="menu-icon">
<i class="bx bx-support"></i>
</span>
<span class="menu-title"><TL>Support</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/subscriptions">
<span class="menu-icon">
<i class="bx bx-credit-card"></i>
</span>
<span class="menu-title"><TL>Subscriptions</TL></span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/statistics">
<span class="menu-icon">
<i class="bx bx-objects-vertical-bottom"></i>
</span>
<span class="menu-title"><TL>Statistics</TL></span>
</a>
</div>
}
}
</div>
</div>
</div>
@code
{
private User? User;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
User = IdentityService.User;
await InvokeAsync(StateHasChanged);
}
}
}

View File

@@ -1,52 +0,0 @@
@inject IJSRuntime JsRuntime
<a href="#" class="@ToggleBtnClass" data-kt-menu-trigger="@Trigger" data-kt-menu-attach="parent" data-kt-menu-placement="@MenuPlacement">
<i class="theme-light-show bx bx-sun"></i>
<i class="theme-dark-show bx bx-moon" ></i>
</a>
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-title-gray-700 menu-icon-muted menu-active-bg menu-state-primary fw-semibold py-4 fs-base w-175px" data-kt-menu="true" data-kt-element="theme-mode-menu">
<div class="menu-item px-3 my-0">
<a href="#" class="menu-link px-3 py-2" data-kt-element="mode" data-kt-value="light" @onclick="TriggerFlashbang">
<span class="menu-icon" data-kt-element="icon">
<i class="bx bx-sun"></i>
</span>
<span class="menu-title">Lightmode</span>
</a>
</div>
<div class="menu-item px-3 my-0">
<a href="#" class="menu-link px-3 py-2" data-kt-element="mode" data-kt-value="dark">
<span class="menu-icon" data-kt-element="icon">
<i class="bx bx-moon"></i>
</span>
<span class="menu-title">Darkmode</span>
</a>
</div>
<div class="menu-item px-3 my-0">
<a href="#" class="menu-link px-3 py-2" data-kt-element="mode" data-kt-value="system">
<span class="menu-icon" data-kt-element="icon">
<i class="bx bx-cog"></i>
</span>
<span class="menu-title">System</span>
</a>
</div>
</div>
@code {
[Parameter]
public string ToggleBtnClass { get; set; } = "";
[Parameter]
public string MenuPlacement { get; set; } = "bottom-end";
[Parameter]
public string ToggleBtnIconClass { get; set; } = "svg-icon svg-icon-2";
[Parameter]
public string Trigger { get; set; } = "{default:'click'}";
private async void TriggerFlashbang()
{
await JsRuntime.InvokeVoidAsync("moonlight.flashbang.run");
}
}

View File

@@ -7,6 +7,7 @@
@inject ResourceService ResourceService @inject ResourceService ResourceService
@inject SmartTranslateService SmartTranslateService @inject SmartTranslateService SmartTranslateService
<div class="scroll-y me-n5 pe-5" style="max-height: 50vh; display: flex; flex-direction: column-reverse;">
@foreach (var message in Messages.OrderByDescending(x => x.Id)) // Reverse messages to use auto scrolling @foreach (var message in Messages.OrderByDescending(x => x.Id)) // Reverse messages to use auto scrolling
{ {
if (message.IsSupportMessage) if (message.IsSupportMessage)
@@ -18,10 +19,16 @@
<div class="d-flex align-items-center mb-2"> <div class="d-flex align-items-center mb-2">
<div class="me-3"> <div class="me-3">
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span> <span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
<a href="#" class="fs-5 fw-bold text-gray-900 text-hover-primary ms-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</a> @if (message.Sender != null)
{
<span class="fs-5 fw-bold text-gray-900 text-hover-primary ms-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</span>
}
</div> </div>
<div class="symbol symbol-35px symbol-circle "> <div class="symbol symbol-35px symbol-circle ">
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender!))"> @if (message.Sender != null)
{
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender))">
}
</div> </div>
</div> </div>
<div class="p-5 rounded bg-light-primary text-dark fw-semibold mw-lg-400px text-end"> <div class="p-5 rounded bg-light-primary text-dark fw-semibold mw-lg-400px text-end">
@@ -63,10 +70,13 @@
<div class="d-flex flex-column align-items-start"> <div class="d-flex flex-column align-items-start">
<div class="d-flex align-items-center mb-2"> <div class="d-flex align-items-center mb-2">
<div class="symbol symbol-35px symbol-circle "> <div class="symbol symbol-35px symbol-circle ">
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender!))"> @if (message.Sender != null)
{
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender))">
}
</div> </div>
<div class="ms-3"> <div class="ms-3">
<a href="#" class="fs-5 fw-bold text-gray-900 text-hover-primary me-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</a> <span class="fs-5 fw-bold text-gray-900 text-hover-primary me-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</span>
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span> <span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
</div> </div>
</div> </div>
@@ -120,10 +130,13 @@
<div class="d-flex flex-column align-items-start"> <div class="d-flex flex-column align-items-start">
<div class="d-flex align-items-center mb-2"> <div class="d-flex align-items-center mb-2">
<div class="symbol symbol-35px symbol-circle "> <div class="symbol symbol-35px symbol-circle ">
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender!))"> @if (message.Sender != null)
{
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender))">
}
</div> </div>
<div class="ms-3"> <div class="ms-3">
<a href="#" class="fs-5 fw-bold text-gray-900 text-hover-primary me-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</a> <span class="fs-5 fw-bold text-gray-900 text-hover-primary me-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</span>
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span> <span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
</div> </div>
</div> </div>
@@ -167,10 +180,13 @@
<div class="d-flex align-items-center mb-2"> <div class="d-flex align-items-center mb-2">
<div class="me-3"> <div class="me-3">
<span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span> <span class="text-muted fs-7 mb-1">@(Formatter.FormatAgoFromDateTime(message.CreatedAt, SmartTranslateService))</span>
<a href="#" class="fs-5 fw-bold text-gray-900 text-hover-primary ms-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</a> <span class="fs-5 fw-bold text-gray-900 text-hover-primary ms-1">@(message.Sender!.FirstName) @(message.Sender!.LastName)</span>
</div> </div>
<div class="symbol symbol-35px symbol-circle "> <div class="symbol symbol-35px symbol-circle ">
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender!))"> @if (message.Sender != null)
{
<img alt="Avatar" src="@(ResourceService.Avatar(message.Sender))">
}
</div> </div>
</div> </div>
<div class="p-5 rounded bg-light-primary text-dark fw-semibold mw-lg-400px text-end"> <div class="p-5 rounded bg-light-primary text-dark fw-semibold mw-lg-400px text-end">
@@ -208,6 +224,7 @@
} }
} }
} }
</div>
@code @code
{ {

View File

@@ -0,0 +1,284 @@
@using Moonlight.App.Services.Files
@using Moonlight.App.Services.Sessions
@inject ResourceService ResourceService
@inject DynamicBackgroundService DynamicBackgroundService
@inject IdentityService IdentityService
<div class="d-flex flex-column flex-root app-root">
<div class="app-page flex-column flex-column-fluid">
<!-- Page Header -->
<div class="app-header">
<div class="app-container container-fluid d-flex align-items-stretch justify-content-between">
<div class="d-flex align-items-center d-lg-none ms-n2 me-2" title="Show sidebar menu">
<a class="btn btn-icon btn-active-color-primary w-35px h-35px" @onclick:preventDefault @onclick="ToggleMobileSidebar">
<i class="bx bx-menu bx-md"></i>
</a>
</div>
@if (ShowMobileSidebar)
{
<div style="z-index: 105;" class="drawer-overlay" @onclick="ToggleMobileSidebar"></div>
}
<div class="d-flex align-items-center flex-grow-1 flex-lg-grow-0">
<a href="/" class="d-lg-none">
<img alt="Logo" src="@(ResourceService.Image("logo.svg"))" class="h-30px"/>
</a>
</div>
<div class="d-flex align-items-stretch justify-content-between flex-lg-grow-1">
<div class="app-header-menu app-header-mobile-drawer align-items-stretch">
<div class="menu menu-rounded menu-column menu-lg-row my-5 my-lg-0 align-items-stretch fw-semibold px-2 px-lg-0">
</div>
</div>
<Navbar></Navbar>
</div>
</div>
</div>
<!-- Page Header End --->
<div class="app-wrapper flex-column flex-row-fluid">
<!-- Sidebar -->
<div class="app-sidebar flex-column @(ShowMobileSidebar ? "drawer drawer-start drawer-on" : "")">
<div class="app-sidebar-logo px-6">
<a href="@(IdentityService.User != null ? "/" : "/login")">
<img alt="Logo" src="@(ResourceService.Image("logolong.png"))" class="h-45px app-sidebar-logo-default"/>
<img alt="Logo" src="@(ResourceService.Image("logo.svg"))" class="h-20px app-sidebar-logo-minimize"/>
</a>
</div>
<div class="app-sidebar-menu overflow-hidden flex-column-fluid">
<div class="app-sidebar-wrapper hover-scroll-overlay-y my-5">
<div class="menu menu-column menu-rounded menu-sub-indention px-3">
@if (IdentityService.User == null)
{
<div class="menu-item">
<a class="menu-link" href="/login">
<span class="menu-icon">
<i class="bx bxs-log-in"></i>
</span>
<span class="menu-title">
<TL>Login</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/register">
<span class="menu-icon">
<i class="bx bx-user-plus"></i>
</span>
<span class="menu-title">
<TL>Register</TL>
</span>
</a>
</div>
}
else
{
<div class="menu-item">
<a class="menu-link" href="/">
<span class="menu-icon">
<i class="bx bx-layer"></i>
</span>
<span class="menu-title">
<TL>Dashboard</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/servers">
<span class="menu-icon">
<i class="bx bx-server"></i>
</span>
<span class="menu-title">
<TL>Servers</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/webspaces">
<span class="menu-icon">
<i class="bx bx-globe"></i>
</span>
<span class="menu-title">
<TL>Webspaces</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/domains">
<span class="menu-icon">
<i class="bx bx-purchase-tag"></i>
</span>
<span class="menu-title">
<TL>Domains</TL>
</span>
</a>
</div>
if (IdentityService.Permissions.HasAnyPermissions())
{
<div class="menu-item pt-5">
<div class="menu-content">
<span class="menu-heading fw-bold text-uppercase fs-7">
<TL>Admin</TL>
</span>
</div>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin">
<span class="menu-icon">
<i class="bx bx-layer"></i>
</span>
<span class="menu-title">
<TL>Dashboard</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/system">
<span class="menu-icon">
<i class="bx bx-chip"></i>
</span>
<span class="menu-title">
<TL>System</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/security">
<span class="menu-icon">
<i class="bx bx-shield"></i>
</span>
<span class="menu-title">
<TL>Security</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/servers">
<span class="menu-icon">
<i class="bx bx-server"></i>
</span>
<span class="menu-title">
<TL>Servers</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/webspaces">
<span class="menu-icon">
<i class="bx bx-globe"></i>
</span>
<span class="menu-title">
<TL>Webspaces</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/users">
<span class="menu-icon">
<i class="bx bx-user"></i>
</span>
<span class="menu-title">
<TL>Users</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/domains">
<span class="menu-icon">
<i class="bx bx-purchase-tag"></i>
</span>
<span class="menu-title">
<TL>Domains</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/support">
<span class="menu-icon">
<i class="bx bx-support"></i>
</span>
<span class="menu-title">
<TL>Support</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/subscriptions">
<span class="menu-icon">
<i class="bx bx-credit-card"></i>
</span>
<span class="menu-title">
<TL>Subscriptions</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/statistics">
<span class="menu-icon">
<i class="bx bx-objects-vertical-bottom"></i>
</span>
<span class="menu-title">
<TL>Statistics</TL>
</span>
</a>
</div>
<div class="menu-item">
<a class="menu-link" href="/admin/changelog">
<span class="menu-icon">
<i class="bx bx-notepad"></i>
</span>
<span class="menu-title">
<TL>Changelog</TL>
</span>
</a>
</div>
}
}
</div>
</div>
</div>
<div class="app-sidebar-footer flex-column-auto pt-2 pb-6 px-6">
<a href="/support" class="btn btn-flex flex-center btn-custom btn-primary overflow-hidden text-nowrap px-0 h-40px w-100 btn-label">
<i class="bx bx-sm bx-support"></i>
</a>
</div>
</div>
<!-- Sidebar End -->
<div class="app-main flex-column flex-row-fluid">
<div class="d-flex flex-column flex-column-fluid">
<div class="app-content flex-column-fluid" style="background-position: center; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-image: linear-gradient(rgba(0, 0, 0, 0.55),rgba(0, 0, 0, 0.55)) ,url('@(DynamicBackgroundService.BackgroundImageUrl)');">
<div class="app-container container-fluid">
<div class="mt-10">
@ChildContent
</div>
</div>
</div>
</div>
<Footer></Footer>
</div>
</div>
</div>
</div>
@code
{
[Parameter]
public RenderFragment ChildContent { get; set; }
private bool ShowMobileSidebar = false;
private async Task ToggleMobileSidebar()
{
ShowMobileSidebar = !ShowMobileSidebar;
await InvokeAsync(StateHasChanged);
}
}

View File

@@ -8,7 +8,6 @@
@using Moonlight.App.Services.Sessions @using Moonlight.App.Services.Sessions
@using Moonlight.App.Events @using Moonlight.App.Events
@layout ThemeInit
@implements IDisposable @implements IDisposable
@inherits LayoutComponentBase @inherits LayoutComponentBase
@@ -23,6 +22,7 @@
@inject DynamicBackgroundService DynamicBackgroundService @inject DynamicBackgroundService DynamicBackgroundService
@inject KeyListenerService KeyListenerService @inject KeyListenerService KeyListenerService
@inject ConfigService ConfigService @inject ConfigService ConfigService
@inject IpVerificationService IpVerificationService
@{ @{
var uri = new Uri(NavigationManager.Uri); var uri = new Uri(NavigationManager.Uri);
@@ -45,26 +45,37 @@
<GlobalErrorBoundary> <GlobalErrorBoundary>
<PageTitle>@(string.IsNullOrEmpty(title) ? "Dashboard - " : title)Moonlight</PageTitle> <PageTitle>@(string.IsNullOrEmpty(title) ? "Dashboard - " : title)Moonlight</PageTitle>
<div class="d-flex flex-column flex-root app-root" id="kt_app_root"> <DefaultLayout>
<div class="app-page flex-column flex-column-fluid" id="kt_app_page">
<canvas id="snow" class="snow-canvas"></canvas>
@{
//TODO: Add a way to disable the snow
}
<PageHeader></PageHeader>
<div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
<Sidebar></Sidebar>
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
<div class="d-flex flex-column flex-column-fluid">
<div id="kt_app_content" class="app-content flex-column-fluid" style="background-position: center; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-image: url('@(DynamicBackgroundService.BackgroundImageUrl)')">
<div id="kt_app_content_container" class="app-container container-fluid">
<div class="mt-10">
<SoftErrorBoundary> <SoftErrorBoundary>
@if (!IsIpBanned) @if (UserProcessed)
{ {
if (UserProcessed) if (IsIpBanned)
{
<div class="modal d-block">
<div class="modal-dialog modal-dialog-centered mw-900px">
<div class="modal-content">
<div class="pt-2 modal-body py-lg-10 px-lg-10">
<h2>@(SmartTranslateService.Translate("Your ip has been banned"))</h2>
<p class="mt-3 fw-normal fs-6">@(SmartTranslateService.Translate("Your ip address has been banned by an admin"))</p>
</div>
</div>
</div>
</div>
}
else if (IsIpSuspicious)
{
<div class="modal d-block">
<div class="modal-dialog modal-dialog-centered mw-900px">
<div class="modal-content">
<div class="pt-2 modal-body py-lg-10 px-lg-10">
<h2>@(SmartTranslateService.Translate("Your ip his blocked. VPNs and Datacenter IPs are prohibited from accessing this site"))</h2>
<p class="mt-3 fw-normal fs-6">@(SmartTranslateService.Translate("Please disable your vpn or proxy and try it again"))</p>
</div>
</div>
</div>
</div>
}
else
{ {
if (uri.LocalPath != "/login" && if (uri.LocalPath != "/login" &&
uri.LocalPath != "/passwordreset" && uri.LocalPath != "/passwordreset" &&
@@ -118,6 +129,7 @@
} }
} }
} }
}
else else
{ {
<div class="modal d-block"> <div class="modal d-block">
@@ -131,57 +143,15 @@
</div> </div>
</div> </div>
} }
}
else
{
<div class="modal d-block">
<div class="modal-dialog modal-dialog-centered mw-900px">
<div class="modal-content">
<div class="pt-2 modal-body py-lg-10 px-lg-10">
<h2>@(SmartTranslateService.Translate("Your ip has been banned"))</h2>
<p class="mt-3 fw-normal fs-6">@(SmartTranslateService.Translate("Your ip address has been banned by an admin"))</p>
</div>
</div>
</div>
</div>
}
</SoftErrorBoundary> </SoftErrorBoundary>
</div> </DefaultLayout>
</div>
</div>
</div>
<Footer></Footer>
</div>
</div>
</div>
</div>
</GlobalErrorBoundary> </GlobalErrorBoundary>
@code @code
{ {
private bool UserProcessed = false; private bool UserProcessed = false;
private bool IsIpBanned = false; private bool IsIpBanned = false;
private bool IsIpSuspicious = false;
protected override void OnAfterRender(bool firstRender)
{
if (firstRender)
AddBodyAttribute("data-kt-app-page-loading", "on");
//Initialize classes and attributes for layout with dark sidebar
AddBodyAttribute("data-kt-app-reset-transition", "true");
AddBodyAttribute("data-kt-app-layout", "dark-sidebar");
AddBodyAttribute("data-kt-app-header-fixed", "true");
AddBodyAttribute("data-kt-app-sidebar-fixed", "true");
AddBodyAttribute("data-kt-app-sidebar-hoverable", "true");
AddBodyAttribute("data-kt-app-sidebar-push-header", "true");
AddBodyAttribute("data-kt-app-sidebar-push-toolbar", "true");
AddBodyAttribute("data-kt-app-sidebar-push-footer", "true");
AddBodyAttribute("data-kt-app-toolbar-enabled", "true");
AddBodyClass("app-default");
}
protected override async Task OnAfterRenderAsync(bool firstRender) protected override async Task OnAfterRenderAsync(bool firstRender)
{ {
@@ -191,11 +161,6 @@
{ {
DynamicBackgroundService.OnBackgroundImageChanged += async (_, _) => { await InvokeAsync(StateHasChanged); }; DynamicBackgroundService.OnBackgroundImageChanged += async (_, _) => { await InvokeAsync(StateHasChanged); };
IsIpBanned = await IpBanService.IsBanned();
if (IsIpBanned)
await InvokeAsync(StateHasChanged);
await Event.On<Object>("ipBan.update", this, async _ => await Event.On<Object>("ipBan.update", this, async _ =>
{ {
IsIpBanned = await IpBanService.IsBanned(); IsIpBanned = await IpBanService.IsBanned();
@@ -203,21 +168,13 @@
}); });
await IdentityService.Load(); await IdentityService.Load();
IsIpBanned = await IpBanService.IsBanned();
IsIpSuspicious = await IpVerificationService.IsDatacenterOrVpn(IdentityService.Ip);
UserProcessed = true; UserProcessed = true;
await InvokeAsync(StateHasChanged); await InvokeAsync(StateHasChanged);
try
{
await JsRuntime.InvokeVoidAsync("document.body.removeAttribute", "data-kt-app-reset-transition");
await JsRuntime.InvokeVoidAsync("document.body.removeAttribute", "data-kt-app-page-loading");
await JsRuntime.InvokeVoidAsync("KTMenu.createInstances");
await JsRuntime.InvokeVoidAsync("KTDrawer.createInstances");
}
catch (Exception)
{
/* ignore errors to make sure that the session call is executed */
}
await SessionClientService.Start(); await SessionClientService.Start();
NavigationManager.LocationChanged += async (_, _) => NavigationManager.LocationChanged += async (_, _) =>
@@ -242,11 +199,6 @@
await KeyListenerService.Initialize(); await KeyListenerService.Initialize();
RunDelayedMenu(0);
RunDelayedMenu(1);
RunDelayedMenu(3);
RunDelayedMenu(5);
if (ConfigService.Get().Moonlight.EnableLatencyCheck) if (ConfigService.Get().Moonlight.EnableLatencyCheck)
{ {
await JsRuntime.InvokeVoidAsync("moonlight.loading.checkConnection", await JsRuntime.InvokeVoidAsync("moonlight.loading.checkConnection",
@@ -272,31 +224,4 @@
await Event.Off($"supportChat.{IdentityService.User.Id}.message", this); await Event.Off($"supportChat.{IdentityService.User.Id}.message", this);
} }
} }
private void AddBodyAttribute(string attribute, string value)
{
JsRuntime.InvokeVoidAsync("document.body.setAttribute", attribute, value);
}
private void AddBodyClass(string className)
{
JsRuntime.InvokeVoidAsync("document.body.classList.add", className);
}
private void RunDelayedMenu(int seconds)
{
Task.Run(async () =>
{
try
{
await Task.Delay(TimeSpan.FromSeconds(seconds));
await JsRuntime.InvokeVoidAsync("KTMenu.initHandlers");
}
catch (Exception e)
{
//Logger.Warn("Delayed menu error");
//Logger.Warn(e);
}
});
}
} }

View File

@@ -3,7 +3,6 @@
@using Moonlight.App.Extensions @using Moonlight.App.Extensions
@using Moonlight.App.Services.Sessions @using Moonlight.App.Services.Sessions
@layout ThemeInit
@implements IDisposable @implements IDisposable
@inherits LayoutComponentBase @inherits LayoutComponentBase

View File

@@ -1,67 +0,0 @@
@using Moonlight.App.Extensions
@inherits LayoutComponentBase
@inject IJSRuntime JS
@inject NavigationManager NavigationManager
@Body
<script suppress-error="BL9992">
window.emptyBody = function(){
document.body.className = '';
}
</script>
@code
{
protected override void OnAfterRender(bool firstRender)
{
JS.InvokeVoidSafe("KTThemeMode.init");
JS.InvokeVoidSafe("emptyBody");
if (firstRender)
{
JS.InvokeVoidSafe("scrollTo", 0, 0);
JS.InvokeVoidSafe("KTDialer.init");
JS.InvokeVoidSafe("KTDrawer.init");
JS.InvokeVoidSafe("KTMenu.init");
JS.InvokeVoidSafe("KTImageInput.init");
JS.InvokeVoidSafe("KTPasswordMeter.init");
JS.InvokeVoidSafe("KTScroll.init");
JS.InvokeVoidSafe("KTScrolltop.init");
JS.InvokeVoidSafe("KTSticky.init");
JS.InvokeVoidSafe("KTSwapper.init");
JS.InvokeVoidSafe("KTToggle.init");
JS.InvokeVoidSafe("KTMenu.updateByLinkAttribute", $"/{NavigationManager.ToBaseRelativePath(NavigationManager.Uri)}");
}
JS.InvokeVoidAsync("KTLayoutSearch.init");
JS.InvokeVoidAsync("KTAppSidebar.init");
}
protected override void OnInitialized()
{
NavigationManager.LocationChanged += OnLocationChanged;
}
private async void OnLocationChanged(object sender, LocationChangedEventArgs args)
{
await JS.InvokeVoidSafeAsync("scrollTo", 0, 0);
await JS.InvokeVoidSafeAsync("KTDrawer.createInstances");
await JS.InvokeVoidSafeAsync("KTMenu.createInstances");
await JS.InvokeVoidSafeAsync("KTImageInput.createInstances");
await JS.InvokeVoidSafeAsync("KTPasswordMeter.createInstances");
await JS.InvokeVoidSafeAsync("KTScroll.createInstances");
await JS.InvokeVoidSafeAsync("KTScrolltop.createInstances");
await JS.InvokeVoidSafeAsync("KTSticky.createInstances");
await JS.InvokeVoidSafeAsync("KTSwapper.createInstances");
await JS.InvokeVoidSafeAsync("KTToggle.createInstances");
await JS.InvokeVoidSafeAsync("KTMenu.updateByLinkAttribute", $"/{NavigationManager.ToBaseRelativePath(args.Location)}");
await JS.InvokeVoidSafeAsync("KTAppSidebar.init");
}
public void Dispose()
{
NavigationManager.LocationChanged -= OnLocationChanged;
}
}

View File

@@ -1,8 +1,10 @@
@page "/changelog" @page "/admin/changelog"
@using Moonlight.App.Services @using Moonlight.App.Services
@inject MoonlightService MoonlightService @inject MoonlightService MoonlightService
@attribute [PermissionRequired(nameof(Permissions.AdminChangelog))]
@{ @{
int i = 0; int i = 0;
} }

View File

@@ -4,6 +4,7 @@
@using Microsoft.EntityFrameworkCore @using Microsoft.EntityFrameworkCore
@using BlazorTable @using BlazorTable
@using Moonlight.App.Services @using Moonlight.App.Services
@using Moonlight.Shared.Components.Navigations
@inject DomainRepository DomainRepository @inject DomainRepository DomainRepository
@inject DomainService DomainService @inject DomainService DomainService
@@ -11,8 +12,9 @@
@attribute [PermissionRequired(nameof(Permissions.AdminDomains))] @attribute [PermissionRequired(nameof(Permissions.AdminDomains))]
<AdminDomainsNavigation Index="0" />
<LazyLoader @ref="LazyLoader" Load="Load"> <LazyLoader @ref="LazyLoader" Load="Load">
<div class="row">
<div class="card"> <div class="card">
<div class="card-header border-0 pt-5"> <div class="card-header border-0 pt-5">
<h3 class="card-title align-items-start flex-column"> <h3 class="card-title align-items-start flex-column">
@@ -60,7 +62,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</LazyLoader> </LazyLoader>
@code @code

View File

@@ -5,6 +5,7 @@
@using Moonlight.App.Database.Entities @using Moonlight.App.Database.Entities
@using Moonlight.App.Services.Interop @using Moonlight.App.Services.Interop
@using BlazorTable @using BlazorTable
@using Moonlight.Shared.Components.Navigations
@inject SharedDomainRepository SharedDomainRepository @inject SharedDomainRepository SharedDomainRepository
@inject SmartTranslateService SmartTranslateService @inject SmartTranslateService SmartTranslateService
@@ -14,18 +15,24 @@
@attribute [PermissionRequired(nameof(Permissions.AdminSharedDomains))] @attribute [PermissionRequired(nameof(Permissions.AdminSharedDomains))]
<AdminDomainsNavigation Index="1" />
<LazyLoader @ref="LazyLoader" Load="Load"> <LazyLoader @ref="LazyLoader" Load="Load">
<div class="card"> <div class="card">
<div class="card-header border-0 pt-5"> <div class="card-header border-0 pt-5">
<h3 class="card-title align-items-start flex-column"> <h3 class="card-title align-items-start flex-column">
<span class="card-label fw-bold fs-3 mb-1"> <span class="card-label fw-bold fs-3 mb-1">
<span><TL>Shared domains</TL></span> <span>
<TL>Shared domains</TL>
</span>
</span> </span>
</h3> </h3>
<div class="card-toolbar"> <div class="card-toolbar">
<a href="/admin/domains/shared/new" class="btn btn-sm btn-light-success"> <a href="/admin/domains/shared/new" class="btn btn-sm btn-light-success">
<i class="bx bx-layer-plus"></i> <i class="bx bx-layer-plus"></i>
<span><TL>Add shared domain</TL></span> <span>
<TL>Add shared domain</TL>
</span>
</a> </a>
</div> </div>
</div> </div>
@@ -44,7 +51,7 @@
</Table> </Table>
</div> </div>
</div> </div>
</LazyLoader> </LazyLoader>
@code @code
{ {

View File

@@ -4,12 +4,23 @@
@using Moonlight.App.Services.Background @using Moonlight.App.Services.Background
@using Moonlight.App.Services @using Moonlight.App.Services
@using BlazorTable @using BlazorTable
@using Microsoft.EntityFrameworkCore
@using Moonlight.App.ApiClients.Wings
@using Moonlight.App.Database.Entities @using Moonlight.App.Database.Entities
@using Moonlight.App.Events @using Moonlight.App.Events
@using Moonlight.App.Helpers
@using Moonlight.App.Models.Misc @using Moonlight.App.Models.Misc
@using Moonlight.App.Repositories
@using Moonlight.App.Services.Interop
@using Moonlight.App.Services.Sessions
@inject MalwareScanService MalwareScanService @inject MalwareBackgroundScanService MalwareBackgroundScanService
@inject SmartTranslateService SmartTranslateService @inject SmartTranslateService SmartTranslateService
@inject ServerService ServerService
@inject ToastService ToastService
@inject SessionServerService SessionServerService
@inject Repository<Server> ServerRepository
@inject Repository<User> UserRepository
@inject EventSystem Event @inject EventSystem Event
@implements IDisposable @implements IDisposable
@@ -22,15 +33,15 @@
<div class="col-12 col-lg-6"> <div class="col-12 col-lg-6">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
@if (MalwareScanService.IsRunning) @if (MalwareBackgroundScanService.IsRunning)
{ {
<span class="fs-3 spinner-border align-middle me-3"></span> <span class="fs-3 spinner-border align-middle me-3"></span>
} }
<span class="fs-3">@(MalwareScanService.Status)</span> <span class="fs-3">@(MalwareBackgroundScanService.Status)</span>
</div> </div>
<div class="card-footer"> <div class="card-footer">
@if (MalwareScanService.IsRunning) @if (MalwareBackgroundScanService.IsRunning)
{ {
<button class="btn btn-success disabled"> <button class="btn btn-success disabled">
<TL>Scan in progress</TL> <TL>Scan in progress</TL>
@@ -38,9 +49,9 @@
} }
else else
{ {
<div class="mb-3"> <div class="mb-5">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" id="scanAllServers" @bind="MalwareScanService.ScanAllServers"> <input class="form-check-input" type="checkbox" id="scanAllServers" @bind="MalwareBackgroundScanService.ScanAllServers">
<label class="form-check-label" for="scanAllServers"> <label class="form-check-label" for="scanAllServers">
<TL>Scan all servers</TL> <TL>Scan all servers</TL>
</label> </label>
@@ -48,8 +59,13 @@
</div> </div>
<WButton Text="@(SmartTranslateService.Translate("Start scan"))" <WButton Text="@(SmartTranslateService.Translate("Start scan"))"
CssClasses="btn-success" CssClasses="btn-success me-3"
OnClick="MalwareScanService.Start"> OnClick="Scan">
</WButton>
<WButton Text="@(SmartTranslateService.Translate("Purge page"))"
CssClasses="btn-danger"
OnClick="PurgeSelected">
</WButton> </WButton>
} }
</div> </div>
@@ -65,39 +81,14 @@
<div class="card-body"> <div class="card-body">
<LazyLoader @ref="LazyLoaderResults" Load="LoadResults"> <LazyLoader @ref="LazyLoaderResults" Load="LoadResults">
<div class="table-responsive"> <div class="table-responsive">
<Table TableItem="Server" Items="ScanResults.Keys" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted"> <Table @ref="Table" TableItem="Server" Items="ScanResults.Keys" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted">
<Column TableItem="Server" Title="@(SmartTranslateService.Translate("Server"))" Field="@(x => x.Id)" Sortable="false" Filterable="false"> <Column TableItem="Server" Title="@(SmartTranslateService.Translate("Server"))" Field="@(x => x.Id)" Sortable="false" Filterable="false">
<Template> <Template>
<a href="/server/@(context.Uuid)">@(context.Name)</a> <a href="/server/@(context.Uuid)">@(context.Name)</a>
</Template> </Template>
</Column> </Column>
<Column TableItem="Server" Title="@(SmartTranslateService.Translate("Results"))" Field="@(x => x.Id)" Sortable="false" Filterable="false"> <Column TableItem="Server" Title="@(SmartTranslateService.Translate("Title"))" Field="@(x => ScanResults[x].Title)" Sortable="false" Filterable="true" />
<Template> <Column TableItem="Server" Title="@(SmartTranslateService.Translate("Description"))" Field="@(x => ScanResults[x].Description)" Sortable="false" Filterable="true" />
<div class="row">
@foreach (var result in ScanResults[context])
{
<div class="col-12 col-md-6 p-3">
<div class="accordion" id="scanResult@(result.GetHashCode())">
<div class="accordion-item">
<h2 class="accordion-header" id="scanResult-header@(result.GetHashCode())">
<button class="accordion-button fs-4 fw-semibold collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#scanResult-body@(result.GetHashCode())" aria-expanded="false" aria-controls="scanResult-body@(result.GetHashCode())">
<span>@(result.Title)</span>
</button>
</h2>
<div id="scanResult-body@(result.GetHashCode())" class="accordion-collapse collapse" aria-labelledby="scanResult-header@(result.GetHashCode())" data-bs-parent="#scanResult">
<div class="accordion-body">
<p>
@(result.Description)
</p>
</div>
</div>
</div>
</div>
</div>
}
</div>
</Template>
</Column>
<Pager ShowPageNumber="true" ShowTotalCount="true"/> <Pager ShowPageNumber="true" ShowTotalCount="true"/>
</Table> </Table>
</div> </div>
@@ -109,7 +100,9 @@
@code @code
{ {
private readonly Dictionary<Server, MalwareScanResult[]> ScanResults = new(); private readonly Dictionary<Server, MalwareScanResult> ScanResults = new();
private Table<Server> Table;
private LazyLoader LazyLoaderResults; private LazyLoader LazyLoaderResults;
@@ -117,16 +110,27 @@
{ {
await Event.On<Object>("malwareScan.status", this, async o => { await InvokeAsync(StateHasChanged); }); await Event.On<Object>("malwareScan.status", this, async o => { await InvokeAsync(StateHasChanged); });
await Event.On<Object>("malwareScan.result", this, async o => { await LazyLoaderResults.Reload(); }); await Event.On<Server?>("malwareScan.result", this, async server =>
{
lock (MalwareBackgroundScanService.ScanResults)
{
if (server == null)
return;
ScanResults.Add(server, MalwareBackgroundScanService.ScanResults[server]);
}
await InvokeAsync(StateHasChanged);
});
} }
private Task LoadResults(LazyLoader arg) private Task LoadResults(LazyLoader arg)
{ {
ScanResults.Clear(); ScanResults.Clear();
lock (MalwareScanService.ScanResults) lock (MalwareBackgroundScanService.ScanResults)
{ {
foreach (var result in MalwareScanService.ScanResults) foreach (var result in MalwareBackgroundScanService.ScanResults)
{ {
ScanResults.Add(result.Key, result.Value); ScanResults.Add(result.Key, result.Value);
} }
@@ -140,4 +144,76 @@
await Event.Off("malwareScan.status", this); await Event.Off("malwareScan.status", this);
await Event.Off("malwareScan.result", this); await Event.Off("malwareScan.result", this);
} }
private async Task PurgeSelected()
{
int users = 0;
int servers = 0;
int allServersCount = Table.FilteredItems.Count();
int position = 0;
await ToastService.CreateProcessToast("purgeProcess", "Purging");
foreach (var item in Table.FilteredItems)
{
position++;
if (item == null)
continue;
try
{
var server = ServerRepository.Get()
.Include(x => x.Owner)
.FirstOrDefault(x => x.Id == item.Id);
if(server == null)
continue;
await ToastService.UpdateProcessToast("purgeProcess", $"[{position}/{allServersCount}] {server.Name}");
ScanResults.Remove(item);
await InvokeAsync(StateHasChanged);
// Owner
server.Owner.Status = UserStatus.Banned;
UserRepository.Update(server.Owner);
users++;
try
{
await SessionServerService.ReloadUserSessions(server.Owner);
}
catch (Exception) {/* Ignored */}
// Server itself
await ServerService.SetPowerState(server, PowerSignal.Kill);
await ServerService.Delete(server);
servers++;
}
catch (Exception e)
{
Logger.Warn($"Error purging server: {item.Uuid}");
Logger.Warn(e);
await ToastService.Error(
$"Failed to purge server '{item.Name}': {e.Message}"
);
}
}
await ToastService.RemoveProcessToast("purgeProcess");
await ToastService.Success($"Successfully purged {servers} servers by {users} users");
}
private async Task Scan()
{
ScanResults.Clear();
await InvokeAsync(StateHasChanged);
await MalwareBackgroundScanService.Start();
}
} }

View File

@@ -229,7 +229,7 @@
{ {
try try
{ {
await ServerService.Create(Model.Name, Model.Cpu, Model.Memory, Model.Disk, Model.Owner, Model.Image, Model.Node, server => var newServer = await ServerService.Create(Model.Name, Model.Cpu, Model.Memory, Model.Disk, Model.Owner, Model.Image, Model.Node, server =>
{ {
server.OverrideStartup = Model.OverrideStartup; server.OverrideStartup = Model.OverrideStartup;
server.DockerImageIndex = Model.DockerImageIndex; server.DockerImageIndex = Model.DockerImageIndex;
@@ -242,7 +242,7 @@
}); });
await ToastService.Success(SmartTranslateService.Translate("Server successfully created")); await ToastService.Success(SmartTranslateService.Translate("Server successfully created"));
NavigationManager.NavigateTo("/admin/servers"); NavigationManager.NavigateTo($"/server/{newServer.Uuid}");
} }
catch (DisplayException e) catch (DisplayException e)
{ {

View File

@@ -1,21 +1,27 @@
@using Moonlight.App.Database.Entities @using Moonlight.App.Database.Entities
@using Moonlight.App.Services @using Moonlight.App.Services
@using Moonlight.App.Services.Interop
@inject ServerService ServerService @inject ServerService ServerService
@inject SmartTranslateService SmartTranslateService @inject SmartTranslateService SmartTranslateService
@inject MalwareScanService MalwareScanService
@inject AlertService AlertService
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<TL>Reinstall</TL> <TL>Actions</TL>
</span> </span>
</div> </div>
<div class="card-footer"> <div class="card-footer">
<WButton Text="@(SmartTranslateService.Translate("Reinstall"))" <WButton Text="@(SmartTranslateService.Translate("Reinstall"))"
WorkingText="@(SmartTranslateService.Translate("Reinstalling"))" WorkingText="@(SmartTranslateService.Translate("Reinstalling"))" CssClasses="btn-warning"
CssClasses="btn-warning"
OnClick="Reinstall"> OnClick="Reinstall">
</WButton> </WButton>
<WButton Text="@(SmartTranslateService.Translate("Scan for malware"))"
WorkingText="@(SmartTranslateService.Translate("Scanning"))" CssClasses="btn-primary ms-3"
OnClick="Scan">
</WButton>
</div> </div>
</div> </div>
@@ -28,4 +34,14 @@
{ {
await ServerService.Reinstall(Server!); await ServerService.Reinstall(Server!);
} }
private async Task Scan()
{
var result = await MalwareScanService.Perform(Server);
if (result == null)
await AlertService.Success(SmartTranslateService.Translate("No malware found on this server"));
else
await AlertService.Warning(result.Title, result.Description);
}
} }

View File

@@ -6,13 +6,16 @@
@using ApexCharts @using ApexCharts
@using Moonlight.App.Helpers @using Moonlight.App.Helpers
@using Moonlight.App.Services @using Moonlight.App.Services
@using Moonlight.Shared.Components.Navigations
@inject StatisticsViewService StatisticsViewService @inject StatisticsViewService StatisticsViewService
@inject SmartTranslateService SmartTranslateService @inject SmartTranslateService SmartTranslateService
@attribute [PermissionRequired(nameof(Permissions.AdminStatistics))] @attribute [PermissionRequired(nameof(Permissions.AdminStatistics))]
<div class="row mt-4 mb-2"> <AdminStatisticsNavigation Index="0" />
<div class="row mb-2">
<div class="col-12 col-lg-6 col-xl"> <div class="col-12 col-lg-6 col-xl">
<div class="card card-body"> <div class="card card-body">
<select class="form-select" @bind="TimeSpanBind"> <select class="form-select" @bind="TimeSpanBind">

View File

@@ -0,0 +1,204 @@
@page "/admin/statistics/live"
@using Moonlight.App.Services
@using Moonlight.App.Repositories
@using Moonlight.App.Database.Entities
@using Moonlight.App.Helpers
@using Moonlight.App.Services.Sessions
@using Moonlight.Shared.Components.Navigations
@inject NodeService NodeService
@inject Repository<Node> NodeRepository
@inject IServiceScopeFactory ServiceScopeFactory
@attribute [PermissionRequired(nameof(Permissions.AdminStatisticsLive))]
<AdminStatisticsNavigation Index="1" />
<div class="row">
<div class="col-12 col-md-3 mb-3">
<div class="card">
<div class="card-header pt-5">
<div class="card-title d-flex flex-column">
<span class="fs-2hx fw-bold text-white me-2 lh-1 ls-n2">@(Math.Round(TotalCpuUsed, 2))% / 100%</span>
<span class="text-white opacity-75 pt-1 fw-semibold fs-6">
<TL>Total cpu load</TL>
</span>
</div>
</div>
<div class="card-body d-flex align-items-end pt-0">
<div class="d-flex align-items-center flex-column mt-3 w-100">
@{
var cpuPercent = Math.Round(Formatter.CalculatePercentage(TotalCpuUsed, 100));
}
<div class="d-flex justify-content-end fw-bold fs-6 text-white opacity-75 w-100 mt-auto mb-2">
<span>@(cpuPercent)%</span>
</div>
<div class="h-8px mx-3 w-100 bg-white bg-opacity-50 rounded">
<div class="bg-@(GetStateColor(cpuPercent)) rounded h-8px" role="progressbar" style="width: @(cpuPercent)%;" aria-valuenow="@(cpuPercent)" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-3 mb-3">
<div class="card">
<div class="card-header pt-5">
<div class="card-title d-flex flex-column">
<span class="fs-2hx fw-bold text-white me-2 lh-1 ls-n2">@(ByteSizeValue.FromKiloBytes(TotalMemoryUsed).GigaBytes)GB / @(ByteSizeValue.FromKiloBytes(TotalMemory).GigaBytes)GB</span>
<span class="text-white opacity-75 pt-1 fw-semibold fs-6">
<TL>Total memory load</TL>
</span>
</div>
</div>
<div class="card-body d-flex align-items-end pt-0">
<div class="d-flex align-items-center flex-column mt-3 w-100">
@{
var memoryPercent = Math.Round(Formatter.CalculatePercentage(TotalMemoryUsed, TotalMemory));
}
<div class="d-flex justify-content-end fw-bold fs-6 text-white opacity-75 w-100 mt-auto mb-2">
<span>@(memoryPercent)%</span>
</div>
<div class="h-8px mx-3 w-100 bg-white bg-opacity-50 rounded">
<div class="bg-@(GetStateColor(memoryPercent)) rounded h-8px" role="progressbar" style="width: @(memoryPercent)%;" aria-valuenow="@(memoryPercent)" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-3 mb-3">
<div class="card">
<div class="card-body pt-5">
<div class="card-title d-flex flex-column">
<span class="fs-2hx fw-bold text-white me-2 lh-1 ls-n2">@(Users)</span>
<span class="text-white opacity-75 pt-1 fw-semibold fs-6">
<TL>Total user count</TL>
</span>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-3 mb-3">
<div class="card">
<div class="card-body pt-5">
<div class="card-title d-flex flex-column">
<span class="fs-2hx fw-bold text-white me-2 lh-1 ls-n2">@(Sessions)</span>
<span class="text-white opacity-75 pt-1 fw-semibold fs-6">
<TL>Total session count</TL>
</span>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-3 mb-3">
<div class="card">
<div class="card-body pt-5">
<div class="card-title d-flex flex-column">
<span class="fs-2hx fw-bold text-white me-2 lh-1 ls-n2">@(ActiveUsers)</span>
<span class="text-white opacity-75 pt-1 fw-semibold fs-6">
<TL>Total active user count</TL>
</span>
</div>
</div>
</div>
</div>
</div>
@code
{
private long TotalMemoryUsed;
private long TotalMemory;
private double TotalCpuUsed;
private int Users;
private int ActiveUsers;
private int Sessions;
protected override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
Task.Run(async () =>
{
while (true)
{
await Monitor();
await Task.Delay(TimeSpan.FromSeconds(5));
}
});
}
return Task.CompletedTask;
}
private async Task Monitor()
{
async Task Nodes()
{
TotalMemory = 0;
TotalMemoryUsed = 0;
var cpuValues = new List<double>();
foreach (var node in NodeRepository.Get().ToArray())
{
try
{
var metrics = await NodeService.GetMemoryMetrics(node);
TotalMemory += metrics.Total;
TotalMemoryUsed += metrics.Used;
var cpuMetrics = await NodeService.GetCpuMetrics(node);
cpuValues.Add(cpuMetrics.CpuUsage);
}
catch (Exception)
{
// ignored
}
}
TotalCpuUsed = Formatter.CalculateAverage(cpuValues);
await InvokeAsync(StateHasChanged);
}
async Task UsersAndSessions()
{
using var scope = ServiceScopeFactory.CreateScope();
var userRepo = scope.ServiceProvider.GetRequiredService<Repository<User>>();
var sessionService = scope.ServiceProvider.GetRequiredService<SessionServerService>();
Users = userRepo.Get().Count();
Sessions = (await sessionService.GetSessions()).Length;
ActiveUsers = userRepo
.Get()
.Count(x => x.LastVisitedAt > DateTime.UtcNow.AddDays(-1));
await InvokeAsync(StateHasChanged);
}
await Nodes();
await UsersAndSessions();
}
private string GetStateColor(double percent)
{
if (percent < 60)
return "success";
else if (percent >= 60 && percent < 80)
return "warning";
else
return "danger";
}
}

View File

@@ -1,379 +1,278 @@
@page "/admin/support" @page "/admin/support"
@page "/admin/support/{Id:int}" @using Moonlight.App.Repositories
@using Moonlight.App.Services.Tickets
@using Moonlight.App.Database.Entities @using Moonlight.App.Database.Entities
@using Moonlight.App.Events
@using Moonlight.App.Helpers
@using Moonlight.App.Models.Misc @using Moonlight.App.Models.Misc
@using Microsoft.EntityFrameworkCore
@using BlazorTable
@using Moonlight.App.Helpers
@using Moonlight.App.Services @using Moonlight.App.Services
@using Moonlight.App.Services.Sessions @using Moonlight.App.Services.Sessions
@using Moonlight.Shared.Components.Tickets
@inject TicketAdminService AdminService @inject Repository<Ticket> TicketRepository
@inject SmartTranslateService SmartTranslateService @inject SmartTranslateService SmartTranslateService
@inject EventSystem EventSystem
@inject IdentityService IdentityService @inject IdentityService IdentityService
@attribute [PermissionRequired(nameof(Permissions.AdminSupport))] @attribute [PermissionRequired(nameof(Permissions.AdminSupport))]
@implements IDisposable <div class="row mb-5">
<LazyLoader Load="LoadStatistics">
<div class="d-flex flex-column flex-lg-row"> <div class="col-12 col-lg-6 col-xl">
<div class="flex-column flex-lg-row-auto w-100 w-lg-300px w-xl-400px mb-10 mb-lg-0"> <div class="mt-4 card">
<div class="card card-flush"> <div class="card-body">
<div class="card-body pt-5"> <div class="row align-items-center gx-0">
<div class="scroll-y me-n5 pe-5 h-200px h-lg-auto" data-kt-scroll="true" data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto" data-kt-scroll-dependencies="#kt_header, #kt_app_header, #kt_toolbar, #kt_app_toolbar, #kt_footer, #kt_app_footer, #kt_chat_contacts_header" data-kt-scroll-wrappers="#kt_content, #kt_app_content, #kt_chat_contacts_body" data-kt-scroll-offset="5px" style="max-height: 601px;"> <div class="col">
<div class="separator separator-content border-primary mb-10 mt-5"> <h6 class="text-uppercase text-muted mb-2">
<span class="w-250px fw-bold fs-5"> <TL>Total Tickets</TL>
</h6>
<span class="h2 mb-0">
@(TotalTicketCount)
</span>
</div>
<div class="col-auto">
<span class="h2 text-muted mb-0">
<i class="text-primary bx bx-purchase-tag bx-lg"></i>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 col-xl">
<div class="mt-4 card">
<div class="card-body">
<div class="row align-items-center gx-0">
<div class="col">
<h6 class="text-uppercase text-muted mb-2">
<TL>Unassigned tickets</TL> <TL>Unassigned tickets</TL>
</h6>
<span class="h2 mb-0">
@(UnAssignedTicketCount)
</span> </span>
</div> </div>
<div class="col-auto">
@foreach (var ticket in UnAssignedTickets) <span class="h2 text-muted mb-0">
{ <i class="text-primary bx bxs-bell-ring bx-lg"></i>
<div class="d-flex flex-stack py-4">
<div class="d-flex align-items-center">
<div class="ms-5">
<a href="/admin/support/@(ticket.Key.Id)" class="fs-5 fw-bold text-gray-900 text-hover-primary mb-2">@(ticket.Key.IssueTopic)</a>
@if (ticket.Value != null)
{
<div class="fw-semibold text-muted">
@(ticket.Value.Content)
</div>
}
</div>
</div>
<div class="d-flex flex-column align-items-end ms-2">
@if (ticket.Value != null)
{
<span class="text-muted fs-7 mb-1">
@(Formatter.FormatAgoFromDateTime(ticket.Value.CreatedAt, SmartTranslateService))
</span>
}
</div>
</div>
if (ticket.Key != UnAssignedTickets.Last().Key)
{
<div class="separator"></div>
}
}
@if (AssignedTickets.Any())
{
<div class="separator separator-content border-primary mb-5 mt-8">
<span class="w-250px fw-bold fs-5">
<TL>Assigned tickets</TL>
</span> </span>
</div> </div>
}
@foreach (var ticket in AssignedTickets)
{
<div class="d-flex flex-stack py-4">
<div class="d-flex align-items-center">
<div class="ms-5">
<a href="/admin/support/@(ticket.Key.Id)" class="fs-5 fw-bold text-gray-900 text-hover-primary mb-2">@(ticket.Key.IssueTopic)</a>
@if (ticket.Value != null)
{
<div class="fw-semibold text-muted">
@(ticket.Value.Content)
</div>
}
</div> </div>
</div> </div>
<div class="d-flex flex-column align-items-end ms-2"> </div>
@if (ticket.Value != null) </div>
{ <div class="col-12 col-lg-6 col-xl">
<span class="text-muted fs-7 mb-1"> <div class="mt-4 card">
@(Formatter.FormatAgoFromDateTime(ticket.Value.CreatedAt, SmartTranslateService)) <div class="card-body">
<div class="row align-items-center gx-0">
<div class="col">
<h6 class="text-uppercase text-muted mb-2">
<TL>Pending tickets</TL>
</h6>
<span class="h2 mb-0">
@(PendingTicketCount)
</span> </span>
}
</div> </div>
</div> <div class="col-auto">
<span class="h2 text-muted mb-">
if (ticket.Key != AssignedTickets.Last().Key) <i class="text-primary bx bx-hourglass bx-lg"></i>
{ </span>
<div class="separator"></div>
}
}
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
<div class="col-12 col-lg-6 col-xl">
<div class="mt-4 card">
<div class="card-body">
<div class="row align-items-center gx-0">
<div class="col">
<h6 class="text-uppercase text-muted mb-2">
<TL>Closed tickets</TL>
</h6>
<span class="h2 mb-0">
@(ClosedTicketCount)
</span>
</div>
<div class="col-auto">
<span class="h2 text-muted mb-">
<i class="text-primary bx bx-lock bx-lg"></i>
</span>
</div>
</div>
</div>
</div>
</div>
</LazyLoader>
</div> </div>
<div class="flex-lg-row-fluid ms-lg-7 ms-xl-10">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
@if (AdminService.Ticket != null) <span class="card-title">
{ <TL>Ticket overview</TL>
<div class="card-title">
<div class="d-flex justify-content-center flex-column me-3">
<span class="fs-3 fw-bold text-gray-900 me-1 mb-2 lh-1">@(AdminService.Ticket.IssueTopic)</span>
<div class="mb-0 lh-1">
<span class="fs-6 fw-bold text-muted me-2">
<TL>Status</TL>
</span> </span>
@switch (AdminService.Ticket.Status)
{
case TicketStatus.Closed:
<span class="badge badge-danger badge-circle w-10px h-10px me-1"></span>
break;
case TicketStatus.Open:
<span class="badge badge-success badge-circle w-10px h-10px me-1"></span>
break;
case TicketStatus.Pending:
<span class="badge badge-warning badge-circle w-10px h-10px me-1"></span>
break;
case TicketStatus.WaitingForUser:
<span class="badge badge-primary badge-circle w-10px h-10px me-1"></span>
break;
}
<span class="fs-6 fw-semibold text-muted me-5">@(AdminService.Ticket.Status)</span>
<span class="fs-6 fw-bold text-muted me-2">
<TL>Priority</TL>
</span>
@switch (AdminService.Ticket.Priority)
{
case TicketPriority.Low:
<span class="badge badge-success badge-circle w-10px h-10px me-1"></span>
break;
case TicketPriority.Medium:
<span class="badge badge-primary badge-circle w-10px h-10px me-1"></span>
break;
case TicketPriority.High:
<span class="badge badge-warning badge-circle w-10px h-10px me-1"></span>
break;
case TicketPriority.Critical:
<span class="badge badge-danger badge-circle w-10px h-10px me-1"></span>
break;
}
<span class="fs-6 fw-semibold text-muted">@(AdminService.Ticket.Priority)</span>
</div>
</div>
</div>
<div class="card-toolbar"> <div class="card-toolbar">
<div class="input-group"> <div class="btn-group">
<div class="me-3"> <WButton Text="@(SmartTranslateService.Translate("Overview"))" CssClasses="btn-secondary" OnClick="() => UpdateFilter(0)" />
@if (AdminService.Ticket!.AssignedTo == null) <WButton Text="@(SmartTranslateService.Translate("Unassigned tickets"))" CssClasses="btn-secondary" OnClick="() => UpdateFilter(1)" />
{ <WButton Text="@(SmartTranslateService.Translate("My tickets"))" CssClasses="btn-secondary" OnClick="() => UpdateFilter(2)" />
<WButton Text="@(SmartTranslateService.Translate("Claim"))" OnClick="AdminService.Claim"/> <WButton Text="@(SmartTranslateService.Translate("All tickets"))" CssClasses="btn-secondary" OnClick="() => UpdateFilter(3)" />
}
else
{
<WButton Text="@(SmartTranslateService.Translate("Unclaim"))" OnClick="AdminService.UnClaim"/>
}
</div>
<select @bind="Priority" class="form-select rounded-start">
@foreach (var priority in (TicketPriority[])Enum.GetValues(typeof(TicketPriority)))
{
if (Priority == priority)
{
<option value="@(priority)" selected="">@(priority)</option>
}
else
{
<option value="@(priority)">@(priority)</option>
}
}
</select>
<WButton Text="@(SmartTranslateService.Translate("Update priority"))"
CssClasses="btn-primary"
OnClick="UpdatePriority">
</WButton>
<select @bind="Status" class="form-select">
@foreach (var status in (TicketStatus[])Enum.GetValues(typeof(TicketStatus)))
{
if (Status == status)
{
<option value="@(status)" selected="">@(status)</option>
}
else
{
<option value="@(status)">@(status)</option>
}
}
</select>
<WButton Text="@(SmartTranslateService.Translate("Update status"))"
CssClasses="btn-primary"
OnClick="UpdateStatus">
</WButton>
</div> </div>
</div> </div>
}
else
{
<div class="card-title">
<div class="d-flex justify-content-center flex-column me-3">
<span class="fs-4 fw-bold text-gray-900 me-1 mb-2 lh-1">
</span>
</div>
</div>
}
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="scroll-y me-n5 pe-5" style="max-height: 55vh; display: flex; flex-direction: column-reverse;"> <LazyLoader @ref="TicketLazyLoader" Load="LoadTickets">
@if (AdminService.Ticket == null) <div class="table-responsive">
<Table TableItem="Ticket" Items="AllTickets" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted">
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Id"))" Field="@(x => x.Id)" Filterable="true" Sortable="true"/>
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Assigned to"))" Field="@(x => x.AssignedTo)" Filterable="true" Sortable="true">
<Template>
<span>@(context.AssignedTo == null ? "None" : context.AssignedTo.FirstName + " " + context.AssignedTo.LastName)</span>
</Template>
</Column>
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Ticket title"))" Field="@(x => x.IssueTopic)" Filterable="true" Sortable="false"/>
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("User"))" Field="@(x => x.CreatedBy)" Filterable="true" Sortable="true">
<Template>
<span>@(context.CreatedBy.FirstName) @(context.CreatedBy.LastName)</span>
</Template>
</Column>
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Created at"))" Field="@(x => x.CreatedAt)" Filterable="true" Sortable="true">
<Template>
<span>@(Formatter.FormatDate(context.CreatedAt))</span>
</Template>
</Column>
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Priority"))" Field="@(x => x.Priority)" Filterable="true" Sortable="true">
<Template>
@switch (context.Priority)
{ {
case TicketPriority.Low:
<span class="badge bg-success">@(context.Priority)</span>
break;
case TicketPriority.Medium:
<span class="badge bg-primary">@(context.Priority)</span>
break;
case TicketPriority.High:
<span class="badge bg-warning">@(context.Priority)</span>
break;
case TicketPriority.Critical:
<span class="badge bg-danger">@(context.Priority)</span>
break;
} }
else </Template>
</Column>
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Status"))" Field="@(x => x.Status)" Filterable="true" Sortable="true">
<Template>
@switch (context.Status)
{ {
<TicketMessageView Messages="Messages" ViewAsSupport="true"/> case TicketStatus.Closed:
<span class="badge bg-danger">@(context.Status)</span>
break;
case TicketStatus.Open:
<span class="badge bg-success">@(context.Status)</span>
break;
case TicketStatus.Pending:
<span class="badge bg-warning">@(context.Status)</span>
break;
case TicketStatus.WaitingForUser:
<span class="badge bg-primary">@(context.Status)</span>
break;
} }
</Template>
</Column>
<Column TableItem="Ticket" Title="" Field="@(x => x.Id)" Filterable="false" Sortable="false">
<Template>
<a class="btn btn-sm btn-primary" href="/admin/support/view/@(context.Id)">
<TL>Open</TL>
</a>
</Template>
</Column>
<Pager ShowPageNumber="true" ShowTotalCount="true"/>
</Table>
</div> </div>
</LazyLoader>
</div> </div>
@if (AdminService.Ticket != null)
{
<div class="card-footer pt-4" id="kt_chat_messenger_footer">
<div class="d-flex flex-stack">
<table class="w-100">
<tr>
<td class="align-top">
<SmartFileSelect @ref="FileSelect"></SmartFileSelect>
</td>
<td class="w-100">
<textarea @bind="MessageText" class="form-control mb-3 form-control-flush" rows="1" placeholder="@(SmartTranslateService.Translate("Type a message"))"></textarea>
</td>
<td class="align-top">
<WButton Text="@(SmartTranslateService.Translate("Send"))"
WorkingText="@(SmartTranslateService.Translate("Sending"))"
CssClasses="btn-primary ms-2"
OnClick="SendMessage">
</WButton>
</td>
</tr>
</table>
</div>
</div>
}
</div>
</div>
</div> </div>
@code @code
{ {
[Parameter] private int TotalTicketCount;
public int Id { get; set; } private int UnAssignedTicketCount;
private int PendingTicketCount;
private int ClosedTicketCount;
private Dictionary<Ticket, TicketMessage?> AssignedTickets; private Ticket[] AllTickets;
private Dictionary<Ticket, TicketMessage?> UnAssignedTickets; private int Filter = 0;
private List<TicketMessage> Messages = new();
private string MessageText;
private SmartFileSelect FileSelect;
private TicketPriority Priority; private LazyLoader TicketLazyLoader;
private TicketStatus Status;
protected override async Task OnParametersSetAsync() private Task LoadStatistics(LazyLoader _)
{ {
await Unsubscribe(); TotalTicketCount = TicketRepository
await ReloadTickets(); .Get()
await Subscribe(); .Count();
await InvokeAsync(StateHasChanged); UnAssignedTicketCount = TicketRepository
.Get()
.Include(x => x.AssignedTo)
.Where(x => x.Status != TicketStatus.Closed)
.Count(x => x.AssignedTo == null);
PendingTicketCount = TicketRepository
.Get()
.Include(x => x.AssignedTo)
.Where(x => x.AssignedTo != null)
.Count(x => x.Status != TicketStatus.Closed);
ClosedTicketCount = TicketRepository
.Get()
.Count(x => x.Status == TicketStatus.Closed);
return Task.CompletedTask;
} }
private async Task UpdatePriority() private Task LoadTickets(LazyLoader _)
{ {
await AdminService.UpdatePriority(Priority); switch (Filter)
{
default:
AllTickets = TicketRepository
.Get()
.Include(x => x.CreatedBy)
.Include(x => x.AssignedTo)
.Where(x => x.Status != TicketStatus.Closed)
.ToArray();
break;
case 1:
AllTickets = TicketRepository
.Get()
.Include(x => x.CreatedBy)
.Include(x => x.AssignedTo)
.Where(x => x.AssignedTo == null)
.Where(x => x.Status != TicketStatus.Closed)
.ToArray();
break;
case 2:
AllTickets = TicketRepository
.Get()
.Include(x => x.CreatedBy)
.Include(x => x.AssignedTo)
.Where(x => x.AssignedTo != null)
.Where(x => x.AssignedTo!.Id == IdentityService.User.Id)
.Where(x => x.Status != TicketStatus.Closed)
.ToArray();
break;
case 3:
AllTickets = TicketRepository
.Get()
.Include(x => x.CreatedBy)
.Include(x => x.AssignedTo)
.ToArray();
break;
} }
private async Task UpdateStatus() return Task.CompletedTask;
{
await AdminService.UpdateStatus(Status);
} }
private async Task SendMessage() private async Task UpdateFilter(int filterId)
{ {
if (string.IsNullOrEmpty(MessageText) && FileSelect.SelectedFile != null) Filter = filterId;
MessageText = "File upload"; await TicketLazyLoader.Reload();
if (string.IsNullOrEmpty(MessageText))
return;
var msg = await AdminService.Send(MessageText, FileSelect.SelectedFile);
Messages.Add(msg);
MessageText = "";
FileSelect.SelectedFile = null;
await InvokeAsync(StateHasChanged);
}
private async Task Subscribe()
{
await EventSystem.On<Ticket>("tickets.new", this, async _ =>
{
await ReloadTickets(false);
await InvokeAsync(StateHasChanged);
});
if (AdminService.Ticket != null)
{
await EventSystem.On<TicketMessage>($"tickets.{AdminService.Ticket.Id}.message", this, async message =>
{
if (message.Sender != null && message.Sender.Id == IdentityService.User.Id && message.IsSupportMessage)
return;
Messages.Add(message);
await InvokeAsync(StateHasChanged);
});
await EventSystem.On<Ticket>($"tickets.{AdminService.Ticket.Id}.status", this, async _ =>
{
await ReloadTickets(false);
await InvokeAsync(StateHasChanged);
});
}
}
private async Task Unsubscribe()
{
await EventSystem.Off("tickets.new", this);
if (AdminService.Ticket != null)
{
await EventSystem.Off($"tickets.{AdminService.Ticket.Id}.message", this);
await EventSystem.Off($"tickets.{AdminService.Ticket.Id}.status", this);
}
}
private async Task ReloadTickets(bool reloadMessages = true)
{
AdminService.Ticket = null;
AssignedTickets = await AdminService.GetAssigned();
UnAssignedTickets = await AdminService.GetUnAssigned();
if (Id != 0)
{
AdminService.Ticket = AssignedTickets
.FirstOrDefault(x => x.Key.Id == Id)
.Key ?? null;
if (AdminService.Ticket == null)
{
AdminService.Ticket = UnAssignedTickets
.FirstOrDefault(x => x.Key.Id == Id)
.Key ?? null;
}
if (AdminService.Ticket == null)
return;
Status = AdminService.Ticket.Status;
Priority = AdminService.Ticket.Priority;
if (reloadMessages)
{
var msgs = await AdminService.GetMessages();
Messages = msgs.ToList();
}
}
}
public async void Dispose()
{
await Unsubscribe();
} }
} }

View File

@@ -0,0 +1,379 @@
@page "/old_admin/support"
@page "/old_admin/support/{Id:int}"
@using Moonlight.App.Services.Tickets
@using Moonlight.App.Database.Entities
@using Moonlight.App.Events
@using Moonlight.App.Helpers
@using Moonlight.App.Models.Misc
@using Moonlight.App.Services
@using Moonlight.App.Services.Sessions
@using Moonlight.Shared.Components.Tickets
@inject TicketAdminService AdminService
@inject SmartTranslateService SmartTranslateService
@inject EventSystem EventSystem
@inject IdentityService IdentityService
@attribute [PermissionRequired(nameof(Permissions.AdminSupport))]
@implements IDisposable
<div class="d-flex flex-column flex-lg-row">
<div class="flex-column flex-lg-row-auto w-100 w-lg-300px w-xl-400px mb-10 mb-lg-0">
<div class="card card-flush">
<div class="card-body pt-5">
<div class="scroll-y me-n5 pe-5 h-200px h-lg-auto" data-kt-scroll="true" data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto" data-kt-scroll-dependencies="#kt_header, #kt_app_header, #kt_toolbar, #kt_app_toolbar, #kt_footer, #kt_app_footer, #kt_chat_contacts_header" data-kt-scroll-wrappers="#kt_content, #kt_app_content, #kt_chat_contacts_body" data-kt-scroll-offset="5px" style="max-height: 601px;">
<div class="separator separator-content border-primary mb-10 mt-5">
<span class="w-250px fw-bold fs-5">
<TL>Unassigned tickets</TL>
</span>
</div>
@foreach (var ticket in UnAssignedTickets)
{
<div class="d-flex flex-stack py-4">
<div class="d-flex align-items-center">
<div class="ms-5">
<a href="/admin/support/@(ticket.Key.Id)" class="fs-5 fw-bold text-gray-900 text-hover-primary mb-2">@(ticket.Key.IssueTopic)</a>
@if (ticket.Value != null)
{
<div class="fw-semibold text-muted">
@(ticket.Value.Content)
</div>
}
</div>
</div>
<div class="d-flex flex-column align-items-end ms-2">
@if (ticket.Value != null)
{
<span class="text-muted fs-7 mb-1">
@(Formatter.FormatAgoFromDateTime(ticket.Value.CreatedAt, SmartTranslateService))
</span>
}
</div>
</div>
if (ticket.Key != UnAssignedTickets.Last().Key)
{
<div class="separator"></div>
}
}
@if (AssignedTickets.Any())
{
<div class="separator separator-content border-primary mb-5 mt-8">
<span class="w-250px fw-bold fs-5">
<TL>Assigned tickets</TL>
</span>
</div>
}
@foreach (var ticket in AssignedTickets)
{
<div class="d-flex flex-stack py-4">
<div class="d-flex align-items-center">
<div class="ms-5">
<a href="/admin/support/@(ticket.Key.Id)" class="fs-5 fw-bold text-gray-900 text-hover-primary mb-2">@(ticket.Key.IssueTopic)</a>
@if (ticket.Value != null)
{
<div class="fw-semibold text-muted">
@(ticket.Value.Content)
</div>
}
</div>
</div>
<div class="d-flex flex-column align-items-end ms-2">
@if (ticket.Value != null)
{
<span class="text-muted fs-7 mb-1">
@(Formatter.FormatAgoFromDateTime(ticket.Value.CreatedAt, SmartTranslateService))
</span>
}
</div>
</div>
if (ticket.Key != AssignedTickets.Last().Key)
{
<div class="separator"></div>
}
}
</div>
</div>
</div>
</div>
<div class="flex-lg-row-fluid ms-lg-7 ms-xl-10">
<div class="card">
<div class="card-header">
@if (AdminService.Ticket != null)
{
<div class="card-title">
<div class="d-flex justify-content-center flex-column me-3">
<span class="fs-3 fw-bold text-gray-900 me-1 mb-2 lh-1">@(AdminService.Ticket.IssueTopic)</span>
<div class="mb-0 lh-1">
<span class="fs-6 fw-bold text-muted me-2">
<TL>Status</TL>
</span>
@switch (AdminService.Ticket.Status)
{
case TicketStatus.Closed:
<span class="badge badge-danger badge-circle w-10px h-10px me-1"></span>
break;
case TicketStatus.Open:
<span class="badge badge-success badge-circle w-10px h-10px me-1"></span>
break;
case TicketStatus.Pending:
<span class="badge badge-warning badge-circle w-10px h-10px me-1"></span>
break;
case TicketStatus.WaitingForUser:
<span class="badge badge-primary badge-circle w-10px h-10px me-1"></span>
break;
}
<span class="fs-6 fw-semibold text-muted me-5">@(AdminService.Ticket.Status)</span>
<span class="fs-6 fw-bold text-muted me-2">
<TL>Priority</TL>
</span>
@switch (AdminService.Ticket.Priority)
{
case TicketPriority.Low:
<span class="badge badge-success badge-circle w-10px h-10px me-1"></span>
break;
case TicketPriority.Medium:
<span class="badge badge-primary badge-circle w-10px h-10px me-1"></span>
break;
case TicketPriority.High:
<span class="badge badge-warning badge-circle w-10px h-10px me-1"></span>
break;
case TicketPriority.Critical:
<span class="badge badge-danger badge-circle w-10px h-10px me-1"></span>
break;
}
<span class="fs-6 fw-semibold text-muted">@(AdminService.Ticket.Priority)</span>
</div>
</div>
</div>
<div class="card-toolbar">
<div class="input-group">
<div class="me-3">
@if (AdminService.Ticket!.AssignedTo == null)
{
<WButton Text="@(SmartTranslateService.Translate("Claim"))"/>
}
else
{
<WButton Text="@(SmartTranslateService.Translate("Unclaim"))"/>
}
</div>
<select @bind="Priority" class="form-select rounded-start">
@foreach (var priority in (TicketPriority[])Enum.GetValues(typeof(TicketPriority)))
{
if (Priority == priority)
{
<option value="@(priority)" selected="">@(priority)</option>
}
else
{
<option value="@(priority)">@(priority)</option>
}
}
</select>
<WButton Text="@(SmartTranslateService.Translate("Update priority"))"
CssClasses="btn-primary"
OnClick="UpdatePriority">
</WButton>
<select @bind="Status" class="form-select">
@foreach (var status in (TicketStatus[])Enum.GetValues(typeof(TicketStatus)))
{
if (Status == status)
{
<option value="@(status)" selected="">@(status)</option>
}
else
{
<option value="@(status)">@(status)</option>
}
}
</select>
<WButton Text="@(SmartTranslateService.Translate("Update status"))"
CssClasses="btn-primary"
OnClick="UpdateStatus">
</WButton>
</div>
</div>
}
else
{
<div class="card-title">
<div class="d-flex justify-content-center flex-column me-3">
<span class="fs-4 fw-bold text-gray-900 me-1 mb-2 lh-1">
</span>
</div>
</div>
}
</div>
<div class="card-body">
<div class="scroll-y me-n5 pe-5" style="max-height: 55vh; display: flex; flex-direction: column-reverse;">
@if (AdminService.Ticket == null)
{
}
else
{
<TicketMessageView Messages="Messages" ViewAsSupport="true"/>
}
</div>
</div>
@if (AdminService.Ticket != null)
{
<div class="card-footer pt-4" id="kt_chat_messenger_footer">
<div class="d-flex flex-stack">
<table class="w-100">
<tr>
<td class="align-top">
<SmartFileSelect @ref="FileSelect"></SmartFileSelect>
</td>
<td class="w-100">
<textarea @bind="MessageText" class="form-control mb-3 form-control-flush" rows="1" placeholder="@(SmartTranslateService.Translate("Type a message"))"></textarea>
</td>
<td class="align-top">
<WButton Text="@(SmartTranslateService.Translate("Send"))"
WorkingText="@(SmartTranslateService.Translate("Sending"))"
CssClasses="btn-primary ms-2"
OnClick="SendMessage">
</WButton>
</td>
</tr>
</table>
</div>
</div>
}
</div>
</div>
</div>
@code
{
[Parameter]
public int Id { get; set; }
private Dictionary<Ticket, TicketMessage?> AssignedTickets;
private Dictionary<Ticket, TicketMessage?> UnAssignedTickets;
private List<TicketMessage> Messages = new();
private string MessageText;
private SmartFileSelect FileSelect;
private TicketPriority Priority;
private TicketStatus Status;
protected override async Task OnParametersSetAsync()
{
await Unsubscribe();
await ReloadTickets();
await Subscribe();
await InvokeAsync(StateHasChanged);
}
private async Task UpdatePriority()
{
await AdminService.UpdatePriority(Priority);
}
private async Task UpdateStatus()
{
await AdminService.UpdateStatus(Status);
}
private async Task SendMessage()
{
if (string.IsNullOrEmpty(MessageText) && FileSelect.SelectedFile != null)
MessageText = "File upload";
if (string.IsNullOrEmpty(MessageText))
return;
var msg = await AdminService.Send(MessageText, FileSelect.SelectedFile);
Messages.Add(msg);
MessageText = "";
FileSelect.SelectedFile = null;
await InvokeAsync(StateHasChanged);
}
private async Task Subscribe()
{
await EventSystem.On<Ticket>("tickets.new", this, async _ =>
{
await ReloadTickets(false);
await InvokeAsync(StateHasChanged);
});
if (AdminService.Ticket != null)
{
await EventSystem.On<TicketMessage>($"tickets.{AdminService.Ticket.Id}.message", this, async message =>
{
if (message.Sender != null && message.Sender.Id == IdentityService.User.Id && message.IsSupportMessage)
return;
Messages.Add(message);
await InvokeAsync(StateHasChanged);
});
await EventSystem.On<Ticket>($"tickets.{AdminService.Ticket.Id}.status", this, async _ =>
{
await ReloadTickets(false);
await InvokeAsync(StateHasChanged);
});
}
}
private async Task Unsubscribe()
{
await EventSystem.Off("tickets.new", this);
if (AdminService.Ticket != null)
{
await EventSystem.Off($"tickets.{AdminService.Ticket.Id}.message", this);
await EventSystem.Off($"tickets.{AdminService.Ticket.Id}.status", this);
}
}
private async Task ReloadTickets(bool reloadMessages = true)
{
AdminService.Ticket = null;
//AssignedTickets = await AdminService.GetAssigned();
//UnAssignedTickets = await AdminService.GetUnAssigned();
if (Id != 0)
{
AdminService.Ticket = AssignedTickets
.FirstOrDefault(x => x.Key.Id == Id)
.Key ?? null;
if (AdminService.Ticket == null)
{
AdminService.Ticket = UnAssignedTickets
.FirstOrDefault(x => x.Key.Id == Id)
.Key ?? null;
}
if (AdminService.Ticket == null)
return;
Status = AdminService.Ticket.Status;
Priority = AdminService.Ticket.Priority;
if (reloadMessages)
{
var msgs = await AdminService.GetMessages();
Messages = msgs.ToList();
}
}
}
public async void Dispose()
{
await Unsubscribe();
}
}

View File

@@ -0,0 +1,293 @@
@page "/admin/support/view/{Id:int}"
@using Moonlight.App.Services.Tickets
@using Moonlight.App.Database.Entities
@using Moonlight.App.Helpers
@using Moonlight.App.Models.Misc
@using Moonlight.App.Repositories
@using Moonlight.App.Services
@using Microsoft.EntityFrameworkCore
@using Moonlight.App.Events
@using Moonlight.App.Services.Sessions
@using Moonlight.Shared.Components.Tickets
@inject TicketAdminService TicketAdminService
@inject SmartTranslateService SmartTranslateService
@inject Repository<Ticket> TicketRepository
@inject EventSystem Event
@inject IdentityService IdentityService
@implements IDisposable
@attribute [PermissionRequired(nameof(Permissions.AdminSupportView))]
<LazyLoader @ref="LazyLoader" Load="Load">
@if (Ticket == null)
{
<NotFoundAlert/>
}
else
{
<div class="card">
<div class="row g-0">
<div class="col-xl-9 col-lg-8">
<div class="card-body border-end">
<div class="row mb-4 pb-2 g-3">
<span class="fs-2 fw-bold">@(Ticket.IssueTopic)</span>
</div>
<span class="fs-4">
<TL>Issue description</TL>:
</span>
<p class="fs-5 text-muted">
@(Formatter.FormatLineBreaks(Ticket.IssueDescription))
</p>
<span class="fs-4">
<TL>Issue resolve tries</TL>:
</span>
<p class="fs-5 text-muted">
@(Formatter.FormatLineBreaks(Ticket.IssueTries))
</p>
</div>
<div class="card-body border-end border-top bg-black">
<TicketMessageView Messages="Messages" ViewAsSupport="true"/>
</div>
<div class="card-footer pt-4">
<div class="d-flex flex-stack">
<table class="w-100">
<tr>
<td class="align-top">
<SmartFileSelect @ref="FileSelect"></SmartFileSelect>
</td>
<td class="w-100">
<textarea @bind="MessageContent" class="form-control mb-3 form-control-flush" rows="1" placeholder="@(SmartTranslateService.Translate("Type a message"))"></textarea>
</td>
<td class="align-top">
<WButton Text="@(SmartTranslateService.Translate("Send"))"
WorkingText="@(SmartTranslateService.Translate("Sending"))"
CssClasses="btn-primary ms-2"
OnClick="SendMessage"/>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="col-xl-3 col-lg-4">
<div class="card-header">
<h6 class="card-title mb-0">
<TL>Ticket details</TL>
</h6>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-borderless align-middle mb-0">
<tbody>
<tr>
<th>
<TL>Ticket ID</TL>
</th>
<td>@(Ticket.Id)</td>
</tr>
<tr>
<th>
<TL>User</TL>
</th>
<td>
<a href="/admin/users/view/@(Ticket.CreatedBy.Id)">
@(Ticket.CreatedBy.FirstName) @(Ticket.CreatedBy.LastName)
</a>
</td>
</tr>
<tr>
<th>
<TL>Subject</TL>
</th>
<td>
<TL>@(Ticket.Subject)</TL>
</td>
</tr>
<tr>
<th>
<TL>Subject ID</TL>
</th>
<td>@(Ticket.SubjectId)</td>
</tr>
<tr>
<th>
<TL>Assigned to</TL>
</th>
@if (Ticket.AssignedTo == null)
{
<td>
<TL>None</TL>
</td>
}
else
{
<td>@(Ticket.AssignedTo.FirstName) @(Ticket.AssignedTo.LastName)</td>
}
</tr>
<tr>
<th>
<TL>Status</TL>
</th>
<td>
<select @bind="StatusModified" class="form-select">
@foreach (var status in (TicketStatus[])Enum.GetValues(typeof(TicketStatus)))
{
if (StatusModified == status)
{
<option value="@(status)" selected="">@(status)</option>
}
else
{
<option value="@(status)">@(status)</option>
}
}
</select>
</td>
</tr>
<tr>
<th>
<TL>Priority</TL>
</th>
<td>
<select @bind="PriorityModified" class="form-select">
@foreach (var priority in (TicketPriority[])Enum.GetValues(typeof(TicketPriority)))
{
if (PriorityModified == priority)
{
<option value="@(priority)" selected="">@(priority)</option>
}
else
{
<option value="@(priority)">@(priority)</option>
}
}
</select>
</td>
</tr>
<tr>
<th>
<TL>Created at</TL>
</th>
<td>@(Formatter.FormatDate(Ticket.CreatedAt))</td>
</tr>
<tr>
<th></th>
<td>
<WButton Text="@(SmartTranslateService.Translate("Save"))" OnClick="Save"/>
</td>
</tr>
<tr>
<th>
<WButton Text="@(SmartTranslateService.Translate("Claim"))" OnClick="() => SetClaim(IdentityService.User)"/>
</th>
<td>
<WButton Text="@(SmartTranslateService.Translate("Unclaim"))" OnClick="() => SetClaim(null)"/>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
}
</LazyLoader>
@code
{
[Parameter]
public int Id { get; set; }
private Ticket? Ticket { get; set; }
private TicketPriority PriorityModified;
private TicketStatus StatusModified;
private List<TicketMessage> Messages = new();
private SmartFileSelect FileSelect;
private string MessageContent = "";
private LazyLoader LazyLoader;
private async Task Load(LazyLoader _)
{
Ticket = TicketRepository
.Get()
.Include(x => x.AssignedTo)
.Include(x => x.CreatedBy)
.FirstOrDefault(x => x.Id == Id);
if (Ticket != null)
{
TicketAdminService.Ticket = Ticket;
PriorityModified = Ticket.Priority;
StatusModified = Ticket.Status;
Messages = (await TicketAdminService.GetMessages()).ToList();
// Register events
await Event.On<TicketMessage>($"tickets.{Ticket.Id}.message", this, async message =>
{
if (message.Sender != null && message.Sender.Id == IdentityService.User.Id && message.IsSupportMessage)
return;
Messages.Add(message);
await InvokeAsync(StateHasChanged);
});
await Event.On<Ticket>($"tickets.{Ticket.Id}.status", this, async _ =>
{
//TODO: Does not work because of data caching. So we dont reload because it will look the same anyways
//await LazyLoader.Reload();
});
}
}
private async Task Save()
{
if (PriorityModified != Ticket!.Priority)
await TicketAdminService.UpdatePriority(PriorityModified);
if (StatusModified != Ticket!.Status)
await TicketAdminService.UpdateStatus(StatusModified);
}
private async Task SetClaim(User? user)
{
await TicketAdminService.SetClaim(user);
}
private async Task SendMessage()
{
if (string.IsNullOrEmpty(MessageContent) && FileSelect.SelectedFile != null)
MessageContent = "File upload";
if (string.IsNullOrEmpty(MessageContent))
return;
var msg = await TicketAdminService.Send(
MessageContent,
FileSelect.SelectedFile
);
Messages.Add(msg);
MessageContent = "";
FileSelect.SelectedFile = null;
await InvokeAsync(StateHasChanged);
}
public async void Dispose()
{
if (Ticket != null)
{
await Event.Off($"tickets.{Ticket.Id}.message", this);
await Event.Off($"tickets.{Ticket.Id}.status", this);
}
}
}

View File

@@ -52,6 +52,8 @@
</a> </a>
</Template> </Template>
</Column> </Column>
<Column TableItem="User" Title="@(SmartTranslateService.Translate("Discord ID"))" Field="@(x => x.DiscordId)" Sortable="true" Filterable="true"/>
<Pager ShowPageNumber="true" ShowTotalCount="true"/> <Pager ShowPageNumber="true" ShowTotalCount="true"/>
</Table> </Table>
</div> </div>

View File

@@ -159,6 +159,9 @@
} }
<img src="data:image/png;base64,@(base64)" alt="" class="mw-200px mt-2"> <img src="data:image/png;base64,@(base64)" alt="" class="mw-200px mt-2">
</div> </div>
<div class="mt-3 text-center">
<span class="h3">@(IdentityService.User.TotpSecret)</span>
</div>
<div class="mt-3 d-flex justify-content-center"> <div class="mt-3 d-flex justify-content-center">
<div class="input-group"> <div class="input-group">
<input type="text" <input type="text"

View File

@@ -185,12 +185,12 @@
.Get() .Get()
.Include(x => x.Allocations) .Include(x => x.Allocations)
.Include(x => x.Image) .Include(x => x.Image)
.Include("Image.Variables") .ThenInclude(x => x.Variables)
.Include(x => x.Node) .Include(x => x.Node)
.Include(x => x.Variables) .Include(x => x.Variables)
.Include(x => x.MainAllocation) .Include(x => x.MainAllocation)
.Include(x => x.Owner) .Include(x => x.Owner)
.First(x => x.Uuid == uuid); .FirstOrDefault(x => x.Uuid == uuid);
if (CurrentServer != null) if (CurrentServer != null)
{ {
@@ -249,7 +249,7 @@
{ {
Name = "Console", Name = "Console",
Route = "/", Route = "/",
Icon = "terminal", Icon = "bx-terminal",
Component = ComponentHelper.FromType(typeof(ServerConsole)) Component = ComponentHelper.FromType(typeof(ServerConsole))
}); });
@@ -257,7 +257,7 @@
{ {
Name = "Files", Name = "Files",
Route = "/files", Route = "/files",
Icon = "folder", Icon = "bx-folder",
Component = ComponentHelper.FromType(typeof(ServerFiles)) Component = ComponentHelper.FromType(typeof(ServerFiles))
}); });
@@ -265,7 +265,7 @@
{ {
Name = "Backups", Name = "Backups",
Route = "/backups", Route = "/backups",
Icon = "box", Icon = "bx-box",
Component = ComponentHelper.FromType(typeof(ServerBackups)) Component = ComponentHelper.FromType(typeof(ServerBackups))
}); });
@@ -273,7 +273,7 @@
{ {
Name = "Network", Name = "Network",
Route = "/network", Route = "/network",
Icon = "wifi", Icon = "bx-wifi",
Component = ComponentHelper.FromType(typeof(ServerNetwork)) Component = ComponentHelper.FromType(typeof(ServerNetwork))
}); });
@@ -281,7 +281,7 @@
{ {
Name = "Settings", Name = "Settings",
Route = "/settings", Route = "/settings",
Icon = "cog", Icon = "bx-cog",
Component = ComponentHelper.FromType(typeof(ServerSettings)) Component = ComponentHelper.FromType(typeof(ServerSettings))
}); });

View File

@@ -6,13 +6,15 @@
@using Moonlight.App.Plugin.UI @using Moonlight.App.Plugin.UI
@using Moonlight.App.Plugin.UI.Servers @using Moonlight.App.Plugin.UI.Servers
@using Moonlight.App.Services.Sessions @using Moonlight.App.Services.Sessions
@using Moonlight.App.ApiClients.Wings
@inject SmartTranslateService TranslationService @inject SmartTranslateService TranslationService
@inject ServerService ServerService
@inject IdentityService IdentityService @inject IdentityService IdentityService
<div class="align-items-center"> <div class="align-items-center">
<div class="row"> <div class="row">
<div class="card card-body me-6"> <div class="card card-body me-6 pb-0">
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
@@ -51,6 +53,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<ul class="nav nav-stretch nav-line-tabs nav-line-tabs-2x border-transparent fs-5 fw-bold text-nowrap flex-nowrap hide-scrollbar" style="overflow-x: auto; overflow-y: hidden;">
@foreach (var tab in Context.Tabs)
{
<li class="nav-item mt-2 @(tab == Context.Tabs.First() ? "ms-5" : "")">
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Route == tab.Route ? "active" : "")" href="/server/@(CurrentServer.Uuid + tab.Route)">
<i class="bx bx-@(tab.Icon) bx-sm me-2"></i><TL>@(tab.Name)</TL>
</a>
</li>
}
</ul>
</div>
</div> </div>
<div class="row mt-3"> <div class="row mt-3">
<div class="card card-body"> <div class="card card-body">
@@ -123,12 +137,13 @@
</div> </div>
<div class="mt-5 row"> <div class="mt-5 row">
<div class="d-flex flex-column flex-md-row card card-body p-5"> <div class="d-flex flex-column flex-md-row card card-body p-5">
<ul class="nav nav-tabs nav-pills flex-row border-0 flex-md-column fs-6 pe-5 mb-5"> @*
<ul class="nav nav-tabs nav-pills flex-row border-0 flex-md-column fs-6 pe-5 mb-5">
@foreach (var tab in Context.Tabs) @foreach (var tab in Context.Tabs)
{ {
<li class="nav-item w-100 me-0 mb-md-2"> <li class="nav-item w-100 me-0 mb-md-2">
<a href="/server/@(CurrentServer.Uuid + tab.Route)" class="nav-link w-100 btn btn-flex @(Route == tab.Route ? "active" : "") btn-active-light-primary"> <a href="/server/@(CurrentServer.Uuid + tab.Route)" class="nav-link w-100 btn btn-flex @(Route == tab.Route ? "active" : "") btn-active-light-primary">
<i class="bx bx-@(tab.Icon) bx-sm me-2"></i> <i class="bx @(tab.Icon) bx-sm me-2"></i>
<span class="d-flex flex-column align-items-start"> <span class="d-flex flex-column align-items-start">
<span class="fs-5"> <span class="fs-5">
<TL>@(tab.Name)</TL> <TL>@(tab.Name)</TL>
@@ -138,6 +153,7 @@
</li> </li>
} }
</ul> </ul>
*@
<div class="tab-content w-100"> <div class="tab-content w-100">
<div class="tab-pane fade show active"> <div class="tab-pane fade show active">
@ChildContent @ChildContent
@@ -177,22 +193,22 @@
private async Task Start() private async Task Start()
{ {
await Console.SetPowerState("start"); await ServerService.SetPowerState(CurrentServer, PowerSignal.Start);
} }
private async Task Stop() private async Task Stop()
{ {
await Console.SetPowerState("stop"); await ServerService.SetPowerState(CurrentServer, PowerSignal.Stop);
} }
private async Task Kill() private async Task Kill()
{ {
await Console.SetPowerState("kill"); await ServerService.SetPowerState(CurrentServer, PowerSignal.Kill);
} }
private async Task Restart() private async Task Restart()
{ {
await Console.SetPowerState("restart"); await ServerService.SetPowerState(CurrentServer, PowerSignal.Restart);
} }
#endregion #endregion

View File

@@ -7,7 +7,7 @@
@foreach (var allocation in CurrentServer.Allocations) @foreach (var allocation in CurrentServer.Allocations)
{ {
<div class="row align-items-center"> <div class="row align-items-center mb-3">
<div class="col-1 me-4"> <div class="col-1 me-4">
<i class="text-primary bx bx-wifi bx-md"></i> <i class="text-primary bx bx-wifi bx-md"></i>
</div> </div>

View File

@@ -49,7 +49,7 @@
<div class="accordion-item"> <div class="accordion-item">
<h2 class="accordion-header" id="serverListGroup-header@(group.GetHashCode())"> <h2 class="accordion-header" id="serverListGroup-header@(group.GetHashCode())">
<button class="accordion-button fs-4 fw-semibold collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#serverListGroup-body@(group.GetHashCode())" aria-expanded="false" aria-controls="serverListGroup-body@(group.GetHashCode())"> <button class="accordion-button fs-4 fw-semibold collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#serverListGroup-body@(group.GetHashCode())" aria-expanded="false" aria-controls="serverListGroup-body@(group.GetHashCode())">
<div class="d-flex justify-content-between"> <div class="d-flex gap-2 justify-content-between">
<div> <div>
@if (EditMode) @if (EditMode)
{ {
@@ -80,7 +80,7 @@
</div> </div>
</button> </button>
</h2> </h2>
<div id="serverListGroup-body@(group.GetHashCode())" class="accordion-collapse collapse" aria-labelledby="serverListGroup-header@(group.GetHashCode())" data-bs-parent="#serverListGroup"> <div id="serverListGroup-body@(group.GetHashCode())" class="accordion-collapse collapse @(string.IsNullOrEmpty(group.Name) ? "show" : "")" aria-labelledby="serverListGroup-header@(group.GetHashCode())" data-bs-parent="#serverListGroup">
<div class="accordion-body"> <div class="accordion-body">
<div class="row min-h-200px draggable-zone" ml-server-group="@(group.Name)"> <div class="row min-h-200px draggable-zone" ml-server-group="@(group.Name)">
@foreach (var id in group.Servers) @foreach (var id in group.Servers)

View File

@@ -1,202 +1,32 @@
@page "/support" @page "/support"
@page "/support/{Id:int}"
@using Moonlight.App.Services.Tickets @using Moonlight.App.Services.Tickets
@using Moonlight.App.Database.Entities @using Moonlight.App.Database.Entities
@using Moonlight.App.Helpers
@using Moonlight.App.Models.Forms
@using Moonlight.App.Models.Misc
@using Moonlight.App.Repositories @using Moonlight.App.Repositories
@using Moonlight.App.Services
@using Microsoft.EntityFrameworkCore @using Microsoft.EntityFrameworkCore
@using Moonlight.App.Events @using Moonlight.App.Models.Misc
@using Moonlight.App.Services.Files @using BlazorTable
@using Moonlight.App.Models.Forms
@using Moonlight.App.Services
@using Moonlight.App.Services.Sessions @using Moonlight.App.Services.Sessions
@using Moonlight.Shared.Components.Tickets
@inject TicketClientService ClientService @inject TicketClientService TicketClientService
@inject Repository<Server> ServerRepository @inject Repository<Ticket> TicketRepository
@inject Repository<WebSpace> WebSpaceRepository
@inject Repository<Domain> DomainRepository
@inject SmartTranslateService SmartTranslateService @inject SmartTranslateService SmartTranslateService
@inject IdentityService IdentityService @inject IdentityService IdentityService
@inject Repository<WebSpace> WebSpaceRepository
@inject Repository<Domain> DomainRepository
@inject Repository<Server> ServerRepository
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject ResourceService ResourceService
@inject EventSystem EventSystem
<div class="d-flex flex-column flex-lg-row"> <div class="row">
<div class="flex-column flex-lg-row-auto w-100 w-lg-300px w-xl-400px mb-10 mb-lg-0"> <div class="col">
<div class="card card-flush"> <div class="card">
<div class="card-body pt-5"> <div class="card-header">
<div class="scroll-y me-n5 pe-5 h-200px h-lg-auto"> <span class="card-title">
<div class="d-flex flex-stack d-flex justify-content-center mb-5">
<a href="/support" class="btn btn-primary">
<TL>Create new ticket</TL>
</a>
</div>
<div class="separator"></div>
@foreach (var ticket in Tickets)
{
<div class="d-flex flex-stack py-4">
<div class="d-flex align-items-center">
<div class="ms-5">
<a href="/support/@(ticket.Key.Id)" class="fs-5 fw-bold text-gray-900 text-hover-primary mb-2">@(ticket.Key.IssueTopic)</a>
@if (ticket.Value != null)
{
<div class="fw-semibold text-muted">
@(ticket.Value.Content)
</div>
}
</div>
</div>
<div class="d-flex flex-column align-items-end ms-2">
@if (ticket.Value != null)
{
<span class="text-muted fs-7 mb-1">
@(Formatter.FormatAgoFromDateTime(ticket.Value.CreatedAt, SmartTranslateService))
</span>
}
</div>
</div>
if (ticket.Key != Tickets.Last().Key)
{
<div class="separator"></div>
}
}
</div>
</div>
</div>
</div>
<div class="flex-lg-row-fluid ms-lg-7 ms-xl-10">
<div class="card">
<div class="card-header">
@if (ClientService.Ticket != null)
{
<div class="card-title">
<div class="d-flex justify-content-center flex-column me-3">
<span class="fs-3 fw-bold text-gray-900 me-1 mb-2 lh-1">@(ClientService.Ticket.IssueTopic)</span>
<div class="mb-0 lh-1">
<span class="fs-6 fw-bold text-muted me-2">
<TL>Status</TL>
</span>
@switch (ClientService.Ticket.Status)
{
case TicketStatus.Closed:
<span class="badge badge-danger badge-circle w-10px h-10px me-1"></span>
break;
case TicketStatus.Open:
<span class="badge badge-success badge-circle w-10px h-10px me-1"></span>
break;
case TicketStatus.Pending:
<span class="badge badge-warning badge-circle w-10px h-10px me-1"></span>
break;
case TicketStatus.WaitingForUser:
<span class="badge badge-primary badge-circle w-10px h-10px me-1"></span>
break;
}
<span class="fs-6 fw-semibold text-muted me-5">@(ClientService.Ticket.Status)</span>
<span class="fs-6 fw-bold text-muted me-2">
<TL>Priority</TL>
</span>
@switch (ClientService.Ticket.Priority)
{
case TicketPriority.Low:
<span class="badge badge-success badge-circle w-10px h-10px me-1"></span>
break;
case TicketPriority.Medium:
<span class="badge badge-primary badge-circle w-10px h-10px me-1"></span>
break;
case TicketPriority.High:
<span class="badge badge-warning badge-circle w-10px h-10px me-1"></span>
break;
case TicketPriority.Critical:
<span class="badge badge-danger badge-circle w-10px h-10px me-1"></span>
break;
}
<span class="fs-6 fw-semibold text-muted">@(ClientService.Ticket.Priority)</span>
</div>
</div>
</div>
<div class="card-toolbar">
<div class="me-n3">
<button class="btn btn-sm btn-icon btn-active-light-primary" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end">
<i class="ki-duotone ki-dots-square fs-2">
<span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span>
</i>
</button>
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-800 menu-state-bg-light-primary fw-semibold w-200px py-3" data-kt-menu="true">
<div class="menu-item px-3">
<div class="menu-content text-muted pb-2 px-3 fs-7 text-uppercase">
Contacts
</div>
</div>
<div class="menu-item px-3">
<a href="#" class="menu-link px-3" data-bs-toggle="modal" data-bs-target="#kt_modal_users_search">
Add Contact
</a>
</div>
<div class="menu-item px-3">
<a href="#" class="menu-link flex-stack px-3" data-bs-toggle="modal" data-bs-target="#kt_modal_invite_friends">
Invite Contacts
<span class="ms-2" data-bs-toggle="tooltip" aria-label="Specify a contact email to send an invitation" data-bs-original-title="Specify a contact email to send an invitation" data-kt-initialized="1">
<i class="ki-duotone ki-information fs-7">
<span class="path1"></span><span class="path2"></span><span class="path3"></span>
</i>
</span>
</a>
</div>
<div class="menu-item px-3" data-kt-menu-trigger="hover" data-kt-menu-placement="right-start">
<a href="#" class="menu-link px-3">
<span class="menu-title">Groups</span>
<span class="menu-arrow"></span>
</a>
<div class="menu-sub menu-sub-dropdown w-175px py-4">
<div class="menu-item px-3">
<a href="#" class="menu-link px-3" data-bs-toggle="tooltip" data-bs-original-title="Coming soon" data-kt-initialized="1">
Create Group
</a>
</div>
<div class="menu-item px-3">
<a href="#" class="menu-link px-3" data-bs-toggle="tooltip" data-bs-original-title="Coming soon" data-kt-initialized="1">
Invite Members
</a>
</div>
<div class="menu-item px-3">
<a href="#" class="menu-link px-3" data-bs-toggle="tooltip" data-bs-original-title="Coming soon" data-kt-initialized="1">
Settings
</a>
</div>
</div>
</div>
<div class="menu-item px-3 my-1">
<a href="#" class="menu-link px-3" data-bs-toggle="tooltip" data-bs-original-title="Coming soon" data-kt-initialized="1">
Settings
</a>
</div>
</div>
</div>
</div>
}
else
{
<div class="card-title">
<div class="d-flex justify-content-center flex-column me-3">
<span class="fs-4 fw-bold text-gray-900 me-1 mb-2 lh-1">
<TL>Create a new ticket</TL> <TL>Create a new ticket</TL>
</span> </span>
</div> </div>
</div> <div class="card-body">
}
</div>
<div class="card-body">
<div class="scroll-y me-n5 pe-5" style="max-height: 55vh; display: flex; flex-direction: column-reverse;">
@if (ClientService.Ticket == null)
{
<LazyLoader Load="LoadTicketCreate"> <LazyLoader Load="LoadTicketCreate">
<SmartForm Model="Model" OnValidSubmit="OnValidSubmit"> <SmartForm Model="Model" OnValidSubmit="OnValidSubmit">
<div class="mb-3"> <div class="mb-3">
@@ -289,63 +119,97 @@
</div> </div>
</SmartForm> </SmartForm>
</LazyLoader> </LazyLoader>
} </div>
else </div>
</div>
<div class="col">
<div class="card">
<div class="card-header">
<span class="card-title">
<TL>Your tickets</TL>
</span>
</div>
<div class="card-body">
<LazyLoader Load="LoadTickets">
<div class="table-responsive">
<Table TableItem="Ticket" Items="Tickets" PageSize="25" TableClass="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" TableHeadClass="fw-bold text-muted">
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Ticket title"))" Field="@(x => x.IssueTopic)" Filterable="true" Sortable="false">
<Template>
<a href="/support/view/@(context.Id)">@(context.IssueTopic)</a>
</Template>
</Column>
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Assigned to"))" Field="@(x => x.AssignedTo)" Filterable="true" Sortable="true">
<Template>
<span>@(context.AssignedTo == null ? "None" : context.AssignedTo.FirstName + " " + context.AssignedTo.LastName)</span>
</Template>
</Column>
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Priority"))" Field="@(x => x.Priority)" Filterable="true" Sortable="true">
<Template>
@switch (context.Priority)
{ {
<TicketMessageView Messages="Messages"/> case TicketPriority.Low:
<span class="badge bg-success">@(context.Priority)</span>
break;
case TicketPriority.Medium:
<span class="badge bg-primary">@(context.Priority)</span>
break;
case TicketPriority.High:
<span class="badge bg-warning">@(context.Priority)</span>
break;
case TicketPriority.Critical:
<span class="badge bg-danger">@(context.Priority)</span>
break;
} }
</Template>
</Column>
<Column TableItem="Ticket" Title="@(SmartTranslateService.Translate("Status"))" Field="@(x => x.Status)" Filterable="true" Sortable="true">
<Template>
@switch (context.Status)
{
case TicketStatus.Closed:
<span class="badge bg-danger">@(context.Status)</span>
break;
case TicketStatus.Open:
<span class="badge bg-success">@(context.Status)</span>
break;
case TicketStatus.Pending:
<span class="badge bg-warning">@(context.Status)</span>
break;
case TicketStatus.WaitingForUser:
<span class="badge bg-primary">@(context.Status)</span>
break;
}
</Template>
</Column>
<Pager ShowPageNumber="true" ShowTotalCount="true"/>
</Table>
</div>
</LazyLoader>
</div> </div>
</div>
@if (ClientService.Ticket != null)
{
<div class="card-footer pt-4">
<div class="d-flex flex-stack">
<table class="w-100">
<tr>
<td class="align-top">
<SmartFileSelect @ref="FileSelect"></SmartFileSelect>
</td>
<td class="w-100">
<textarea @bind="MessageText" class="form-control mb-3 form-control-flush" rows="1" placeholder="@(SmartTranslateService.Translate("Type a message"))"></textarea>
</td>
<td class="align-top">
<WButton Text="@(SmartTranslateService.Translate("Send"))"
WorkingText="@(SmartTranslateService.Translate("Sending"))"
CssClasses="btn-primary ms-2"
OnClick="SendMessage">
</WButton>
</td>
</tr>
</table>
</div> </div>
</div> </div>
}
</div>
</div>
</div> </div>
@code @code
{ {
[Parameter] private Ticket[] Tickets;
public int Id { get; set; }
private Dictionary<Ticket, TicketMessage?> Tickets;
private List<TicketMessage> Messages = new();
private CreateTicketDataModel Model = new(); private CreateTicketDataModel Model = new();
private string MessageText;
private SmartFileSelect FileSelect;
private Server[] Servers; private Server[] Servers;
private WebSpace[] WebSpaces; private WebSpace[] WebSpaces;
private Domain[] Domains; private Domain[] Domains;
protected override async Task OnParametersSetAsync() private Task LoadTickets(LazyLoader _)
{ {
await Unsubscribe(); Tickets = TicketRepository
await ReloadTickets(); .Get()
await Subscribe(); .Include(x => x.CreatedBy)
.Include(x => x.AssignedTo)
.Where(x => x.Status != TicketStatus.Closed)
.Where(x => x.CreatedBy.Id == IdentityService.User.Id)
.ToArray();
await InvokeAsync(StateHasChanged); return Task.CompletedTask;
} }
private Task LoadTicketCreate(LazyLoader _) private Task LoadTicketCreate(LazyLoader _)
@@ -374,7 +238,7 @@
private async Task OnValidSubmit() private async Task OnValidSubmit()
{ {
var ticket = await ClientService.Create( var ticket = await TicketClientService.Create(
Model.IssueTopic, Model.IssueTopic,
Model.IssueDescription, Model.IssueDescription,
Model.IssueTries, Model.IssueTries,
@@ -384,85 +248,6 @@
Model = new(); Model = new();
NavigationManager.NavigateTo("/support/" + ticket.Id); NavigationManager.NavigateTo("/support/view/" + ticket.Id);
}
private async Task SendMessage()
{
if (string.IsNullOrEmpty(MessageText) && FileSelect.SelectedFile != null)
MessageText = "File upload";
if(string.IsNullOrEmpty(MessageText))
return;
var msg = await ClientService.Send(MessageText, FileSelect.SelectedFile);
Messages.Add(msg);
MessageText = "";
FileSelect.SelectedFile = null;
await InvokeAsync(StateHasChanged);
}
private async Task Subscribe()
{
await EventSystem.On<Ticket>("tickets.new", this, async ticket =>
{
if (ticket.CreatedBy != null && ticket.CreatedBy.Id != IdentityService.User.Id)
return;
await ReloadTickets(false);
await InvokeAsync(StateHasChanged);
});
if (ClientService.Ticket != null)
{
await EventSystem.On<TicketMessage>($"tickets.{ClientService.Ticket.Id}.message", this, async message =>
{
if (message.Sender != null && message.Sender.Id == IdentityService.User.Id && !message.IsSupportMessage)
return;
Messages.Add(message);
await InvokeAsync(StateHasChanged);
});
await EventSystem.On<Ticket>($"tickets.{ClientService.Ticket.Id}.status", this, async _ =>
{
await ReloadTickets(false);
await InvokeAsync(StateHasChanged);
});
}
}
private async Task Unsubscribe()
{
await EventSystem.Off("tickets.new", this);
if (ClientService.Ticket != null)
{
await EventSystem.Off($"tickets.{ClientService.Ticket.Id}.message", this);
await EventSystem.Off($"tickets.{ClientService.Ticket.Id}.status", this);
}
}
private async Task ReloadTickets(bool reloadMessages = true)
{
ClientService.Ticket = null;
Tickets = await ClientService.Get();
if (Id != 0)
{
ClientService.Ticket = Tickets
.FirstOrDefault(x => x.Key.Id == Id)
.Key ?? null;
if (ClientService.Ticket == null)
return;
if (reloadMessages)
{
var msgs = await ClientService.GetMessages();
Messages = msgs.ToList();
}
}
} }
} }

View File

@@ -0,0 +1,131 @@
@page "/support/view/{Id:int}"
@using Moonlight.App.Services.Tickets
@using Moonlight.App.Database.Entities
@using Moonlight.App.Repositories
@using Moonlight.App.Services
@using Moonlight.Shared.Components.Tickets
@using Microsoft.EntityFrameworkCore
@using Moonlight.App.Events
@using Moonlight.App.Services.Sessions
@inject TicketClientService TicketClientService
@inject SmartTranslateService SmartTranslateService
@inject Repository<Ticket> TicketRepository
@inject IdentityService IdentityService
@inject EventSystem Event
@implements IDisposable
<LazyLoader Load="Load">
@if (Ticket == null)
{
<NotFoundAlert />
}
else
{
<div class="card">
<div class="card-header">
<span class="card-title">@(Ticket.IssueTopic)</span>
</div>
<div class="card-body border-end border-top bg-black">
<TicketMessageView Messages="Messages"/>
</div>
<div class="card-footer pt-4">
<div class="d-flex flex-stack">
<table class="w-100">
<tr>
<td class="align-top">
<SmartFileSelect @ref="FileSelect"></SmartFileSelect>
</td>
<td class="w-100">
<textarea @bind="MessageContent" class="form-control mb-3 form-control-flush" rows="1" placeholder="@(SmartTranslateService.Translate("Type a message"))"></textarea>
</td>
<td class="align-top">
<WButton Text="@(SmartTranslateService.Translate("Send"))"
WorkingText="@(SmartTranslateService.Translate("Sending"))"
CssClasses="btn-primary ms-2"
OnClick="SendMessage"/>
</td>
</tr>
</table>
</div>
</div>
</div>
}
</LazyLoader>
@code
{
[Parameter]
public int Id { get; set; }
private Ticket? Ticket;
private List<TicketMessage> Messages = new();
private SmartFileSelect FileSelect;
private string MessageContent = "";
private async Task Load(LazyLoader _)
{
Ticket = TicketRepository
.Get()
.Include(x => x.CreatedBy)
.Where(x => x.CreatedBy.Id == IdentityService.User.Id)
.FirstOrDefault(x => x.Id == Id);
if (Ticket != null)
{
TicketClientService.Ticket = Ticket;
Messages = (await TicketClientService.GetMessages()).ToList();
// Register events
await Event.On<TicketMessage>($"tickets.{Ticket.Id}.message", this, async message =>
{
if (message.Sender != null && message.Sender.Id == IdentityService.User.Id && !message.IsSupportMessage)
return;
Messages.Add(message);
await InvokeAsync(StateHasChanged);
});
await Event.On<Ticket>($"tickets.{Ticket.Id}.status", this, async _ =>
{
//TODO: Does not work because of data caching. So we dont reload because it will look the same anyways
//await LazyLoader.Reload();
});
}
}
private async Task SendMessage()
{
if (string.IsNullOrEmpty(MessageContent) && FileSelect.SelectedFile != null)
MessageContent = "File upload";
if (string.IsNullOrEmpty(MessageContent))
return;
var msg = await TicketClientService.Send(
MessageContent,
FileSelect.SelectedFile
);
Messages.Add(msg);
MessageContent = "";
FileSelect.SelectedFile = null;
await InvokeAsync(StateHasChanged);
}
public async void Dispose()
{
if (Ticket != null)
{
await Event.Off($"tickets.{Ticket.Id}.message", this);
await Event.Off($"tickets.{Ticket.Id}.status", this);
}
}
}

380
Moonlight/Startup.cs Normal file
View File

@@ -0,0 +1,380 @@
using BlazorDownloadFile;
using BlazorTable;
using HealthChecks.UI.Client;
using Moonlight.App.ApiClients.CloudPanel;
using Moonlight.App.ApiClients.Daemon;
using Moonlight.App.ApiClients.Modrinth;
using Moonlight.App.ApiClients.Paper;
using Moonlight.App.ApiClients.Telemetry;
using Moonlight.App.ApiClients.Wings;
using Moonlight.App.Database;
using Moonlight.App.Diagnostics.HealthChecks;
using Moonlight.App.Events;
using Moonlight.App.Helpers;
using Moonlight.App.Helpers.Wings;
using Moonlight.App.LogMigrator;
using Moonlight.App.Repositories;
using Moonlight.App.Repositories.Domains;
using Moonlight.App.Repositories.Servers;
using Moonlight.App.Services;
using Moonlight.App.Services.Background;
using Moonlight.App.Services.DiscordBot;
using Moonlight.App.Services.Files;
using Moonlight.App.Services.Interop;
using Moonlight.App.Services.Mail;
using Moonlight.App.Services.Notifications;
using Moonlight.App.Services.Plugins;
using Moonlight.App.Services.Sessions;
using Moonlight.App.Services.Statistics;
using Moonlight.App.Services.Tickets;
using Sentry;
using Serilog;
using Serilog.Events;
using Stripe;
using SubscriptionService = Moonlight.App.Services.SubscriptionService;
namespace Moonlight;
public class Startup
{
// Base services
private StorageService StorageService;
private ConfigService ConfigService;
private DatabaseCheckupService DatabaseCheckupService;
private EventSystem Event;
private LetsEncryptService LetsEncryptService;
private PluginService PluginService;
// Builders
private WebApplicationBuilder WebApplicationBuilder;
private WebApplication WebApplication;
public async Task Init(string[] args)
{
WebApplicationBuilder = WebApplication.CreateBuilder(args);
await PreInitServices();
await SetupLoggers();
Logger.Info("[1/5] Initialized base services and loggers");
await PreInit();
await Configure();
await BuildServices();
WebApplication = WebApplicationBuilder.Build();
await ConfigurePipeline();
Logger.Info("Initialisation complete!");
}
public async Task Start()
{
Logger.Info("Starting moonlight panel");
await StartBackgroundServices();
await PostInit();
Logger.Info("Done. Going live now!");
if (!Uri.TryCreate(ConfigService.Get().Moonlight.AppUrl, UriKind.RelativeOrAbsolute, out Uri uri))
{
Logger.Fatal("Invalid app url");
return;
}
if(ConfigService.DebugMode || uri.HostNameType == UriHostNameType.IPv4 || !ConfigService.Get().Moonlight.LetsEncrypt.Enable)
await WebApplication.RunAsync();
else
await WebApplication.RunAsync(ConfigService.Get().Moonlight.AppUrl);
}
private Task PreInitServices()
{
StorageService = new();
ConfigService = new(StorageService);
DatabaseCheckupService = new(ConfigService);
Event = new();
LetsEncryptService = new(ConfigService, Event);
PluginService = new();
return Task.CompletedTask;
}
private Task StartBackgroundServices()
{
Logger.Info("[1/2] Starting background services");
_ = WebApplication.Services.GetRequiredService<CleanupService>();
_ = WebApplication.Services.GetRequiredService<DiscordBotService>();
_ = WebApplication.Services.GetRequiredService<StatisticsCaptureService>();
_ = WebApplication.Services.GetRequiredService<DiscordNotificationService>();
_ = WebApplication.Services.GetRequiredService<MalwareBackgroundScanService>();
_ = WebApplication.Services.GetRequiredService<TelemetryService>();
_ = WebApplication.Services.GetRequiredService<TempMailService>();
_ = WebApplication.Services.GetRequiredService<DdosProtectionService>();
_ = WebApplication.Services.GetRequiredService<MoonlightService>();
return Task.CompletedTask;
}
private Task PostInit()
{
Logger.Info("[2/2] Started post init tasks");
Task.Run(async () =>
{
await LetsEncryptService.AutoProcess();
});
return Task.CompletedTask;
}
private async Task PreInit()
{
Logger.Info("[2/5] Running pre init tasks");
await StorageService.EnsureCreated();
await DatabaseCheckupService.Perform();
await PluginService.ReloadPlugins();
}
private Task Configure()
{
Logger.Info("[3/5] Configuring kestrel");
WebApplicationBuilder.WebHost.ConfigureKestrel(options =>
{
options.ConfigureHttpsDefaults(httpsOptions =>
{
httpsOptions.ServerCertificateSelector = LetsEncryptService.SelectCertificate;
});
});
WebApplicationBuilder.Services.AddServerSideBlazor()
.AddHubOptions(options =>
{
options.MaximumReceiveMessageSize = 10000000;
options.ClientTimeoutInterval = TimeSpan.FromSeconds(30);
options.HandshakeTimeout = TimeSpan.FromSeconds(10);
});
WebApplicationBuilder.Services.AddHttpContextAccessor();
WebApplicationBuilder.Services.AddRazorPages();
WebApplicationBuilder.Services.AddHealthChecks()
.AddCheck<DatabaseHealthCheck>("Database")
.AddCheck<NodeHealthCheck>("Nodes")
.AddCheck<DaemonHealthCheck>("Daemons");
if (ConfigService.Get().Moonlight.Sentry.Enable)
{
WebApplicationBuilder.WebHost.UseSentry(options =>
{
options.Dsn = ConfigService
.Get()
.Moonlight.Sentry.Dsn;
options.Debug = ConfigService.DebugMode;
options.DiagnosticLevel = SentryLevel.Warning;
options.TracesSampleRate = 1.0;
options.DiagnosticLogger = new SentryDiagnosticsLogger(SentryLevel.Warning);
});
}
StripeConfiguration.ApiKey = ConfigService
.Get()
.Moonlight.Stripe.ApiKey;
return Task.CompletedTask;
}
private async Task BuildServices()
{
Logger.Info("[4/5] Building services");
await BuildSingletonServices();
await BuildScopedServices();
// Third party services
WebApplicationBuilder.Services.AddBlazorTable();
WebApplicationBuilder.Services.AddBlazorContextMenu();
WebApplicationBuilder.Services.AddBlazorDownloadFile();
await PluginService.BuildServices(WebApplicationBuilder.Services);
}
private Task BuildScopedServices()
{
// Databases
WebApplicationBuilder.Services.AddDbContext<DataContext>();
// Repositories
WebApplicationBuilder.Services.AddScoped<UserRepository>();
WebApplicationBuilder.Services.AddScoped<NodeRepository>();
WebApplicationBuilder.Services.AddScoped<ServerRepository>();
WebApplicationBuilder.Services.AddScoped<ServerBackupRepository>();
WebApplicationBuilder.Services.AddScoped<ImageRepository>();
WebApplicationBuilder.Services.AddScoped<DomainRepository>();
WebApplicationBuilder.Services.AddScoped<SharedDomainRepository>();
WebApplicationBuilder.Services.AddScoped<RevokeRepository>();
WebApplicationBuilder.Services.AddScoped<NotificationRepository>();
WebApplicationBuilder.Services.AddScoped<DdosAttackRepository>();
WebApplicationBuilder.Services.AddScoped<SubscriptionRepository>();
WebApplicationBuilder.Services.AddScoped<LoadingMessageRepository>();
WebApplicationBuilder.Services.AddScoped<NewsEntryRepository>();
WebApplicationBuilder.Services.AddScoped<NodeAllocationRepository>();
WebApplicationBuilder.Services.AddScoped<StatisticsRepository>();
WebApplicationBuilder.Services.AddScoped(typeof(Repository<>));
// Js interopt and session stuff
WebApplicationBuilder.Services.AddScoped<CookieService>();
WebApplicationBuilder.Services.AddScoped<IdentityService>();
WebApplicationBuilder.Services.AddScoped<IpLocateService>();
WebApplicationBuilder.Services.AddScoped<AlertService>();
WebApplicationBuilder.Services.AddScoped<ClipboardService>();
WebApplicationBuilder.Services.AddScoped<ModalService>();
WebApplicationBuilder.Services.AddScoped<FileDownloadService>();
WebApplicationBuilder.Services.AddScoped<KeyListenerService>();
WebApplicationBuilder.Services.AddScoped<PopupService>();
WebApplicationBuilder.Services.AddScoped<SessionClientService>();
WebApplicationBuilder.Services.AddScoped<ReCaptchaService>();
WebApplicationBuilder.Services.AddScoped<DynamicBackgroundService>();
// Main application stuff
WebApplicationBuilder.Services.AddScoped<SmartTranslateService>();
WebApplicationBuilder.Services.AddScoped<UserService>();
WebApplicationBuilder.Services.AddScoped<TotpService>();
WebApplicationBuilder.Services.AddScoped<ToastService>();
WebApplicationBuilder.Services.AddScoped<NodeService>();
WebApplicationBuilder.Services.AddScoped<ServerService>();
WebApplicationBuilder.Services.AddScoped<DomainService>();
WebApplicationBuilder.Services.AddScoped<OneTimeJwtService>();
WebApplicationBuilder.Services.AddScoped<NotificationAdminService>();
WebApplicationBuilder.Services.AddScoped<SmartDeployService>();
WebApplicationBuilder.Services.AddScoped<WebSpaceService>();
WebApplicationBuilder.Services.AddScoped<StatisticsViewService>();
WebApplicationBuilder.Services.AddScoped<RatingService>();
WebApplicationBuilder.Services.AddScoped<IpBanService>();
WebApplicationBuilder.Services.AddScoped<SubscriptionService>();
WebApplicationBuilder.Services.AddScoped<BillingService>();
WebApplicationBuilder.Services.AddScoped<TicketClientService>();
WebApplicationBuilder.Services.AddScoped<TicketAdminService>();
WebApplicationBuilder.Services.AddScoped<MalwareScanService>();
WebApplicationBuilder.Services.AddScoped<MailService>();
WebApplicationBuilder.Services.AddScoped<WingsServerConverter>();
WebApplicationBuilder.Services.AddScoped<WingsConsoleHelper>();
return Task.CompletedTask;
}
private Task BuildSingletonServices()
{
WebApplicationBuilder.Services.AddSingleton(ConfigService);
WebApplicationBuilder.Services.AddSingleton(Event);
WebApplicationBuilder.Services.AddSingleton(PluginService);
WebApplicationBuilder.Services.AddSingleton<StorageService>();
// Api helpers
WebApplicationBuilder.Services.AddSingleton<PaperApiHelper>();
WebApplicationBuilder.Services.AddSingleton<DaemonApiHelper>();
WebApplicationBuilder.Services.AddSingleton<CloudPanelApiHelper>();
WebApplicationBuilder.Services.AddSingleton<ModrinthApiHelper>();
WebApplicationBuilder.Services.AddSingleton<TelemetryApiHelper>();
WebApplicationBuilder.Services.AddSingleton<WingsApiHelper>();
// Main application stuff
WebApplicationBuilder.Services.AddSingleton<HostSystemHelper>();
WebApplicationBuilder.Services.AddSingleton<OAuth2Service>();
WebApplicationBuilder.Services.AddSingleton<PluginStoreService>();
WebApplicationBuilder.Services.AddSingleton<TicketServerService>();
WebApplicationBuilder.Services.AddSingleton<IpVerificationService>();
WebApplicationBuilder.Services.AddSingleton<NotificationServerService>();
WebApplicationBuilder.Services.AddSingleton<DateTimeService>();
WebApplicationBuilder.Services.AddSingleton<MoonlightService>();
WebApplicationBuilder.Services.AddSingleton<ResourceService>();
WebApplicationBuilder.Services.AddSingleton<BucketService>();
// Helpers
WebApplicationBuilder.Services.AddSingleton<SmartTranslateHelper>();
WebApplicationBuilder.Services.AddSingleton<WingsJwtHelper>();
// Background services
WebApplicationBuilder.Services.AddSingleton<DiscordBotService>();
WebApplicationBuilder.Services.AddSingleton<StatisticsCaptureService>();
WebApplicationBuilder.Services.AddSingleton<DiscordNotificationService>();
WebApplicationBuilder.Services.AddSingleton<CleanupService>();
WebApplicationBuilder.Services.AddSingleton<MalwareBackgroundScanService>();
WebApplicationBuilder.Services.AddSingleton<TelemetryService>();
WebApplicationBuilder.Services.AddSingleton<TempMailService>();
WebApplicationBuilder.Services.AddSingleton<DdosProtectionService>();
WebApplicationBuilder.Services.AddSingleton<SessionServerService>();
return Task.CompletedTask;
}
private Task SetupLoggers()
{
var logConfig = new LoggerConfiguration();
if (ConfigService.DebugMode)
logConfig = logConfig.MinimumLevel.Verbose();
else
logConfig = logConfig.MinimumLevel.Information();
if (ConfigService.Get().Moonlight.Sentry.Enable)
{
if (ConfigService.DebugMode)
{
logConfig = logConfig.WriteTo.Sentry(options =>
{
options.MinimumBreadcrumbLevel = LogEventLevel.Debug;
options.MinimumEventLevel = LogEventLevel.Warning;
});
}
else
{
logConfig = logConfig.WriteTo.Sentry(options =>
{
options.MinimumBreadcrumbLevel = LogEventLevel.Information;
options.MinimumEventLevel = LogEventLevel.Warning;
});
}
}
logConfig = logConfig.Enrich.FromLogContext()
.WriteTo.Console(
outputTemplate:
"{Timestamp:HH:mm:ss} [{Level:u3}] {SourceContext} {Message:lj}{NewLine}{Exception}")
.WriteTo.File(PathBuilder.File("storage", "logs", $"{DateTime.UtcNow:yyyy-MM-dd}.log"));
Log.Logger = logConfig.CreateLogger();
WebApplicationBuilder.Logging.ClearProviders();
WebApplicationBuilder.Logging.AddProvider(new LogMigratorProvider());
return Task.CompletedTask;
}
private Task ConfigurePipeline()
{
Logger.Info("[5/5] Configuring pipeline");
if (!WebApplication.Environment.IsDevelopment())
{
WebApplication.UseExceptionHandler("/Error");
}
// Sentry
if (ConfigService.Get().Moonlight.Sentry.Enable)
{
WebApplication.UseSentryTracing();
}
WebApplication.UseStaticFiles();
WebApplication.UseRouting();
WebApplication.UseWebSockets();
WebApplication.MapControllers();
WebApplication.MapBlazorHub();
WebApplication.MapFallbackToPage("/_Host");
WebApplication.MapHealthChecks("/_health", new()
{
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
return Task.CompletedTask;
}
}

View File

@@ -1,636 +0,0 @@
Open support;Support Öffnen
About us;Über uns
Imprint;Impressum
Privacy;Privacy
Login;Einloggen
Register;Registrieren
Insert brand name...;Firmenname eingeben...
Save and continue;Speichern und Fortfahren
Saving;Speichern
Configure basics;Grundlagen einstellen
Brand name;Firmenname
test;test
Insert first name...;Vornamen eingeben...
Insert last name...;Nachnamen eingeben...
Insert email address...;E-Mail-Adresse eingeben...
Add;Hinzufügen
Adding...;Wird hinzugefügt...
Add admin accounts;Admin Konto hinzufügen
First name;Vorname
Last name;Nachname
Email address;E-Mail-Adresse
Enter password;Passwort eingeben
Next;Weiter
Back;Zurück
Configure features;Features konfigurieren
Support chat;Chat Hilfe
Finish;Fertigstellen
Finalize installation;Installation Fertigstellen
Moonlight basic settings successfully configured;Moonlight's Standard-Einstellungen wurden konfiguriert
Ooops. This page is crashed;Ups. Die Seite ist abgestürzt.
This page is crashed. The error has been reported to the moonlight team. Meanwhile you can try reloading the page;Diese Seite ist abgestürzt. Bitte versuche, sie neu zu laden.
Setup complete;Einrichtung abgeschlossen
It looks like this moonlight instance is ready to go;Diese Moonlight Instanz ist bereit
User successfully created;Benutzer erfolgreich erstellt
Ooops. Your moonlight client is crashed;Ups. Dein Moonlight ist abgestürzt.
This error has been reported to the moonlight team;Dieser Fehler wurde dem Moonlight-Team mitgeteilt
Sign In;Anmelden
Sign in to start with moonlight;Anmelden, um mit Moonlight zu starten
Sign in with Discord;Mit Discord Anmelden
Or with email;Oder mit E-Mail
Forgot password?;Password vergessen?
Sign-in;Anmelden
Not registered yet?;Noch nicht Registriert?
Sign up;Registrieren
Authenticating;Authentifizieren...
Sign in with Google;Mit Google Anmelden
Working;Bitte warten...
Error;Fehler
Email and password combination not found;E-Mail und Password-Kombination wurden nicht gefunden
Email;E-mail
Password;Password
Account settings;Benutzer-Einstellungen
Logout;Abmelden
Dashboard;Dashboard
Order;Bestellen
Website;Website
Database;Datenbank
Domain;Domain
Servers;Server
Websites;Websiten
Databases;Datenbanken
Domains;Domains
Changelog;Änderungen
Firstname;Vorname
Lastname;Nachname
Repeat password;Passwort wiederholen
Sign Up;Anmelden
Sign up to start with moonlight;Registrieren um mit Moonlight zu starten
Sign up with Discord;Mit Discord Registrieren
Sign up with Google;Mit Google Registrieren
Sign-up;Registrieren
Already registered?;Schon Registriert?
Sign in;Registrieren
Create something new;Etwas Neues erstellen
Create a gameserver;Einen Gameserver erstellen
A new gameserver in just a few minutes;Ein neuer Gameserver in wenigen Minuten
Create a database;Eine Datenbank erstellen
A quick way to store your data and manage it from all around the world;Eine schnelle Möglichkeit, deine Daten von überall auf der Welt zu verwalten
Manage your services;Deine Dienste verwalten
Manage your gameservers;Gameserver verwalten
Adjust your gameservers;Deine Gameserver anpassen
Manage your databases;Datenbanken verwalten
Insert, delete and update the data in your databases;Daten in die Datenbank einfügen, entfernen und ändern
Create a website;Eine Website erstellen
Make your own websites with a webspace;Mit einem Webspace eine Website erstellen
Create a domain;Eine Domain erstellen
Make your servvices accessible throught your own domain;Mache deine Dienste mit einer Domain erreichbar
Manage your websites;Deine Webseiten verwalten
Modify the content of your websites;Den Inhalt deiner Websiten verwalten
Manage your domains;Deine Domains verwalten
Add, edit and delete dns records;DNS-Records hinzufügen, entfernen oder bearbeiten
Admin;Admin
System;System
Overview;Übersicht
Manager;Manager
Cleanup;Cleanup
Nodes;Nodes
Images;Images
aaPanel;aaPanel
Users;Benutzer
Support;Hilfe
Statistics;Statistiken
No nodes found. Start with adding a new node;Keine Nodes gefunden. Eine neue Node hinzufügen
Nodename;Nodename
FQDN;FQDN
Create;Erstellen
Creating;Wird erstellt...
Http port;Http Port
Sftp port;Sftp Port
Moonlight daemon port;Moonlight Daemon Port
SSL;SSL
CPU Usage;CPU Auslastung
In %;In %
Memory;Arbeitsspeicher
Used / Available memory;Benutzter / Verfügbarer Arbeitsspeicher
Storage;Speicherplatz
Available storage;Verfügbarer Speicherplatz
Add a new node;Eine neue Node hinzufügen
Delete;Löschen
Deleting;Wird gelöscht...
Edit;Bearbeiten
Token Id;Token ID
Token;Token
Save;Speichern
Setup;Aufsetzen
Open a ssh connection to your node and enter;Eine SSH verbindung zu der Node hinzufügen und öffnen
and paste the config below. Then press STRG+O and STRG+X to save;und die Config darunter einfügen. Dann STRG+O und STRG+X drücken um zu Speichern
Before configuring this node, install the daemon;Installiere den Daemon bevor du dieses Node konfigurierst
Delete this node?;Diese Node löschen?
Do you really want to delete this node;Möchtest du diese Node wirklich löschen?
Yes;Ja
No;Nein
Status;Status
Adding;Hinzufügen
Port;Port
Id;ID
Manage;Verwalten
Create new server;Neuen Server erstellen
No servers found;Keine Server gefunden
Server name;Server Name
Cpu cores;CPU Kerne
Disk;Speicherplatz
Image;Image
Override startup;Startup überschreiben
Docker image;Docker Image
CPU Cores (100% = 1 Core);CPU Kerne (100% = 1 Kern)
Server successfully created;Server erfolgreich erstellt
Name;Name
Cores;Kerne
Owner;Besitzer
Value;Wert
An unknown error occured;Ein unbekannter Fehler ist aufgetreten
No allocation found;Keine Allocation gefunden
Identifier;Identifier
UuidIdentifier;UUIDIdentifier
Override startup command;Startup Befehl überschreiben
Loading;Wird geladen...
Offline;Offline
Connecting;Verbinden...
Start;Start
Restart;Neustarten
Stop;Stoppen
Shared IP;Geteilte IP
Server ID;Server ID
Cpu;CPU
Console;Konsole
Files;Dateien
Backups;Backups
Network;Netzwerk
Plugins;Plugins
Settings;Einstellungen
Enter command;Befehl eingeben
Execute;Ausführen
Checking disk space;Speicherplatz überprüfen
Updating config files;Konfigurations-Dateien werden geupdatet
Checking file permissions;Datei-Rechte werden überprüft
Downloading server image;Server Image wird heruntergeladen
Downloaded server image;Server Image wurde heruntergeladen
Starting;Startet
Online;Online
Kill;Kill
Stopping;Stoppt
Search files and folders;Ordner und Dateien durchsuchen
Launch WinSCP;WinSCP starten
New folder;Neuer Ordner
Upload;Hochladen
File name;Dateiname
File size;Dateigröße
Last modified;Zuletzt geändert
Cancel;Abbrechen
Canceling;Wird Abgebrochen
Running;Läuft
Loading backups;Backups werden geladen
Started backup creation;Backup wird erstellt
Backup is going to be created;Backup wird erstellt werden
Rename;Umbenennen
Move;Bewegen
Archive;Archivieren
Unarchive;Archivieren rückgängig machen
Download;Herunterladen
Starting download;Download wird gestartet
Backup successfully created;Backup wurde erfolgreich erstellt
Restore;Wiederherstellen
Copy url;URL Kopieren
Backup deletion started;Backup Löschung wird gestartet
Backup successfully deleted;Backup wurde erfolgreich gelöscht
Primary;Primärer
This feature is currently not available;Diese Funktion ist zurzeit leider nicht verfügbar
Send;Senden
Sending;Wird gesendet
Welcome to the support chat. Ask your question here and we will help you;Willkommen im Support Chat. Stelle hier deine Frage und wir helfen dir.
minutes ago; Minuten her
just now;gerade eben
less than a minute ago;vor weniger als einer Minute
1 hour ago;vor einer Stunde
1 minute ago;vor einer Minute
Failed;Fehlgeschlagen
hours ago; Stunden her
Open tickets;Tickets öffnen
Actions;Aktionen
No support ticket is currently open;Kein Support Ticket ist zurzeit offen.
User information;Benutzer-Information
Close ticket;Ticket schließen
Closing;Wird geschlossen...
The support team has been notified. Please be patient;Das Support-Team wurde benachrichtigt. Habe etwas Geduld
The ticket is now closed. Type a message to open it again;Das Ticket wurde geschlossen. Schreibe etwas, um es wieder zu öffnen
1 day ago;vor einem Tag
is typing;schreibt...
are typing;schreiben...
No domains available;Keine Domains verfügbar
Shared domains;Geteilte Domains
Shared domain;Geteilte Domain
Shared domain successfully deleted;Geteilte Domain wurde erfolgreich gelöscht
Shared domain successfully added;Geteilte Domain wurde erfolgreich hinzugefügt
Domain name;Domain Name
DNS records for;DNS-Record für
Fetching dns records;Es wird nach DNS-Records gesucht
No dns records found;Keine DNS-Records gefunden
Content;Inhalt
Priority;Priorität
Ttl;TTL
Enable cloudflare proxy;Cloudflare-Proxy benutzen
CF Proxy;CF Proxy
days ago; Tage her
Cancle;Abbrechen
An unexpected error occured;Ein unbekannter Fehler ist aufgetreten
Testy;Testy
Error from cloudflare api;Fehler von der Cloudflare-API
Profile;Profil
No subscription available;Kein Abonnement verfügbar
Buy;Kaufen
Redirecting;Weiterleiten
Apply;Anwenden
Applying code;Code Anwenden
Invalid subscription code;Unbekannter Abo-Code
Cancel Subscription;Abo beenden
Active until;Aktiv bis
We will send you a notification upon subscription expiration;Wenn dein Abonnement endet, senden wir dir eine E-Mail
This token has been already used;Dieser Token wurde schon benutzt
New login for;Neue Anmeldung für
No records found for this day;Für diesen Tag wurden keine Records gefunden
Change;Ändern
Changing;Wird geändert
Minecraft version;Minecraft Version
Build version;Build Version
Server installation is currently running;Der Server wird installiert.
Selected;Ausgewählt
Move deleted;Gelöschtes Bewegen
Delete selected;Ausgewähltes löschen
Log level;Log Level
Log message;Log Message
Time;Zeit
Version;Version
You are running moonlight version;Du benutzt die Moonlight-Version
Operating system;Betriebssystem
Moonlight is running on;Moonlight läuft auf
Memory usage;Arbeitsspeicher Auslastung
Moonlight is using;Moonlight benutzt
of memory;des Arbeitsspeichers
Cpu usage;CPU Auslastung
Refresh;Neuladen
Send a message to all users;Eine Nachricht an alle Benutzer senden
IP;IP
URL;URL
Device;Gerät
Change url;URL Ändern
Message;Nachricht
Enter message;Nachricht eingeben
Enter the message to send;Eine Nachricht zum Senden eingeben
Confirm;Bestätigen
Are you sure?;Bist du dir sicher?
Enter url;URL eingeben
An unknown error occured while starting backup deletion;Ein unbekannter Fehler ist während der Backuplöschung aufgetreten
Success;erfolgreich
Backup URL successfully copied to your clipboard;Die Backup URL wurde in deine Zwischenablage kopiert
Backup restore started;Backup wiederherstellung gestartet
Backup successfully restored;Das Backup wurde erfolgreich wiedergeherstellt
Register for;Registrieren für
Core;Kern
Logs;Logs
AuditLog;Audit Log
SecurityLog;Security Log
ErrorLog;Error Log
Resources;Resourcen
WinSCP cannot be launched here;WinSCP kann nicht gestartet werden
Create a new folder;Neuen Ordner erstellen
Enter a name;Einen Namen eingeben
File upload complete;Dateiupload abgeschlossen
New server;Neuer Server
Sessions;Sitzungen
New user;Neuer Benutzer
Created at;Erstellt am
Mail template not found;E-Mail template wurde nicht gefunden
Missing admin permissions. This attempt has been logged ;Fehlende Admin-Rechte. Dieser Versuch wurde aufgezeichnet und ist für das ganze Admin Team sichtbar
Address;Addresse
City;Stadt
State;Land
Country;Staat
Totp;TOTP
Discord;Discord
Subscription;Abonnement
None;None
No user with this id found;Kein Benutzer mit dieser ID gefunden
Back to list;Zurück zur Liste
New domain;Neue Domain
Reset password;Password wiederherstellen
Password reset;Password wiederherstellung
Reset the password of your account;Password deines Accounts zurücksetzen
Wrong here?;Falsch hier?
A user with this email can not be found;Ein Benutzer mit dieser E-Mail konnte nicht gefunden werden
Passwort reset successfull. Check your mail;Password wiederherstellung erfolgreich. Überprüfe dein Email Postfach
Discord bot;Discord Bot
New image;Neues Image
Description;Beschreibung
Uuid;UUID
Enter tag name;Tag Namen eingeben
Remove;Entfernen
No tags found;Keine Tags gefunden
Enter docker image name;Docker Image Namen eingeben
Tags;Tags
Docker images;Docker Images
Default image;Standard Image
Startup command;Startup Befehl
Install container;Install container
Install entry;Install entry
Configuration files;Konfigurationsdateien
Startup detection;Startuperkennung
Stop command;Stopp-Befehl
Successfully saved image;Das Image wurde erfolgreich gespeichert
No docker images found;Keine Docker Images gefunden
Key;Key
Default value;Standardwert
Allocations;Zuweisung
No variables found;Keine Variablen gefunden
Successfully added image;Das Image wurde erfolgreich hinzugefügt
Password change for;Password ändern für
of;von
New node;Neue Node
Fqdn;FQDN
Cores used;Kerne genutzt
used;benutzt
5.15.90.1-microsoft-standard-WSL2 - amd64;5.15.90.1-microsoft-standard-WSL2 - amd64
Host system information;Host System Information
0;0
Docker containers running;Laufende Docker Container
details;Details
1;1
2;2
DDos;DDos
No ddos attacks found;Keine DDos Attacken gefunden
Node;Node
Date;Datum
DDos attack started;DDos Attacke gestartet
packets;Pakete
DDos attack stopped;DDos Attacke gestoppt
packets; Pakete
Stop all;Alle Stoppen
Kill all;Allen Killen
Network in;Network in
Network out;Network out
Kill all servers;Alle Server Killen
Do you really want to kill all running servers?;Möchtest du wirklich alle laufenden Server Killen?
Change power state for;Power-State ändern für
to;zu
Stop all servers;Alle Server stoppen
Do you really want to stop all running servers?;Möchtest du wirklich alle laufenden Server stoppen?
Manage ;Verwalten
Manage user ;Benutzer verwalten
Reloading;Lade neu...
Update;Aktualisieren
Updating;Wird Aktualisiert...
Successfully updated user;Benutzer erfolgreich aktualisiert
Discord id;Discord User ID
Discord username;Discord Benutzername
Discord discriminator;Discord Tag
The Name field is required.;Der Name dieses Feldes ist erforderlich
An error occured while logging you in;Ein Fehler ist aufgetreten, während du dich angemeldet hast
You need to enter an email address;Du musst eine E-Mail-Adresse angeben
You need to enter a password;Du musst ein Password eingeben
You need to enter a password with minimum 8 characters in lenght;Du musst ein Password eingeben, das mindestens 8 Buchstaben lang ist
Proccessing;Weid verarbeitet...
The FirstName field is required.;Das Vorname-Feld ist erforderlich
The LastName field is required.;Das Nachname-Feld ist erforderlich
The Address field is required.;Das Addresse-Feld ist erforderlich
The City field is required.;Das Stadt-Feld ist erforderlich
The State field is required.;Das Staat-Feld ist erforderlich
The Country field is required.;Das Land-Feld ist erforderlich
Street and house number requered;Straße und Hausnummer erforderlich
Max lenght reached;Maximale Länge erreicht
Server;Server
stopped;gestoppt
Cleanups;Cleanups
executed;ausgeführt
Used clanup;Cleanup benutzt
Enable;Aktivieren
Disable;Deaktivieren
Addons;Add-ons
Javascript version;Javascript Version
Javascript file;Javascript Datei
Select javascript file to execute on start;Javascript Datei zum Starten auswählen
Submit;Einreichen
Processing;Wird verarbeitet...
Go up;Nach oben gehen
Running cleanup;Cleanup läuft
servers;Servers
Select folder to move the file(s) to;Ordner zum Bewegen der Dateien auswählen
Paper version;Paper Version
Join2Start;Join2Start
Server reset;Server zurücksetzen
Reset;Zurücksetzen
Resetting;Wird zurückgesetzt
Are you sure you want to reset this server?;Möchtest du diesen Server wirklich zurücksetzen?
Are you sure? This cannot be undone;Bist du dir sicher? Dies kann nicht rückgängig gemacht werden
Resetting server;Server wird zurückgesetzt...
Deleted file;Datei gelöscht
Reinstalling server;Server wird neuinstalliert
Uploading files;Dateien wurden hochgeladen
complete;vollständig
Upload complete;Upload komplett
Security;Sicherheit
Subscriptions;Abonnements
2fa Code;2FA Code
Your account is secured with 2fa;Dein Account wird mit 2-FA gesichert
anyone write a fancy text here?;hier einen schönen Text schreiben? -Nö.
Activate 2fa;2-FA Aktivieren
2fa apps;2-FA Apps
Use an app like ;Benutze eine App wie
or;oder
and scan the following QR Code;und scanne diesen QR-Code
If you have trouble using the QR Code, select manual input in the app and enter your email and the following code:;Wenn du Probleme mit dem Scannen des Qr-Codes has, benutze doch die Manuelle Eingabe der App und gib deine E-Mail und den folgenden Code ein:
Finish activation;Aktivierung fertig
2fa Code requiered;2-FA Code erforderlich
New password;Neues Password
Secure your account;Deinen Account sichern
2fa adds another layer of security to your account. You have to enter a 6 digit code in order to login.;2-FA fügt eine weitere Sicherheits-Schicht hinzu. Du musst einen 6-Ziffern-Code eingeben, um dich anzumelden.
New subscription;Neues Abonnement
You need to enter a name;Du musst einen Namen eingeben
You need to enter a description;Du musst eine Beschreibung eigeben
Add new limit;Ein neues Limit hinzufügen
Create subscription;Abonnement erstellen
Options;Optionen
Amount;Betrag
Do you really want to delete it?;Möchtes du es wirklich löschen?
Loading your subscription;Dein Abonnement wird geladen
Searching for deploy node;Suche nach einer verfügbaren Node
Searching for available images;Nach verfügbaren Images wird gesucht
Server details;Server Details
Configure your server;Deinen Server konfigurieren
Default;Standart
You reached the maximum amount of servers for every image of your subscription;Du hast die maximale Anzahl an Images von deinem Abonnement erreicht.
Personal information;Persönliche Informationen
Enter code;Code eingeben
Server rename;Server Umbenennen
Create code;Code erstellen
Save subscription;Abonnement speichern
Enter your information;Informationen eingeben
You need to enter your full name in order to use moonlight;Du musst deinen ganzen Namen eingeben, um Moonlight zu nutzen
No node found;Kein Node gefunden
No node found to deploy to found;Keine Node für die Bereitstellung gefunden
Node offline;Node offline
The node the server is running on is currently offline;Das Node, auf dem der Server grade läuft, ist offline
Server not found;Server konnte nicht gefunden werden
A server with that id cannot be found or you have no access for this server;Ein Server mit dieser ID konnte nicht gefunden werden oder du hast keinen Zugriff auf ihn
Compress;Komprimieren
Decompress;De-Komprimieren
Moving;Bewegen...
Compressing;Komprimieren...
selected;Ausgewählt
New website;Neue Website
Plesk servers;Plesk Servers
Base domain;Base Domain
Plesk server;Plesk Server
Ftp;FTP
No SSL certificate found;Keine SSL-Zertifikate gefunden
Ftp Host;FTP Host
Ftp Port;FTP Port
Ftp Username;FTP Username
Ftp Password;FTP Passwort
Use;Benutzen
SSL Certificates;SSL Zertifikate
SSL certificates;SSL Zertifikate
Issue certificate;SSL-Zertifikat erstellen lassen
New plesk server;Neuer Plesk Server
Api url;API URL
Host system offline;Host System Offline
The host system the website is running on is currently offline;Das Host System, auf dem diese Website läuft, ist offline
No SSL certificates found;Keine SSL-Zertifikate gefunden
No databases found for this website;Dieser Website konnten keine Datenbanken zugeordnet werden
The name should be at least 8 characters long;Der Name sollte mindestens 8 Zeichen lang sein
The name should only contain of lower case characters and numbers;Der Name sollte nur Kleinbuchstaben und Zahlen enthalten
Error from plesk;Error von Plesk
Host;Host
Username;Benutzername
SRV records cannot be updated thanks to the cloudflare api client. Please delete the record and create a new one;SRV Records können aufgrund von Cloudflare nicht geupdatet werden. Bitte lösche den Record und erstelle einen neuen.
The User field is required.;Das Benutzer-Feld ist erforderlich
You need to specify a owner;Du musst einen Server-Besitzer angeben
You need to specify a image;Du musst ein Image angeben
Api Url;API URL
Api Key;Api Key
Duration;Dauer
Enter duration of subscription;Dauer des Abonnements eingeben
Copied code to clipboard;Code in die Zwischenablage kopiert
Invalid or expired subscription code;Ungültiger oder Abgelaufener Abo-Code
Current subscription;Dein Abonnement
You need to specify a server image;Du musst ein Image angeben
CPU;CPU
Hour;Stunde
Day;Tag
Month;Monat
Year;Jahr
All time;Für immer
This function is not implemented;Diese Funktion wurde noch nicht hinzugefügt
Domain details;Domain Details
Configure your domain;Deine Domain konfigurieren
You reached the maximum amount of domains in your subscription;Du hast das Maximum an Domains in deinem Abonnement erreicht
You need to specify a shared domain;Du musst eine Shared-Domain angeben
A domain with this name does already exist for this shared domain;Eine Domain mit diesem Name existiert bereits in dieser Shared-Domain
The Email field is required.;Das E-Mail-Feld ist erforderlich
The Password field is required.;Das Password-Feld ist erforderlich
The ConfirmPassword field is required.;Das Password-Bestätigen-Feld ist erforderlich
Passwords need to match;Die Passwörter müssen übereinstimmen
Cleanup exception;Cleanup Ausnahme
No shared domain found;Keine Shared-Domain gefunden
Searching for deploy plesk server;Suchen um den Plesk Server aufzusetzen
No plesk server found;Kein Plesk Server gefunden
No plesk server found to deploy to;Keinen Plesk Server zum Aufsetzen gefunden
No node found to deploy to;Kein Node zum Aufsetzen
Website details;Website Details
Configure your website;Konfiguriere deine Website
The name cannot be longer that 32 characters;Der Name kann nicht länger als 32 Zeichen sein
The name should only consist of lower case characters;Der Name sollte nur aus Kleinbuchstaben bestehen
News;Neuigkeiten
Title...;Titel...
Enter text...;Text einfügen...
Saving...;Wird gespeichert...
Deleting...;Wird gelöscht...
Delete post;Post löschen
Do you really want to delete the post ";Post löschen? "
You have no domains;Du hast keine Domains
We were not able to find any domains associated with your account;Wir haben keine Domains, die mit deinem Account verbunden sind, gefunden
You have no websites;Du hast keine Websites
We were not able to find any websites associated with your account;Wir haben keine Websiten, die mit deinem Account verbunden sind, gefunden
Guest;Gast
You need a domain;Du brauchst eine Domain
New post;Neuer Post
New entry;Neuer Eintrag
You have no servers;Du hast keine Server
We were not able to find any servers associated with your account;Wir haben keine Server, die mit deinem Account verbunden sind, gefunden
Error creating server on wings;Fehler bei der Erstellung des Servers auf Wings
An unknown error occured while restoring a backup;Ein unbekannter Fehler ist während der Backup-Wiederherstellung aufgetreten
Error from daemon;Fehler vom Daemon
End;Ende
Cloud panel;Cloud Panel
Cloud panels;Cloud Panels
New cloud panel;Neues Cloud Panel
You need to enter an api key;Du musst einen API-Key eigeben
Webspaces;Webspaces
New webspace;Neuer Webspace
The uploaded file should not be bigger than 100MB;Die Datei sollte nicht größer als 100MB sein
An unknown error occured while uploading a file;Ein unbekannter Fehler ist während dem Datei Upload aufgetreten
No databases found for this webspace;Keine Datenbanken für diesen Webspace gefunden
Sftp;SFTP
Sftp Host;SFTP Host
Sftp Port;SFTP Port
Sftp Username;SFTP Benutzername
Sftp Password;SFTP Password
Lets Encrypt certificate successfully issued;Lets Encrypt Zertifikat erfolgreich erstellt
Add shared domain;Shared Domain Hinzufügen
Webspace;Webspace
You reached the maximum amount of websites in your subscription;Du hast das Maximum an Websiten in deinem Abonnement erreicht
Searching for deploy web host;Suchen um den Webhost aufzusetzen
Webspace details;Webspace Details
Web host;Web host
Configure your webspaces;Konfiguriere deine Webspaces
You reached the maximum amount of webspaces in your subscription;Du hast das Maximum an Webspaces in deinem Abonnement erreicht
Create a webspace;Einen Webspace erstellen
Manage your webspaces;Deine Webspaces verwalten
Modify the content of your webspaces;Den Inhalt deiner Webspaces verwalten
Successfully updated password;Password erfolgreich geupdatet
An unknown error occured while sending your message;Ein unbekannter Fehler ist während dem Senden von deiner Nachricht aufgetreten
Open chats;Offene Chats
No message sent yet;Keine Nachrichten gesendet
Support ticket open;Support-Ticket geöffnet
Support ticket closed;Support-Ticket geschlossen
Your connection has been paused;Deine Verbindung wurde pausiert
We paused your connection because of inactivity. The resume just focus the tab and wait a few seconds;Wir haben deine Verbindung aufgrund von inaktivität pausiert. Wechsle auf den Tab und warte ein paar Sekunden
Failed to reconnect to the moonlight servers;Die Wiederverbindung zu den Moonlight-Servern ist gescheitert
We were unable to reconnect to moonlight. Please refresh the page;Verbindung zu Moonlight fehlgeschlagen. Bitte aktualisiere die Seite
Failed to reconnect to the moonlight servers. The connection has been rejected;Die Wiederverbindung zu den Moonlight-Servern ist fehlgeschlagen. Die Verbindung wurde abgelehnt
We were unable to reconnect to moonlight. Most of the time this is caused by an update of moonlight. Please refresh the page;Verbindung zu Moonlight fehlgeschlagen. Meistens wird dies durch eine Aktualisierung von Moonlight verursacht. Bitte aktualisiere die Seite
Verifying token, loading user data;Token verifizieren, lade Benutzerdaten
Reload config;Konfiguration neuladen
Successfully reloading configuration;Konfiguration wird neugeladen...
Successfully reloaded configuration;Die Konfiguration wurde erfolgreich neugeladen
Flows;Flows
Add node;Node Hinzufügen
Web system;Web System
Servers with this image;Server mit diesem Image
You need to specify a user;Du musst einen Benutzer angeben
Import;Importieren
Export;Exportieren
Exporting;Wird exportiert
Successfully imported image;Das Image wurde erfolgreich importiert.
Forge version;Forge Version
Fabric version;Fabric Version
Fabric loader version;Fabric Loader Version
Rate;Rate
Hey, can i borrow you for a second?;Hey, kann ich dich mal kurz ausleihen?
We want to improve our services and get a little bit of feedback how we are currently doing. Please leave us a rating;Da wir unsere Dienste ständig verbessern, möchten wir dich um Feedback bitten. Bitte Bewerte uns:
Thanks for your rating;Danke für deine Bewertung
It would be really kind of you rating us on a external platform as it will help our project very much;Es wäre wirklich nett, wenn du uns auf einer externen Plattform bewerten würdest, denn das würde unserem Projekt sehr helfen
Close;Schließen
Rating saved;Bewertung gespeichert
Group;Gruppe
Beta;Beta
Create a new group;Eine neue Gruppe erstellen

View File

@@ -1,567 +0,0 @@
Open support;Open support
About us;About us
Imprint;Imprint
Privacy;Privacy
Login;Login
Register;Register
Insert brand name...;Insert brand name...
Save and continue;Save and continue
Saving;Saving
Configure basics;Configure basics
Brand name;Brand name
test;test
Insert first name...;Insert first name...
Insert last name...;Insert last name...
Insert email address...;Insert email address...
Add;Add
Adding...;Adding...
Add admin accounts;Add admin accounts
First name;First name
Last name;Last name
Email address;Email address
Enter password;Enter password
Next;Next
Back;Back
Configure features;Configure features
Support chat;Support chat
Finish;Finish
Finalize installation;Finalize installation
Moonlight basic settings successfully configured;Moonlight basic settings successfully configured
Ooops. This page is crashed;Ooops. This page crashed
This page is crashed. The error has been reported to the moonlight team. Meanwhile you can try reloading the page;This page crashed. The error has been reported to the moonlight team. Meanwhile you can try reloading the page
Setup complete;Setup complete
It looks like this moonlight instance is ready to go;It looks like this moonlight instance is ready to go
User successfully created;User successfully created
Ooops. Your moonlight client is crashed;Ooops. Your moonlight client crashed
This error has been reported to the moonlight team;This error has been reported to the moonlight team
Sign In;Sign In
Sign in to start with moonlight;Sign in to start with moonlight
Sign in with Discord;Sign in with Discord
Or with email;Or with email
Forgot password?;Forgot password?
Sign-in;Sign-in
Not registered yet?;Not registered yet?
Sign up;Sign up
Authenticating;Authenticating
Sign in with Google;Sign in with Google
Working;Working
Error;Error
Email and password combination not found;Email and password combination not found
Email;Email
Password;Password
Account settings;Account settings
Logout;Logout
Dashboard;Dashboard
Order;Order
Website;Website
Database;Database
Domain;Domain
Servers;Servers
Websites;Websites
Databases;Databases
Domains;Domains
Changelog;Changelog
Firstname;First Name
Lastname;Last Name
Repeat password;Repeat password
Sign Up;Sign Up
Sign up to start with moonlight;Sign up to start with moonlight
Sign up with Discord;Sign up with Discord
Sign up with Google;Sign up with Google
Sign-up;Sign-up
Already registered?;Already registered?
Sign in;Sign in
Create something new;Create something new
Create a gameserver;Create a gameserver
A new gameserver in just a few minutes;A new gameserver in just a few minutes
Create a database;Create a database
A quick way to store your data and manage it from all around the world;A quick way to store your data and manage it from all around the world
Manage your services;Manage your services
Manage your gameservers;Manage your gameservers
Adjust your gameservers;Adjust your gameservers
Manage your databases;Manage your databases
Insert, delete and update the data in your databases;Insert, delete and update the data in your databases
Create a website;Create a website
Make your own websites with a webspace;Make your own websites with a webspace
Create a domain;Create a domain
Make your servvices accessible throught your own domain;Make your services accessible throught your own domain
Manage your websites;Manage your websites
Modify the content of your websites;Modify the content of your websites
Manage your domains;Manage your domains
Add, edit and delete dns records;Add, edit and delete dns records
Admin;Admin
System;System
Overview;Overview
Manager;Manager
Cleanup;Cleanup
Nodes;Nodes
Images;Images
aaPanel;aaPanel
Users;Users
Support;Support
Statistics;Statistics
No nodes found. Start with adding a new node;No nodes found. Start with adding a new node
Nodename;Nodename
FQDN;FQDN
Create;Create
Creating;Creating
Http port;Http port
Sftp port;Sftp port
Moonlight daemon port;Moonlight daemon port
SSL;SSL
CPU Usage;CPU Usage
In %;In %
Memory;Memory
Used / Available memory;Used / Available memory
Storage;Storage
Available storage;Available storage
Add a new node;Add a new node
Delete;Delete
Deleting;Deleting
Edit;Edit
Token Id;Token Id
Token;Token
Save;Save
Setup;Setup
Open a ssh connection to your node and enter;Open a ssh connection to your node and enter
and paste the config below. Then press STRG+O and STRG+X to save;and paste the config below. Then press STRG+O and STRG+X to save
Before configuring this node, install the daemon;Before configuring this node, install the daemon
Delete this node?;Delete this node?
Do you really want to delete this node;Do you really want to delete this node
Yes;Yes
No;No
Status;Status
Adding;Adding
Port;Port
Id;Id
Manage;Manage
Create new server;Create new server
No servers found;No servers found
Server name;Server name
Cpu cores;Cpu cores
Disk;Disk
Image;Image
Override startup;Override startup
Docker image;Docker image
CPU Cores (100% = 1 Core);CPU Cores (100% = 1 Core)
Server successfully created;Server successfully created
Name;Name
Cores;Cores
Owner;Owner
Value;Value
An unknown error occured;An unknown error occured
No allocation found;No allocation found
Identifier;Identifier
UuidIdentifier;UuidIdentifier
Override startup command;Override startup command
Loading;Loading
Offline;Offline
Connecting;Connecting
Start;Start
Restart;Restart
Stop;Stop
Shared IP;Shared IP
Server ID;Server ID
Cpu;Cpu
Console;Console
Files;Files
Backups;Backups
Network;Network
Plugins;Plugins
Settings;Settings
Enter command;Enter command
Execute;Execute
Checking disk space;Checking disk space
Updating config files;Updating config files
Checking file permissions;Checking file permissions
Downloading server image;Downloading server image
Downloaded server image;Downloaded server image
Starting;Starting
Online;Online
Kill;Kill
Stopping;Stopping
Search files and folders;Search files and folders
Launch WinSCP;Launch WinSCP
New folder;New folder
Upload;Upload
File name;File name
File size;File size
Last modified;Last modified
Cancel;Cancel
Canceling;Canceling
Running;Running
Loading backups;Loading backups
Started backup creation;Started backup creation
Backup is going to be created;Backup is going to be created
Rename;Rename
Move;Move
Archive;Archive
Unarchive;Unarchive
Download;Download
Starting download;Starting download
Backup successfully created;Backup successfully created
Restore;Restore
Copy url;Copy url
Backup deletion started;Backup deletion started
Backup successfully deleted;Backup successfully deleted
Primary;Primary
This feature is currently not available;This feature is currently not available
Send;Send
Sending;Sending
Welcome to the support chat. Ask your question here and we will help you;Welcome to the support chat. Ask your question here and we will help you
minutes ago; minutes ago
just now;just now
less than a minute ago;less than a minute ago
1 hour ago;1 hour ago
1 minute ago;1 minute ago
Failed;Failed
hours ago; hours ago
Open tickets;Open tickets
Actions;Actions
No support ticket is currently open;No support ticket is currently open
User information;User information
Close ticket;Close ticket
Closing;Closing
The support team has been notified. Please be patient;The support team has been notified. Please be patient
The ticket is now closed. Type a message to open it again;The ticket is now closed. Type a message to open it again
1 day ago;1 day ago
is typing;is typing
are typing;are typing
No domains available;No domains available
Shared domains;Shared domains
Shared domain;Shared domain
Shared domain successfully deleted;Shared domain successfully deleted
Shared domain successfully added;Shared domain successfully added
Domain name;Domain name
DNS records for;DNS records for
Fetching dns records;Fetching dns records
No dns records found;No dns records found
Content;Content
Priority;Priority
Ttl;Ttl
Enable cloudflare proxy;Enable cloudflare proxy
CF Proxy;CF Proxy
days ago; days ago
Cancle;Cancle
An unexpected error occured;An unexpected error occured
Testy;Testy
Error from cloudflare api;Error from cloudflare api
Profile;Profile
No subscription available;No subscription available
Buy;Buy
Redirecting;Redirecting
Apply;Apply
Applying code;Applying code
Invalid subscription code;Invalid subscription code
Cancel Subscription;Cancel Subscription
Active until;Active until
We will send you a notification upon subscription expiration;We will send you a notification upon subscription expiration
This token has been already used;This token has been already used
New login for;New login for
No records found for this day;No records found for this day
Change;Change
Changing;Changing
Minecraft version;Minecraft version
Build version;Build version
Server installation is currently running;Server installation is currently running
Selected;Selected
Move deleted;Move deleted
Delete selected;Delete selected
Log level;Log level
Log message;Log message
Time;Time
Version;Version
You are running moonlight version;You are running moonlight version
Operating system;Operating system
Moonlight is running on;Moonlight is running on
Memory usage;Memory usage
Moonlight is using;Moonlight is using
of memory;of memory
Cpu usage;Cpu usage
Refresh;Refresh
Send a message to all users;Send a message to all users
IP;IP
URL;URL
Device;Device
Change url;Change url
Message;Message
Enter message;Enter message
Enter the message to send;Enter the message to send
Confirm;Confirm
Are you sure?;Are you sure?
Enter url;Enter url
An unknown error occured while starting backup deletion;An unknown error occured while starting backup deletion
Success;Success
Backup URL successfully copied to your clipboard;Backup URL successfully copied to your clipboard
Backup restore started;Backup restore started
Backup successfully restored;Backup successfully restored
Register for;Register for
Core;Core
Logs;Logs
AuditLog;AuditLog
SecurityLog;SecurityLog
ErrorLog;ErrorLog
Resources;Resources
WinSCP cannot be launched here;WinSCP cannot be launched here
Create a new folder;Create a new folder
Enter a name;Enter a name
File upload complete;File upload complete
New server;New server
Sessions;Sessions
New user;New user
Created at;Created at
Mail template not found;Mail template not found
Missing admin permissions. This attempt has been logged ;)
Address;Address
City;City
State;State
Country;Country
Totp;Totp
Discord;Discord
Subscription;Subscription
None;None
No user with this id found;No user with this id found
Back to list;Back to list
New domain;New domain
Reset password;Reset password
Password reset;Password reset
Reset the password of your account;Reset the password of your account
Wrong here?;Wrong here?
A user with this email can not be found;A user with this email can not be found
Passwort reset successfull. Check your mail;Passwort reset successfull. Check your mail
Discord bot;Discord bot
New image;New image
Description;Description
Uuid;Uuid
Enter tag name;Enter tag name
Remove;Remove
No tags found;No tags found
Enter docker image name;Enter docker image name
Tags;Tags
Docker images;Docker images
Default image;Default image
Startup command;Startup command
Install container;Install container
Install entry;Install entry
Configuration files;Configuration files
Startup detection;Startup detection
Stop command;Stop command
Successfully saved image;Successfully saved image
No docker images found;No docker images found
Key;Key
Default value;Default value
Allocations;Allocations
No variables found;No variables found
Successfully added image;Successfully added image
Password change for;Password change for
of;of
New node;New node
Fqdn;Fqdn
Cores used;Cores used
used;used
5.15.90.1-microsoft-standard-WSL2 - amd64;5.15.90.1-microsoft-standard-WSL2 - amd64
Host system information;Host system information
0;0
Docker containers running;Docker containers running
details;details
1;1
2;2
DDos;DDos
No ddos attacks found;No ddos attacks found
Node;Node
Date;Date
DDos attack started;DDos attack started
packets;packets
DDos attack stopped;DDos attack stopped
packets; packets
Stop all;Stop all
Kill all;Kill all
Network in;Network in
Network out;Network out
Kill all servers;Kill all servers
Do you really want to kill all running servers?;Do you really want to kill all running servers?
Change power state for;Change power state for
to;to
Stop all servers;Stop all servers
Do you really want to stop all running servers?;Do you really want to stop all running servers?
Manage ;Manage
Manage user ;Manage user
Reloading;Reloading
Update;Update
Updating;Updating
Successfully updated user;Successfully updated user
Discord id;Discord id
Discord username;Discord username
Discord discriminator;Discord discriminator
The Name field is required.;The Name field is required.
An error occured while logging you in;An error occured while logging you in
You need to enter an email address;You need to enter an email address
You need to enter a password;You need to enter a password
You need to enter a password with minimum 8 characters in lenght;You need to enter a password with minimum 8 characters in length
Proccessing;Proccessing
The FirstName field is required.;The FirstName field is required.
The LastName field is required.;The LastName field is required.
The Address field is required.;The Address field is required.
The City field is required.;The City field is required.
The State field is required.;The State field is required.
The Country field is required.;The Country field is required.
Street and house number requered;Street and house number requered
Max lenght reached;Max lenght reached
Server;Server
stopped;stopped
Cleanups;Cleanups
executed;executed
Used clanup;Used clanup
Enable;Enable
Disabble;Disabble
Disable;Disable
Addons;Addons
Javascript version;Javascript version
Javascript file;Javascript file
Select javascript file to execute on start;Select javascript file to execute on start
Submit;Submit
Processing;Processing
Go up;Go up
Running cleanup;Running cleanup
servers;servers
Select folder to move the file(s) to;Select folder to move the file(s) to
Paper version;Paper version
Join2Start;Join2Start
Server reset;Server reset
Reset;Reset
Resetting;Resetting
Are you sure you want to reset this server?;Are you sure you want to reset this server?
Are you sure? This cannot be undone;Are you sure? This cannot be undone
Resetting server;Resetting server
Deleted file;Deleted file
Reinstalling server;Reinstalling server
Uploading files;Uploading files
complete;complete
Upload complete;Upload complete
Security;Security
Subscriptions;Subscriptions
2fa Code;2fa Code
Your account is secured with 2fa;Your account is secured with 2fa
anyone write a fancy text here?;anyone write a fancy text here?
Activate 2fa;Activate 2fa
2fa apps;2fa apps
Use an app like ;Use an app like
or;or
and scan the following QR Code;and scan the following QR Code
If you have trouble using the QR Code, select manual input in the app and enter your email and the following code:;If you have trouble using the QR Code, select manual input in the app and enter your email and the following code:
Finish activation;Finish activation
2fa Code requiered;2fa Code requiered
New password;New password
Secure your account;Secure your account
2fa adds another layer of security to your account. You have to enter a 6 digit code in order to login.;2fa adds another layer of security to your account. You have to enter a 6 digit code in order to login.
New subscription;New subscription
You need to enter a name;You need to enter a name
You need to enter a description;You need to enter a description
Add new limit;Add new limit
Create subscription;Create subscription
Options;Options
Amount;Amount
Do you really want to delete it?;Do you really want to delete it?
Loading your subscription;Loading your subscription
Searching for deploy node;Searching for deploy node
Searching for available images;Searching for available images
Server details;Server details
Configure your server;Configure your server
Default;Default
You reached the maximum amount of servers for every image of your subscription;You reached the maximum amount of servers for every image of your subscription
Personal information;Personal information
Enter code;Enter code
Server rename;Server rename
Create code;Create code
Save subscription;Save subscription
Enter your information;Enter your information
You need to enter your full name in order to use moonlight;You need to enter your full name in order to use moonlight
No node found;No node found
No node found to deploy to found;No node found to deploy to found
Node offline;Node offline
The node the server is running on is currently offline;The node the server is running on is currently offline
Server not found;Server not found
A server with that id cannot be found or you have no access for this server;A server with that id cannot be found or you don't have access for this server
Compress;Compress
Decompress;Decompress
Moving;Moving
Compressing;Compressing
selected;selected
New website;New website
Plesk servers;Plesk servers
Base domain;Base domain
Plesk server;Plesk server
Ftp;Ftp
No SSL certificate found;No SSL certificate found
Ftp Host;Ftp Host
Ftp Port;Ftp Port
Ftp Username;Ftp Username
Ftp Password;Ftp Password
Use;Use
SSL Certificates;SSL Certificates
SSL certificates;SSL certificates
Issue certificate;Issue certificate
New plesk server;New plesk server
Api url;Api url
Host system offline;Host system offline
The host system the website is running on is currently offline;The host system the website is running on is currently offline
No SSL certificates found;No SSL certificates found
No databases found for this website;No databases found for this website
The name should be at least 8 characters long;The name should be at least 8 characters long
The name should only contain of lower case characters and numbers;The name should only contain of lower case characters and numbers
Error from plesk;Error from plesk
Host;Host
Username;Username
SRV records cannot be updated thanks to the cloudflare api client. Please delete the record and create a new one;SRV records cannot be updated thanks to the cloudflare api client. Please delete the record and create a new one
The User field is required.;The User field is required.
You need to specify a owner;You need to specify a owner
You need to specify a image;You need to specify a image
Api Url;Api Url
Api Key;Api Key
Duration;Duration
Enter duration of subscription;Enter duration of subscription
Copied code to clipboard;Copied code to clipboard
Invalid or expired subscription code;Invalid or expired subscription code
Current subscription;Current subscription
You need to specify a server image;You need to specify a server image
CPU;CPU
Hour;Hour
Day;Day
Month;Month
Year;Year
All time;All time
This function is not implemented;This function is not implemented
Domain details;Domain details
Configure your domain;Configure your domain
You reached the maximum amount of domains in your subscription;You reached the maximum amount of domains in your subscription
You need to specify a shared domain;You need to specify a shared domain
A domain with this name does already exist for this shared domain;A domain with this name does already exist for this shared domain
The Email field is required.;The Email field is required.
The Password field is required.;The Password field is required.
The ConfirmPassword field is required.;The ConfirmPassword field is required.
Passwords need to match;Passwords need to match
Cleanup exception;Cleanup exception
No shared domain found;No shared domain found
Searching for deploy plesk server;Searching for deploy plesk server
No plesk server found;No plesk server found
No plesk server found to deploy to;No plesk server found to deploy to
No node found to deploy to;No node found to deploy to
Website details;Website details
Configure your website;Configure your website
The name cannot be longer that 32 characters;The name cannot be longer that 32 characters
The name should only consist of lower case characters;The name should only consist of lower case characters
News;News
Title...;Title...
Enter text...;Enter text...
Saving...;Saving...
Deleting...;Deleting...
Delete post;Delete post
Do you really want to delete the post ";Do you really want to delete the post "
You have no domains;You don't have domains
We were not able to find any domains associated with your account;We were not able to find any domains associated with your account
You have no websites;You have no websites
We were not able to find any websites associated with your account;We were not able to find any websites associated with your account
Guest;Guest
You need a domain;You need a domain
New post;New post
New entry;New entry

View File

@@ -1,53 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>New moonlight login</title>
</head>
<body>
<div style="background-color:#ffffff; padding: 45px 0 34px 0; border-radius: 24px; margin:40px auto; max-width: 600px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" height="auto"
style="border-collapse:collapse">
<tbody>
<tr>
<td align="center" valign="center" style="text-align:center; padding-bottom: 10px">
<div style="text-align:center; margin:0 15px 34px 15px">
<div style="margin-bottom: 10px">
<a href="https://endelon-hosting.de" rel="noopener" target="_blank">
<img alt="Logo" src="https://moonlight.endelon-hosting.de/assets/media/logo/MoonFullText.png" style="height: 35px">
</a>
</div>
<div style="font-size: 14px; font-weight: 500; margin-bottom: 27px; font-family:Arial,Helvetica,sans-serif;">
<p style="margin-bottom:9px; color:#181C32; font-size: 22px; font-weight:700">Hey {{FirstName}}, there is a new login in your moonlight account</p>
<p style="margin-bottom:2px; color:#7E8299">Here is all the data we collected</p>
<p style="margin-bottom:2px; color:#7E8299">IP: {{Ip}}</p>
<p style="margin-bottom:2px; color:#7E8299">Device: {{Device}}</p>
<p style="margin-bottom:2px; color:#7E8299">Location: {{Location}}</p>
</div>
<a href="https://moonlight.endelon-hosting.de" target="_blank"
style="background-color:#50cd89; border-radius:6px;display:inline-block; padding:11px 19px; color: #FFFFFF; font-size: 14px; font-weight:500;">Open Moonlight
</a>
</div>
</td>
</tr>
<tr>
<td align="center" valign="center"
style="font-size: 13px; text-align:center; padding: 0 10px 10px 10px; font-weight: 500; color: #A1A5B7; font-family:Arial,Helvetica,sans-serif">
<p style="color:#181C32; font-size: 16px; font-weight: 600; margin-bottom:9px">You need help?</p>
<p style="margin-bottom:2px">We are happy to help!</p>
<p style="margin-bottom:4px">More information at
<a href="https://endelon.link/support" rel="noopener" target="_blank" style="font-weight: 600">endelon.link/support</a>.
</p>
</td>
</tr>
<tr>
<td align="center" valign="center"
style="font-size: 13px; padding:0 15px; text-align:center; font-weight: 500; color: #A1A5B7;font-family:Arial,Helvetica,sans-serif">
<p>Copyright 2022 Endelon Hosting </p>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

View File

@@ -1,53 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Moonlight password change</title>
</head>
<body>
<div style="background-color:#ffffff; padding: 45px 0 34px 0; border-radius: 24px; margin:40px auto; max-width: 600px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" height="auto"
style="border-collapse:collapse">
<tbody>
<tr>
<td align="center" valign="center" style="text-align:center; padding-bottom: 10px">
<div style="text-align:center; margin:0 15px 34px 15px">
<div style="margin-bottom: 10px">
<a href="https://endelon-hosting.de" rel="noopener" target="_blank">
<img alt="Logo" src="https://moonlight.endelon-hosting.de/assets/media/logo/MoonFullText.png" style="height: 35px">
</a>
</div>
<div style="font-size: 14px; font-weight: 500; margin-bottom: 27px; font-family:Arial,Helvetica,sans-serif;">
<p style="margin-bottom:9px; color:#181C32; font-size: 22px; font-weight:700">Hey {{FirstName}}, your password has been changed</p>
<p style="margin-bottom:2px; color:#7E8299">If this was not you please contact us. Also here is the data we collected.</p>
<p style="margin-bottom:2px; color:#7E8299">IP: {{Ip}}</p>
<p style="margin-bottom:2px; color:#7E8299">Device: {{Device}}</p>
<p style="margin-bottom:2px; color:#7E8299">Location: {{Location}}</p>
</div>
<a href="https://moonlight.endelon-hosting.de" target="_blank"
style="background-color:#50cd89; border-radius:6px;display:inline-block; padding:11px 19px; color: #FFFFFF; font-size: 14px; font-weight:500;">Open Moonlight
</a>
</div>
</td>
</tr>
<tr>
<td align="center" valign="center"
style="font-size: 13px; text-align:center; padding: 0 10px 10px 10px; font-weight: 500; color: #A1A5B7; font-family:Arial,Helvetica,sans-serif">
<p style="color:#181C32; font-size: 16px; font-weight: 600; margin-bottom:9px">You need help?</p>
<p style="margin-bottom:2px">We are happy to help!</p>
<p style="margin-bottom:4px">More information at
<a href="https://endelon.link/support" rel="noopener" target="_blank" style="font-weight: 600">endelon.link/support</a>.
</p>
</td>
</tr>
<tr>
<td align="center" valign="center"
style="font-size: 13px; padding:0 15px; text-align:center; font-weight: 500; color: #A1A5B7;font-family:Arial,Helvetica,sans-serif">
<p>Copyright 2023 Endelon Hosting </p>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

View File

@@ -1,54 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Moonlight password reset</title>
</head>
<body>
<div style="background-color:#ffffff; padding: 45px 0 34px 0; border-radius: 24px; margin:40px auto; max-width: 600px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" height="auto"
style="border-collapse:collapse">
<tbody>
<tr>
<td align="center" valign="center" style="text-align:center; padding-bottom: 10px">
<div style="text-align:center; margin:0 15px 34px 15px">
<div style="margin-bottom: 10px">
<a href="https://endelon-hosting.de" rel="noopener" target="_blank">
<img alt="Logo" src="https://moonlight.endelon-hosting.de/assets/media/logo/MoonFullText.png" style="height: 35px">
</a>
</div>
<div style="font-size: 14px; font-weight: 500; margin-bottom: 27px; font-family:Arial,Helvetica,sans-serif;">
<p style="margin-bottom:9px; color:#181C32; font-size: 22px; font-weight:700">Hey {{FirstName}}, your password has been resetted</p>
<p style="margin-bottom:2px; color:#7E8299">Your new password is: <b>{{Password}}</b></p>
<p style="margin-bottom:2px; color:#7E8299">If this was not you please contact us. Also here is the data we collected.</p>
<p style="margin-bottom:2px; color:#7E8299">IP: {{Ip}}</p>
<p style="margin-bottom:2px; color:#7E8299">Device: {{Device}}</p>
<p style="margin-bottom:2px; color:#7E8299">Location: {{Location}}</p>
</div>
<a href="https://moonlight.endelon-hosting.de" target="_blank"
style="background-color:#50cd89; border-radius:6px;display:inline-block; padding:11px 19px; color: #FFFFFF; font-size: 14px; font-weight:500;">Open Moonlight
</a>
</div>
</td>
</tr>
<tr>
<td align="center" valign="center"
style="font-size: 13px; text-align:center; padding: 0 10px 10px 10px; font-weight: 500; color: #A1A5B7; font-family:Arial,Helvetica,sans-serif">
<p style="color:#181C32; font-size: 16px; font-weight: 600; margin-bottom:9px">You need help?</p>
<p style="margin-bottom:2px">We are happy to help!</p>
<p style="margin-bottom:4px">More information at
<a href="https://endelon.link/support" rel="noopener" target="_blank" style="font-weight: 600">endelon.link/support</a>.
</p>
</td>
</tr>
<tr>
<td align="center" valign="center"
style="font-size: 13px; padding:0 15px; text-align:center; font-weight: 500; color: #A1A5B7;font-family:Arial,Helvetica,sans-serif">
<p>Copyright 2022 Endelon Hosting </p>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

View File

@@ -1,50 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome</title>
</head>
<body>
<div style="background-color:#ffffff; padding: 45px 0 34px 0; border-radius: 24px; margin:40px auto; max-width: 600px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" height="auto"
style="border-collapse:collapse">
<tbody>
<tr>
<td align="center" valign="center" style="text-align:center; padding-bottom: 10px">
<div style="text-align:center; margin:0 15px 34px 15px">
<div style="margin-bottom: 10px">
<a href="https://endelon-hosting.de" rel="noopener" target="_blank">
<img alt="Logo" src="https://moonlight.endelon-hosting.de/assets/media/logo/MoonFullText.png" style="height: 35px">
</a>
</div>
<div style="font-size: 14px; font-weight: 500; margin-bottom: 27px; font-family:Arial,Helvetica,sans-serif;">
<p style="margin-bottom:9px; color:#181C32; font-size: 22px; font-weight:700">Hey {{FirstName}}, welcome to moonlight</p>
<p style="margin-bottom:2px; color:#7E8299">We are happy to welcome you in ;)</p>
</div>
<a href="https://moonlight.endelon-hosting.de" target="_blank"
style="background-color:#50cd89; border-radius:6px;display:inline-block; padding:11px 19px; color: #FFFFFF; font-size: 14px; font-weight:500;">Open Moonlight
</a>
</div>
</td>
</tr>
<tr>
<td align="center" valign="center"
style="font-size: 13px; text-align:center; padding: 0 10px 10px 10px; font-weight: 500; color: #A1A5B7; font-family:Arial,Helvetica,sans-serif">
<p style="color:#181C32; font-size: 16px; font-weight: 600; margin-bottom:9px">You need help?</p>
<p style="margin-bottom:2px">We are happy to help!</p>
<p style="margin-bottom:4px">More information at
<a href="https://endelon.link/support" rel="noopener" target="_blank" style="font-weight: 600">endelon.link/support</a>.
</p>
</td>
</tr>
<tr>
<td align="center" valign="center"
style="font-size: 13px; padding:0 15px; text-align:center; font-weight: 500; color: #A1A5B7;font-family:Arial,Helvetica,sans-serif">
<p>Copyright 2022 Endelon Hosting </p>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="256px" height="301px" viewBox="0 0 256 301" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
<defs>
<linearGradient x1="2.17771739%" y1="34.7938955%" x2="92.7221942%" y2="91.3419405%" id="linearGradient-1">
<stop stop-color="#41A7EF" offset="0%"></stop>
<stop stop-color="#813DDE" offset="54.2186236%"></stop>
<stop stop-color="#8F2EE2" offset="74.4988788%"></stop>
<stop stop-color="#A11CE6" offset="100%"></stop>
</linearGradient>
</defs>
<g>
<path d="M124.183681,101.699 C124.183681,66.515 136.256681,34.152 156.486681,8.525 C159.197681,5.092 156.787681,0.069 152.412681,0.012 C151.775681,0.004 151.136681,0 150.497681,0 C67.6206813,0 0.390681343,66.99 0.00168134279,149.775 C-0.386318657,232.369 66.4286813,300.195 149.019681,300.988 C189.884681,301.381 227.036681,285.484 254.376681,259.395 C257.519681,256.396 255.841681,251.082 251.548681,250.42 C179.413681,239.291 124.183681,176.949 124.183681,101.699" fill="url(#linearGradient-1)"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

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